第 6 步:让我们填写add_player()函数。记得在文档字符串下面添加新的功能代码!

  • 单击图形。去并将Player 1放在add_player()中。
  • 将精灵的名称更改为player .将玩家精灵定位在( 0 , -155 )处。
  • 单击逻辑。去.在main()的最后一行,将Function Call into Variable中。
  • my_var更改为player并将函数从my_function()更改为add_player() .

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

def set_stage(): """ Sets up the stage for the game """ stage.set_background("soccerfield") stage.disable_floor() def add_player(): """ Adds a player to the stage for the user to control """ def main(): """ Sets up the program and calls other functions """ set_stage() main()
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)