Tkinter Canvas Design for multiple ball movement
When creating the ball object, you can set the id value, and later you can put this id value inside the move() method to indicate that it is moving this ball.
Example#1
Move two balls at a time. Row 8 sets the yellow ball to be id1 and row 9 sets the aqua ball to be id2.
from tkinter import *
import time
tk = Tk()
tk.title("apidemos.com")
canvas = Canvas(tk,width=500, height=250) # Create Canvas
canvas.pack()
id1 = canvas.create_oval(10,50,60,100,fill="yellow")
id2 = canvas.create_oval(10,150,60,200,fill="aqua")
for x in range(0,80):
canvas.move(id1,5,0)
canvas.move(id2,5,0) # ID=1 Shift 5 pixels on the x-axis and 2 pixels on the y-axis
tk.update() # Forced tkinter redraw
time.sleep(0.05)
# tk.mainloop()
Output: