/
Dragon925
/
Python-Graphics
Обзор
Документация
Войти
/
Dragon925
/
Python-Graphics
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
lesson_26
classes.py
24 строки
676 B
Alexandr Romanov
Пример выполнения задания 12
03 апр 2025, 17:41
03 апр 2025, 17:41
6998438
Код
Авторство
О чём код?
from pygame import Surface, Color, image class Dino: def __init__(self, x: int, y: int, image_path: str): self.image = image.load(image_path) self.image.set_colorkey(Color("white")) self.rect = self.image.get_rect(topleft=(x, y)) def draw(self, screen: Surface): screen.blit(self.image, self.rect) class Ground: def __init__(self, y: int, image_path: str, speed: int): self.image = image.load(image_path) self.image.set_colorkey(Color("white")) self.rect = self.image.get_rect(topleft=(0, y)) self.speed = speed def draw(self, screen: Surface): screen.blit(self.image, self.rect)