diff options
| author | Eltrac <hi@guhub.cn> | 2025-02-18 20:24:41 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-02-18 20:24:41 +0800 |
| commit | 423cfe133ae8a8f9d7a87b2c4d151af3fd7aa7fc (patch) | |
| tree | 10c4d8eedcc65155b0f234d6d74be6663bcf5bb0 /objects/Direction.lua | |
| parent | 875cc3e70c11e589c548775c3208659f50daf7df (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.lua | 12 |
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 |
