Getting Started Guide

SCRATCH CODING KIT
Mole game coding activity
How to use “If not ~’ block in the mole game.
With the script we used in the previous page make a script like the one above.
Previously, you expressed pressing the sensor or timer exceeding the time set in the ‘Timeout’ variable. Let’s think
about what should happen next. If the timer exceeds ‘1 second’ the game is over. At this moment, computer must
announce the end of the game and stop the script.
But if the timer did not exceed ‘1 second’, which means that the user pressed the IR sensor within a second, 1
point must be accumulated. We need to use ‘If not~’ block to express this. This block is similar to the ‘If~’ block we
learned in previous lesson. We just added the “not” part to the ‘If~’ block.
Therefore, if you fail to satisfy ‘If~’ condition, then the script in ‘If not~’ will be activated. If you satisfy ‘If~’ condition
then the script inside the ‘If~’ will be activated and the one saved inside ‘If not~’ will not. You must access inside
the ‘If~’ to end the game and stop the script if the ‘timer > Timeout (1sec.)’ condition is satisfied in the ‘If not~’
block. If this is not the situation, you must add 1 point to ‘Score’ variable each time. Your score is increasing by 1.