[Solved] Proper damage for multiple bullet collisions at once

How do I…

Cause an enemy to take an appropriate amount of damage from multiple bullet collisions on the same frame?

I’m making a Shmup-style game and the default weapon of the player has twin shots. However, I noticed that my zombie enemies die in the same amount of hits no matter if one bullet hits or two bullets hit. I temporarily got around that by having the bullets alternate and shoot faster to compensate so that the bullets just land on separate frames and essentially do what I originally wanted.

However, as I added more to the game, eventually the player will get upgrades that will allow once more for bullets to land on the exact same frame and do less damage than it should. So I have the same problem again and no idea have to properly fix it.

What is the expected result

For example, Zombie has 5hp and two bullets hit him on the same frame, he should be lowered to 3hp.

What is the actual result

Following the previous example, when the Zombie is hit with two bullets on the exact same frame, he has 4hp as if only getting hit by one bullet.

Related screenshots

Here is a screenshot of all the zombie code, including how the object reacts to colliding with the bullets.

if I understand you right, you have two bullets which are instances of the same sprite-object. In case both of them hit the target at exactly the same frame you want to reduce the damage for both bullets.

You can do that by adding a ‘For each’-event, like:

1 Like

Yep, this was exactly what I was looking for! Took me a while actually find it though. Had no idea there were more event options next to the add comment button up at the top until just now. Thanks a lot for the help!

1 Like