#!/usr/bin/env python #original code from Game Development with Python and Pygame by Will McGugan import pygame from pygame.locals import * from sys import exit from random import * pygame.init() screen = pygame.display.set_mode((640, 480), 0, 16) j = 0 while True: for event in pygame.event.get(): if event.type == QUIT: exit() if (j%640 == 0): screen.fill((0,0,0)) random_color = (randint(0,255), randint(0,255), 0) #random_pos = (randint(0,639), 240) random_pos = (j%640, 240+ 20) random_pos2 = (640 - j%640, 80) random_pos3 = (640 - j%640, 410) random_radius = randint(5,75) pygame.draw.circle(screen, random_color, random_pos, random_radius) pygame.draw.circle(screen, random_color, random_pos2, random_radius/2) pygame.draw.circle(screen, random_color, random_pos3, random_radius/2) j = j+5 pygame.display.update()