Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import exit
- from random import randrange
- import scene_list
- class Engine(object):
- scenes = {
- "Scene1": Scene1(),
- "Scene2": Scene2(),
- "Scene3": Scene3(),
- "GameOver": GameOver(),
- }
- def __init__(self, scene):
- self.scene = scene
- def first(self):
- return self.next_scene(self.scene)
- def following(self, next_scene):
- value = Engine.scenes.get(next_scene)
- return value
- def play(self):
- current = self.scene.first()
- final = self.scene.following("GameOver")
- while current is not final:
- scene = current.start()
- current = self.scene.following(scene)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement