/
ap1k
/
PyGame_Practice
Обзор
Документация
Войти
/
ap1k
/
PyGame_Practice
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/core/scene.py
28 строк
710 B
Roman
The all game
27 май 2025, 15:26
27 май 2025, 15:26
4ea7de9
Код
Авторство
О чём код?
""" Scene base class - abstract base class for all game scenes """ from abc import ABC, abstractmethod class Scene(ABC): """ Abstract base class for all game scenes Follows the Open/Closed principle by defining a common interface for all scenes """ def __init__(self, game): """Initialize the scene with a reference to the game object""" self.game = game @abstractmethod def update(self): """Update the scene state""" pass @abstractmethod def render(self, screen): """Render the scene to the screen""" pass @abstractmethod def handle_event(self, event): """Handle pygame events""" pass