# Tile Based Collision Detection

**URL:** <https://forum.kirupa.com/t/tile-based-collision-detection/212862>\
**Category:** programming\
**Created:** [January 15, 2007, 4:42am UTC](https://forum.kirupa.com/t/tile-based-collision-detection/212862 "2007-01-15T04:42:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregmax](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gregmax](https://forum.kirupa.com/u/gregmax)\
**Post date:** [January 15, 2007, 4:42am UTC](https://forum.kirupa.com/t/tile-based-collision-detection/212862/1 "2007-01-15T04:42:46Z")

</div>

I am following Tonypa’s Tile Based Tutorials and I have to say, they are great. His covers everything needed, except for one thing - Refering to Tutorial 9, [http://www.tonypa.pri.ee/tbw/tut09.html](http://www.tonypa.pri.ee/tbw/tut09.html), Stupid Enemy, I want to make this a NPC in stead of an enemy. So what do I do to make it so that I don’t walk right over the enemy/NPC? I am trying to develop an RPG, and it would look silly to have the character walk on top of the NPC. Can someone provided a snippet on how to make a collision detection with the NPC and not walk on top/under the NPC?

One last favor to ask: What if I want to talk to the NPC if I am within a half tile? Would anyone be willing to share info on how this as well?

Thanks a bunch in advance
