Reputation: 11
How to make Multiplayer Turnbased game in unity Photon Networking like Tic Tac Toe.How to assign Controls on runtime through Photon Network.Is it done by change the ownershipp o game object?
Upvotes: 0
Views: 4362
Reputation: 91
Create a Turn Manager first, use either RPC or Custom Properties(preferably Room Custom Properties) to manage who is playing. Switch turn using GetNext() (see https://doc-api.photonengine.com/en/pun/v2/class_photon_1_1_realtime_1_1_player.html)
Depending upon who is playing allow drawing 'O' or 'X' on the board and sync board's data with RPC or Custom Properties.
Upvotes: 0
Reputation: 709
Have a look at the demo on https://doc.photonengine.com/en/turnbased/current/tutorials/memory-demo. It should be easily adaptable to your purposes. Make sure that you use proper tool for turnbased game. PUN does not support turnbased apps currently. So you need dotnet Photon Client SDK. There is no concept of object or ownership in this SDK. Use events or room properties to synchronize game state.
Upvotes: 1