Добавлена лабораторная работа 2

This commit is contained in:
Vlad24
2026-03-04 14:14:16 +03:00
parent e50aaa443c
commit 98fc10133c
3 changed files with 359 additions and 0 deletions

47
lab2/task1.py Normal file
View File

@@ -0,0 +1,47 @@
import pygame
from pygame.draw import *
pygame.init()
FPS = 30
screen = pygame.display.set_mode((400, 400))
# ЦВЕТА
GRAY = (200, 200, 200) # Светло-серый фон
YELLOW = (255, 255, 0) # Жёлтое лицо
BLACK = (0, 0, 0) # Чёрный (контуры, рот, брови)
RED = (255, 0, 0) # Красные глаза
# ФОН
screen.fill(GRAY)
# === ЛИЦО ===
# Жёлтый круг
circle(screen, YELLOW, (200, 200), 100)
circle(screen, BLACK, (200, 200), 100, 3)
#ГЛАЗА
circle(screen, RED, (165, 170), 18) # Левый
circle(screen, RED, (235, 170), 18) # Правый
circle(screen, BLACK, (165, 170), 8) # Левый
circle(screen, BLACK, (235, 170), 8) # Правый
РОdb
line(screen, BLACK, (140, 145), (185, 165), 8)
line(screen, BLACK, (260, 145), (215, 165), 8)
rect(screen, BLACK, (150, 240, 100, 15))
pygame.display.update()
clock = pygame.time.Clock()
finished = False
while not finished:
clock.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
finished = True
pygame.quit()