# How do i make enemy's not walk over each other? and if i have a sword how would i defeat only the enemy's that i hit?

**URL:** <https://forum.makecode.com/t/how-do-i-make-enemys-not-walk-over-each-other-and-if-i-have-a-sword-how-would-i-defeat-only-the-enemys-that-i-hit/46727>\
**Category:** Help\
**Tags:** game\
**Created:** [October 26, 2026, 10:39pm UTC](https://forum.makecode.com/t/how-do-i-make-enemys-not-walk-over-each-other-and-if-i-have-a-sword-how-would-i-defeat-only-the-enemys-that-i-hit/46727 "2026-10-26T22:39:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mebby](https://avatars.discourse-cdn.com/v4/letter/m/c2a13f/32.png) [@mebby](https://forum.makecode.com/u/mebby)\
**Post date:** [October 26, 2026, 10:39pm UTC](https://forum.makecode.com/t/how-do-i-make-enemys-not-walk-over-each-other-and-if-i-have-a-sword-how-would-i-defeat-only-the-enemys-that-i-hit/46727/1 "2026-10-26T22:39:11Z")

</div>

1e This is an very early boult of an new game of mine, multiple enemy’s are going to spawn and walk to the player, but i don’t like that the enemy’s can walk over each other. how do i fix it in this case?

2e the way i programed to have many enemy’s while using only one variable is by spawning duplicates. if i do: 'if “sword” overlaps with ‘‘enemy’’ then: destroy enemy. then only the last spawned enemy gets deleted and the one that got hit still exists. [https://arcade.makecode.com/S94144-29005-01539-34548](https://arcade.makecode.com/S94144-29005-01539-34548)

(also if there are other tips for what i currently have it is welcome)

---

<div class="post-metadata">

**Author:** ![Sword\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sword_studios/32/36911_2.png) [@Sword\_Studios](https://forum.makecode.com/u/Sword_Studios)\
**Post date:** [October 27, 2026, 10:51pm UTC](https://forum.makecode.com/t/how-do-i-make-enemys-not-walk-over-each-other-and-if-i-have-a-sword-how-would-i-defeat-only-the-enemys-that-i-hit/46727/2 "2026-10-27T22:51:31Z")

</div>

1. use @Sonicblaston’s sprite walls extension for that
2. do this

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/e/5e759e86b12045a2588d39b4eebf0b008dfd2fb7.png)
