diff options
author | Dinko Galetic <dgaletic@everflame.(none)> | 2010-06-08 23:02:03 (GMT) |
---|---|---|
committer | Dinko Galetic <dgaletic@everflame.(none)> | 2010-06-08 23:02:03 (GMT) |
commit | cda82448da92bb394eecc1d5de2261ff10c837c1 (patch) | |
tree | f61586796181dd76ece6c0df3f736ad8d14d557f | |
parent | 9c3dab23e1db2cff18b9a598a35dc768c092b39c (diff) |
Added opposite_exits() function.
It is used when connecting two rooms. If you add an exit to the west from one room, it will be an east (opposite) exit in the one you are connecting to.
-rw-r--r-- | library/pippy/scholar/scholar.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/library/pippy/scholar/scholar.py b/library/pippy/scholar/scholar.py index 7fba91c..c2c141b 100644 --- a/library/pippy/scholar/scholar.py +++ b/library/pippy/scholar/scholar.py @@ -69,4 +69,29 @@ def create_some_rooms(): return [starting, balcony] +def opposite_exit(side): + if side == East: + return West + elif side == West: + return East + elif side == North: + return South + elif side == South: + return North + elif side == Northwest: + return Southeast + elif side == Southeast: + return Northwest + elif side == Northeast: + return Suthwest + elif side == Southwest: + return Northeast + + elif side == Up: + return Down + elif side == Down: + return Up + + else: + return side |