Project 265: Gravity Dodger

2. Hero Movement

Let's make our hero move with constant speed, either left or right using the arrow keys and some motion blocks.
This challenge doesn't have a starting point

Your goal

Steps

1. Make the Hero Start in the Bottom Middle

Head back to the "hero" sprites, let's use a "when green flag clicked" block. Using code from the motion tab, position your hero that it always starts at the bottom middle of the screen.  The coordinates for that would be: (0 , -150).

2. Conditional Shell

Grab a "forever" loop and an "if ___ then ___ " statement and put them together below the motion block to form a conditional shell.   

3. Add Left Movement

Grab a "key ____ pressed?"  block as the condition for our If statement. Then add a "change x by 10" block from motion and switch it to  -10 so we move left.  

4. Duplicate for Right

Now that we have left movement done, let's move right to Right!   We can duplicate our work too, by right clicking on the If statement.   and clicking duplicate.  Then in the resulting statement, switch the condition to "right arrow" and the change to -10.