• From the section, drag Set y Speed inside the space_bar() event.

Make sure that .set_y_speed() has a green block ···· in front of it.

  • Change the number in the .set_y_speed() command to 2.
  • Change the name in front of .set_y_speed() to snow.
  • Click Run to test your program!

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
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)