HTML5 Platform Game for iPhone
I’ve spent today porting my HTML 5 platformer, mentioned in an earlier post, to run on iPhone/iPod Touch.
The game uses the HTML 5 Canvas element and a few iPhone-specific HTML/JS extensions. It should still run on most desktop and mobile web browsers however.
I’ve tested the game on an iPhone 3G and 3Gs. The 3Gs performs as well as a desktop PC which is some feat! The 3G on the other had is a little sluggish, but the game is still playable; if you’re using a 3G I recommend playing the game with your phone upright (portrait) for best performance, since in this mode the game aims to draw to a smaller area of the display.
It is also possible to play the game full screen, that is without the Safari address bar & toolbar, by adding the game to your home screen.
According to Liam Green-Hughes on Twitter, the game also runs fine on the Nokia N900, running Firefox.
See my earlier post for the history of the game, or to play the desktop version. As before I invite you to take a look at the source code of the game. Simply hit your browser’s “view source” button to read the code.
Click the Play link below (ideally on your iPhone!) and be sure to leave a comment with your thoughts.
Play!
Or go to this address on your iPhone: http://tinyurl.com/purplefloyd
Congrats. This is exactly what the “no flash on my iPod” whiners need. Proof that HTML5 can replace not just the video features of flash, but their precious flash games too!
Thanks.
To truly dethrone Flash as an online gaming platform HTML5+JavaScript would have to match its performance, which, as numerous tests have conclusively demonstrated, is nowhere near the case. Claiming that a scripted app can run [nearly] as fast as it’s compiled, strictly-typed and resource-cautious counterpart, would simply be absurd. I am ready to back this up with concrete examples.
PS. Props to PurpleFloyd for this lovely game, which ran quite well on my iPhone 3GS.
Thanks for the comment Pectoris Fleo.
Are you comparing HTML5/JS to Flash/AS3, or to native iPhone apps? I ask since Flash apps are not “compiled”, “strictly-typed”, nor “resource-cautious”, but you seem to be stating that they are.
Yes Flash apps can benefit from JIT compilation and the type system in AS3 is better than earlier versions, but if we are comparing Javascript to ActionScript surely with their common EcmaScript origins there is no reason to suspect one can outperform the other, given suitably well-implemented VMs?
HTML5 through ajax can load in and unload server sources which to me makes it much more useful for the development of browser based mmorpgs.
Works fine on my myTouch 3G, nice job man!
Great job! Works surprisingly well on a third generation iPod touch.
Cool game! Works great, but the button triggers don’t line up on the iPad!
Anyone prepared to send me their iPad so I can test this?!
I just tried on my iPad it works, except I cannot jump lol
nice game again thanks
Great game! But It doesn’t work on my Nexus!
nice game
Well, it seems good for an HTML5 game. I have yet to see any decent HTML5 games on the iphone though, so that’s not saying very much. I don’t think people would play a game like this, its too choppy (seems like most html5 apps had a horrible framerate, especially on the iphone). I tried this in my ipod touch 4, I would expect a better framerate on the nexus. Also, there isnt enough feedback on buttons and things you click (but most html5 games seem like this, I guess because there aren’t too many toolkits available yet for the canvas).
Its as good as any other HTML5 game I’ve seen.
Nicely done. It’s great to see fellow JS / Canvas developers creating this stuff.
I too have a wee game to play on iPhone. Except it currently runs like a complete dog on there.
In dev here – http://www.wilfscorner.co.uk/sandpit/hypergunner
I’m pretty sure it’s all the collision routines that’s killing it. Possibly too much drawImage() as well.
Any one an expert on this stuff ?
The games looks like the one in super mario and its kind of interesting. Playing mobile games is very enjoyable and help me kill some time. Do you know some sites where I could download mobile games?
Apple does not allowing Flash apps on the iPhone or iPad because they bypass the app store does not hold water. You can make them RIGHT NOW, with touch controls, and people can play them immediately.
not the best game ever but its a good starting point, give it another 2 years and well be playing 3d html5 games.
so cool,I like this game,and I am from China,I am also use html5 .
Apple does not allowing Flash apps on the iPhone or iPad because they bypass the app store does not hold water. You can make them RIGHT NOW, with touch controls, and people can play them immediately.
Works great on iPod touch 4G.
Cool game play. Thanks for share..
nice game again thanks