diff options
| author | Eltrac <hi@guhub.cn> | 2025-02-22 10:38:47 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-02-22 10:38:47 +0800 |
| commit | 040bc85494b86004167ae323e3b77fcf48654051 (patch) | |
| tree | 82aeeeb8ad09744519b4c99f706a5ca5102c1018 /objects/Direction.lua | |
| parent | 7a403b57dadc10a81e98f5cf4b68a0128e100695 (diff) | |
fix: unnatural movement around obstacles
- predict next location based on moving direction
- add UP and DOWN to Direction as aliases of TOP and BOTTOM, for moving directions instead of location
Diffstat (limited to 'objects/Direction.lua')
| -rw-r--r-- | objects/Direction.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/objects/Direction.lua b/objects/Direction.lua index 8653250..137f970 100644 --- a/objects/Direction.lua +++ b/objects/Direction.lua @@ -1,10 +1,12 @@ Direction = { - LEFT = 1, RIGHT = 2, TOP = 3, BOTTOM = 4 + LEFT = 1, RIGHT = 2, TOP = 3, BOTTOM = 4, UP = 3, DOWN = 4 } OppositeDirection = { [Direction.LEFT] = Direction.RIGHT, [Direction.RIGHT] = Direction.LEFT, [Direction.TOP] = Direction.BOTTOM, - [Direction.BOTTOM] = Direction.TOP + [Direction.BOTTOM] = Direction.TOP, + [Direction.UP] = Direction.DOWN, + [Direction.DOWN] = Direction.UP } |
