I'm trying to make a multiplayer game. BTW I'm not using the multiplayer object. I'm using websocket.
Each player can create turrets. When a turret is created it should get another turret as target.
If I try to use a single sprite object for everyone 's turret (they look identical but I can use a simple text to see who "owns" a turret) and the event:
- Code: Select all
Turret -> Add Target -> Turret
Turret does not make difference from "my" turret and "enemy" turret (also the turret will self target).
I can solve this by using two sprites objects; let say my turrets use the sprite "Turret" and enemy's turrets use the sprite "Enemy_turret".
So I can do:
- Code: Select all
Turret -> Add Target -> Enemy_turret
Enemy_turret -> Add Target -> Turret
In this way my turrets should only target Enemy's Turrets and viceversa.
But what if I want to have an undeterminated number (or a max of 5) of players?
Should I clone all those sprites, events and condition? Is there (I think surely there is) a better way to do it?
BTW I have an instance var in each turret with the player ID. But I can't find a way to use this as filter.
Thank you!!!