HTML and CSS Reference
A PRACTICAL EXAMPLE: THE
So far, you've explored how to combine the canvas with
some key programming techniques to make interactive
drawings and to perform animations. These building
blocks take the canvas beyond mere drawing and into
the realm of complete, self-contained applications—like
games or Flash-style mini-apps.
Figure 7-11 shows a more ambitious example that takes
advantage of what you've learned so far and builds on
both concepts. It's a simple game that invites the user to
guide a small happy face icon through a complex maze.
When the user presses an arrow key, the happy face