Time for action – increasing ball speed
There are several criteria that we could use to increase the ball speed, such as score or number of hits. However, we're going to increase the ball speed based on the duration of the game. The steps are as follows:
- To manipulate the ball speed as the script runs, we'll need a variable. So, create a variable named
speed
for the ball. - Find the ball script that begins with when I receive (play) and add a set () to () block from the Data palette at the top of the stack. Select the speed variable and give it a starting value of
5
. - From the Sensing palette, add a reset timer block. We'll use this block with the understanding that we won't use reset timer anywhere else in the project.
- Inside the forever block, add an if () then block.
- We're going to evaluate whether or not the timer block is greater than 10 by snapping the () > () block from the Operators palette into the if () block. Then, we will add the timer block from the...