STEP 8: Our UFO is pretty fast! Let's slow it down before it glides to the next target.

  • Go to . Drag out Set Speed and drop it at the bottom of your program, after the event.

The set speed tells the sprite how fast to move. It only affects commands that come after it in the program. Larger numbers make the sprite move faster. Smaller numbers make the sprite move slower.

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

stage.set_background("space") sprite = codesters.Sprite("ufo") sprite.set_size(0.4) sprite.go_to(-200, -200) sprite.glide_to(-100, -100) def collision(sprite, hit_sprite): hit_sprite.hide() # add any other actions... sprite.event_collision(collision)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)