# How to prevent multiple sprites from overlapping each other

**URL:** <https://forum.makecode.com/t/how-to-prevent-multiple-sprites-from-overlapping-each-other/37442>\
**Category:** Help\
**Created:** [June 20, 2025, 9:21pm UTC](https://forum.makecode.com/t/how-to-prevent-multiple-sprites-from-overlapping-each-other/37442 "2025-06-20T21:21:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gl125371](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gl125371/32/29131_2.png) [@Gl125371](https://forum.makecode.com/u/Gl125371)\
**Post date:** [June 20, 2025, 9:21pm UTC](https://forum.makecode.com/t/how-to-prevent-multiple-sprites-from-overlapping-each-other/37442/1 "2025-06-20T21:21:15Z")

</div>

I have a player and 4 enemy sprites. The enemy sprites are going to follow the player using the path following extension, and right now, the enemies are overlapping each other. Is there any way to prevent the enemy sprites from overlapping each other?

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [June 22, 2025, 2:39am UTC](https://forum.makecode.com/t/how-to-prevent-multiple-sprites-from-overlapping-each-other/37442/2 "2025-06-22T02:39:33Z")

</div>

You could try making them pathfind somewhere random if they are overlapping, so whenever they overlap they would spread out until they weren’t anymore, and then they could keep following you. That would probably make them much slower, and it’s not a very good solution, just the one I came up with off the top of my head.

---

<div class="post-metadata">

**Author:** ![Gl125371](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gl125371/32/29131_2.png) [@Gl125371](https://forum.makecode.com/u/Gl125371)\
**Post date:** [June 23, 2025, 8:18pm UTC](https://forum.makecode.com/t/how-to-prevent-multiple-sprites-from-overlapping-each-other/37442/3 "2025-06-23T20:18:07Z")

</div>

Ok. I’ll try this.

---

<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:** [June 28, 2025, 12:49am UTC](https://forum.makecode.com/t/how-to-prevent-multiple-sprites-from-overlapping-each-other/37442/4 "2025-06-28T00:49:47Z")

</div>

if you were able to set tiles to be “occupied” that might help with the pathfinding

---

<div class="post-metadata">

**Author:** ![Gl125371](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/gl125371/32/29131_2.png) [@Gl125371](https://forum.makecode.com/u/Gl125371)\
**Post date:** [July 7, 2025, 10:18pm UTC](https://forum.makecode.com/t/how-to-prevent-multiple-sprites-from-overlapping-each-other/37442/5 "2025-07-07T22:18:38Z")

</div>

Thank you!
