comparison gamelib/scenes/machine.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 366c8fe16697
children dfc89bc64fdb
comparison
equal deleted inserted replaced
241:b1451b0b906f 242:12c4f87ea424
1 """Machine room where tools and machines are found.""" 1 """Machine room where tools and machines are found."""
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.cursor import CursorSprite 4 from gamelib.cursor import CursorSprite
5 from gamelib.scenes.scene_widgets import Door
5 6
6 7
7 class Machine(Scene): 8 class Machine(Scene):
8 9
9 FOLDER = "machine" 10 FOLDER = "machine"
23 24
24 def enter(self): 25 def enter(self):
25 return Result("The machine room is dark and forbidding.") 26 return Result("The machine room is dark and forbidding.")
26 27
27 28
28 class ToMap(Thing): 29 class ToMap(Door):
29 "Way to map."
30 30
31 NAME = "machine.tomap" 31 NAME = "machine.tomap"
32 DEST = "map"
33 32
34 INTERACTS = { 33 INTERACTS = {
35 "door": InteractText(100, 200, "To Map"), 34 "door": InteractText(100, 200, "To Map"),
36 } 35 }
37 36
38 INITIAL = "door" 37 INITIAL = "door"
39
40 def interact_without(self):
41 """Go to map."""
42 self.state.set_current_scene("map")
43 38
44 39
45 class LaserWelder(Thing): 40 class LaserWelder(Thing):
46 41
47 NAME = "machine.laser_welder" 42 NAME = "machine.laser_welder"