Have you ever gone to a carnival and played Whack-a-mole?  Catch a crab is a fun game that is similar to Whack-a-mole.

We will explore ways to make the crab randomly appear on the screen. The player controls the mouse and has to hit the crab as much as possible within the time limit.  Good luck and have fun!!

Download the Building Instructions Guide Below

Link to Building Guide


What you will be learning in this Lesson?

In the above Scratch Activity you will be exploring the below concepts in detail

Use of Mouse As an input Device

What is an input device? It is a device that can be used to provide user input to a computer system. You have learned to use the Keyboard Input device. Using this activity you will be mouseCursorexploring the Mouse as an input device!

 

crab4In scratch, we can do this by using the when this sprite clicked block. By using the script on the right, we can increase the score whenever the crab sprite is clicked.

Use of variables

 

crab5Variables are very useful to keep values stored in your program. We will be using variables in this activity to:

  • Keep a track of the score
    • This is the number of times the crab is clicked (or whacked)
  • Keep a track of the time
    • This is for the timer

Exploring Sprite random Movementcrab6

 

We will be exploring random sprite movement in this game. The crab will disappear and appear randomly at different points of the screen.

Creating a timertimer

We will create a timer that starts from a certain time (like 20 seconds) and countdowns to 0. Once it reaches 0 the game is over.