stage.set_background("moon")
sprite = codesters.Sprite("astronaut1")
sprite.go_to(-125, -150)
glorp = codesters.Sprite("alien1")
glorp.go_to(100, -125)
rock = codesters.Sprite("asteroid")
rock.go_to(100, 75)
sprite.say("What do planets read?")
sprite.set_say_color("white")
def click(sprite):
sprite.say("Comet books!")
# add other actions...
sprite.event_click(click)
t = codesters.Teacher()
try:
params = t.find_function('turn_left')
tval1a = params[0][1].lower()
tval1b = t.get_indent_at_line(params[0][0])
except:
tval1a = "DNE"
tval1b = "DNE"
t1 = TestObjective()
t1.add_success("sprite" in tval1a and tval1b == 4, "Great job!")
t1.add_failure(tval1a == "DNE" or tval1b == "DNE", "Did you add a Turn Left command to the click event?")
t1.add_failure(tval1b != 4, "Make sure your Turn Left command is indented four spaces inside the Click event.")
t2 = TestObjective()
t2.add_success("360" in tval1a, "Great job!")
t2.add_failure("90" in tval1a, "Did you change the number of degrees the sprite turns?")
t2.add_failure(tval1a == "DNE", "Did you add a Turn Left command to your Click event?")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()