SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

4.05 Increase the difficulty

Now you’re going to make the game more difficult the longer the player plays it. You will do this by making the dots appear faster and faster over time.

Create a new variable called ‘delay’.

Stage sprite

Go to the Stage’s Scripts area and create a new script that sets the delay variable to 8 and then slowly reduces the value of delay while the game runs.

Stage sprite

Notice that this code is very similar to the code you would use to create a countdown timer!

Next, use the delay variable in the code scripts of the ‘red’, ‘yellow’, and ‘blue’ sprites.

Remove the code block that makes the game wait a random number of seconds between making the dot sprite clones. Replace the block you’ve removed with your new delay variable:

screenshot

Do this for all three dot sprites.

Test the game, and check whether the dots begin to appear more quickly as the game goes on.

  • Does this work for all three coloured dots?
  • Can you see that the value of the delay variable decreases?
×
×

Cart