From 423cfe133ae8a8f9d7a87b2c4d151af3fd7aa7fc Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 18 Feb 2025 20:24:41 +0800 Subject: feat: entering new rooms - door connects two rooms - detects if player enters a door, if so, then switch room and update player location --- objects/Direction.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 objects/Direction.lua (limited to 'objects/Direction.lua') 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 -- cgit v1.2.3