/
Dragon925
/
Python-Graphics
Обзор
Документация
Войти
/
Dragon925
/
Python-Graphics
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
lesson_30
main.py
31 строка
734 B
Alexandr Romanov
Пример решения
15 май 2025, 18:44
15 май 2025, 18:44
d4a813e
Код
Авторство
О чём код?
import pygame from petard import Petard WIDTH, HEIGHT = 800, 600 FPS = 60 WHITE = pygame.Color("white") BLACK = pygame.Color("black") pygame.init() screen = pygame.display.set_mode((WIDTH, HEIGHT)) clock = pygame.time.Clock() petard_1 = Petard(WIDTH // 4, HEIGHT - 50, 50, 100, 100) petard_2 = Petard(WIDTH // 2, HEIGHT - 50, 50, 100, 100) petard_3 = Petard(WIDTH // 4 * 3, HEIGHT - 50, 50, 100, 100) petards = (petard_3, petard_2, petard_1) while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() exit() screen.fill(BLACK) for petard in petards: petard.draw(screen) petard.move(HEIGHT) pygame.display.update() clock.tick(FPS)