import pygame
import random
import math
WIDTH = 700
HEIGHT = 700
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
clock = pygame.time.Clock()
surf = pygame.Surface((500,500))
surf.fill(BLACK)
rotate_surf = pygame.Surface((500,500))
rotate_surf.fill(BLACK)
running = True
a = 250
b = 50
c = 50
d = 50
angle = 0
while running:
clock.tick(50)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill(WHITE)
for q in range(0,500,50):
for w in range(0,500,50):
pygame.draw.circle(surf, (255,255,255), (q,w), 10)
rotate_surf = pygame.transform.rotate(surf,angle)
screen.blit(rotate_surf, (0, 0))
angle = angle + 1
pygame.display.flip()
pygame.quit()
|