I'm working on a two player online minigolf.
I read the chat and pong tutorial.
In my game, I want to call a function only when the client(s) has finished spawning all the elements from the server (both players balls).
Actually, the function (which targets one of the two balls) is called before the client has spawned the balls so the client can't find the targetted ball when it receives the server message sent from the function.
I don't know if I explain well.
The purpose is having, on the first turn of the game, each player seeing only the first player (chosen randomly) ball, whether the first player is host or client.
The 2nd player ball will be visible only then the first player has ended his turn.
In my events, the server immediately starts determining which ball to display in order to send this information to the client, but the client hasn't spawn both balls yet so it can't find it.
So I'd like to wait until the client has no more balls to spawn before doing stuff.
Any idea ?
http://canapin.com/construct/canagolf/0 ... lf-06.capx (open two windows)
Event 41 : this is where the server will broadcast the right ball (to set visible) to the peers
Event 33 : this is where the client creates all the players balls : because it takes some times, the event 41 is called way before.
If I broadcast the ball peer Id during the event 41and I create an "on peer message" event for the client, the ball having this peer id doesn't exist yet client side and that's the problem.
Sorry, english isn't my native english and it's quite difficult to explain with so little vocabilary.