Question: Sidescrolling multi-unit battle

Hi all,

I'm working on a concept that is probably a bit advanced for a beginner like me, but I'm giving it a go and was wondering if anyone has some advice.

In the game, I spawn multiple "good guy" actors to fight multiple "bad guy" actors on a 2D sidescrolling type scene. When the actors get within range, they fight. While fighting, each actor deals a random number in damage at a certain rate. What I want to have happen is each attacker only hits one other unit and that unit loses hit points based on the attack damage.

I am able to make a table and have it pull values for attack damage and attack speed.

The problem I have is that I allow units from the same side to overlap one another. So I cannot simply have damage dealt when the units are colliding, because then one attacker would deal damage to any number of enemies stacked close to each other. And I also haven't found a good way to simply pass an attribute (damage) from one actor to another actor (subtract hp).

Hope that is clear. Any suggestions would be very helpful!
Sign In or Register to comment.