I am trying to build a simple turn-based facebook game on javascript. So in my game when a player (i.e Alex) presses a submit button and ends his turn, it is another player’s (i.e Jack) turn. My problem is the following: At first the game runs on Alex’s pc. Then, after an event trigger on Alex’s pc, the game must go on (or make a new instance of it) on Jack’s pc.Is it part of a request dialog (player to player)? How can I implement this?
Share
If you want to do something like SongPop, where it doesn’t matter when exactly second player will take his turn, you can simply do this in those few steps:
If you want users to take more turns, like for example in chess game, steps 2-6 will be repeated. And, of course, think about informing player that didn’t take the last turn when the game is over.
If you want to do something like Rummikub, where each player have to be online in the same time, your logic would be more complicated and you will not use app requests to notify user that he should take his turn. In this case you would need realtime checking of actions taken by players and informing other players about those actions.