HTML and CSS Reference
Chapter 8. Canvas Games: Part I
Games are the reason why many of us initially became interested in computers, and they con-
tinue to be a major driving force that pushes computer technology to new heights. In this
chapter, we will examine how to build a mini game framework that can be used to create
games on the canvas. We will explore many of the core building blocks associated with game
We don't have the space to cover every type of game you might want to create, but we will
chapter, we will have a basic clone of Atari's classic Asteroids game. We will step through
the creation of this game by first applying some of the techniques for drawing and transform-
ations specific to our game's visual objects. This will help get our feet wet by taking some of
the techniques we covered in previous chapters and applying them to an arcade game applica-
make on the canvas. Following this, we will dive into some game techniques and algorithms,
and finally, we will apply everything we have covered to create the finished product.
Two-dimensional flying space shooter games are just the beginning of what can be accom-
ture we create in Chapter 4 and apply it to an application In doing so, we will take a look at
using the A* path-finding algorithm to navigate the 2D tile map.