import pygame
import random
import sys
FPS = 60
W = 500
H = 500
WHITE = (255, 255, 255)
YELLOW = (225, 225, 0)
sc = pygame.display.set_mode((W, H))
clock = pygame.time.Clock()
x = 0
y = 0
sc.fill((200, 255, 200))
while 1:
for i in pygame.event.get():
if i.type == pygame.QUIT:
sys.exit()
pygame.draw.rect(sc, WHITE , (x, y, 10, 10))
pygame.draw.rect(sc, WHITE , (y, x, 10, 10))
x = x + 10
if x > 400:
y = y + 100
x = 0
if x%100 == 0:
pygame.draw.circle(sc, YELLOW, (x, y), 50)
pygame.display.update()
clock.tick(FPS)
|