STEP 11: We need to keep track of how many times the left and down arrow keys are pressed.

A variable lets us store information. The variable has a name and a value. Like this: name = value.

  • Click on the LOGIC tab and click on . Drag two Integer Variable commands into your program.
  • Change the name of one variable to left_count and the other to down_count.
  • Change both of the values to 0.

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) ball.set_gravity_off() net.set_gravity_off()