You can visit the Resume website here
The the source code is on github
You can move Mario to the left or to the right using keyboard arrows on desktop or the arrows buttons on mobile.
What I used
- Music and sounds from youtube videos
- jQuery (to write js code with less pain)
- Google fonts
1- Start with the basics
2- Little details
3- Pixel perfect images
4- Polish the code
5- What have been the most difficult things for me?
6- What other problems I found?
Start with the basics
On the screen there are 5 objects:
- Sky (clouds + mountains)
- Information boxes
- Arrow buttons
The steps to make this from zero are:
1- Write the HTML
2- Write the CSS
4- Test, test, test
5- Polish the code
Mario object is a simple IMG html tag and the src value is a transparent image, yes as you read, the image is really applied using the CSS attribute background.
- Frame 1, background-position-x: 0px;
- Frame 2, background-position-x: -65px;
- Frame 3, background-position-x: -130px;
To change the perspective of moving Mario to left or right, I'm using the same image file, but I'm applying the CSS attribute "-webkit-transform":
- Left, -webkit-transform:scaleX(-1);
- Right, -webkit-transform:scaleX(1);
Pixel perfect images
For the background image i'm using a little image that looks a little bit blurry on desktop.
Victor @olivicmic suggested me to add the CSS attribute to the background "image-rendering: crisp-edges" to get a crispy pixels. Wow! This little tweak makes the difference.
Thank you Victor!
Polish the code
In the first version there is a lot of duplicate code in the user controls when user press the keys or click the arrow buttons, so I put the code in functions.
What have been the most difficult things for me?
What other problems I found?
Some browsers like Google Chrome not allow to autoplay music, so I have to play the music when users starts some interaction, for example click the screen, press the keys or click the arrow buttons.
I hope you like it, get some inspiration and it would be great if you can share it to your family and friends who ever play once Mario Bros to bring back some good memories.
All content on this website, including articles, artwork, screen shots, graphics, logos, digital downloads and other files, is the property of Nintendo, unless owned by a third party, and is protected by German and international copyright, trademark and other intellectual property laws. Trademarks and copyrights for third-party games and characters are owned by the companies that market or license those products.
Take a look at my other resumes