Hello everyone,
In my game I have multiple factions. And they basically have some friendships and hostileships.
So basically enemies are like this:
F1 > F4
F2 > F3
F4 > F1 and F3
F3 > Everyone.
Now in my setup, I have an object (the actual enemy sprite) and a hidden "range" sprite as child that I create at runtime so can't pre-setup it. When an object enters range, I'd like to detect which faction it is + which faction I belong to and see if it matches an enemy.
The only way I can think of this happening is to have an "id" for each faction and then have variables like "enemy1, enemy2, enemy3, enemy4" and a "selfID" in the range object. Upon collision I compare if selfID is "F1" then ignore everyone but F4 from enemy1, enemy2, enemy3 and enemy4.
But I feel this method is very crude and will end up breaking soon. Any ideas how I can tackle this so I can detect which kind of object entered and how I deal with it?