• 点击工具栏中的 部分,并将 Go To 拖动到程序中。
  • .go_to() 指令中的第一个数字更改为 215 ,将第二个数字更改为 175
  • .go_to() 指令前面的名称更改为 net

我们可以通过使用精灵的名称将指令分配给特定的精灵。这被称为点符号

首先,我们使用精灵的名称来分配指令。 然后我们将我们想要的动作放在点符号后面。就像这样: name.action()

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

stage.set_background("halfcourt") sprite = codesters.Sprite("player4") sprite.go_to(215, -175) net = codesters.Sprite("basketballnet")
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)