For exemple :
Here we have an distance approximate distance of 68 and a tile distance of 6.
And here we have an distance approximate distance of 80 and a tile distance of 5.
If the tile size is 32x32 you can do it with the following. Basically the horizontal distance plus the vertical one. It’s called Manhattan distance after the city.
int(abs(Player.x-goal.x)/32)+int(abs(player.y-goal.y)/32)
Develop games in your browser. Powerful, performant & highly capable.
Thanks a lot !