From c642df20109abbc1d0a97772ca4e2aebf4f0fe93 Mon Sep 17 00:00:00 2001 From: mokangleb1818-crypto Date: Wed, 13 May 2026 11:52:58 +0300 Subject: [PATCH] fix --- gun.py | 0 lb_3_fix.py | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++ rk 2 2.py | 0 rk2.py | 0 4 files changed, 125 insertions(+) create mode 100644 gun.py create mode 100644 lb_3_fix.py create mode 100644 rk 2 2.py create mode 100644 rk2.py diff --git a/gun.py b/gun.py new file mode 100644 index 0000000..e69de29 diff --git a/lb_3_fix.py b/lb_3_fix.py new file mode 100644 index 0000000..1b2d38b --- /dev/null +++ b/lb_3_fix.py @@ -0,0 +1,125 @@ +import pygame +from pygame.draw import * + +pygame.init() + +FPS = 30 +screen = pygame.display.set_mode((400, 400)) + +# Используемые цвета +BLACK = (0, 0, 0) +WHITE = (255, 255, 255) +PINK = (255, 200, 200) +DARK_PINK = (255, 150, 150) +LIGHT_GREEN = (220, 255, 220) +BROWN = (180, 130, 80) +DARK_BROWN = (160, 110, 60) + + +def draw_ellipse(surface, x, y, width, height, color): + """Рисует эллипс по центру с координатами x,y""" + ellipse(surface, color, (x - width // 2, y - height // 2, width, height)) + + +def draw_body(surface, x, y, width, height, color): + """Рисует тело зайца""" + draw_ellipse(surface, x, y, width, height, color) + + +def draw_ear(surface, x, y, width, height, color): + """Рисует ухо зайца""" + draw_ellipse(surface, x, y, width, height, color) + # Добавляем внутреннюю часть уха (розовую) + draw_ellipse(surface, x, y + 3, width // 2, height // 1.5, PINK) + + +def draw_head(surface, x, y, size, color): + """Рисует голову зайца""" + circle(surface, color, (x, y), size // 2) + + +def draw_eyes(surface, x, y, head_size): + """Рисует глаза зайца""" + eye_size = head_size // 8 + + # Белки глаз + for offset_x in (-head_size // 5, head_size // 5): + circle(surface, WHITE, (x + offset_x, y - head_size // 8), int(eye_size // 1.5)) + # Зрачки + circle(surface, BLACK, (x + offset_x, y - head_size // 8), eye_size // 3) + + # Нос + circle(surface, DARK_PINK, (x, y + head_size // 10), eye_size // 2) + + +def draw_leg(surface, x, y, width, height, color): + """Рисует ногу зайца""" + draw_ellipse(surface, x, y, width, height, color) + + +def draw_hare(surface, x, y, width, height, color): + """Рисует зайца на экране""" + # Параметры + body_width = width // 2 + body_height = height // 2 + body_y = y + body_height // 4 + head_size = height // 3 + head_y = y - head_size // 2 + + # Тело + draw_body(surface, x, body_y, body_width, body_height, color) + + # Уши (должны быть под головой) + ear_height = height // 3 + ear_y = y - height // 2 + ear_height // 2 + ear_width = width // 10 + + for ear_x in (x - head_size // 4, x + head_size // 4): + draw_ear(surface, ear_x, ear_y, ear_width, ear_height, color) + + # Голова (рисуем поверх ушей) + draw_head(surface, x, head_y, head_size, color) + + # Глаза и нос + draw_eyes(surface, x, head_y, head_size) + + # Задние лапы + back_leg_height = height // 10 + back_leg_y = y + height // 3 + back_leg_width = width // 3 + + for leg_x in (x - width // 5, x + width // 5): + draw_leg(surface, leg_x, back_leg_y, back_leg_width, back_leg_height, color) + + # Передние лапы + front_leg_height = height // 4 + front_leg_y = y + height // 12 + front_leg_width = width // 7 + + for leg_x in (x - width // 5, x + width // 5): + draw_leg(surface, leg_x, front_leg_y, front_leg_width, front_leg_height, color) + + # Маленькие лапки (ступни) + foot_width = front_leg_width // 1.2 + foot_height = front_leg_height // 4 + foot_y = front_leg_y + front_leg_height // 1.8 + + for leg_x in (x - width // 5, x + width // 5): + draw_leg(surface, leg_x, foot_y, foot_width, foot_height, DARK_BROWN) + + +# Основная программа +screen.fill(LIGHT_GREEN) +draw_hare(screen, 200, 200, 240, 380, BROWN) +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() \ No newline at end of file diff --git a/rk 2 2.py b/rk 2 2.py new file mode 100644 index 0000000..e69de29 diff --git a/rk2.py b/rk2.py new file mode 100644 index 0000000..e69de29