comparison gamelib/scenes/crew_quarters.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 b1451b0b906f
children dfc89bc64fdb
comparison
equal deleted inserted replaced
241:b1451b0b906f 242:12c4f87ea424
1 """Crew quarters.""" 1 """Crew quarters."""
2 2
3 from gamelib.cursor import CursorSprite 3 from gamelib.cursor import CursorSprite
4 from gamelib.state import Scene, Item, Thing, Result, InteractText 4 from gamelib.state import Scene, Item, Thing, Result, InteractText
5 from gamelib.scenes.scene_widgets import Door
5 6
6 class CrewQuarters(Scene): 7 class CrewQuarters(Scene):
7 8
8 FOLDER = "crew_quarters" 9 FOLDER = "crew_quarters"
9 BACKGROUND = None # TODO 10 BACKGROUND = None # TODO
12 'accessible': True, 13 'accessible': True,
13 } 14 }
14 15
15 def __init__(self, state): 16 def __init__(self, state):
16 super(CrewQuarters, self).__init__(state) 17 super(CrewQuarters, self).__init__(state)
18 self.add_thing(ToMap())
17 19
18 def enter(self): 20 def enter(self):
19 return Result("The crew were a messy bunch. Or maybe that's just the intervening centuries.") 21 return Result("The crew were a messy bunch. Or maybe that's just the intervening centuries.")
20 22
21 23
22 class ToMap(Thing): 24 class ToMap(Door):
23 "Way to map."
24 25
25 NAME = "crew.tomap" 26 NAME = "crew.tomap"
26 DEST = "map"
27 27
28 INTERACTS = { 28 INTERACTS = {
29 "door": InteractText(100, 200, "To Map"), 29 "door": InteractText(100, 200, "To Map"),
30 } 30 }
31 31
32 INITIAL = "door" 32 INITIAL = "door"
33
34 def interact_without(self):
35 """Go to map."""
36 self.state.set_current_scene("map")
37 33
38 34
39 class Safe(Thing): 35 class Safe(Thing):
40 "A safe, for keeping things safe." 36 "A safe, for keeping things safe."
41 37