I want to build an iPhone game, which is real-time and turn-based, with a back-end implemented in Rails.
The game flow is like the following:
Player A and Player B will queue for a match. Then the server willmatch these 2 players into a match which is turn-based.
When the match starts, Player A waits while Player B is entering hisaction, and Player B waits while Player A entering his action.
The game ends after 5 or 6 turns.
What I am planning is that to use "Devise" for user authentication, and a RESTful API. The iOS game client will keep sending request to the server and ask if the opponent has finish his/her moves or not.
Is this approach correct for this kind of application? As this is the first time I use Rails to build an app, I am not sure which approach should be used. And there are far too many libraries or tools to choose from.
And if I use a RESTful API, how can I send request like
- has_opponent (when queuing for a match)
- take_actions?actions={...} (submitting the user actions at the end of each turn)
Any good suggestions?