Review: Build your own 2D Game Engine and Create Great Web Games: Using HTML5, JavaScript, and WebGL by Kelvin Sung, Jebediah Pavleas, Fernando Arnez, Jason Pace

Build your own 2D Game Engine is a pretty straight-forward book for what can usually be a fairly complex topic. Out of the game engine books I’ve read (mostly for 3D) this is one of the more approachable of the bunch, while still showing the details necessary. Thankfully, the authors here stick mostly to the standard API, and show real HTML5, Javascript, and WebGL code to make a simple 2D game. While much of the coverage was more basic to me (as I’ve been learning 3D for a while), I still found value in the book’s approach and felt it was pretty worthwhile.

It is definitely not complete, and at 500 pages you can only scratch the surface of an engine, but the architecture is sound and could be a nice breath of fresh air compared to other books that get bogged down in needless detail. Here we have working with HTML5, drawing objects, textures, sprites, and fonts, collision detection, a camera, light and shadow, particle physics, and a parallax background. Really a nice set of topics, along with some cute programmer art, you’ll have a playable demo at the end of the reading. My only complaint is that they are using fairly old Javascript syntax (using prototype inheritance) and you probably wouldn’t write it like this today. Not the end of the world.

So overall I’d say it is worth reading. It is definitely on the beginner to intermediate level, which is fine. I think a total beginner to game development is better off using a library like three.js. That said, WebGL is relatively simple compared to modern desktop graphics APIs, so it’s not so crazy to write the engine from scratch. And I think if you are already well on the expert level, you probably won’t gain too much from the book. But if you are new to WebGL maybe you will learn a thing or two. I liked it.