import pygame
WIDTH = 500
HEIGHT = 500
BLACK = (0, 0, 0)
pygame.init()
sc = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("")
clock = pygame.time.Clock()
pygame.time.set_timer(pygame.USEREVENT, 100)
running = True
r = 255
g = 255
b = 255
while running:
sc.fill(BLACK)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.USEREVENT:
if r > 0:
r = r - 5
g = g - 5
b = b - 5
pygame.draw.circle(sc,(r,g,b), (200, 250), 200)
pygame.display.flip()
pygame.quit()
|