• Ve a y arrastra un Wait ADENTRO de la función después de los otros comandos.
  • Ve a y arrastra Function Call. Suéltalo al final de tu programa, AFUERA de la función.
  • Cambia my_function() a bridge_scene(). Haz clic en Correr para ver tu función en el escenario.

Puedes llamar a una función en cualquier parte en tu programa DESPUÉS de ser definida.

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

sprite = codesters.Sprite("knight1", -175, -150) sprite.set_speed(2) def park_scene(): stage.set_background("park") sprite.say("I should hurry to the castle!") sprite.move_forward(550) park_scene() def bridge_scene(): stage.set_background("drawbridge") sprite.go_to(-175, -150) sprite.say("I made it!")
  • Run Code
  • Enviar Trabajo
  • Actividad Siguiente
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)