I'm having a dilemma trying to decide how to route the enemies in my game the best way. Right now they go straight toward the player, and will slide along walls if the player is diagonal from them (they will not go through walls). The problem is that if a player is directly on the other side of the wall (walls are red in the picture), the enemies will just stay against the wall, so I need to re-route them to go through the nearest doorway. What do you guys think the easiest way to do this would be?
(the player is the dot inside the walls, the enemies spawn outside)