Project 550: Racing Road

6. Design and program scrolling boost sprites

Design a sprite that will give your car a boost later. The boost sprite should scroll downwards based off your "speed" variable.
Starting point file for this challenge

Your goal

Steps

1. Design a boost sprite

You can either pick a new sprite by clicking on the blue cat button, or design one again.

2. Set the boost sprite's starting position

Click and drag the new sprite into the top left of your screen. Then, add a "when green flag clicked" block into the code. Finally, add a "go to x: __ y:__" block. 

You don't need to change the coordinates, they should update to match the new position of your sprite. 

3. Copy over the cloning code

Go back into your road divider line sprite, and find the code that tells it to clone itself. Click and drag this code over your new boost sprite, and let go when you see the boost sprite wiggle. 

Your code should now be copied into the boost sprite. 

4. Copy over the scrolling code

Repeat the last step, but this time for the code that tells the clones to scroll downwards. 

5. Make the clones more rarely and more randomly

The game would be way too easy if the boost sprites appeared as often as the road lines did! And too predictable. 

Grab an "operators" block called "pick random __ to __" and put it in the "wait __ seconds" blank. Try any range you like, but the example uses 1 to 10 seconds. 

6. Duplicate the sprite for the other side of the road

Right click on the boost sprite and select "duplicate." Click and drag the new sprite to the top right of your screen, and change its starting coordinates accordingly.