I'm building a targeting system where a player can double click an object and set it as the attack target.
When a target is selected, I note down the peer id.
If a player sets a target, the distance between the attacker and the target should be calculated in a loop.
Since both objects are of the exact same type, I can't reference them correctly in the loop.
Can I select 2 different objects inside a foreach loop?
As an example:
Pick object Player by peer id 1 as Player1
Pick object Player by peer id 2 as Player2
Calculate distance of Player1 and Player2
The code is pretty much a template multiplayer game code, the problem starts at line 71.
If you can help, would be really nice.
Is there a part you don't understand?
If yes, I can re-phrase.
I really do need help on this one.
It's kind of a quirk of construct. You can add the player object to a family and pick the sprite on one hand and the sprite[family] on the other.
Develop games in your browser. Powerful, performant & highly capable.
Thank you very much
Can you provide a working example?
Would be so nice. I'm very confused at the moment.