CompSci 4 - Classwork 13 - Oct 20, 2011
Today's classwork goes along with Chapter 7, Section 1, and also
covers more on variables, showing you how to do timers and counters.
The following work needs to be checked off when you have completed it.
Download the ClickACow world from the web page.
Your computer may save it as a zip file, be sure to rename it as
a .a2w file.
- First run the world to see what it does. Look at the existing methods
- Add a counter to keep track of the number of times the cow will be clicked on.
- Add a timer with class variables and a method to initialize its class
variables. The timer should start at 20 (Set the number lower while you are
testing it out)
and count down by 1 each time
until it reaches 0. You should have an initialize method, similar to what you
had for the counter. The cow should appear one time for each value in the
- When the timer stops, the cow should stop and say a message. If the user
reached or passed the target value, the user won; otherwise, the user lost.
If you finish early, feel free to embelish your animation.