The AStar2D implementation was grid-based using tilemap. The game is top-down, and the implementation of AStar2D has been made using any examples floating around the Internet.
in the result Image because it’s 8 ways and it checks for the neighbors [ top-left, top-right , bottom-left, bottom-right] and if they are empty then the object should move to them without checking if the left or up tiles are free, my advice is to use the 4 ways for path finding then simplify the path to have 8 diagonal movement
you just need an algorithm like the pixel perfect algorithm to simplify the path after finding it
Whalesstate | 2021-09-25 13:03
Thank you!
So, I made it in 4 directions first, and when it was diagonal, I put 0 in x and y, respectively, and after checking, if both are empty, I moved it diagonally.