Super Mario Bros in Javascript - only 14KB!!


Super Mario in Javascript

They built a proof of concept to see if it could be done, they even got sprites and music embedded into the javascript file. It works, and hey it’s Super Mario Bros in your web browser!

Here’s an experiment in keepings things small and confined to one Javascript file. There are no external image files or anything, everything is rendered with Javascript using either canvas elements or old fashioned div-making tactics (for IE). The sprites are stored in custom encoded strings in a format that only allows 4 colors for each sprite but in turn only takes up around 40-60 bytes per sprite.

We also have MIDI music embedded as base64-encoded data: URI’s. No music for IE, though, and it seems all the other browsers each have different, minor problems with it, but it sort of works.

Sphere: Related Content

Leave a Reply

Helping new projects get the head start they need