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
465 B
Python
Raw Normal View History

2019-11-23 10:46:25 +01:00
from .singleton import Singleton
class SceneManager(metaclass=Singleton):
def __init__(self, scene):
super().__init__()
2019-12-09 09:57:53 +01:00
self.scene = scene
self.scene.load()
2019-11-23 10:46:25 +01:00
def change_scene(self, new_scene):
2019-12-09 09:57:53 +01:00
self.scene.unload()
self.scene = new_scene
self.scene.load()
2019-11-23 10:46:25 +01:00
def step(self):
2019-12-09 09:57:53 +01:00
for entity in self.scene.entities.values():
2019-11-23 10:46:25 +01:00
if entity.script is not None:
entity.script(entity)