Learning HTML5 Game Programming

Author: James L. Williams
Publisher: Addison-Wesley
Pages: 256
ISBN: 978-0321767363
Aimed at: Web and mobile developers
Rating: 2
Pros: Overview of several frameworks
Cons: Reluctance to write or discuss actual code
Reviewed by: Ian Elliot

Does this book live up to its subtitle, "A Hands-on Guide to Building Online Games Using Canvas, SVG, and WebGL"?

Author: James L. Williams
Publisher: Addison-Wesley, 2012
Pages: 256
ISBN: 978-0321767363
Aimed at: Web and mobile developers
Rating: 2
Pros: Overview of several frameworks
Cons: Reluctance to write or discuss actual code
Reviewed by: Ian Elliot

The whole idea of HTML5 game programming is really something of a misnomer. It should really be JavaScript game programming because this is the language that you are going to have to do all of the work in. HTML5 doesn't really contribute much to the party apart from the Canvas object and perhaps a few other technical APIs.

The subtitle reveals that this book is going to focus on games using Canvas, SVG and WebGL - which seems very reasonable if a little ambitious. Canvas is a 2D bitmapped environment, SVG, which predates HTML5, is a vector environment and WebGL, which is by no means accepted as part of HTML5, is a 3D graphics system. This is a big area to cover for a book with only just over 200 pages.

Banner

 

When you start to read the book you quickly understand how so much ground can be covered. The first chapter is the usual lightening overview of the HTML5 technologies - media, canvas, geolocation, etc are all included even if they don't have much to do with games or graphics, and all at a very superficial level. Fine if you just want to know what HTML5 is about, but not if you want to get started with games.

Chapter 2 is very odd as it concentrates on setting up a development environment in the form of Eclipse and the Google Web Toolkit. There then follows a mention of a number of other tools that might be useful - it seems to be about mentioning as many things as possible rather than recommending a good setup that allows you to work with JavaScript. .

Chapter 3 is called Learning JavaScript and it hardly helps with the problem at all. After outlining the basics of JavaScript - loops, conditionals and a bit about first class functions, the topic moves to using Prototype and JQuery. Again, no depth and no real explanation of JavaScript and how it can be used in clever or even basic ways. At this point you can't help but think that this is a book that is doing its best to avoid explaining any code or any techniques but would rather simply point out that there is a tool or a library for this or that.

Chapter 4 is where games are introduced and, after a quick look at the types of games you might want to create and the basic game loop, we have some examples of JavaScript objects, but created with the help of Prototype which isn't mentioned. Then, without even a "hello world" level game, we move straight on to using another framework - SGF - but at least we get to write a small game in the form of Pong. Next we are considering AI in games with a look at minimax and other techniques - advanced perhaps but over in two pages and before the lessons of Pong have sunk in.

Then we move on to the Canvas, which gets a single short chapter devoted to it. Again, rather than any practical examples, we have a discussion of basic Canvas drawing - transformations, state and using images. Then, you probably guessed, we have another Framework - Trident.js - a 2D animation system. The chapter closes with another simple example but even here we meet another packaged chunk of code - JFugue to handle some sound.

Chapter 6 does 2D graphics over again, but this time using SVG. Another framework enters the scene, but this time it gets a full billing in the chapter title - RaphaelJS. This time the example is a card game. Again, the problem is that, even with the help of a framework, the chapter is far too shallow a look at the problem. At best you are learning how to use boilerplate code and effects that other people have thought up.

I approached Chapter 7 with some trepidation as it claims to tackle WebGL. Again, we are introduced to Three.js, a general purpose 3D framework, and as a result we learn virtually nothing about WebGL. This isn't a huge problem but the book claims to tell you about WebGL and not a different 3D framework.

The next chapter is on creating games without JavaScript and it looks at alternatives such as Google Web Toolkit, CoffeeScript and so on. Finally we get to Chapter 9 which outlines how to create a multiplayer game server using Node.js and again it is far too short to be anything other than a taster. The final two chapters are equally nothing but overviews of developing mobile games - again more frameworks - and finally of publishing your game.

The whole book is an exercise in listing ways of doing things while minimizing the actual doing of anything. There are very few examples and no discussion of the real world of working with browsers that don't quite support HTML5. Put simply it is just too shallow.

If you want a book that provides an overview then you might find this useful. If you are a beginner it won't help much and if you are an intermediate to expert programmer then you will know most of this and more. This is no more than a tour of some interesting facilities and frameworks.

 

Banner


Algorithmic Thinking, 2nd Ed (No Starch Press)

Author: Dr. Daniel Zingaro
Publisher: No Starch
Date: January 2024
Pages: 480
ISBN: 978-1718503229
Print: 1718503229
Kindle: B0BZGZHK3B
Audience: C programmers
Rating: 4
Reviewer: Mike James
What exactly is algorithmic thinking?



ChatGPT For Dummies

Author: Pam Baker
Publisher: For Dummies
Pages: 176
ISBN: 9781394204632
Print: 1394204639
Kindle: B0C63LZ6DN
Audience: Everyone
Rating: 4
Reviewer: Ian Stirk

 


This book aims to introduce you to ChatGPT, how does it fare?


More Reviews

Last Updated ( Tuesday, 21 February 2012 )