Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [Multiplayer] Creating/moving sprites / objects

Author
Message
Alex Goaga
9
Years of Service
User Offline
Joined: 6th Nov 2015
Location:
Posted: 15th Apr 2017 12:58
Hey guys,

I'm following the https://www.appgamekit.com/documentation/examples/multiplayer/0_getting_started.htm documentation in order to create a simple multi-player game for 2 to max 4 players .
The simple idea that i want to make :
- a player hits with his sprite , another sprite already present on the map (let's say 3 times) , and then from that sprite, 2 more sprites should appear near them, like some items.

The question is how do i sent that concept to multi-player game? Until now, after hitting 3 times the sprite, 2 sprite appears only for the user that hit the sprite, for the other ones did not. <--main problem
Also, i would love to know if its possible after creating them to know their if it's possible to know their id's or something like that to create another function like : keeping pressed on the button on the keyboard or button activation to move the 2 sprites with the player if he touches them (like lift and move the object )

Thanks,
Alex
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 15th Apr 2017 14:46 Edited at: 15th Apr 2017 14:49
You want to count the hits in the host session
The host only should judge those things so cheating gets harder

So you check in the Host session if the sprites hit and after the 3rd time you send that event to all other clients

Not sure but maybe you are looking for: SetNetworkClientUserData() and GetNetworkMyClientID()

Using AGKv2 Tier1
Alex Goaga
9
Years of Service
User Offline
Joined: 6th Nov 2015
Location:
Posted: 15th Apr 2017 16:10
ok...can you give me an idea how to implement them ?
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 15th Apr 2017 17:24 Edited at: 15th Apr 2017 17:33
Pseudo code:

Host:


Client side:

Using AGKv2 Tier1

Login to post a reply

Server time is: 2024-11-22 15:02:36
Your offset time is: 2024-11-22 15:02:36