In This Chapter
Moving an object onscreen
Responding to keyboard input
Reading mouse input
Running code repeatedly
Bouncing off the walls
Using image-swapping and compound images
Using external script files
Because this chapter is about animation, most of the pages feature motion. You really must see these pages in your browser to get the effect because a static screen shot can't really do any of these programs justice.
The general structure of this page provides a foundation for other kinds of animation:
The HTML is pretty simple. As you'll see when you pop the hood, there really isn't much to the HTML code. It's a couple of
divs and some buttons.
Figure 8.1. Click the buttons, and the ball moves.
The ball is in a special
sprite. Game developers call the little images ...