Step 11: Ship Right Movement

Goal:


We want the ship to move right when we press the ‘d’ key.

Right on the computer is a change in the positive x direction.

We want to use the “wasd” keys instead of the regular arrow keys because most pc games – like Minecraft or Fortnight – use the “wasd” keys to control movement on the screen.

Steps:

  1. From Control, place an IF block.
  2. From Sensing, place a key block in the IF block.
  3. Set the key to ‘d.’
  4. From Motion, place a change x by block and set it to 3.

Code: