PASO 10: Dibujemos una línea desde el balón de fútbol hasta la red.

  • En busque Line y arrástrelo hasta la parte inferior del editor de código.
  • Cambia el nombre de la línea de sprite a line .
  • Cambie x-start de 0 a ballx y y-start de 0 a bally .
  • Cambie x-end de 200 a netx y y-end de 100 a nety .

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

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()
  • Run Code
  • Enviar Trabajo
  • Actividad Siguiente
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)