summaryrefslogtreecommitdiff
path: root/objects/Direction.lua
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-02-18 20:24:41 +0800
committerEltrac <hi@guhub.cn>2025-02-18 20:24:41 +0800
commit423cfe133ae8a8f9d7a87b2c4d151af3fd7aa7fc (patch)
tree10c4d8eedcc65155b0f234d6d74be6663bcf5bb0 /objects/Direction.lua
parent875cc3e70c11e589c548775c3208659f50daf7df (diff)
feat: entering new rooms
- door connects two rooms - detects if player enters a door, if so, then switch room and update player location
Diffstat (limited to 'objects/Direction.lua')
-rw-r--r--objects/Direction.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/objects/Direction.lua b/objects/Direction.lua
new file mode 100644
index 0000000..eaf843a
--- /dev/null
+++ b/objects/Direction.lua
@@ -0,0 +1,12 @@
+Direction = {
+ LEFT = 1, RIGHT = 2, TOP = 3, BOTTOM = 4
+}
+
+OppositeDirection = {
+ [Direction.LEFT] = Direction.RIGHT,
+ [Direction.RIGHT] = Direction.LEFT,
+ [Direction.TOP] = Direction.BOTTOM,
+ [Direction.BOTTOM] = Direction.TOP
+}
+
+return Direction, OppositeDirection