#!/bin/python
import pygame, sys
import random
import math
pygame.init()
sc = pygame.display.set_mode((500, 500))
pygame.display.set_caption("Разброс кружков на pygame")
r = 250
a = 0
sc.fill((125,125,125))
it = 1
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
for a in range(0,360,25):
x = 250+(r-it*50)*math.cos(a*(3.14/180))
y = 250+(r-it*50)*math.sin(a*(3.14/180))
color = (random.randint(0,255),random.randint(0,255),random.randint(0,255))
pygame.draw.circle(sc, color, (int(x), int(y)),random.randint(5,20))
if it < 5:
it = it + 1
pygame.display.flip()
|