Check out my
new book!
HTML5 Games book
Play Super Mario Bros in 14kB Javascript Here's an experiment in keeping things small and confined to one Javascript file. A piece of the old Super Mario Bros Nintendo classic. There are no external image or sound files, everything is rendered with Javascript using either canvas elements or old fashioned div-making tactics (for IE).

Hey! While you're here, why don't you also check out the new Games section, a section completely dedicated to online JavaScript web games! And subscribe to the feeds to get the latest updates and games! Now let's play Super Mario...

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.

There is also 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.

It is by no means a complete clone or anything, it's not even an entire level and several key things are missing, such as mushrooms, Koopas and stuff. It was merely done as a sort of proof-of-concept and to see how small it could get.

Performance varies somewhat between the different browsers, but Firefox, Opera, Safari and IE are all playable. The latest WebKit nightly seems to give Safari a speed boost.

Be sure to click the mouse on the game if Mario won't move. When you die, you have to reload the page to start over. And yes, you can move left. Sorry.


Play Super Mario Bros without music
Play Super Mario Bros with music

Or try the larger double size version:
Play Super Mario Bros (2X) without music or Play Super Mario Bros (2X) with music

The script has been compressed to 14kb with the YUI compressor.
Here's the uncompressed script (35kb), if anyone is interested. The structure may look a bit weird, a lot of things have been moved around to get better compression.


If you liked this, be sure to check out the Super Mario Kart JavaScript game as well. Have fun!
⇓ 238 comments «Oldest   ‹Older   1 – 200 of 238   Newer›   Newest» Steve

Very impressive!

April 8, 2008 at 11:29 AM
Anonymous

doesn't seem to work properly on FF3 beta or the latest webkit

i get this

http://tinyurl.com/6924qh

April 8, 2008 at 12:05 PM
Unknown

It works fine for me under FF 3, beta 5. Very nice. :)

April 8, 2008 at 12:10 PM
Anonymous

Fantastic job! Nice tight code, fairly faithful implementation. Superb!

April 8, 2008 at 12:13 PM
Jacob Seidelin

Thanks!

@anon: Both the latest webkit and FF3 beta 5 work fine here. Not sure what your problem is.

April 8, 2008 at 12:18 PM
Hixie

I get the same as anon. Works in Opera 9.5beta, though. I'm on Mac, if that matters.

April 8, 2008 at 12:32 PM
Jacob Seidelin

Probably a mac problem then. Oh well, not much I can do about that right now, I'm afraid. Thanks.

April 8, 2008 at 12:39 PM
Anonymous

Really cool. A bit sluggish on IE though. And I'm working on a tetris game, but this game beats it. =)

April 8, 2008 at 12:40 PM
Anonymous

For me, rendering is broken if the browser default encoding is set to anything but Latin-1 (e.g. to Windows Cyrillic AKA Windows-1251). Both Firefox and Safari have this problem, so chances are that both browsers are performing correctly.

April 8, 2008 at 12:43 PM
Anonymous

I'm speechless, this is amazing! How many lines of code? (prior to js compression)

April 8, 2008 at 12:48 PM
ph0rque

amazing... for usability, add a few tips on the left side. Also, whenever Mario dies, it doesn't restart right away.

April 8, 2008 at 12:54 PM
Anonymous

siq

April 8, 2008 at 1:05 PM
Anonymous

if you go off the left side of the screen, you're stuck.
when you die and fly up then fall down off the screen, you can still jump. and you can jump as many times as you want too... even when you fall off the bottom of the screen after dying, you can still jump your way back up.

April 8, 2008 at 1:08 PM
Anonymous

Great!!!!

April 8, 2008 at 1:11 PM
Anonymous

I like how you can outrun the 'camera'...

@ap
Thanks! Works perfect.

April 8, 2008 at 1:33 PM
Andrea Giammarchi

really good stuff! nice experiment, and works great with FF3 b5

April 8, 2008 at 1:37 PM
Anonymous

I get the same as anonymous on my PC (Firefox 2). It works when I switch away from Unicode.

April 8, 2008 at 1:40 PM
Anonymous

but: the complete original super mario land gameboy rom is only 8kb.

April 8, 2008 at 1:56 PM
Mark

COOL.

Works (slowly) on my iPhone. No music, and no keyboard.

April 8, 2008 at 2:10 PM
Anonymous

I like how theres no flag, and at the end you just step into white. It's like that episode of star trek where Picard dies and meets Q.

April 8, 2008 at 2:15 PM
Hixie

cupboy: Add a character encoding declaration and you should be ok. e.g. an HTTP header like:
"Content-Type: text/html;charset=iso-8859-1".

April 8, 2008 at 2:15 PM
Michael R. Head

I have the same "ugly FF3b5" problem as from the 2nd post. I've disabled all my FF addons, and it's still looks the same as the posted screenshot.

(running FF in the Ubuntu hardy beta release)

April 8, 2008 at 2:16 PM
Michael R. Head

Switching character encoding to ISO-8859-1 fixes it on both FF3b5 and Epiphany/gecko-1.9.

Cool!

April 8, 2008 at 2:20 PM
Anonymous

Amazing! Never thought these are ever possible with Javascript!

April 8, 2008 at 2:27 PM
admin

How could you done this with js? You are the master of js, congragulations dude.
Dave Sickoo
http://veryamazing.blogspot.com

April 8, 2008 at 2:30 PM
Anonymous

cojonudo!

April 8, 2008 at 3:02 PM
Anonymous

Works fine in FF3b5 on Mac here.

But when I die, it complains I need a plugin for "text/plain".

April 8, 2008 at 3:13 PM
Anonymous

All four versions work fine on my mac with firefox! Thanks!

April 8, 2008 at 3:48 PM
bennn

Awesome! Well done - really impressive from one js dude to anoher. :)

April 8, 2008 at 4:20 PM
Yanuar

everybody, try this..
it's more interesting
http://nintendo8.com/game/629/super_mario_brothers/

April 8, 2008 at 4:27 PM
Anonymous

Nice, but I can't help thinking that 14Kb is actually quite big.

I've been doing size optimization for some time, including some effects in 256 bytes, a simple remake of Wolfenstein 3D in 20 lines, and a Doom like ( with various enemies, items, levels, floor and ceiling mapping ) in 4Kb.

April 8, 2008 at 4:52 PM
Anonymous

Nice, but no music and no mushroom in the second question block..

April 8, 2008 at 4:58 PM
Anonymous

Very very impressive. As a guy that programs a bit of javascript to get this down to 14kb with those sorts o collisions etc. Wow, cudos man, that is rad.

April 8, 2008 at 5:28 PM
Schill

Well done! The Base64-encoded MIDI is cool, I guess it works in everything except IE these days (maybe IE 8, even?)

I have a few random JS projects on my own site which while not this light, are in similar spirit (ie., arkanoid and SoundManager 2.)

Super Mario World is an old favourite everyone knows though - again, nice work. Works fine for me on Firefox 3 B5.

April 8, 2008 at 5:36 PM
Anonymous

Pac-Man in 4K of 6507 assembly:

http://www.bytecellar.com/archives/000102.php

April 8, 2008 at 5:36 PM
Carpathian66

truly amazing!

April 8, 2008 at 6:37 PM
Jason

collision detection is a little off.

April 8, 2008 at 6:55 PM
Anonymous

amazing

April 8, 2008 at 7:13 PM
Anonymous

AWESOME!!

April 8, 2008 at 7:20 PM
Anonymous

Wow! That's really frickin' cool.

Weel done!

April 8, 2008 at 7:21 PM
Anonymous

Neat little game. I died, and kept pressing the up arrow; you'll never fall if you do that, lol.

April 8, 2008 at 7:25 PM
Anonymous

doesn't work right in FireFox, I could see and hear things, but not do anything.

April 8, 2008 at 7:35 PM
Anonymous

That's insane. FF3b5 on Leopard work beautifully.

April 8, 2008 at 7:41 PM
Unknown

This is truly amazing work. I'm impressed.

April 8, 2008 at 7:49 PM
muzbye®

hahaha.. that's correct. when mario died, you still can press up arrow, and the mario will be still flyin' around.
Nice code though... fantastic

April 8, 2008 at 7:49 PM
Cameron

Very awesome, nice work.

April 8, 2008 at 7:51 PM
Anonymous

Wow!, aweasome. Fantastic job rlly.

April 8, 2008 at 7:57 PM
Anonymous

Very cool. It's very impressive that you managed to do that. I would like to see a whole level done and see how small you can get the file size down to.

April 8, 2008 at 8:05 PM
Anonymous

the goomba keeps getting me

April 8, 2008 at 8:07 PM
Anonymous

totally pointless. go get a job.

April 8, 2008 at 8:13 PM
Anonymous

this is pretty ghey

April 8, 2008 at 8:19 PM
Anonymous

To the guy that said, "but: the complete original super mario land gameboy rom is only 8kb." Yeah, but the gameboy has onboard graphics chips that handle things like sprites, screen swaps, moving background layers, and so on. You don't get that very easily in a browser. It's a miracle this developer got it down to 14kb. Hire that man!

April 8, 2008 at 8:21 PM
Anonymous

wow, I can't believe you did that in JS. I would have used python :-) nice job!

April 8, 2008 at 8:25 PM
Matt McCarthy

@Robb Montgomery: This might get him a job.

April 8, 2008 at 8:32 PM
Anonymous

WOW!

April 8, 2008 at 8:32 PM
Anonymous

This is a very nice invention. I never thought the whole game can be designed only using 14kb. :)

April 8, 2008 at 8:33 PM
Rog

Good proof of concept - except that if I reload the page using FF 3b5, I can't MOVE! I can jump, but l-r arrows do jack squat. It does however work on the Wii (hook up a keyboard ppl, really it works. Just awfully slowly.)

April 8, 2008 at 8:40 PM
Jonathan Carl Broderick

works (slow) on my nokia n800 os2008, great job.

April 8, 2008 at 8:51 PM
Anonymous

Thats incredible. Makes me look at javascript in a whole new way.

April 8, 2008 at 8:57 PM
Anonymous

@Volo Mike
Your obviously a noob. You cant do something like this in a server side language.

Every day when I find out something new of JS's abilities I continue to be amazed.

April 8, 2008 at 9:01 PM
Anonymous

Well, I don't understand why some people here don't like this. It's a very well done script buddy!
I wish I had the knowledge and patience to do this. Congratulations =)

April 8, 2008 at 9:17 PM
Totoro

wow! you're a master!
excellent work. congratulations!

April 8, 2008 at 9:38 PM
Anonymous

Well done!! Amazing job! How about mushrooms, stars, and other levels?

April 8, 2008 at 9:51 PM
Terry

Amazing!

However, it works until I change encoding from gb2312 to utf-8

April 8, 2008 at 10:05 PM
Anonymous

There's no encoding declaration; you should always use an encoding declaration on every HTML page (or do it server-side).

It's not hard, just add <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> before the <title> and it solves everything.

April 8, 2008 at 10:35 PM
Unknown

Impressive !

April 8, 2008 at 10:36 PM
ABHINAV

Very impressive!

April 8, 2008 at 11:08 PM
Hayesha

Grate work.

April 8, 2008 at 11:11 PM
JAV

Works smooth to be playable on an old pentium4 2000Mhz, firefox3 beta5, debian etch. Great work!

April 8, 2008 at 11:15 PM
Anonymous

Really Cool

April 8, 2008 at 11:22 PM
Anonymous

Great job!

April 8, 2008 at 11:24 PM
Anonymous

there's no music,and no mushrooms

April 8, 2008 at 11:29 PM
Ashly Lorenzana

Okay, seriously...

Not only is that incredibly badass that you coded this entirely in javascript (no external images?!?!?...pretty damn good!) but it is even cooler because you emulated the oldschool mario bros. game for the first nintendo systems. That, I do believe, makes you A PIMP! For real. I might be in love with you.


-Mona

April 8, 2008 at 11:30 PM
Anonymous

This is seriously nice! I've made a couple of JS based games as well, but this does beat 'em in gfx and smoothness... Not to mention size - that's an achievement.

April 8, 2008 at 11:31 PM
Jacob Seidelin

Haven't been able to do anything before now. Added the encoding declaration, hope that works better.

April 8, 2008 at 11:51 PM
Anonymous

great script and idea :)

April 9, 2008 at 12:02 AM
Anonymous

It sucks

April 9, 2008 at 12:26 AM
Anonymous

Both game and music ran slow in Firefox 1.5.0.12, if that applies to anyone besides myself. Ran only slightly better in IE 6, and without music when it should have. Just as an FYI.

Nice work.

April 9, 2008 at 12:55 AM
Anonymous

Nice!

It does not have all the secret rooms i believe, but well done! It runs smooth on my safari browser.

April 9, 2008 at 1:11 AM
Anonymous

I am amazed! As a proof of concept this is fantastic. I'm going to be studying your code for a hours tonight. Gonna need some Java in the morning. I have never thought of using javascript as a platform for web based games.

April 9, 2008 at 1:20 AM
Anonymous

No shrooms? I loved the schrooms :D

April 9, 2008 at 1:20 AM
Anonymous

Simply awesome

April 9, 2008 at 1:29 AM
ubik

Very impressive. CupBoy how long it took you to write it? You just opened gates of new world;)

Regards
Darek

April 9, 2008 at 1:51 AM
もぎー

Good job!
I want to mushroom...

April 9, 2008 at 2:09 AM
Anonymous

Really good :)

No mushrooms tho :(

April 9, 2008 at 2:11 AM
DeeDey

WOUW !!! Very nice ! Like my SuperMario on Nintendo 64

April 9, 2008 at 2:39 AM
Anonymous

Looks like the death music failing to play is an off-by-one error. For whatever reason, your aSounds array has three elements in it - the main theme, a noop element, then the death music. The die() function calls playMusic(1), which (correctly!) plays nothing. Changing this call to playMusic(2), or removing the element sound element, should cause the death music to work properly.

But that aside, great job! And it's a very nice proof-of-concept. :-)

April 9, 2008 at 2:47 AM
Anonymous

Stunning! I miss the mushroom at start. :-)

April 9, 2008 at 3:12 AM
Anonymous

kb != kB. This is 14 Kilobytes of JavaScript, not 14 Kilobits, there is a massive difference.

April 9, 2008 at 3:17 AM
Anonymous

Whoaa, impressive.

Now do Quake using the same tools :)

April 9, 2008 at 3:49 AM
Anonymous

Hi, good job!
But I found some issue with jump:
if I press 'up' arrow (jump) and then, when Mario in the air, press 'left' or 'right' I can move only a little range. Then Mario stops like he hits on wall.

April 9, 2008 at 3:49 AM
Jacob Seidelin

@Andrzej Doyle: Yea, I know. The empty element was there for debugging purposes and I forgot to remove it. It's fixed now. Thanks.

@madpilot: Very nice! This version does actually work using just divs as well. That's how it's done when running it in IE. That's actually how it was done in all browsers to start with, until the canvas thing was rather hastily tacked on in the end.

@Darek: I have no idea, really. I started doing the sprite thing a few years ago, but then it just sat in the corner for ages..

And seriously people, read the post. I told you there are no mushrooms.

April 9, 2008 at 4:00 AM
Anonymous

Dude, you are the man... very very impressive and a step in the right direction for web based gaming

April 9, 2008 at 4:21 AM
Jim H

sweet 'n' slick

April 9, 2008 at 4:27 AM
Anonymous

No mushrooms, no secret levels, no flag... = fail

April 9, 2008 at 4:34 AM
Anonymous

cool :)

April 9, 2008 at 4:46 AM
Håvard Pedersen

You can also run too far to the right, out of the screen :)

April 9, 2008 at 4:49 AM
Anonymous

Good!! It works fine.

April 9, 2008 at 4:57 AM
Unknown

Great job!!

April 9, 2008 at 5:50 AM
Anonymous

This is madness... you're a genius!

April 9, 2008 at 5:58 AM
Augusto Kurt TMW

amazing work! gratz!

April 9, 2008 at 5:58 AM
Topper

Dude I am beyond impressed. I think only guru programmers who have dabbled with inline images and advanced javascript, sine waves for jumping, physics acceleration, scrolling panes and so will really appreciate what you have achieved here.

I am calling other programmers into my office to show them and the latest comment was "fuck me" and "damn hes good", "give that guy a job".

Well done!

April 9, 2008 at 6:03 AM
Anonymous

def. not a mac problem. working in camino.

April 9, 2008 at 6:15 AM
Anonymous

works perfect in safari. and, in fact, much smoother than in failfox.

April 9, 2008 at 6:26 AM
Unknown

I only played it for a few seconds, but

1) wasn't there supposed to be a super mario shroom in the second "?" box at the beginning of the game?

2) shouldn't the box before the first pitfall be invisible, and contain a 1-up shroom?

Stopped playing after that. Sluggish in IE 6 on Win XP (what I'm stuck with at work).

April 9, 2008 at 6:28 AM
Anonymous

I think auther is too great and geneus.

I want to eat kinoko

April 9, 2008 at 6:49 AM
Paco

A.W.E.S.O.M.E

April 9, 2008 at 7:04 AM
Josh Mormann

Holy Effing crap! NICE WORK ALL INVOLVED. AND EF THE NAYSAYERS!

April 9, 2008 at 7:18 AM
Anonymous

Awesome!!!

You've just raised a bar for the rest of us :)

April 9, 2008 at 7:46 AM
Anonymous

Is this open source? E.g. could I put this on my own website?

April 9, 2008 at 7:47 AM
Unknown

Зачод!!

April 9, 2008 at 7:55 AM
Nicolaspar

Excelent Works, thanks!!!

April 9, 2008 at 8:04 AM
Anonymous

Holy hell. To do that in cross-browser compatible Javascript is something special indeed. Big props to you.

April 9, 2008 at 8:20 AM
Anonymous

Check out http://TheGamersGuild.info
Brand spanking new. Be a part of the beginning of a huge site!

April 9, 2008 at 8:37 AM
Francesco Fracassi

Huge!

April 9, 2008 at 8:41 AM
Unknown

thought it might be possible but not in 14kb, not even in 35kb...very cool!

April 9, 2008 at 8:47 AM
Anonymous

YOU OWE ME A MUSHROOM!!!

Seriously though, this is amazing.

April 9, 2008 at 8:53 AM
Anonymous

That's amazing! CompressorRater shows that if you served your JS gzipped you could get it down to ~7KB !

April 9, 2008 at 9:00 AM
pambuk

I have to stop in order to jump :(
Great work (14kb!) but unplayable for me... I'm on Ubuntu 7.10, using Firefox (if that matters).

April 9, 2008 at 9:16 AM
Anonymous

amazing.

April 9, 2008 at 9:24 AM
Anonymous

Very impressive, it's good to see people pushing limits on scripting.

April 9, 2008 at 9:36 AM
Abhijeet

Really impressive!

April 9, 2008 at 9:44 AM
Anonymous

I don't like to pull the plug like this, but seeing the ecstatic reactions to this game prototype, it seems that many haven't seen 3D TOMB II.

3D TOMB II is a DOOM like in less than 4Kb of JavaScript featuring several enemies & items, levels generation, texture generation, walls floor and ceiling mapping ...

April 9, 2008 at 10:06 AM
Anonymous

NO MUSHROOM = FAIL!

April 9, 2008 at 10:16 AM
Smok

how cool is that :)

April 9, 2008 at 11:59 AM
Unknown

14kb, you're pissing me. javascript chess with cpu opponent http://javascript.internet.com/games/javascript-chess-with-cpu-oppo.html

April 9, 2008 at 12:01 PM
Anonymous

Amazing, just amazing, you're a talented guy...

®

April 9, 2008 at 12:05 PM
Anonymous

Amazing!

You are the best, javascrisching.

April 9, 2008 at 12:10 PM
jonserr

awesome,
hey did anyone write the control buttons for it. if not do you mind if i give it a shot. it loads fine on the iPhone but no controls.

much oblige

April 9, 2008 at 1:17 PM
pollaki

para cuando el Mario 3? =P

April 9, 2008 at 2:04 PM
Anonymous

Fantastico

April 9, 2008 at 2:24 PM
Maria Andrea Lenis

You are my new hero.

April 9, 2008 at 2:53 PM
Anonymous

awesome!

April 9, 2008 at 4:10 PM
Anonymous

Wonderful!

I don't hear any music in Opera (9.27) though.

April 9, 2008 at 4:20 PM
][][]

Very nice, sophisticated code!
Another example that has some things in common with your Super Mario clone: Jangaron.
It also implements a classic game, in this case "Tron", is written in fairly tight code (80kb uncompressed), and features unprecedented DHTML graphics, even 3D as in your Doom prototype (but does not use canvas).

April 9, 2008 at 4:44 PM
Matt

this is great, but there is a cheat. if you die you can keep on jumping up, but you cant move.

April 9, 2008 at 6:53 PM
Anonymous

Impressive, but not in the sense of size. 16kb of compressed JS is quite a lot of code...

it loses a little of it's magic when considering the original mario, with all the bells and whistles, was only 40kb in total.

April 9, 2008 at 7:10 PM
Anonymous

amazing stuff... kudos to your effort to squeeze things

April 9, 2008 at 7:21 PM
rookie23

wow nice i love it!

April 9, 2008 at 8:02 PM
Anonymous

It's amazing!!!! nice job !!!

April 9, 2008 at 9:28 PM
Anonymous

Hey,

I found what you did quite interesting and I would like to ask something important regarding the super mario javascript.

We have a site and we are thinking of using it there. That said I would like to discuss it with you.

Please do email me at jurge16@yahoo.com so that we can talk about it.

Thanks mate.

April 10, 2008 at 12:32 AM
Frankie!

It seems like the most of you have under estastinmated the power of javascript, there are some raytracers, lots of games and other stuff.
you have to use google!
try to search for games or just go to Ajaxian where they post a lot of stuff of web development.

JavaScript might be like syrup, but these days they just keeps on adding water to the mix.

It seems like the sound doesn't work on FF3 beta 4 but that's not a major problem.

Great work Nihilogic! I didn't get what kid of lisence it was released under but i will study your code and maybe fix a few bugs or so.

In conclusion i will just tell that i'm currently writing on a 3D roleplaying game in JavaScript and php, many people have told me that it's impossible but what i have seen this far it looks like i can complete the project.

April 10, 2008 at 2:01 AM
Anonymous

Great application, man. Well done. Can't wait to see you do an online poker one.

April 10, 2008 at 2:31 AM
Anonymous

Really good work! Impressive!
Quess

April 10, 2008 at 2:37 AM
Anonymous

One word: WICKED!

April 10, 2008 at 2:41 AM
David Sherman

AWESOME!

April 10, 2008 at 5:06 AM
Anonymous

One problem I noticed was the lack of conservation of momentum while in the air. as well as the ability to jump and then start moving, considering you have no momentum in any direction this should be impossible. What i have done to fix this in the past is to establish a boolean value that represents if the char is on the ground or not. If the char is on the ground, let the player change its momentum. If the char is off the ground STILL let him, but at a very very diminished rate.

Other than that i LOVE it, great work.

April 10, 2008 at 6:28 AM
nitro2k01

I repeat what p01 said earlier. Nothing beats 3D Tomb II! It's a 4k JS game with 3D.

April 10, 2008 at 6:52 AM
Anonymous

@daniel thornbury

Impressive, but not in the sense of size. 16kb of compressed JS is quite a lot of code...

it loses a little of it's magic when considering the original mario, with all the bells and whistles, was only 40kb in total.

this mario was done in javascript on a web browser. the original mario was written in optimized compiled code. i'd say 14kb is impressive.

April 10, 2008 at 7:06 AM
Anonymous

Happy!

April 10, 2008 at 7:30 AM
Anonymous

At some point I want to revive my project at http://code.google.com/p/renderengine

I'd like to get some more people involved. I think this is amazing, and would like to see people really put the browser to use. With faster browsers every day, Javascript is quick becoming a good gaming platform.

April 10, 2008 at 8:25 AM
Anonymous

I've seen more stuff in less ^_°

I might already know .theprodukkt

http://www.theprodukkt.com/kkrieger

First person Shooter in 96kb.

http://kk.kema.at/files/gfx/full1.jpg

April 10, 2008 at 8:59 AM
Valkin

Hey,

I would like to have a talk to you about a potential job offer/freelance work, could you please contact me on leon.bollerup@startforce.com .

With Kind Regards,
Leon Bollerup
Project Manager, www.StartForce.com

April 10, 2008 at 11:06 AM
Anonymous

Whoa !

Damn... Compliments !
Pretty masochistic though ! :-)

April 10, 2008 at 12:19 PM
Anonymous

Clap Clap Clap.

I cannot believe this size of the source. Even 35 kb is small.
The graphics is ultra compressed.
Hardly possible to make much smaller. The code is compact and efficient (as you would expect).

The combination is unbelievable.
I had heard about javascript games.
But I didn't think it was possible to make them with so few lines of code.

You impressed me (and I am a savy coder).


This is not exactly something one's girlfriend appreciates. Look honey what I have done!!
And it is only 14kb!!
Oh, good for you. btw what is a kb?

Get a life.
You have too much spare time. :)

April 10, 2008 at 12:39 PM
Anonymous

If you liked this Mario "clone" in 14Kb of minified JavaScript, you might enjoy Castle Wolfenstein, a "clone" of Wolfenstein 3D in 17 lines of JavaScript with a several levels, a map editors, dogs attacking you ...

April 10, 2008 at 2:15 PM
Anonymous

mind blowing !

April 10, 2008 at 5:12 PM
RaphaSantos

sux a lot...
the flash player is a very mucth better.

April 10, 2008 at 5:41 PM
Anonymous

Wow. Just...wow. The double-size version chugs and skips input-read occasionally on my computer (might be my old computer), but the single -size works great. The minor issues of not having koopas and 'shrooms are more than justified by the fact that the source is microscopic. Original NES carts were, if I remember correctly, 128kb minimum, but I don't know how big SMB was. It's no small feat to compress the game into less than 1/10 that, especially in a language as (relatively) bulky as Javascript! Very impressive coding, people. Very impressive coding.

That said, I did have a problem with the music. I don't mind that it was in MIDI, or even that the main tune was just a portion of the song. The impressively tiny size, again, justifies those factors. But could you have picked a DIFFERENT MIDI that got the melody right, or even the few notes that were used? Some of the notes in the track were off-key, others off-tempo, and a few just plain wrong. After turning off the music, the game felt much better though, so I didn't let that detract from my game experience (beyond the first ten seconds).


It's easy to ignore the absence of koopas, but it's tough to ignore an off-key version of the soundtrack playing right into your ears. Encoding a new MIDI into Javascript might be a royal pain, but fixing that will eliminate the single biggest flaw of the game (in my opinion).

April 10, 2008 at 5:55 PM
Anonymous

Nice work! Keeping these file sizes small is key. If you're going to put this on a dot mobi, remember that most of the world is seeing the internet for the first time and will be less critical than this bunch (grin).

@anonymous re: encoding - the encoding you selected will fail at ready.mobi.

April 11, 2008 at 7:48 AM
Eat_My_Shortz

Wow .. awesome in JavaScript!

Quicktime for audio crashes my browser (FF2 on Windows). But maybe that's just me.

Non-audio version is fine.

April 11, 2008 at 8:44 AM
Anonymous

hehe very cool

April 11, 2008 at 10:49 AM
Unknown

since when can you go to the left in Super Mario Bros.?
besides theres a bug when you go to the most left...

April 11, 2008 at 11:44 AM
Unknown

in ie7.0 it runs off the page to the right and the same thing in firefox 3beta ... in other words ... the game is not inside the frame or part is not hidden and the gam takes up the whole width of the screen to the right instead of being neat and nice in a little box like it should be ... can anyone give me a tip please hot to fix it

April 11, 2008 at 1:18 PM
Anonymous

toedilly fotoshawped

April 11, 2008 at 6:49 PM
ronzox

nunca sabré tanto java no me gustó tanto mario como para hacer eso... gran trabajo!!

April 11, 2008 at 8:18 PM
German

@ronzox: java tiene poco que ver con javascript además de ser lenguajes de sintaxis parecida, pero la orientación es completamente distinta.

Tampoco me funciona en derivado de Safari...
(S60 Browser, javascript habilitado)

April 12, 2008 at 6:59 AM
Anonymous

awesome!!

April 12, 2008 at 9:33 AM
esquedeaquiaqui

hagan esto dejense matar y apenas los toquen que mario hace la mueca del porque empiecen a presionar ctrl para brincar , el prgrama calcula la distancia de salto en el aire y saltando puedes llevar a mario al cielo jajajajajaj y el calculo es tan correcto que cuando sale de la pantalla hacia arriba se dmora en caer lo que subio saltanto ajajaj.

April 12, 2008 at 9:42 AM
Anonymous

awesome

April 12, 2008 at 10:43 AM
Anonymous

Wow!!

Awesome guy!!

Great job!!

April 12, 2008 at 6:46 PM
Mr.Hyde

Nice, however it was disipointing that i could not find any muchrooms. normaly there is a muchroom on the 2nd question mark box. and ya it was good ne ways

April 12, 2008 at 6:51 PM
Anonymous

Extremely neat, though by no means amazingly ground-breaking. (Sorry. ;-)

Though they didn't use canvas, there were a lot of really cool games something like five or six years ago at the now dead javascript-games.org. Oh Javascript-Games.org, I pine for thee.

April 12, 2008 at 10:44 PM
Lestat Malandro Porco Porto Alegre/RS

uahu

April 13, 2008 at 10:04 AM
Anonymous

insane.... absolutely insane... love it! let's port MAME to javascript :)

April 14, 2008 at 3:55 AM
Anonymous

This Thing Rocks! :-)

Please add a SPACE => Up Assignment for a
better Gameplay.

April 14, 2008 at 6:38 AM
Jensemann

Really nice But you have a bug there. When Mario died you can still jump. :D
Thanks for this entertaining work
Jensemann

April 14, 2008 at 6:48 AM
Mister Potato

Amazing!!!

April 14, 2008 at 3:58 PM
James

Very impressive.

April 14, 2008 at 8:29 PM
Anonymous

nice dude!!
never thought that that game can be done in javascript...
may i link your page to my blog???

April 14, 2008 at 9:17 PM
nagoon97 This comment has been removed by the author. April 15, 2008 at 2:46 AM Anonymous

Great work!
Two suggestions: 1. a flag and castle at the end, and 2, perhaps a piranha plant or a koopa troopa besides the goombas.

April 15, 2008 at 8:50 AM
Unknown

Not dead yet!!!
When you die, click the up-arrow and you can fly! see video example here:
http://screencast.com/t/jvtzqoDw

Cool!!! Great job. Much fun in such a small package.

April 15, 2008 at 10:02 AM
Anonymous

yeah n1

April 15, 2008 at 1:01 PM
Anonymous

Its really but. May be a little bit to easy...

April 15, 2008 at 3:37 PM
Anonymous

wonderfull work.

April 15, 2008 at 10:09 PM
Anonymous

That is SO COOOL!!!!! Loved running it on firefox in 64bit linux; Amazing that you did this in Javascript.

April 16, 2008 at 5:50 PM
Anonymous

damnit! halfway through the game and still no mushroom! no flag at the end of the stage either! =) really nice though

April 17, 2008 at 12:02 AM
Anonymous

I played the whole thing, getting every coin. Worked great (FF2, XP).

Amazing work, what are you doing next?

April 17, 2008 at 4:29 AM
Jay Bose

Very creative, great job!

April 17, 2008 at 1:15 PM
Anonymous

suparb

April 17, 2008 at 10:19 PM
Ryan

Nice work
http://www.littleking.jp

April 18, 2008 at 1:40 AM
Anonymous

Hi sorry but no music on FF 2.0. Collision good but commands OK. Fantastic game in 14KB and no external media...
Antonio

April 18, 2008 at 3:04 AM
Anonymous

Impressive. Never underestimate the power of Javascript. :D

April 18, 2008 at 5:46 AM
Anonymous

IMPRESSIVE!!

April 20, 2008 at 10:34 AM
Anonymous

再現はすばらしいですが不具合はあるようです。

The reappearance is wonderful but seems to have a problem.

April 21, 2008 at 3:51 PM
Anonymous

Lavoro Davvero Molto Interessante.

April 22, 2008 at 9:03 AM
Anonymous

I love Mario Bros

April 23, 2008 at 2:22 AM
Anonymous

Some of the people that came here really need to learn to read:

"It is by no means a complete clone or anything, it's not even an entire level and several key things are missing, such as mushrooms, Koopas and stuff. It was merely done as a sort of proof-of-concept and to see how small it could get."

I WONDER WHY THERE AREN'T ANY MUSHROOMS DUR NOW I'M GOING TO THROW THE WORD "FAIL" AROUND LIKE A RETARDED 4CHANNER

But in all serious, nice work. This amused me. :)

April 24, 2008 at 7:39 PM
Unknown

Quite nifty!

April 24, 2008 at 10:18 PM
Post a Comment