comparison gamelib/scenes/engine.py @ 242:12c4f87ea424

Unify doors a bit
author Neil Muller <neil@dip.sun.ac.za>
date Fri, 27 Aug 2010 11:32:49 +0200
parents d00aa26941c4
children cc478e3a951e
comparison
equal deleted inserted replaced
241:b1451b0b906f 242:12c4f87ea424
1 """Engine room where things need to be repaired.""" 1 """Engine room where things need to be repaired."""
2 2
3 from gamelib.state import Scene, Item, Thing, InteractText, Result 3 from gamelib.state import Scene, Item, Thing, InteractText, Result
4 from gamelib.scenes.scene_widgets import Door
4 5
5 6
6 class Engine(Scene): 7 class Engine(Scene):
7 8
8 FOLDER = "engine" 9 FOLDER = "engine"
18 19
19 def enter(self): 20 def enter(self):
20 return Result("Somewhere in the darkness the engine waits and bides its time.") 21 return Result("Somewhere in the darkness the engine waits and bides its time.")
21 22
22 23
23 class ToMap(Thing): 24 class ToMap(Door):
24 "Way to map."
25 25
26 NAME = "engine.tomap" 26 NAME = "engine.tomap"
27 DEST = "map"
28 27
29 INTERACTS = { 28 INTERACTS = {
30 "door": InteractText(100, 200, "To Map"), 29 "door": InteractText(100, 200, "To Map"),
31 } 30 }
32 31
33 INITIAL = "door" 32 INITIAL = "door"
34 33
35 def interact_without(self):
36 """Go to map."""
37 self.state.set_current_scene("map")
38
39 34
40 SCENES = [Engine] 35 SCENES = [Engine]