Step 5: Move Right

Goal:


Moving left and right is almost identical to moving up and down on the screen, except that we are going to change our X-Wing’s x coordinates and not the y coordinates.

Let’s code our right movement (positive x direction).

Steps:

  1. From Control, place an IF statement block.
  2. From Sensing, place a key space pressed block.
  3. Click on the triangle to open up the menu and select right arrow.
  4. From Motion, place a change x by block.
  5. From Variables, place a speed block.

Code:


Click to replay