Cat Walk
The goal of this exercise to make an awesome interactive animated cat.
You may find these slides helpful.
Start with this webpage, which has an img of a cat walking, and JavaScript functions that animate the cat across the screen. (For all of these, you shouldn’t need to touch the original code - just add code below.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
- Add an event listener to the start button, so that the cat starts moving across the screen when its clicked.
- Add an event listener to the stop button, so that the cat stops moving when clicked.
- Add an event listener to the speed button, so that the cat moves faster when it’s clicked.
- Bonus: Disable the start/stop/faster buttons at the appropriate times (e.g. the user shouldn’t be able to click “stop” if the cat isn’t currently moving.)