this is just a little pathfinding i made for the ghost. it works out what the most space is in each direction and then goes in the direction with the most space.