stage.set_background("grid")
sprite = codesters.Sprite("triangle")
text_box = codesters.Text("Click the triangle to see a translation in x", 0, 180, "blue")
click = "x_translation"
def step1():
global click
click = "y_translation"
sprite.translate_x(50)
text_box.set_text("Click to see a translation in y")
def step2():
global click
click = "rotation"
sprite.translate_y(50)
text_box.set_text("Click to see a rotation about the origin")
def step3():
global click
click = "x_axis_flip"
for counter in range(45):
sprite.rotate_origin(-2)
sprite.wait(.02)
text_box.set_text("Click to see a refection over the x-axis")
def step4():
global click
click = "y_axis_flip"
sprite.reflect_x_axis()
text_box.set_text("Click to see a refection over the y-axis")
def step5():
global click
click = "None"
sprite.reflect_y_axis()
text_box.set_text("Great job! ")
click_sprite()
def click_sprite():
global click
if click == "x_translation":
step1()
elif click == "y_translation":
step2()
elif click == "rotation":
step3()
elif click == "x_axis_flip":
step4()
elif click == "y_axis_flip":
step5()
else:
text_box3 = codesters.Text("Make sure to answer the questions on the ticket.", 0, 30, "green")
text_box4 = codesters.Text("Then, Click Submit and Next.", 0, 0, "green")
tester = TestManager()
tester.display_success_message("Great job! Click submit and next to continue!")
sprite.event_click(click_sprite)