Goal:
Let’s add movement to our Storm Trooper.
If I move the right arrow key, then I am moving in the positive X direction
If I move the left arrow key, then I am moving in the negative X direction
Steps:
- Still on the “Trooper” sprite, in Events, add a forever loop, then put 2 if statements inside it
- From Sensing, place a key space pressed and change it to left arrow inside the first if statement
- From Motion, place a change x by -10 inside the first if statement
- From Sensing, place a key space pressed and change it to right arrow inside the second if statement
- From Motion, place a change x by 10 inside the second if statement