Project 550: Racing Road

7. Collide into boost sprites

The car should be checking if it drives over the boost sprite. If it does, the speed variable should raise, and the car should also be launched forward. After it speeds up, the car should be returned to the middle of the screen and slow down.
Starting point file for this challenge

Your goal

Steps

1. Find the first if-then-else in the car

It should be the code that checks if the car is touching the grass. 

2. Remove the results of the first "else"

Click and drag the "set speed to 10" block out and place it aside for now.

3. Replace it with another if-then-else

Grab another "if _ then _ else _" block from "control" and put it inside the blank of the first "else" block.

4. Check if the car is touching a boost sprite

Since you have to check for two different boost sprites, you'll need to put an "operators" block called "__ or __" in the "if" blank first. 

Then, grab two of the "touching __" blocks from "sensing" and place them in either "or" blank. Change them to check for either of your boost sprites. 

5. If so, then speed the car up and launch it forward as a result

Add a "change Y by __" block from "motion" and change Y by 2. Add a "change __ by __" and change speed by 2. 

6. Repeat the result for fluid movement

Put a "repeat __" loop around the previous two blocks. Repeat these about 20 times. 

7. Glide the car back to the middle as another result

After the car speeds foward, we should actually bring it back to the middle. Otherwise, the car could get stuck up at the top of the screen and it'd be impossible to tell what the car will run into! 

Add a "glide __ to x: _ y: _" block from the "motion" section and put it after the repeat loop. 

8. Otherwise, set speed back to 10

Put the "set speed to 10" block back in the very last empty "else" blank.