Bouncing Ball
|
ASSIGNMENT:
Alter this example in the following ways:
- A single click of the mouse will freeze the ball in its current
position
- A second click will cause the ball to resume movement
- Pressing the space bar will reset the values associated with the ball to
their intial values
- Pressing the c key will cause the color of the ball to toggle between at
least five different colors
The JavaScript source file is called bounce and this is the first lesson
where the source has been external to the web page. By clicking on the name
of the source file on the View Page Source page, you can view the source
code file. Nothing too tricky here.
|