Bouncing Balls - no UI code. from ui_classes import * self.event_name = event_name self.x = x self.y = y self.window_width = window_width self.window_height = window_height 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