/
Dragon925
/
Python-Graphics
Обзор
Документация
Войти
/
Dragon925
/
Python-Graphics
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
lesson_28
dino.py
35 строк
804 B
Alexandr Romanov
Пример выполнения задания 13
24 апр 2025, 17:08
24 апр 2025, 17:08
b609cf8
Код
Авторство
О чём код?
import pygame from random import choice, randint import display import moving import creation # Параметры игрового поля и fps WIDTH, HEIGHT = 1400, 600 start_fps = 70 fps = start_fps pygame.init() screen = pygame.display.set_mode((WIDTH, HEIGHT)) clock = pygame.time.Clock() dino, ground, clouds = creation.create_world( WIDTH, HEIGHT, -10, 0.25,10, 4, 2, 10 ) timer = 1 while True: # Выход по нажатию крестика for event in pygame.event.get(): if event.type == pygame.QUIT: exit() display.draw_world(screen, dino, ground, clouds) moving.move(WIDTH, HEIGHT, dino, ground, clouds) if timer % (fps // 10) == 0: dino.animate() timer = (timer + 1) % fps pygame.display.update() clock.tick(fps)