STEP 3: To run a function, we have to call the function by using it's name.

The command that calls the function should NOT be indented because it is separate from the function.

  • Click Run. Notice that the function code is in the editor, but it doesn't run on the stage.
  • Go to . Drag Function Call and drop it in your program, OUTSIDE the function.
  • Change my_function() to park_scene(). Click Run to see your function on the stage.

sprite = codesters.Sprite("knight1", -175, -150) sprite.set_speed(2) def park_scene(): stage.set_background("park") sprite.say("I should hurry to the castle!") sprite.move_forward(550)