Im trying to get my Real time strategy kind of game working, but im Stuck at the attack part.
I have a family called MOVABLE, and it contains various variables like Speed, Faction, Health
I'm Planning to have more subclasses as sprites that will determine if the unit is a archer / soldier / mage / 3headed Unicorn.. whatsoever
Here is where im Stuck:
When a unit from the movable family is in range of another unit from the moveable family with another faction it should automaticle initiate the attack by setting a target position into the Enemy (just coordinates).
The thing is when i write :
if MOVABLE has LOS of MOVABLE
i cant figure out how to distinguish between the two units and read out the faction of the other movable :O
i hope you guys understand my problem and can help me to find a way to fix it.