Pacman: how do the eyes find their way back to the monster hole?
Actually, I’d say your approach is a pretty awesome solution, with almost zero-run time cost compared to any sort of pathfinding. If you need it to generalise to arbitrary maps, you could use any pathfinding algorithm – breadth-first search is simple to implement, for example – and use that to calculate which directions to encode … Read more