Start Game Concurrently

Options
The game will only start when 2 player are joining the room. How i gonna to add this logic to PUN or i need to implement the logic on server side ?

Comments

  • Kaiserludi
    Options
    Just set the maxPlayers to 2 and close the room, when 2 players are in. Then you can start with your in game logic. There is no extra "start room" operation, as there is no need for such.
  • Actually now i'm using marco polo tutorial to test.
    I already set the maxPlayer to 2, but how i keep the player in the lobby instead of go to game before 2 players are joined?
  • Tobias
    Options
    You can't create a room AND stay in the lobby.
    Once the room is open, show a wait animation or something.
    To speed up things, you could just skip the lobby and join a random game. When this fails, create a game and wait. The next player will try to join randomly and finds you that way.
  • carmine
    Options
    xhtai4 wrote:
    Actually now i'm using marco polo tutorial to test.
    I already set the maxPlayer to 2, but how i keep the player in the lobby instead of go to game before 2 players are joined?

    What you need to do is...
    - Show a button to create a room
    - Show the list of current rooms with a button to join it them.
    - OnJoinRoom - change some sort of state variable and display some sort of message that you ware waiting for someone else to show up
    - If the room has more than one person in it, then Application.LoadLeve(" ... your other level...")

    My game is here: http://www.snagen.com/aeosrift

    -Carmine
  • xhtai4 wrote:
    The game will only start when 2 player are joining the room. How i gonna to add this logic to PUN or i need to implement the logic on server side ?
    xhtai4, checkout this topic also, maybe it is the solution right for your case: http://forum.exitgames.com/viewtopic.php?f=17&t=2071