Skip to content

Commit

Permalink
Update movement.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Kherae committed Oct 30, 2023
1 parent 9ebe3a3 commit 9136c90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/actions/movement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function move(args, board, node)
for _,yDir in pairs({0, -1, 1}) do
--util.debugRect(rect.translate(groundRect, {direction * x, y + yDir}), "blue")
if world.rectTileCollision(rect.translate(groundRect, {direction * x, y + yDir}), {"Null", "Block", "Dynamic", "Platform"}) then
--util.debugRect(rect.translate(groundRect, {direction * x, y + yDir}), "green")
move = true
y = y + yDir
break
Expand Down Expand Up @@ -267,14 +268,16 @@ function moveToPosition(args, board, node)
end

if entity.entityType() == "npc" then
--openDoorsAhead()
openDoorsAhead()
if args.closeDoors then
closeDoorsBehind()
end
end

coroutine.yield(nil, {pathfinding = mcontroller.pathfinding(), direction = mcontroller.facingDirection()})
end

return true
end
-- param velocity
-- param x
Expand Down

0 comments on commit 9136c90

Please sign in to comment.