Mole+Masher+Game




 * This lesson will cover**
 * Timers
 * Variables
 * Procedures
 * Algorithm
 * Mobile features**
 * Touch interface
 * Working with graphics
 * Using timers in games


 * Design**




 * Algorithm**

Let’s consider the main steps we need to code in our game. There are **two** main stages: We’ll now design our code by creating an **algorithm** for each stage.
 * touching the mole
 * moving the mole



Adapt your program to display the number of **misses** as well as the number of hits.
 * Extension 1**

Display a “GAME OVER” sprite on the canvas when the misses reach a certain number. **Hint**: Create a GameOver procedure for this.
 * Extension 2**

//**Comments**// You may have noticed that some code is shown with small comments beside it in speech bubbles. Comments are used to **explain what code is doing**. This is useful if you’re working as part of a team, so that other programmers can understand your code – or even for yourself, when you try to update your app this time next year!
 * All good programmers use comments to explain key stages in a program.**

Go back to your code and add comments to it.
 * Extension 3**


 * Note that you would normally add comments as you create your code, not afterwards.**


 * Did you understand?**

Complete the worksheet below.