STEP 6: Let's add our basketball!

  • Click on the section of the toolkit and drag Basketball into your program.
  • Change the name before the equals sign to ball.

From now on, we'll use the variable name ball to assign actions to this sprite.

stage.set_background("halfcourt") sprite = codesters.Sprite("player4") sprite.go_to(215, -175) net = codesters.Sprite("basketballnet") net.go_to(215, 175)