STEP 7: The point needs to be able to move in every direction.

  • Click and drag Up Key into the very bottom of your program, under the event handler.
  • Drag Down Key into your program. Place it at the very bottom of the program.
  • Click Run and and use the arrow keys on move the point. It draws a thin green line!

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

stage.set_background_color("black") # sprite = codesters.Point(x, y) sprite = codesters.Point(50, 100) sprite.set_color("green") sprite.pen_down() def right_key(): sprite.move_right(20) # add other actions... stage.event_key("right", right_key)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)