#!/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
sc.fill((125,125,125))
angle = 0
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
angle += 0.25
if angle >= 360:
angle = 0
r = r + 25
x1 = x0 + r * math.cos(angle)
y1 = y0 + r * math.sin(angle)
pygame.draw.circle(sc, green, (int(x1), int(y1)), 5)
pygame.display.flip()
|