I'd like to do something like this:
There's many soldiers on the map. They all moves randomly. All of them has its own crosshair (aim). If soldier sees another soldier in his crosshair he shoots.
There's my pseudo-code for this:
<font size="2">events:
- Start of level
- for every soldier
Action:
- create crosshair
- pin crosshair to soldier
event:
- crosshair collides with soldier
action:
</font>
But wrong soldier is firing (not shooter-soldier but target-soldier is shooting).
I think it should be done like this:
<font size="2">events:
- Start of level
- for every soldier
Action:
- create crosshair
- pin crosshair to soldier
- for that crosshair set this soldier as parent
event:
- crosshair collides with soldier
action:
</font>
Is there any action similar to parenting?