Page 144 - Learn To Program With Scratch
P. 144

Whac-a-Mole .sb2  11. Complete the Whac-a-Mole game introduced earlier in the chapter.
                             The file Whac-a-Mole.sb2 contains a partial implementation of this pro-
                             gram. When the green flag is clicked, the provided script starts a loop
                             that moves the Cat sprite randomly over the holes. Add two scripts (one
                             for the Cat and the other for the Stage) to change the values of the two
                             variables (hits and misses) appropriately. Try adding some sound effects
                             to make the game more fun! You could also add a condition that ends
                             the game after a timer or the number of misses reaches a certain value.






























































           122   Chapter 5
                                           www.it-ebooks.info
   139   140   141   142   143   144   145   146   147   148   149