from tkinter import * root = Tk() c = Canvas(root, width=200, height=80, bg="green") c.pack() ball = c.create_oval(10, 30, 30, 50, fill='yellow') def motion(): c.move(ball, 1, 0) if c.coords(ball)[2] < 200: root.after(10, motion) motion() root.mainloop()