# Enemy taking too much damage when colliding with multiple projectiles

**URL:** <https://forum.makecode.com/t/enemy-taking-too-much-damage-when-colliding-with-multiple-projectiles/13269>\
**Category:** Help\
**Tags:** game\
**Created:** [April 25, 2022, 5:22pm UTC](https://forum.makecode.com/t/enemy-taking-too-much-damage-when-colliding-with-multiple-projectiles/13269 "2022-04-25T17:22:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregg](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@gregg](https://forum.makecode.com/u/gregg)\
**Post date:** [April 25, 2022, 5:22pm UTC](https://forum.makecode.com/t/enemy-taking-too-much-damage-when-colliding-with-multiple-projectiles/13269/1 "2022-04-25T17:22:27Z")

</div>

So the problem I’m having is that when my player fires multiple projectiles in a row and they all collide with the boss enemy some won’t be destroyed by the “On Overlap” function, and damage the boss multiple times without being destroyed. Does anyone know a solution to this? I think adding a delay to the firing projectile function so too many aren’t fired at one would work but idk how to do that. Also any other suggestion to the game are welcome.

(Just go straight down the center hallway to the final boss room, pressing A fires projectiles but only down)

> **[Final Project](https://arcade.makecode.com/83171-13055-99864-04531)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![AqeeAqee](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/aqeeaqee/32/5424_2.png) [@AqeeAqee](https://forum.makecode.com/u/AqeeAqee)\
**Post date:** [April 26, 2022, 5:03pm UTC](https://forum.makecode.com/t/enemy-taking-too-much-damage-when-colliding-with-multiple-projectiles/13269/2 "2022-04-26T17:03:15Z")

</div>

Replace “projectile” to “otherSprite”, which can be grag out from above line.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/69b50ef20c3931f59fa055de2183620e59267568.png)

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f1a39534a84564f4e424dbfe850931389df46589.png)

One fire a time worked because the variable storing the **last** fire projectile you just created. But 2 fire at same time, it never pointing to the prev one any more, so you can’t detroy prev fire with it.  
Instead, using the “otherSprite” please, it always storing the fire overlaping right now.

---

<div class="post-metadata">

**Author:** ![gregg](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@gregg](https://forum.makecode.com/u/gregg)\
**Post date:** [April 27, 2022, 5:18pm UTC](https://forum.makecode.com/t/enemy-taking-too-much-damage-when-colliding-with-multiple-projectiles/13269/3 "2022-04-27T17:18:24Z")

</div>

Yep that worked, Thanks!
