Play game flow - Homophone/HomophoneGame GitHub Wiki
- visit play with a game id and no round
- If
game.roundsCount
is 0 make new round
- 'get ready' state while loading the mutation, loading the gif image, and waiting for min-duration timer to finish
mutation NewRound(gameId: ID!) {
roundType {
id
correctAnswer
game {
livesRemaining
}
}
}
- onChoice: mutation ChooseWord(roundId: ID!, word: string)
- onRope: mutation ChooseWord(roundId: ID!, null: string)
- onChooseWord: compare user answer to round.correctAnswer and return an optimistic response
- enter 'correct', 'incorrect', or 'gameOver' state based on mutation results.
- gameOver state: setTimeout before showing results screen
- correct or incorrect state:
- back to step 2: 'get ready' state while loading the mutation, loading the gif image, and waiting for min-duration timer to finish