import pygame
import random
import math
pygame.init()
win = pygame.display.set_mode((500,500))
pygame.display.set_caption("")
pygame.time.set_timer(pygame.USEREVENT, 1000)
size = 50
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
pygame.image.save(win, "image.jpg")
if event.type == pygame.USEREVENT:
size = size + 5
for i in range(0,360,30):
center_x = 250
center_y = 250
x = center_x + math.cos(math.radians(i))*size;
y = center_y + math.sin(math.radians(i))*size;
pygame.draw.line(win, (255,255,255), [center_x, center_y], [x, y], 3)
pygame.display.update()
pygame.quit()
|