PASO 13: Ahora hagamos lo mismo con las coordenadas y de cada sprite.

  • Desde , arrastre Delta Y .
  • Reemplace la variable y2 a la derecha del signo igual con emma_y .
  • Reemplace la variable y1 a la derecha del signo igual con michael_y .

delta_y ahora es igual a la distancia entre las coordenadas y de Emma y Michael.

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

stage.set_background("schoolentrance") stage.wait(2) stage.create_grid_overlay(50, "blue") stage.set_background_color("azure") emma = codesters.Sprite("person1") emma.set_size(0.5) michael = codesters.Sprite("person2") michael.set_size(0.5) emma_x = random.randint(-230,230) emma_y = random.randint(-230,230) emma.go_to(emma_x, emma_y) michael_x = random.randint(-230,230) michael_y = random.randint(-230,230) michael.go_to(michael_x, michael_y) delta_x = emma_x - michael_x
  • Run Code
  • Enviar Trabajo
  • Actividad Siguiente
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)