• 中,将 Set y Speed 拖动到 space_bar() 事件内部。

确保 .set_y_speed() 前面有一个绿色区块 ····

  • .set_y_speed() 指令中的数字更改为 2
  • .set_y_speed() 前面的名称更改为 snow
  • 点击 运行 以测试你的程序!

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

stage.set_background("winter") sprite = codesters.Sprite("person12") sprite.go_to(-125, -150) frosty = codesters.Sprite("snowman") frosty.go_to(100, -125) snow = codesters.Sprite("snowflake3") snow.go_to(100, 75) greeting = codesters.Text("Happy Holidays!") greeting.go_to(0, 200) greeting.set_color("yellow") def click(sprite): sprite.say("I hope your holidays are great!") sprite.turn_left(360) # add other actions... sprite.event_click(click) def space_bar(): # add other actions... snow.set_x_speed(5) stage.event_key("space", space_bar)
  • Run Code
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)