# Characters that walk around walls?

**URL:** <https://forum.kirupa.com/t/characters-that-walk-around-walls/310553>\
**Category:** programming\
**Created:** [June 13, 2010, 2:10pm UTC](https://forum.kirupa.com/t/characters-that-walk-around-walls/310553 "2010-06-13T14:10:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jMilstead](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@jMilstead](https://forum.kirupa.com/u/jMilstead)\
**Post date:** [June 13, 2010, 2:10pm UTC](https://forum.kirupa.com/t/characters-that-walk-around-walls/310553/1 "2010-06-13T14:10:48Z")

</div>

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.
