PASO 10 : ¡Genial! Ahora que agregamos nuestro jugador de fútbol, coloquemos nuestro balón de fútbol.

Las variables permiten que nuestro programa recuerde nuestros sprites . Las variables aparecen a la izquierda de un signo = y en orange .

  • En GRÁFICOS, haga clic en , desplácese hacia abajo hasta SPORTS SPRITES y arrastre Soccer Ball .
  • Cambie la palabra a la izquierda del signo = de sprite a ball .
  • Hacer clic Corre para ver aparecer el balón de fútbol en medio del escenario.

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

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