move pathfinding code to GameMachine