On sprite of kind overlap block not working :(

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

and not this code:

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

1 Like

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!

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

3 Likes

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

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:

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

1 Like

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.

1 Like