So I'm using Graphics2D in order to create a simple game where I have the world divided into a grid, and when I click somewhere in the world, it gets the players current position and the position I clicked at which is mouseClickPosition.x / tileSize.
it then uses that in order to calculate the shortest path within the grid by using the BFS algorithm.
The issue has nothing to do with the algorithm itself, it's more so when I'm actually moving the rectangle from point A to point B diagonally.
So moving diagonally is fine, but if I'm trying to walk diagonally when there is a non walkable tile, I want it to walk around.. And it does!
However, if I click fast enough, it's going to slide across because "it thinks" that it's at a certain position due to the fact that the top left corner is at that position is within that range.