WARNING: This program has a bug, which means we need to fix it!

RULE: Commands must be indented with a green block ···· in order to run when the event is triggered.

An indent is 4 spaces, or 1 tab.

  • Click Run and read the error message. Our command is outside of the event!
  • Fix the event by indenting the .move_left() command so that the ghost can haunt some people!

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

stage.set_background("hauntedhouse") sprite = codesters.Sprite("ghost", 0, -100) sprite.say("Let's go haunt some people!!!!!") def left_key(): sprite.move_left(20) # add other actions... stage.event_key("left", left_key) 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)