summaryrefslogtreecommitdiff
path: root/include/algs.lua
diff options
context:
space:
mode:
authorSteph Enders <smenders@gmail.com>2022-06-17 11:19:51 -0400
committerSteph Enders <smenders@gmail.com>2022-06-17 11:19:51 -0400
commit87a53f2a09a204ca9bcdde9c73db414c79075326 (patch)
tree5dbb78e554d01a8f9dd1e3cdf11d4077f0d15676 /include/algs.lua
parent49bb775d4cf9935b0f0d54daa358423ac786c9be (diff)
Add scene controls and win/loss scenarios
Setup ability to check collisions and transition game scene
Diffstat (limited to 'include/algs.lua')
-rw-r--r--include/algs.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/algs.lua b/include/algs.lua
index 2541102..c9e6438 100644
--- a/include/algs.lua
+++ b/include/algs.lua
@@ -104,7 +104,7 @@ local function pathfind(start_pos, target_pos, map)
end
if (push_moves(start_pos.x, start_pos.y, nil, visit_map, queue, target_pos)) then
- return { dx = start_pos.x - target_pos.x, dy = start_pos.y - target_pos.y }
+ return { dx = target_pos.x - start_pos.x, dy = target_pos.y - start_pos.y }
end
while queue:empty() ~= true do