2 projectiles when overlaps kills shooter

Hi there. I`m having trouble with an enemy shooting back, it kills them both. I set two types of projectiles, from the good soldier (player) to the enemy one and the enemy to the player, but when the condition overlaps sens a bullet from the enemy, he dies too. https://makecode.com/_EUYMhwicK943.

How can I have two projectiles when on set, you can only change de variable for the player and the enemy, but there is no changing the type of projectile on the OVERLAPS.

Welcome!

You are just making it harder on yourself. Why do you want to do that?

If you seriously don’t want to do that, you can use sprite data and set a boolean on the sprite saying whether it came from the enemy or not, and in the overlap handler, you can check the boolean to see which sprite should get destroyed.

It worked https://makecode.com/_gEzasUMKA87R
thanks

1 Like

I love the concept of your game. I changed position of the ‘pew pew’, based on whether the player is facing right or not, and when crouching down moving left and right. To get the position of the ‘pew pew’ correct, I had to resize the image. Keep up the good work.

We teach small children, and still learning how to get the best of Arcade. We are making a competition of videogame design using a Arcade and other platforms, so children become makers. we dont profit from the competition, will give mewbit as prize just to make them conquer their dreams (Monterrey, Mexico).
Thanks for the support.

2 Likes

Great improvement. Love the change.

1 Like

You are welcome.

I have been programming for quite some time and have been working with Arcade for a few months now. Even though the Javascript programming model offers better structure of code, I quite like how Blocks is simple and easy to implement. However, there are times when certain functions or assumptions can be become a pitfall. I am happy to offer advice and help when needed, so feel free to ask any questions.

Thank you, I’ll keep that in mind

And yes, each program has its ups and downs.But love it for little kids and not so little. Have a nice weekend.

Greetings
Rossana

1 Like

Hi Cosmo

I made another but something is not working https://makecode.com/_464C5Mdo8CHw
the bullet doesnt face left, can you help me please!