How do I MP game?

Get help using Construct 2

Post » Fri Jun 02, 2017 10:50 am

I download the MP game example and add it: "Touch | On touched sprite | Sprite destroy" so if I click on "sprite" it will disappear and it works but since it is MP I tried 2 phones so that all 2 phones But this does not disappear.
If I clicked, I just clicked on the click on the other.
If this is MP, why does not the "sprite" disappear on all 2 phones? Is it not the case if you connect to the server then put them in a layout? Why does not the sprite disappear on the other phone?
Even trying a multiplayer game I do not really understand it.
B
7
S
1
Posts: 16
Reputation: 455

Post » Fri Jun 02, 2017 11:09 am

You need Synchronized objects and associate the objects with the peers.
When the peer disconnects from the host/room, the host automatically destroys the objects, which in turn destroys the objects on the other peers.

Adding a touch event on the host side, to destroy a player associated object will destroy the given object on the peers as well.
But the other way around will fail:
Adding the touch event on a peer (not host) to destroy any of the player objects ... the object in question would simply be recreated.

You can however, from the peer end, send a message to the host, with a reference to the object you want to destroy, and have the host destroy the object for the peer.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Fri Jun 02, 2017 11:50 am

Message: Blendi1223 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I added:
System on start of layout :Multiplayer sync "sprite" (with position and angle,precision Normal (float, 4 bytes) at Normal bandwidth (unpredictable)
Multiplayer associate "Sprite" with peer Myusername.

But this only shows sprite on both sides if only the "host" is clicked on sprite.

Screenshot: http://prntscr.com/ff1itp
B
7
S
1
Posts: 16
Reputation: 455

Post » Fri Jun 02, 2017 4:55 pm

Needs to be associated with the correct peers.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572


Return to How do I....?

Who is online

Users browsing this forum: Euduardo, Kin, mikehive, ratboy3, tinhofiel, Yahoo [Bot] and 31 guests