14KB Super Mario A bit of Super Mario all in one JavaScript file, graphics and music included.

This was one of my first experiments using JavaScript for more than "regular" web development and it had been lying around for way too long until I put it online last year (at which it point it just went crazy on Digg and other sites, for whatever reason.)

The game aims to recreate the Super Mario gameplay and parts of the first level of the classic NES game using only JavaScript. This means that all the sprites are created at runtime with tiny divs or, if possible, drawn on sprite-sized canvas elements. The sprite data is included in the code as encoded strings. The (admittedly horrible) MIDI tune is stored as base64 encoded data and embedded as a data: URI. The embedded sprites were also discussed in detail by John Resig.

Check the original blog post for links to a smaller version as well as music enabled versions.

And if you're looking for a not-so-tech-demoish game of Mario, be sure to also check out the more complete Super Mario clone by Guillermo Bruchmann.
Read more...
0 comments
Post a Comment