Code Examples

For Professional Mobile HTML5 Game Development

All the code examples from the book are available on this website, you can also download the content for this site off GitHub and run the examples locally (any examples that load JSON will need to be run from a server). All examples are in the sidebar, and highlighted examples are shown below.

All the code examples from the book are available on this website, you can also download the content for this site off GitHub and run the examples locally (any examples that load JSON will need to be run from a server). All examples are at the bottom of the page, and highlighted examples are shown below.

Buy the Book

Alien Invasion

This is the example built from scratch in the first three chapters of the book.

Play Alien Invasion »

Block Break

The Simple breakout clone from Chapter 11 created in the HTML5 Game Engine that is built over chapters 9-11

Play Blockbreak »

RPG

The DOM-based Dungeon crawler built in Chapter 13 that is playable back to IE6 but uses CSS3 transitions to provide a smooth experience on newer browsers.

Play RPG »

SVG Cannon

The Physics based cannon shooter built in Chapter 14 using SVG elements and Box2DWeb

Play Cannon »

Lander

A Lander-type game built in Chapter 17 that uses getImageData to create pixel-perfect collisions and particle explosions.

Play Lander »

Platformer

A Canvas-based 2D Platformer demo built in Chapter 18 demonstrating parallax scrolling, bitmap animation and platformer collisions.

Play Platformer»