stage.set_background("schoolentrance")
stage.wait(3)
stage.set_background("schoolhallway")
stage.wait(2)
stage.create_grid_overlay(50, "grey")
stage.set_background_color("azure")
michael = codesters.Sprite("person1")
emma = codesters.Sprite("person2")
michael.set_size(.5)
emma.set_size(.5)
michael_x = random.randint(-230,230)
michael_y = random.randint(-230,230)
michael.go_to(michael_x, michael_y)
emma_x = random.randint(-230,230)
emma_y = random.randint(-230,230)
emma.go_to(emma_x, emma_y)
delta_x = michael_x-emma_x
delta_y = michael_y-michael_y
distance = math.sqrt((delta_x**2)+(delta_y**2))
end_text = codesters.Text(" ", 0, 100)
if distance <= 200:
end_text.set_text("We need some masks, STAT!")
stage.wait(1)
emma.load_image("person1_masked")
michael.load_image("person2_masked")
else:
end_text.set_text("Great job social distancing!")
michael.say("Social distancing high five!")
emma.say("Social distancing high five!")
tester = TestManager()
tester.display_success_message("Great job! Click Submit and Next to continue!")
-
Run Code
-
Activity Submitted!
Submit Work
-
Next Activity
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)