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’.
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
while the game runs.delay
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
variable:delay
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.
delay
variable decreases?