From cda82448da92bb394eecc1d5de2261ff10c837c1 Mon Sep 17 00:00:00 2001 From: Dinko Galetic Date: Tue, 08 Jun 2010 23:02:03 +0000 Subject: 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. --- (limited to 'library') 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 -- cgit v0.9.1