#!/bin/python
import pygame, sys
import random
import math
green = (0, 255, 0)
blue = (0, 0, 128)
red = (255, 0, 0)
pygame.init()
sc = pygame.display.set_mode((500, 500))
pygame.display.set_caption("Колесо на pygame")
x0 = 250
y0 = 250
r = 50
a = 0
sc.fill((125,125,125))
it = 0
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
for a in range(0,360,5):
x = 250+(r-it*50)*math.cos(a*(3.14/180))
y = 250+(r-it*50)*math.sin(a*(3.14/180))
pygame.draw.circle(sc, green, (int(x), int(y)), random.randint(5,25))
if it < 5:
it = it + 1
pygame.display.flip()
|