This commit is contained in:
2026-03-18 10:50:01 +03:00
parent b1d681cd96
commit a1b27e9e97

36
sm.py Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python3
import pygame
from pygame.draw import*
pygame.init()
FPS=30
screen=pygame.display.set_mode((500,500))
def smile(screen):
rect(screen, (230,200,160), (0, 0, 500, 500)) #фон
circle(screen, (255, 255, 0), (250, 250), 230) #основа
rect(screen, (0, 0, 0), (150, 400, 200, 25)) #рот
polygon(screen, (0, 0, 0), [(100, 25), (225, 125), (200, 150), (75, 50)]) #левая бровь
polygon(screen, (0, 0, 0), [(400, 50), (425, 75), (300, 175), (275, 150)]) #правая бровь
def eye(y):
circle(screen, (255, 0, 0), (150, 200), 15+y) #радужка
circle(screen, (0, 0, 0), (150, 200), 15) #левый глаз
circle(screen, (255, 0, 0), (350, 200), 15+y) #радужка
circle(screen, (0, 0, 0), (350, 200), 15) #правый глаз
smile(screen)
eye(10)
pygame.display.update()
clock = pygame.time.Clock()
finish = False
while not finish:
clock.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
finish = True
pygame.quit()