STEP 4: Let's start by making the hedgehog spin left using the left arrow key.

  • In GRAPHICS, from add Left Key to the bottom of the program.
  • Find and delete ····sprite.move_left(20)¬ from inside the event. We want to spin, not move!
  • From add Get Rotation indented inside the event. An indent ····¬ is 4 spaces or 1 tab.

In order to spin more, we need to know our current rotation! That's why we need to get the current rotation first.

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

stage.set_background("moon") sprite = codesters.Sprite("hedgehog", 0, -210) score = 0 #my_display = codesters.Display(my_var, x, y) score_display = codesters.Display(score, -210, -210) time = 60 #my_display = codesters.Display(my_var, x, y) time_display = codesters.Display(time, 210, -210)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)