STEP 13: Now let's do the same for the y-coordinates of each sprite.

  • From , drag out Delta Y.
  • Replace the y2 variable to the right of the equals sign with emma_y.
  • Replace the y1 variable to the right of the equals sign with michael_y.

delta_y is now equal to the distance between Emma's and Michael's y-coordinates.

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