第2步:现在添加一些动作到场景中!

调用函数时运行的所有指令必须位于函数内部。

  • 让精灵 Say "I should hurry to the castle!"。确保它位于函数内部!

  • 让精灵 Move Forward 550 像素,让其在调用此函数时离开控制台。

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

sprite = codesters.Sprite("knight1", -175, -150) sprite.set_speed(2) def park_scene(): stage.set_background("park")
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)