# Food overlaps with wall tiles, unreachable

**URL:** <https://forum.makecode.com/t/food-overlaps-with-wall-tiles-unreachable/11799>\
**Category:** Help\
**Created:** [January 20, 2022, 6:26pm UTC](https://forum.makecode.com/t/food-overlaps-with-wall-tiles-unreachable/11799 "2022-01-20T18:26:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![julian1](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@julian1](https://forum.makecode.com/u/julian1)\
**Post date:** [January 20, 2022, 6:26pm UTC](https://forum.makecode.com/t/food-overlaps-with-wall-tiles-unreachable/11799/1 "2022-01-20T18:26:54Z")

</div>

im making a game where you collect food and then goes to a random position, only problem is sometimes it goes ontop of a wall tile, making it unreachable and i cant seem to find a sollution

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [January 20, 2022, 7:15pm UTC](https://forum.makecode.com/t/food-overlaps-with-wall-tiles-unreachable/11799/2 "2022-01-20T19:15:35Z")

</div>

There is a block in the tilemap extension that checks whether a location has a wall set on it:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b29c30adc2896185148a70044c6112262e55b6fa.png)  
Then you could say put this in a `while` loop and only `break` out of it if it’s _not_ a wall.

---

<div class="post-metadata">

**Author:** ![julian1](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@julian1](https://forum.makecode.com/u/julian1)\
**Post date:** [January 21, 2022, 5:21pm UTC](https://forum.makecode.com/t/food-overlaps-with-wall-tiles-unreachable/11799/3 "2022-01-21T17:21:52Z")

</div>

thanks for the help!, i dont quite understand what you meant but i ended up fixing it with the “tile to center of sprite is” block, thanks though 🙂
