Files
YP_2026_oskin/eg.py
24_OskinEA 35a5fa510c Текущая ветка: main
Начальный коммит

 Изменения, которые будут включены в коммит:
	новый файл:    1_draw.py
	новый файл:    eg.py
2026-03-17 16:51:05 +03:00

37 lines
1.0 KiB
Python
Executable File
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.

#!/usr/bin/env python3
import pygame
from pygame.draw import *
pygame.init()
FPS = 30
screen = pygame.display.set_mode((800, 500))
def pezag(screen):
# Небо
rect(screen, (230, 200, 160), (0, 0, 800, 500))
# дальний фон
rect(screen, (240, 210, 190), (0, 200, 800, 80))
# солнце
circle(screen, (255, 230, 0), (400, 150), 60)
# горы задний план
polygon(screen, (250, 150, 50), [(0,250), (200,120), (350,260), (600,130), (800,250)])
# средний слой
polygon(screen, (180, 70, 50), [(0,350), (150,300), (250,360), (400,310), (600,370), (800,320), (800,500), (0,500)])
# передний слой
rect(screen, (170, 130, 140), (0, 380, 800, 120))
# Вызов функции отрисовки
pezag(screen)
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()