STEP 8: Now let's make the sprite sway back and forth.

  • Change the integer in the .turn_left() command to 45 so that the sprite turns 45 degrees to the left.
  • Use Turn Right inside the function to have the sprite turn 90 degrees.
  • Use another Turn Left inside the function to turn the sprite 45 degrees so that it is upright.

We aren't seeing these commands run yet, because we haven't called sway() yet!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)