STEP 5: Oops! That Glide To command sent our sprite all the way off the stage! Let's change the coordinates so that our sprite glides to the hat! In this lesson, our stage goes from -8 to 8 on the x-axis and the y-axis.
Click Run to see the hat on the stage.
Click in the code editor and change the numbers in the .glide_to() command to (5, -6).
The numbers in the .glide_to() command are the coordinate pair that the sprite will glide to.
t = codesters.Teacher()
glides = t.find_function('glide_to')
tval1 = glides.replace(' ', '')
tval1 = "DNE"
t1 = TestObjective()
t1.add_success('5,-6' in tval1, "Great job!")
t1.add_failure(tval1 == "DNE", "Oops! Did you erase your Glide To command?")
t1.add_failure(len(glides) > 1, "Make sure you're only using 1 Glide To command!")
t1.add_failure('-6,5' in tval1, "Oops! Did you mix up the x and y coordintates?")
t1.add_failure('5,-6' not in tval1, "Oops! Make sure you're sendingthe sprite to (5, -2)!")
tester = TestManager()