Goal:
Now let’s add on to this previous code and add a loop
This loop will be used to slowly decrease our time until it hits 0, when it does it will send a “GameOver!” message
Steps:
- From Control place a repeat until block under the previous code
- From Operators place a < block inside the repeat until block
- From Variables place a round “Time Remaining:” block on the left side of the < block
- On the right side of the < block, type in the number 1
- From Control place a wait block inside the repeat until block, be sure it says 1 seconds
- From Variables place a change by block under the wait block
- In that change by block, on the left side set its variable to “Time Remaining:” on the right side type in the number -1
- From Events place a broadcast block under the repeat until loop
- On the broadcast block, set the message to be “GameOver!”