impact-astar-for-entities
impact-astar-for-entities copied to clipboard
Disable Diagonal Movement Completely
Hi, I'm having problems with having to disable diagonal movement completely for a tile based movement game. I already set the diagonalMovement in getPath to false, but it still follows an angle particularly in open or wide areas without obstacles, screenshot below.

Can you create a small demo and share the code, so that others can confirm the issue on their end?
Yes, here it is: https://www.dropbox.com/s/0v89cxsrzg75w2v/astar.zip?dl=0
I have already set all entities getPath diagonalMovement parameter to false and edit a part of the level to be wider like the screenshot above.
The bug/issue shows when you click or select a new destination target while the player is moving on the current destination. Example: make the first target farther/wider and opposite then click the next target right in the middle or between the first target.
Decreasing also the pathTimer to milliseconds triggers the diagonal behavior even when set to false.
this.pathTimer = new ig.Timer(.5);