HTML5 is ready
But it’s not perfect. Neither are your other popular browser-based games alternatives such as Flash, Unity3D, or Java(via applet). There are some quirks and you find yourself sometimes coming up with a little “hack” to get something to work properly, and those aren’t fun. HTML5 Game Engines can really save you the pain of getting started in HTML5 Game Development, although I wrote Stellar Alien without one and it was not too bad.
Browser Support is decent
It’s not 2009 anymore! I see a lot of reasons why people do not fully dive into HTML5 including old-news about it having bad browser support or it will only work with a very minimal amount of browsers. It is 2013 at the time of this writing and the support for the important HTML5 Technologies most 2D games need (<canvas> tag, <audio> tag, localStorage) is great. <canvas> is supported on all major browsers that you should care about, including Firefox, Chrome, Opera, IE9, & Safari. It is the same for the new <audio> tag. Although the HTML5 Audio has some bad issues I’ll discuss in a minute.
Canvas is fast(enough)
And if it’s not, you can make optimizations, like any other software you would write.
You can implement “dirty rectangles” so your game will only clear pixels where it’s necessary and not the whole canvas every frame(although some game engines take care of this). If you have a large background image like my game has, you should draw that background image on another canvas, that isn’t in a loop, and then draw your foreground canvas on top of the background. This is so that your large image is only drawn once, and not every frame.
Game engines, game engines!
Not everyone wants to start coding a game from scratch like I did. I understand that. You can get started much quicker by using a game engine. There are many game engines out there for HTML5 that really make developing in it a lot more pleasant. ImpactJS is a very popular game engine, although it’s $99 dollars. If you dislike commercial game engines like me, and want something free & open source, then check out CraftyJS, it’s one of the favorite ones I’ve played around with. Also look at this table on Github that lists tons of open source game engines to use:https://github.com/bebraw/
HTML5 Audio sucks
The HTML5 <audio> tag wasn’t fun to develop in. It is buggy, it is bad, it just isn’t good. And sound is an important part of a game. I’ve noticed some sound would stutter, like there was some latency issues, some wouldn’t even play at all!
So should you use Web Audio or the <audio> tag? Well, it depends on your game really. All my game had to do was play a few sounds, some background music, and it was okay, so I ended up using an open source audio library called YAAK, which uses <audio> tags, but saves me some of the pain of working with them. Other games may need more complex audio programming, and some even have gameplay that depend on sound! That is where Web Audio should definitely be the one your game should be using.
One problem with the Web Audio API is that it’s newer than the <audio> tag. Which means browser support isn’t as good. Web Audio is supported on Chrome & Safari 6.0. Firefox has planned support for Web Audio but they are seriously taking their sweet time (perhaps they’re focusing on their awesome new OS).