comparison gamelib/scenes/bridge.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 ae01c10497b3
children 37f892b59c4b
comparison
equal deleted inserted replaced
241:b1451b0b906f 242:12c4f87ea424
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 InteractNoImage, InteractRectUnion 5 InteractNoImage, InteractRectUnion
6 from gamelib.statehelpers import GenericDescThing 6 from gamelib.statehelpers import GenericDescThing
7 from gamelib.scenes.scene_widgets import Door
7 8
8 class Bridge(Scene): 9 class Bridge(Scene):
9 10
10 FOLDER = "bridge" 11 FOLDER = "bridge"
11 BACKGROUND = 'bridge.png' 12 BACKGROUND = 'bridge.png'
25 26
26 def enter(self): 27 def enter(self):
27 return Result("The bridge is in a sorry, shabby state") 28 return Result("The bridge is in a sorry, shabby state")
28 29
29 30
30 class ToMap(Thing): 31 class ToMap(Door):
31 "Way to map."
32 32
33 NAME = "bridge.tomap" 33 NAME = "bridge.tomap"
34 DEST = "map"
35 34
36 INTERACTS = { 35 INTERACTS = {
37 "door": InteractNoImage(707, 344, 84, 245), 36 "door": InteractNoImage(707, 344, 84, 245),
38 } 37 }
39 38
40 INITIAL = "door" 39 INITIAL = "door"
41
42 def interact_without(self):
43 """Go to map."""
44 self.state.set_current_scene("map")
45 40
46 41
47 class BridgeComputer(Thing): 42 class BridgeComputer(Thing):
48 """The bridge computer. Gives status updates""" 43 """The bridge computer. Gives status updates"""
49 44