This repository has been archived on 2019-12-09. You can view files and clone it, but cannot push or open issues or pull requests.
pacman2/engine/scene_manager.py

19 lines
462 B
Python

from .singleton import Singleton
class SceneManager(metaclass=Singleton):
def __init__(self, scene):
super().__init__()
self._scene = scene
self._scene.load()
def change_scene(self, new_scene):
self._scene.unload()
self._scene = new_scene
self._scene.load()
def step(self):
for entity in self._scene.entities:
if entity.script is not None:
entity.script(entity)