import pygame
import sys
import math
import random
pygame.init()
sc = pygame.display.set_mode((500, 500))
f1 = pygame.font.SysFont('arial', 36)
a = 0
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
pygame.image.save(sc, "image.jpg")
sc.fill((0,0,0))
w = 0
for a in range(0,360,5):
w = w + 1
y = 250+200*math.sin(a)
x = 250+200*math.cos(a)
pygame.draw.rect(sc, (255, 255, 255),
(x, y, w,w))
pygame.display.update()
|