STEP 10: Great! Now that we added our soccer player, let's put in our soccer ball.

Variables let our program remember our sprites. Variables appear to the left of an = sign and in orange.

  • In GRAPHICS, click on , scroll down to SPORTS SPRITES and drag in Soccer Ball.
  • Change the word to the left of the = sign from sprite to ball.
  • Click Run to see the soccer ball appear in the middle of stage.

microbit = codesters.Microbit() microbit.show_string("hello") stage.set_background("soccerfield") sprite = codesters.Sprite("athlete2") sprite.move_down(150) def button_a(): sprite.move_left(50) microbit.event_button_a(button_a) def button_b(): sprite.move_right(50) microbit.event_button_b(button_b)