STEP 10: Let's draw a line from the soccerball to the net.

  • In find Line and drag it to the bottom of the code editor.
  • Change the name of the line from sprite to line.
  • Change x-start from 0 to ballx and y-start from 0 to bally.
  • Change x-end from 200 to netx and y-end from 100 to nety.

stage.set_axis(100) stage.create_grid_overlay(10, "grey") stage.set_background("soccerfield") ballx = -80 bally = random.randint(-100,100) # sprite = codesters.Sprite("image", x, y) ball = codesters.Sprite("soccerball", ballx, bally) netx = 90 nety = random.randint(-100,100) # sprite = codesters.Sprite("image", x, y) net = codesters.Sprite("soccernet", netx, nety) net.flip_right_left()