Automatically Moving Shape? Python 3.5 Tkinter
问题 In python, I am currently making a 'game' using tkinter, but it has decided not to work. What I am trying to do is have one rectangle movable by the mouse, and the other rectangle that moves up and down continuously without the player doing anything. Here is my code: from tkinter import * import time root = Tk() root.title("Game") root.geometry("800x800") def motion(): canvas.delete(ALL) a = canvas.create_rectangle(event.x-50, event.y-50, event.x+50, event.y+50, fill='red') def motion2(): b =