Play game flow - Homophone/HomophoneGame GitHub Wiki

  1. visit play with a game id and no round
  2. If game.roundsCount is 0 make new round
  3. '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
    }
  }
}
  1. onChoice: mutation ChooseWord(roundId: ID!, word: string)
  2. onRope: mutation ChooseWord(roundId: ID!, null: string)
  3. onChooseWord: compare user answer to round.correctAnswer and return an optimistic response
  4. 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