# Overlapping player and enemy sprite immediately loses all lives inside of change life by -1

**URL:** <https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881>\
**Category:** Help\
**Created:** [March 31, 2023, 4:50pm UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881 "2023-03-31T16:50:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tbnb](https://avatars.discourse-cdn.com/v4/letter/t/53a042/32.png) [@Tbnb](https://forum.makecode.com/u/Tbnb)\
**Post date:** [March 31, 2023, 4:50pm UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881/1 "2023-03-31T16:50:04Z")

</div>

Is there a solution or fix to this? Please help!

---

<div class="post-metadata">

**Author:** ![randomuser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/randomuser/32/32505_2.png) [@randomuser](https://forum.makecode.com/u/randomuser)\
**Post date:** [March 31, 2023, 6:13pm UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881/2 "2023-03-31T18:13:07Z")

</div>

The game checks for an overlap every 1/30th of a second, or 30 times a second. If you have the player lose a life when it is overlapping an enemy, it will actually be overlapping that enemy 30 times a second and will lose its lives that fast! My recommendation is to move the player sprite out of the way of the enemy sprite after being hit, like knockback.

---

<div class="post-metadata">

**Author:** ![Samsano](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/samsano/32/8307_2.png) [@Samsano](https://forum.makecode.com/u/Samsano)\
**Post date:** [March 31, 2023, 6:15pm UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881/3 "2023-03-31T18:15:13Z")

</div>

Try putting a ‘pause 100ms’ block after taking away a life

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [March 31, 2023, 6:17pm UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881/4 "2023-03-31T18:17:28Z")

</div>

well you can use the

> **Timer Extention**
>
> microsoft/arcade-timers

end do this

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/084be5952bc2235e8e9b935e3dc693923a881d3a.png)  
however you will lose life once evrey (“The time you put in ms” in this case “500ms”)  
if ever you need more help come

> **Here**
>
> [help with pixel art end math issue's](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809)

---

<div class="post-metadata">

**Author:** ![Nerdiest](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/nerdiest/32/10678_2.png) [@Nerdiest](https://forum.makecode.com/u/Nerdiest)\
**Post date:** [March 31, 2023, 6:17pm UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881/5 "2023-03-31T18:17:37Z")

</div>

@Tbnb Welcome to the Makecode forums! (I hope your gonna love it here just as much as me!) you should make it so that the enemy sprite gets destroyed when it touches the player

---

<div class="post-metadata">

**Author:** ![\_jupiter](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_jupiter/32/28012_2.png) [@\_jupiter](https://forum.makecode.com/u/_jupiter)\
**Post date:** [April 3, 2023, 4:10pm UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881/6 "2023-04-03T16:10:16Z")

</div>

YES. ANOTHER CODER

best day of by life

---

<div class="post-metadata">

**Author:** ![Nayansharma](https://avatars.discourse-cdn.com/v4/letter/n/f0a364/32.png) [@Nayansharma](https://forum.makecode.com/u/Nayansharma)\
**Post date:** [August 27, 2024, 5:36am UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881/7 "2024-08-27T05:36:55Z")

</div>

Can someone help me i need to get this done by Saturday I need to make these enemies spawn over and over again not to much just like 5 I also need it to over lap to lower hp and points and also making the bullets damage. Could you also please add another level splash so when it hits the flag then a splash box says “time for level 2” that should be it thanks. Here is the link.

> **[Game digital 2024](https://arcade.makecode.com/S23680-66164-14788-73907)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![KIKIvsIT](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kikivsit/32/10492_2.png) [@KIKIvsIT](https://forum.makecode.com/u/KIKIvsIT)\
**Post date:** [August 28, 2024, 1:15am UTC](https://forum.makecode.com/t/overlapping-player-and-enemy-sprite-immediately-loses-all-lives-inside-of-change-life-by-1/18881/9 "2024-08-28T01:15:42Z")

</div>

@Nayansharma Here, you will find a lot of people willing to help you solve problems. What we do not do is finish assignments for others.

For help, please go ahead and start your own post with an accurate topic so that others can share their expertise to help you finish your game before your deadline.
