Hi, I have a ‘Zombies’ and ‘Bats’ arrays (of type ‘Enemy’), I want to get their total attack damage and inflict damage to the player by that
amount, is it possible to do it in one go (loop)? or in a shorter way that what I’m doing?
Here’s what I’m currently doing
float totalDamage = 0
foreach(Zombie z in Zombies)
totalDamage += z.AttackDamage;
foreach(Bat b in Bats)
totalDamage += b.AttackDamage;
Player.InflictDamage(totalDamage);
Thanks