RSS Feed

HTML5 – The Best Platform For Rapid Game Development

May 19, 2012 by Austin Hallock

It’s a bold claim, but I’m going to make it and back it up with two example games… HTML5 is *the* best platform for rapid game development available right now.

Nick vs Bus

I’m a student at the University of Texas, and two weeks ago, another UT student was hit by a bus (video embedded below, he made it out without serious injuries). As soon as I saw the video start going viral, I decided I would make a game for it. 24 hours later, the game was complete and went viral itself. In just a few days, the game had 25,000+ unique visitors, 1,500+ likes, and articles on sites like Kotaku, News.com.au, and the Statesman. Here’s the link to the game: Nick vs Bus

The game makes use of <canvas>, SVG (Scalable Vector Graphics – which were remarkably easy to implement), and Clay.io. It’s written in CoffeeScript, here’s the source code (keep in mind it was made in <24 hours). Thanks to HTML5, it’ll run from your phone’s browser as well (assuming have a semi-modern smartphone).

Nick vs. Bus wouldn’t have received anywhere near as much response if I had released it two weeks after the incident, and HTML5 was the perfect language to crank it out in such little time. (Keep in mind when I say HTML5, what I really mean is <canvas> and JavaScript)

The graphics aren’t great, but that’s not my background (if you’re curious, I used Inkscape)

Word Wars

The second game that backs up my claim that “HTML5 is the best platform for rapid game development” is a game called Word Wars.

Word Wars was initially developed by a couple other students and friends during a 24 hour hackaton at UT. It was called Worldle at first, and had some good reception from Hacker News. One of the developers didn’t even know JavaScript going into the thing (pretty impressive).

What’s more impressive about Word Wars in relation to Nick vs Bus is it has a backend + multiplayer (nowjs), all done in less than 24 hours. This one was done in pure JavaScript rather than CoffeeScript like the first — it’s really just a matter of preference, CoffeeScript isn’t going to drastically reduce your development time.

Again, the game works from mobile devices as well

That’s two games developed in less than a day, both with a pretty good reception.

Bonus: Since it’s the development time is so little, I even made a game for TechCrunch in an attempt to get noticed for an article. That attempt wasn’t successful (a couple editors tweeted about it, but no article), but here is the game anyways.

Why HTML5?

The best candidate to compare HTML5 to for rapidly developing and deploying games like Nick vs Bus and Word Wars is Flash. Java, C++, Unity, iOS and the rest all typically have longer development cycles, not to mention they simply wouldn’t have spread as quickly since people are forced to download the game (or use the terrible Java applet). Sure, you can create a game fairly quick in those languages if you’re very familiar with them, but I’d argue that, given an equal knowledge of all languages, HTML5 would win out on rapid game development. If you’re hoping to create the next Call of Duty (we definitely need more games like those /sarcasm), go with C++… WebGL is great but we’re probably still a couple years away from seeing console-quality games using it.

Why HTML5 over Flash?

Mobile Support

This is the big one in my eyes. Right now the main benefit of HTML5 is it’s “cross-platformness” by nature. 3,000 of the 25,000 visitors to Nick vs. Bus came from mobile devices. Most of those came from people clicking the link from Facebook’s app.

Sure, you can get your Flash game on the App Store (when I say App Store, I mean iOS, Android and WP7), but that takes time, and any update you make takes time as well… With HTML5, you can get your app on the App Store if you’d like, plus your game can be played straight from the browser.

For the Nick vs. Bus game, mobile support would just now be ready… two weeks later… if I had used Flash.

In addition to mobile support, HTML5 paves the way for games to be playable on smart TVs (in the hopefully near future), Windows 8 apps, and perhaps even consoles as Microsoft is very supportive of the new markup.

No compiling

Having to wait for a compiler sucks. With JavaScript you don’t have to. (Yeah, I use CoffeeScript,  a compiled language; however, it’s very quick to compile and certainly not necessary). That also leaves open possibilities like this.

Easy Testing

As per the nature of the web, to test a game on different platforms, you just point your browser at wherever you chose to upload your game. Testing for mobile is the same, and since most browsers and mobile browsers have their own JavaScript console, it’s fairly easy to find the issue and debug quickly.

Same language for a backend

Should your game need a backend (if for example, you want a multiplayer component), you’re able to use the same language: JavaScript (node.js), which just makes sense. Why write a game in two different languages when you don’t have to? For one of our games, Slime Volley we run a separate instance of each game on the server. In our implementation, we simply share code between the client and server, so there’s no need to rewrite the mechanics in another language. The game’s source code can be found here.

It’s not a plugin

Okay, okay… pretty much everyone has Flash, but it’s hard to argue against a standard being better than a plugin. Apple has already taken a stance against Flash. Sure, none of the major players in browsers are going to publicly take a stance against Flash, but I can see HTML5 being favored over something that is completely beyond their control.

It’s not controlled by a single corporation

Adobe does fine work with their products, but in this case Google, Mozilla and Microsoft all competing against each other will be able to continue making something better. Chrome was the first to really make HTML5 games viable with the V8 engine, and now Firefox and even IE are doing their part to push the limits.

Great stuff is being pushed out like the Gamepad API and Notifications API.

More active development

Because it is new, more and more developers are building tools for HTML5. New doesn’t necessarily mean better… in fact, it means it’s likely less stable. What it does mean however is there is likely much more active development going on and much less legacy code / excess bulk.

HTML5 games get more attention

Honestly, HTML5 games get more attention just for being HTML5 – deserved or not. It’s still a buzz-word, and early adopters seem more likely to have a look, opposed to flash games which they’ve played hundreds, if not thousands, in the past 10+ years.

HTML5 Weak Spots

The two biggest criticisms of HTML5 are audio and security. Audio still needs work, I’m not going to beat around the bush on that. It shouldn’t be long though…

As for security, I just wrote an article for DZone about this. It’s not published yet, but you can have a look at the Google Doc for it here. Basically, you can make your game secure, you just need a backend that can be done fairly easily with node.js.

Finishing Words

I’ve written a three part series on HTML5 game development tips — things I’ve picked up on along the way. Part 1 is about style & performance tips, part 2 covers input methods (keyboard, mouse, touch, accelerometer, etc), and part 3 (link to Google Doc since it’s scheduled to be published on Monday) talks about security tips.

I’m betting on HTML5 which is why I’m building what’s essentially “Steam for HTML5″. It’s called Clay.io. You can have a look at more HTML5 games in the Clay.io store. For developers, have a look at the HTML5 Game Development Tools we offer.


  • Pingback: Hackernytt | Om startups och allt som hör till. På svenska. | HTML5 för snabb spelutveckling

  • Tom

    Looks interesting but cant read it due to a massive FB/twitter/g+ bar on the screen on my phone. Shame that :(

    • Austin

      Ouch, sorry about that, CSS media queries to save the day!

  • mobilereader

    I really wanted to read this article but your sliding social sharing box consistently covers a third of the screen on my smartphone. I can’t even proofread what I’m writing here. I’m on a Galaxy Nexus.

    • Austin

      Fixed!

  • Johan

    Couldn’t you just use CSS media queries to get the scrolling bar only show up if the screen is wide enough? That shouldn’t be too hard.

    • Austin

      Yep, done! Sorry about that

  • foljs

    """"If you’re hoping to develop the next Call of Duty (we definitely need more games like those /sarcasm),""""

    What's the justification of the sarcasm? We don't need more Call of Duty style games but we DO need more HTML5 or Flash casual games?

    • Austin

      The world probably doesn't need more of my lame, "take a 90's/2000's game and turn it into HTML5", but there's a lot of room for creativity in Flash and HTML5 games.

  • http://twitter.com/rey12rey Jeffrey G.

    Great article. Just the inspiration needed to learn yet another lang. Thanks dude!

  • http://eric-wieser.tk Eric Wieser

    I'll have to agree with you here. I managed to build [this connect 4 game] (http://eric-wieser.tk/games/4d.html) in about 3 hours, [this nim-like game] (http://jsfiddle.net/Eric/QMGGN/show/) in about 10 hours, and [this multiplayer snake game] (http://snakes.eric-wieser.tk) in about 48 hours. Haven't had the chance to try building a game from scratch without breaks.

    • Austin

      I saw your snake game the other day and was really impressed by it! If I can interest you at all in http://clay.io – shoot me an email. austin (at) clay [dot] io

  • http://ganbarugames.com Nathan

    Interesting article; I'm building my first "HTML5" game and it's really pretty nice, compared with the Objective-C stuff I've been doing the past two years.

    While it's true that these modern Javascript browser games don't require plugins, the flip side of that is that people on older computers/browsers won't be able to run your game correctly. That being said, I'm also pretty excited about "native" browser games that can go viral, but also be sold in app stores using web view wrappers.

    One suggestion is that you can use the CoffeeScript compiler embedded in your page (http://coffeescript.org/#scripts) for development, then run a build script that produces .js files for production.

    • Austin

      Of the 30,000+ who played the Nick vs. Bus game I didn't get a single complaint about it not working. There certainly were people who it didn't work for, I'm sure, but the fact that no one mentioned it makes me believe most people interested in web games right now have a somewhat modern browser.

      If you take a look at part 3 about security I mentioned in the post, I go over what we do for compiling our CoffeeScript. It's a rake file in ruby that watches the folder and automatically compiles all the files together into a single .js

  • http://guest.com Guest

    It's a shame Word wars is now unplayable due to the FB, clay.io, login, ads and other crap polluting the screen all the times. Replacing the highscores with "other games you might like" and putting it into a popup was a dick move.

    • Austin

      The only difference now from when the game launched on Clay is the recommended games. High scores have always been in a popup (modal window), so the recommended games will just show if you close that.

      No need to login, you can just enter your name.

  • http://enbake.com/html5-app-development/ HTML5 Developer

    Although HTML5 has come a long way but i will say that it still has a long way to go in terms of user experience vis-a-vis speed and Native Graphics rendering built into Android and iPhones.

    • http://www.ludei.com Ludei

      Yes definitely, as game developers we've faced this problem ourselves. Although simple games like chess, sudoku etc. can be played with HTML5 on mobile, interactive games with heavy animation cannot be played on mobile browsers.

      That's why we built our CocoonJS platform -a hardware accelerated platform to accelerate and deploy HTML5 games.

  • http://fultonlarsen.webnode.com/ BrentLowe

    Although HTML5 has come a lengthy way but i will say that it still has a lengthy way to go with regards to consumer encounter vis-a-vis rate and Local Design making designed into Android operating system and iPhones.

  • http://daydietcapsules.wordpre 2 Days Diet

    I just get the package in the postoffice, it took a even though , but lastly I got it, it can be in fantastic shape and I seriously appreciate that , and I open the package seeing the tablets are all fantastic. I will start out to utilize 2 Days Diet http://daydietcapsules.wordpress.com/ tomorrow. Hope it works quick .