from sprites import path2points,Screen,Sprite
A = (100,100)
B = (0,0)
C = (200,0)
points = [A,B,C,A]
path = path2points(points)
screen = Screen()
screen.setup(480,360)
screen.xy_grid()
bug = Sprite()
bug.draw_line(A,B)
bug.draw_line(C,B)
bug.draw_line(A,C)
while True:
for x,y in path:
screen.title(f"({round(x)},{round(y)})")
bug.goto(x,y)
bug.wait(0.01)
|