# On sprite of kind overlap block not working :(

**URL:** <https://forum.makecode.com/t/on-sprite-of-kind-overlap-block-not-working/40420>\
**Category:** Help\
**Created:** [November 13, 2025, 10:29pm UTC](https://forum.makecode.com/t/on-sprite-of-kind-overlap-block-not-working/40420 "2025-11-13T22:29:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DatCaptainNemo24](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@DatCaptainNemo24](https://forum.makecode.com/u/DatCaptainNemo24)\
**Post date:** [November 13, 2025, 10:29pm UTC](https://forum.makecode.com/t/on-sprite-of-kind-overlap-block-not-working/40420/1 "2025-11-13T22:29:50Z")

</div>

> [@On another topic](https://forum.makecode.com/t/40416/1):
>
> So for some reason my on sprite of kind block works with this code:
> 
> ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/2/2/22a21a76e37df6623ec5253a4837b101a8693c38.png)
> 
> but not this code:
> 
> ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/4/f/4f86f33796e14ccecab4808975e9344fbb8c7bd4.png)
> 
> and yes, I’ve checked, the image is actually the wave. Some background info is that this is for a sailing game, I’m trying to have a Kraken boss send waves at the boat. The waves are supposed to dissipate into bubbles after taking a chunk out the player’s health but it is not working.
> 
> * * *

So for some reason my on sprite of kind overlap block works with this:

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

and not this code:

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

So this is for a sailing game where I have a Kraken boss send waves at the player’s boat. I’m trying to distinguish the projectile because the boat can’t send any cannonballs to the enemy to defeat him.

Project link: [https://arcade.makecode.com/S15609-42312-11259-01967](https://arcade.makecode.com/S15609-42312-11259-01967)

---

<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:** [November 14, 2025, 12:13am UTC](https://forum.makecode.com/t/on-sprite-of-kind-overlap-block-not-working/40420/2 "2025-11-14T00:13:04Z")

</div>

Use Sprite Data to filter out which projectiles shouldn’t hurt one another.

Just go to the extensions tab and install it to do what I suggested, thanks!

---

<div class="post-metadata">

**Author:** ![Bilangus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/bilangus/32/33219_2.png) [@Bilangus](https://forum.makecode.com/u/Bilangus)\
**Post date:** [November 14, 2025, 12:15am UTC](https://forum.makecode.com/t/on-sprite-of-kind-overlap-block-not-working/40420/3 "2025-11-14T00:15:14Z")

</div>

Welcome! The logic tab’s compare block cant be used on images, and should be replaced with the one from the “images” advanced tab:

 ![1000081318](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/a/8a3f4f09d6d9be55fd3154c8a6e94ca32e40f09e.jpeg)

---

<div class="post-metadata">

**Author:** ![Johns\_tired](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/johns_tired/32/34228_2.png) [@Johns\_tired](https://forum.makecode.com/u/Johns_tired)\
**Post date:** [November 14, 2025, 12:55am UTC](https://forum.makecode.com/t/on-sprite-of-kind-overlap-block-not-working/40420/4 "2025-11-14T00:55:42Z")

</div>

you could have multiple of the same “wave” asset check your assets

---

<div class="post-metadata">

**Author:** ![DatCaptainNemo24](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@DatCaptainNemo24](https://forum.makecode.com/u/DatCaptainNemo24)\
**Post date:** [November 14, 2025, 3:35am UTC](https://forum.makecode.com/t/on-sprite-of-kind-overlap-block-not-working/40420/5 "2025-11-14T03:35:23Z")

</div>

I did what Bilangus said and it works.. but now I’ve run into another error.

I changed up the counting mechanism because I realized I wanted a resettable timer variable. The code still works.. except this:

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

the while loop seems to be problematic. It all works fine without the while loop (except the enemy projectiles don’t shoot of course), but when I add it back in it doesn’t work. Also can someone help me fix my status bar because it isn’t going on top of the enemy?

Thanks,  
DatCaptainNemo24

---

<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:** [November 17, 2025, 9:33pm UTC](https://forum.makecode.com/t/on-sprite-of-kind-overlap-block-not-working/40420/6 "2025-11-17T21:33:24Z")

</div>

If you take the code inside the while loop and put it into a forever block with an IF to check the conditions it will probably work. Most likely the reason it’s not working is because the While loop is stopping everything from running until it’s done, so you have to move that code out somewhere else instead of using a While loop.
