Chapter 9. Creating the Asteroid Avoidance Game

This time around you're going to create an asteroid avoidance game; a game that's going to build from the lessons learnt in previous chapters, while also teaching you a few new skills at the same time. The game is also going to be very different in gameplay from the previous game, with much more control from the player.

The two most important lessons that you'll take from this chapter are how to detect keyboard input with JavaScript, and also how to use and control HTML5 audio for sound within a game. Enjoy!

Overview of the game

The goal of the asteroid avoidance game should be fairly obvious, I hope (it's kind of in the name). For those who are still unsure, the aim of the game is to fly a rocket around ...

Get Foundation HTML5 Canvas now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.