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))
running = True
a = 250
b = 50
c = 50
d = 50
angle = 0
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill(BLACK)
for x in range(0,3600):
y = a + b*math.sin(c*x + d)
pygame.draw.circle(surf, (255,255,0), (x,y), 1)
rotate_surf = pygame.transform.rotate(surf,angle)
screen.blit(rotate_surf, (0, 0))
angle = angle + 1
pygame.display.flip()
pygame.quit()
|