Hello,
I am not sure about this, maybe I am just tired, but I have a problem:
I have one family for each player (Red Player, Blue Player, etc.). Those families hold all structures and units in my game.
Now, I have separate families for those as well (Units for my units and Structures for my structures).
What I need to do is this:
Get the coordinates of my mouse cursor (I know, MouseX and MouseY) and see what friendly structure is closest to it.
For example:
I am the blue player, my cursor is closest to a red structure. However, this is not the one I want to pick in my game code. I want to ignore all structures but the blue ones and there pick the closest one.
The way I see it, my only means of doing so would be to split the player families further, so that in addition to Units, Structures and Blue Player I would get Blue Structures and Blue Units.
If at all possible, I would like to prevent that for sanity's sake.
Any ideas? Maybe something I just overlooked?
Cheers,
Sebastian