Learning HTML5 Game Programming

Until recently, without Flash or Java, the kinds of games you could create tended to be less action orientated, though some enterprising types had built late 1970s favourites.

By: Staff


Almost anyone who’s learned to program at some point decides to create a game, so it’s natural that web developers will want to give it a go. That said, until recently, without using Flash or Java, the kinds of games you could realistically create tended to be less action orientated, though some enterprising types had built late 1970s favourites.

The technologies developed under the banner “HTML5” promise to open up a lot more avenues for game developers, from creating bitmap games using the well-supported Canvas tag, to standardized support for audio and video (in case anyone wants to re-create Myst!) to even 3D with the newest releases of FireFox and Chrome (the two browsers arguably pushing ahead the fastest).

The first four chapters are what you’d expect: a bit of an overview of HTML5, how to set-up a developer environment, an introduction to JavaScript and games. The first chapter on HTML5 is good reading, just because “HTML5” is used as a catch-all for so many different things, it’s really important these days to figure out what someone means when they say “HTML5.” Considering to that on page 150 there’s mention of HP’s exit from the WebOS hardware business, which is barely 2 months old, this book is pretty up to date and presents that different approaches being taken, for instance in the case of a databases where WebKit and FireFox have decided on two different types and no formal HTML5 spec exists. However much of the bleeding-edge features are supported in different browsers specific ways, so the book introduces readers to a range of libraries are used in book to get around the incompatibilities as well as easing the work of developers; in fact that's probably a good way of summarizing this book: a tour of the libraries you could build games using in the browser.

A bit surprisingly one library introduced is Prototype and its extensions to JavaScript's object orientation. There's been a lot written about how Prototype tries to make JavaScript more like the Ruby language (which in its original role as a helper for Ruby on Rails made some sense) and the potential problems it can cause,  when used with other libraries, it's introduction here seems to be mostly for it being the foundation to the Simple Game Framework which is covered in chapter four, How Games Work. Besides jQuery and Prototype, the book introduces readers to a lot of libraries including: Trient.js (canvas animation), RaphaëlJS(svg helper), Three.js (WebGL helper), and those are just the browser-side helpers.

Many books on game programming start with a simple game and gradually expand it over the course of the book, or else introduce several mini-games to show different methods. This book doesn’t really do that, it’s more of a tour of different libraries that can be used to build games.  There isn’t a lot of the game mechanics I was kind of expecting, but that’s partly because many of these libraries take care of the basics for you, the other reason is a lot of the code is found on the book’s website, rather than re-printed in the book. Some readers might find it a bit un-focused since it doesn’t have an over-arching project and tries to cover a lot in its 200-odd pages, everything from 2D with Canvas and SVG libraries to 3D with Three.js to JavaScript on the server with Node.js, but for readers looking to figure out what’s available then this book is a good start.

Date published: 17-Oct-2011





Building Findable Websites

Making your website understandable not only to search engines, but readers as well.

The CSS Anthology

Practical advice on how to solve design problems with CSS.

Drupal 6 Themes

Learning the many ways to theme with Drupal 6

Front End Drupal

Tools and techniques for learning to create themes for the Drupal 6 CMS.

The Book of CSS3

Peter Gasston guides you through what is not so much a specification as a set of features that will someday become CSS3.


2017 YYZTech

For American computers stores, visit: AmericanComputerDealer.com