Two Player Game

Options
Hi,

I starting a new project and one of the features a looking to put in is a co-op/two player option and I was wondering how I would do this with PUN. For example, I would like two players to connect with each other and play a game. I would also like one player to start a game and choose to connect with a specific player. So when player 1 starts they will locate player 2 and then a new game would start.

From reading the documentation my first thoughts are player 1 starts a game and creates a room. This room could be limited to one extra player. The second player starts, goes to the room and the game starts.

Would this be correct?

If so, can the first player limit "who" can enter the room and how would the player comminute to the other player what room they should join?

Thanks

James

Comments

  • Tobias
    Options
    You are right. A player creates a room and sets the maxplayers (in your case: 2).
    See Marco Polo Tutorial for a simple Matchmaking intro:
    http://doc.exitgames.com/en/pun/current ... marco-polo

    If you want a friend to join, you can set the rooms "visible" value to false when you create it. then no one will accidentally join it and you can send your room's name to the friend. Or your friends can use FindFriends() on the Master Server until they find out which room you created.