A real basketball would fall to the floor and then bounce.

  • Click to open that section of the toolkit.
  • Drag Set Gravity into your program.
  • Drag Set Bounce into your program.
  • Click Run to see your work. Click Submit and Next to move on.

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

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