import pygame, time, random pygame.init() screen = pygame.display.set_mode([601,601]) screen.fill([0,200,0]) pygame.display.flip() x = 300 y = 300 dx = 3 dy = 4 while True: pygame.draw.circle(screen, [0,0,0], [x,y], 30) pygame.display.flip() time.sleep(.003) x = x + dx y = y + dy if x > 570: dx = -3 if x < 30: dx = 3 if y > 570: dy = -4 if y < 30: dy = 4 raw_input("Press ENTER to close the graphics window") pygame.quit()