Re: How to bounce the ball forever around the screen

2015-12-04 Thread Peter Otten
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

2015-12-03 Thread phamtony33
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: