My game has many different type of good guys and many different type of bad guys. They will all be firing projectiles at each other but I don't want any accidental collateral damage to occur for either alignment. So bad guys should not be able to hit/damage other bad guys and good guys should not be able to hit/damage other good guys.
The way I'm thinking of solving this is by making it so that the
alignment property that can be either
bad. And I'll only let collision happen if the
class Attack boolean didAttackCollideWithTarget(target) return attack.source.alignment != target.alignment and collisionDetected(attack.source, target)
This is pseudo-code, of course.
But I'm asking this question because I get the sense that there might be a much more elegant way to design this besides adding yet another property to my