41 lines
956 B
Python
41 lines
956 B
Python
import pygame
|
|
import sys
|
|
|
|
pygame.init()
|
|
|
|
# Настройки экрана
|
|
screen = pygame.display.set_mode((600, 600))
|
|
pygame.display.set_caption("Злой смайлик")
|
|
|
|
|
|
YELLOW = (255, 255, 0)
|
|
BLACK = (0, 0, 0)
|
|
WHITE = (255, 255, 255)
|
|
RED = (255, 0, 0)
|
|
|
|
running = True
|
|
while running:
|
|
for event in pygame.event.get():
|
|
if event.type == pygame.QUIT:
|
|
running = False
|
|
|
|
screen.fill(WHITE)
|
|
|
|
pygame.draw.circle(screen, YELLOW, (300, 300), 200)
|
|
|
|
pygame.draw.circle(screen, RED, (220, 220), 30)
|
|
pygame.draw.circle(screen, RED, (380, 220), 30)
|
|
|
|
pygame.draw.circle(screen, BLACK, (220, 220), 12)
|
|
pygame.draw.circle(screen, BLACK, (380, 220), 12)
|
|
|
|
pygame.draw.line(screen, BLACK, (150, 150), (230, 190), 20)
|
|
pygame.draw.line(screen, BLACK, (450, 150), (370, 190), 20)
|
|
|
|
pygame.draw.rect(screen, BLACK, (200, 370, 200, 30))
|
|
|
|
pygame.display.flip()
|
|
|
|
pygame.quit()
|
|
sys.exit()
|