Re: How to bounce the ball forever around the screen
phamton...@gmail.com wrote: > from Tkinter import * > window = Tk() > canvas = Canvas(window, width=500, height=500, background="green") > canvas.pack() > > def move_ball(speed_x, speed_y): > box = canvas.bbox("ball") > x1 = box[0] > y1 = box[1] > x2 = box[2] >
How to bounce the ball forever around the screen
from Tkinter import * window = Tk() canvas = Canvas(window, width=500, height=500, background="green") canvas.pack() def move_ball(speed_x, speed_y): box = canvas.bbox("ball") x1 = box[0] y1 = box[1] x2 = box[2] y2 = box[3] if x1 <= 0: