Project 114: Ant Racing

4. Make Racer #1 turn right

Get your Racer #1 sprite to turn to the right when you press the right arrow on your keyboard. We're going to go through almost the same steps as challenge 2, except in this challenge, the racer should turn right when you press the right arrow key. Try to use your work from the "turn left" challenge as an example to complete this challenge.
Starting point file for this challenge

Your goal

Steps

1. Add a "When green flag clicked" block

You can find the block in the yellow "events" section.

2. Add a "turn right" block

You can find it in the dark blue "motion" section. When you click the green flag after adding the block, your Racer #1 should turn slightly to the right. 

3. Repeat your code with a forever loop

We don't want the motion to just happen once – we want it to repeat. To repeat code, we need to add a loop. Add a forever loop to keep your racer turning. Don't worry, we'll control the turn in the next step. You can find the forever loop in the orange "control" section.

4. Add an if-statement

It's great that the turning repeats, but the racer shouldn't turn automatically – it should only turn when we press down the right arrow key. This kind of functionality means our code has to make a decision. 

If we want our code to make decisions, we need to use an if-statement. You can find the "if __ then"-statement in the orange "control" section. 

5. Add a "right arrow pressed" condition

If-statements only work if they have a condition that tells them when to run. A condition is a statement that boils down to "true" or "false". In this case, we can use a sensing condition that checks whether or not a key is pressed. We need to change the key in that sensing block to the "right arrow key".