Bouncing Balls - no UI code. self.height = height self.width = width self.event_name = event_name self.x = x self.y = y self.window_height = window_height self.window_width = window_width self.r = 20.0; self.vel = {'x': random.uniform(-5.0, 5.0), 'y': random.uniform(-5.0, 5.0)}; self.smooth = 0.4 # value between 0 and 1