diff --git a/ol.py b/ol.py new file mode 100755 index 0000000..e891921 --- /dev/null +++ b/ol.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python3 +import pygame +from pygame.draw import * +import math + +pygame.init() + +FPS = 30 +screen = pygame.display.set_mode((900, 900)) +pygame.display.set_caption("BIG STRAIGHT HARE") +clock = pygame.time.Clock() + +# Colors +WHITE = (255, 255, 255) +GRAY = (230, 230, 230) +DARK_GRAY = (180, 180, 180) +PINK = (255, 210, 210) +NOSE = (255, 120, 120) +BLACK = (0, 0, 0) + +screen.fill(WHITE) + +cx, cy = 450, 420 # центр + +# SHADOW +ellipse(screen, (200, 200, 200), (cx - 200, cy + 220, 400, 60)) + +# BODY (строго по центру) +ellipse(screen, GRAY, (cx - 150, cy, 300, 220)) +ellipse(screen, DARK_GRAY, (cx - 80, cy + 80, 160, 100)) + +# HEAD (ровно над телом) +circle(screen, GRAY, (cx, cy - 120), 120) + +# EARS (идеально симметричные) +ellipse(screen, GRAY, (cx - 90, cy - 420, 70, 260)) +ellipse(screen, GRAY, (cx + 20, cy - 420, 70, 260)) + +ellipse(screen, PINK, (cx - 70, cy - 400, 30, 200)) +ellipse(screen, PINK, (cx + 40, cy - 400, 30, 200)) + +# EYES (одна линия) +eye_y = cy - 150 +circle(screen, BLACK, (cx - 45, eye_y), 12) +circle(screen, BLACK, (cx + 45, eye_y), 12) + +circle(screen, WHITE, (cx - 50, eye_y - 5), 4) +circle(screen, WHITE, (cx + 40, eye_y - 5), 4) + +# NOSE (ровный и аккуратный) +nose_y = cy - 90 +polygon(screen, NOSE, [ + (cx, nose_y), + (cx - 12, nose_y + 14), + (cx + 12, nose_y + 14) +]) + +# MOUTH (симметрия) +line(screen, BLACK, (cx, nose_y + 14), (cx, nose_y + 28), 2) +arc(screen, BLACK, (cx - 30, nose_y + 20, 30, 20), math.pi, 2*math.pi, 2) +arc(screen, BLACK, (cx, nose_y + 20, 30, 20), math.pi, 2*math.pi, 2) + +# WHISKERS (зеркально) +for side in [-1, 1]: + for angle in [-10, 0, 10]: + rad = math.radians(angle) + line(screen, BLACK, + (cx + side*10, nose_y + 10), + (cx + side*(10 + 120*math.cos(rad)), nose_y + 10 + 40*math.sin(rad)), 2) + +# FRONT PAWS (симметрия) +ellipse(screen, GRAY, (cx - 120, cy + 160, 90, 50)) +ellipse(screen, GRAY, (cx + 30, cy + 160, 90, 50)) + +# BACK PAWS +ellipse(screen, GRAY, (cx - 180, cy + 200, 120, 70)) +ellipse(screen, GRAY, (cx + 60, cy + 200, 120, 70)) + +# TAIL +circle(screen, GRAY, (cx + 160, cy + 80), 30) + +pygame.display.update() + +running = True +while running: + clock.tick(FPS) + for event in pygame.event.get(): + if event.type == pygame.QUIT: + running = False + +pygame.quit()