STEP 10: We don't want the gravity to affect any of our sprites yet.

  • From the section of the toolkit, drag Sprite Gravity off into your program.
  • Assign the command to ball by changing the name before .set_gravity_off() to ball.
  • From the , drag another Sprite Gravity off into your program. Assign it to net.
  • Click Run to test your program. Now those sprites don't fall!

stage.set_background("halfcourt") sprite = codesters.Sprite("player4") sprite.go_to(215, -175) net = codesters.Sprite("basketballnet") net.go_to(215, 175) ball = codesters.Sprite("basketball") x = random.randint(-100, 150) ball.go_to(x, -25) stage.set_gravity(10) stage.set_bounce(.8)