# Does anyone have a consistent way of making sprites overlap each-other like walls?

**URL:** <https://forum.makecode.com/t/does-anyone-have-a-consistent-way-of-making-sprites-overlap-each-other-like-walls/36812>\
**Category:** Help\
**Tags:** game\
**Created:** [May 20, 2025, 11:27pm UTC](https://forum.makecode.com/t/does-anyone-have-a-consistent-way-of-making-sprites-overlap-each-other-like-walls/36812 "2025-05-20T23:27:46Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [August 30, 2025, 2:36am UTC](https://forum.makecode.com/t/does-anyone-have-a-consistent-way-of-making-sprites-overlap-each-other-like-walls/36812/11 "2025-08-30T02:36:14Z")

</div>

> [@\[Tutorial\] Making an Enemy Follow Multiple Sprites snake](https://forum.makecode.com/t/tutorial-making-an-enemy-follow-multiple-sprites/33914):
>
> The code gathers all the player-enemy distances, sorts them in an array to find the shortest distance, then for each player sprite, compares it’s distance to the shortest distance in the array to find the closest player. This player sprite is stored in the enemy sprite data and set as a follow target. All of this happens every game update so that the enemy can register a new closest player as fast as possible. The array before being sorted. After the sort, the 52.47… distance will be…

this might work^

> [@\[Tutorial\] Making an Enemy Follow Multiple Sprites snake](https://forum.makecode.com/t/tutorial-making-an-enemy-follow-multiple-sprites/33914/1):
>
> The distances are recorded to such an absurd number of precision that I’ve managed to use this method to register sprite overlaps as the default block can be quite buggy (especially when lagging or when dealing with multiple sprites)  
> Registering sprite overlaps is the same as finding the closest sprite, but it checks if the shortest distance is also short enough to be overlapping with the player.

---

_[View the full topic](https://forum.makecode.com/t/does-anyone-have-a-consistent-way-of-making-sprites-overlap-each-other-like-walls/36812)._
