From 040bc85494b86004167ae323e3b77fcf48654051 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sat, 22 Feb 2025 10:38:47 +0800 Subject: 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 --- objects/Direction.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'objects/Direction.lua') 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 } -- cgit v1.2.3