Mercurial > boomslang
comparison pyntnclick/state.py @ 749:a453731e4531 pyntnclick
Game-defined scene module
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sun, 20 Jan 2013 18:57:17 +0200 |
parents | efa58c92b304 |
children | ef4bda7d623d |
comparison
equal
deleted
inserted
replaced
748:763ff5a9ee42 | 749:a453731e4531 |
---|---|
119 def add_item(self, item): | 119 def add_item(self, item): |
120 item.set_game(self) | 120 item.set_game(self) |
121 self.items[item.name] = item | 121 self.items[item.name] = item |
122 | 122 |
123 def load_scenes(self, modname): | 123 def load_scenes(self, modname): |
124 mod = __import__("gamelib.scenes.%s" % (modname,), fromlist=[modname]) | 124 mod = __import__('%s.%s' % (self.gd.SCENE_MODULE, modname), |
125 fromlist=[modname]) | |
125 for scene_cls in mod.SCENES: | 126 for scene_cls in mod.SCENES: |
126 scene = scene_cls(self) | 127 scene = scene_cls(self) |
127 self.add_scene(scene) | 128 self.add_scene(scene) |
128 if hasattr(mod, 'DETAIL_VIEWS'): | 129 if hasattr(mod, 'DETAIL_VIEWS'): |
129 for scene_cls in mod.DETAIL_VIEWS: | 130 for scene_cls in mod.DETAIL_VIEWS: |