PASO 11: Necesitamos hacer seguimiento de cuántas veces las teclas de flecha izquierda y abajo son pulsadas.

Una variable nos deja guardar información. La variable tiene un nombre y un valor. Como esto: name = value.

  • Clic en la pestaña LOGIC y en . Arrastra dos comandos Integer Variable en tu programa.
  • Cambia el nombre de una variable a left_count y el de la otra a down_count.
  • Cambia ambos valores a 0.

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

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