Project 550: Racing Road

2. Program the car's side to side movement

The car should be able to move left and right using the arrow keys. You will also want to set up the car's starting position in the middle of the screen.
Starting point file for this challenge

Your goal

Steps

1. Grab a "when green flag clicked" block

This is a yellow "Events" block 

2. Add a "go to x: __ y: __"

This is a dark blue "motion" block. Set both coordinates to 0 to set the car in the middle of your screen. 

3. Check if the right arrow key is pressed

Grab an "if __ then __" block from the "control" section. Then, grab a light blue "sensing" block called "key __ pressed?" and put it in the "if" blank. Change it to check for the right arrow key.

4. Change X by 10 as a result

Grab a "motion" block called "change X by __" and put it in the "then" blank. 

5. Check if the left arrow key is pressed

Check back on hint 3 for this. You'll want to change X by a negative number this time to move left instead of right. 

6. Change X by -10 as a result

Check back on hint 4 for this. You'll want to change X by a negative number so it goes left instead of right. 

7. Repeat the if statements forever

Grab a "forever" loop from the "control" section and put it around both if-statements.