Step 6: Move Left

Goal:


Moving left is just like moving down in that it is in the negative direction. Once again we need to temporarily change our speed variable from a positive number to a negative one using multiplication.

Let’s code our left movement (negative 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 left arrow.
  4. From Motion, place a change x by block.
  5. From Operators, place a *(multiply) block and set the right side to -1.
  6. From Variables, place a round speed block in the left side of the *(multiply) block.

Code:


Click to replay