Вроде моя новая идея.
import pygame
import random
pygame.init()
w = 500
h = 500
screen = pygame.display.set_mode([w,h])
running = True
x = 250
y = 250
r = 50
direction = 1
screen.fill((255,255,255))
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.MOUSEMOTION:
x = event.pos[0]
y = event.pos[1]
if (direction == 1):
r = r - 1
if (direction == 2):
r = r + 1
if (r > 50):
direction = 1
if (r < 1):
direction = 2
pygame.draw.circle(screen, (255,255, 0),(x, y), r)
pygame.display.update()
pygame.quit()
|