Вот код программы:
import pygame import random WIDTH = 480 HEIGHT = 600 FPS = 60 black = (0,0,0) white = (255,255,255) red = (255,0,0) green = (0,255,0) blue = (0,0,255) pygame.init() pygame.mixer.init() screen = pygame.display.set_mode((WIDTH,HEIGHT)) pygame.display.set_caption("My Game") clock = pygame.time.Clock() running = True while running: clock.tick(FPS) for event in pygame.event.get(): if event.type == pygame.QUIT: running = False screen.fill(red) pygame.display.flip() pygame.quit()