I am making a game where the NPCs only walk around the walls. So if they are in a square room they will walk in a square until one of the wall is removed. I was wondering what you all think would be the most efficient/elegant way to solve this problem. I have been thinking about it for a day or two now and the only way I can think to do it is with a bunch of conditional statements checking where the walls are. I know there is probably a much better way to do this. any suggestions?
My game is tile based btw.