STEP 10: We will follow the same steps to create a random y-coordinate.

  • Click the LOGIC tab in the toolkit, click and drag out Random Integer.
  • Change the variable name from my_var to michael_y.
  • Change the integers in the parentheses from 1,10 to -230, 230

This will create a random integer between -230 & 230 that we will use as Michael's y-coordinate.

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)