# Sprite Data for Enemy Hit Points

**URL:** <https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676>\
**Category:** Game Design\
**Created:** [February 7, 2025, 7:36pm UTC](https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676 "2025-02-07T19:36:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pmaiurano](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pmaiurano](https://forum.makecode.com/u/pmaiurano)\
**Post date:** [February 7, 2025, 7:36pm UTC](https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676/1 "2025-02-07T19:36:11Z")

</div>

Logically this makes sense to me. Anyone know what I’ve done wrong? I can hit the snake once and it dies. I want it to have to be hit three times. Thanks.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/a/da447b3b12d35512c2227d3195f9ddbd3358daa5.png)

---

<div class="post-metadata">

**Author:** ![ADM\_F](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/adm_f/32/19808_2.png) [@ADM\_F](https://forum.makecode.com/u/ADM_F)\
**Post date:** [February 8, 2025, 7:55am UTC](https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676/2 "2025-02-08T07:55:22Z")

</div>

you need to destroy the projectile or pause when it overlaps

your code is fine but because there is no wait between each iteration it keeps running in quick succession

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [February 8, 2025, 8:52am UTC](https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676/3 "2025-02-08T08:52:28Z")

</div>

add destroy sprite

---

<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:** [February 8, 2025, 8:58am UTC](https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676/4 "2025-02-08T08:58:05Z")

</div>

When the projectile collides with the enemy and takes away a life, you should destroy the projectile. Otherwise, the overlapping code will continue to run indefinitely! :snake:

---

<div class="post-metadata">

**Author:** ![redSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/redsprite/32/34262_2.png) [@redSprite](https://forum.makecode.com/u/redSprite)\
**Post date:** [February 8, 2025, 9:01am UTC](https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676/5 "2025-02-08T09:01:13Z")

</div>

Write code in the “on sprite of kind (kind) overlaps otherSprite of kind (otherKind)” to have a "destroy (sprite) block.

Basically add code that destroys the projectile sprite.

---

<div class="post-metadata">

**Author:** ![BotWarrior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/botwarrior/32/25328_2.png) [@BotWarrior](https://forum.makecode.com/u/BotWarrior)\
**Post date:** [February 8, 2025, 9:05am UTC](https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676/6 "2025-02-08T09:05:04Z")

</div>

@pmaiurano are you destroying the projectile anywhere? It seems to me that your projectile is triggering this code multiple times, taking all of the life in a single go. Tell me if this helps 🙂

---

<div class="post-metadata">

**Author:** ![pmaiurano](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pmaiurano](https://forum.makecode.com/u/pmaiurano)\
**Post date:** [February 10, 2025, 6:14pm UTC](https://forum.makecode.com/t/sprite-data-for-enemy-hit-points/33676/7 "2025-02-10T18:14:02Z")

</div>

Thank you all! Works great now.
