Super Mario in one JavaScript file

Posted on April 10th 2008 in Fun, Web Development

supermariojs.gifThis is a great example of how JavaScript can be used to render graphics and games in browsers, at only 14 Kb of code (compressed). The demo is playable, using arrow keys, although it features only one (incomplete) level. No external images or files are used. Sprites are made using canvas or div-making tactics (for IE), and sound is embedded as base64 encoded data (URIs). All sprites have only 4 colors, which helps keep things small (40-60 bytes per sprite).

As the guys at Nihilogic said, this was a proof-of-concept exercise, but it’s impressive how much was achieved with a single 14 Kb javascript file.

Trackback URI | Comments RSS

Leave a Reply

Close
E-mail It