Files
LABAn3GLEB/kroliklaba3.py
mokangleb1818-crypto 86ffa05db6 Initial commit
2026-03-31 19:12:15 +03:00

88 lines
2.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import pygame
import sys
# Инициализация
pygame.init()
WIDTH, HEIGHT = 600, 600
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Кроликкк")
# Цвета
WHITE = (255, 255, 255)
GRAY = (200, 200, 200)
PINK = (255, 180, 180)
BLACK = (0, 0, 0)
def draw_ears(surface):
# Внешняя часть ушей
pygame.draw.ellipse(surface, GRAY, (250, 100, 40, 120))
pygame.draw.ellipse(surface, GRAY, (310, 100, 40, 120))
# Внутренняя часть ушей
pygame.draw.ellipse(surface, PINK, (260, 110, 20, 80))
pygame.draw.ellipse(surface, PINK, (320, 110, 20, 80))
def draw_head(surface):
pygame.draw.circle(surface, GRAY, (300, 250), 80)
def draw_face(surface):
# Глаза
pygame.draw.circle(surface, BLACK, (270, 240), 10)
pygame.draw.circle(surface, BLACK, (330, 240), 10)
# Блик в глазах
pygame.draw.circle(surface, WHITE, (275, 235), 4)
pygame.draw.circle(surface, WHITE, (335, 235), 4)
# Нос
pygame.draw.circle(surface, PINK, (300, 270), 8)
# Рот
pygame.draw.arc(surface, BLACK, (285, 275, 30, 20), 3.14, 0, 2)
# Усы
pygame.draw.line(surface, BLACK, (260, 270), (220, 265), 2)
pygame.draw.line(surface, BLACK, (260, 275), (220, 280), 2)
pygame.draw.line(surface, BLACK, (340, 270), (380, 265), 2)
pygame.draw.line(surface, BLACK, (340, 275), (380, 280), 2)
def draw_body(surface):
pygame.draw.ellipse(surface, GRAY, (240, 330, 120, 150))
def draw_limbs(surface):
# Лапки
pygame.draw.ellipse(surface, GRAY, (250, 450, 40, 50))
pygame.draw.ellipse(surface, GRAY, (310, 450, 40, 50))
# Хвост
pygame.draw.circle(surface, WHITE, (300, 470), 20)
def draw_rabbit(surface):
draw_ears(surface)
draw_head(surface)
draw_face(surface)
draw_body(surface)
draw_limbs(surface)
# Основной цикл
running = True
clock = pygame.time.Clock()
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill(WHITE)
draw_rabbit(screen)
pygame.display.flip()
clock.tick(60)
pygame.quit()
sys.exit()