annotate gamelib/scenes/engine.py @ 252:dfc89bc64fdb

Start of walkthrough "unit test" and associated fixes and tweaks.
author Jeremy Thurgood <firxen@gmail.com>
date Fri, 27 Aug 2010 16:45:47 +0200
parents cc478e3a951e
children 5f58da9eeb52
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
47
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
1 """Engine room where things need to be repaired."""
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
2
151
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
3 from gamelib.state import Scene, Item, Thing, InteractText, Result
242
12c4f87ea424 Unify doors a bit
Neil Muller <neil@dip.sun.ac.za>
parents: 151
diff changeset
4 from gamelib.scenes.scene_widgets import Door
47
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
5
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
6
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
7 class Engine(Scene):
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
8
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
9 FOLDER = "engine"
244
cc478e3a951e Line-art engine room.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 242
diff changeset
10 BACKGROUND = "engine_room.png"
47
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
11
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
12 INITIAL_DATA = {
151
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
13 'accessible': True,
47
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
14 }
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
15
151
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
16 def __init__(self, state):
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
17 super(Engine, self).__init__(state)
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
18 self.add_thing(ToMap())
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
19
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
20 def enter(self):
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
21 return Result("Somewhere in the darkness the engine waits and bides its time.")
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
22
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
23
242
12c4f87ea424 Unify doors a bit
Neil Muller <neil@dip.sun.ac.za>
parents: 151
diff changeset
24 class ToMap(Door):
151
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
25
252
dfc89bc64fdb Start of walkthrough "unit test" and associated fixes and tweaks.
Jeremy Thurgood <firxen@gmail.com>
parents: 244
diff changeset
26 SCENE = "engine"
151
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
27
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
28 INTERACTS = {
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
29 "door": InteractText(100, 200, "To Map"),
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
30 }
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
31
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
32 INITIAL = "door"
d00aa26941c4 Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
Simon Cross <hodgestar+bzr@gmail.com>
parents: 55
diff changeset
33
47
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
34
8f1fccb8cadf Skeletons for scenes in plot outline.
Simon Cross <simon@simonx>
parents:
diff changeset
35 SCENES = [Engine]