Sequence Diagrams
Use Case 1 - Start Game Session (Host)
As a host, I want to initiate a new game session from my device, so that players can join.
- The host opens the game and chooses to start a new session.
- A unique game code and QR code is created and shown on their screen.
- The host shares this code (or QR code) with those who want to join.
- As players join the game, their hippo avatars and roles appear on the host’s screen.
- Once at least one AAC user and one hippo player have joined, the host can begin the game.inputs.
Use Case 2 – Join Game Session (Hippo Player or AAC User)
As a hippo player or AAC User, I want to join a game session using a code so that I can play the game.
- A player opens the game on their device.
- They enter or scan the game code that was shared by the host.
- They choose a role: Hippo Player or AAC User
- Hippo Players also choose a hippo color.
- Once joined, they wait until the host starts the game.
Use Case 3 – Start Game (Host)
As a host, I want to start the game after players have joined so that everyone can begin playing.
- The Host Player sees a "Start Game" button on their game interface.
- The Host Player taps "Start Game".
- The Host Player's client sends a start_game command to the backend via WebSocket.
- The backend updates the central game state in PostgreSQL to state = 'playing'.
- The backend broadcasts the updated game state (playing) to all connected clients via WebSocket.
- All clients (Host, AAC User, and Other Players) immediately switch to the gameplay screen and the game begins for everyone at the same time.
Use Case 4 – Control Food Queue (AAC User)
As an AAC user, I want to control the food in the queue so that I can challenge players.
- During the game, the AAC user sees a menu of foods they can pick from.
- They tap the foods they want the other players to go after.
- They can also choose a special effect, like Freeze or Grow
- The foods they picked becomes the new target for all the hippos playing.
- The chosen food appears on screen, and players try to catch it with their hippos.
Use Case 5 – Eats Food (Player)
As a player, I want to move my hippo on my side and eat the correct food so that I can earn points.
- Food spawn out from the center of the screen toward each hippo player.
- The screen shows which food the AAC user has selected as the target.
- The player moves their hippo along their edge of the screen to try to catch that food.
- If they catch the correct food, they earn a point — and may receive a bonus effect like growing bigger.
- If they catch the wrong food, they may lose a point or trigger a penalty like being frozen.
- The game continues until the timer runs out.
Use Case 6 – Game Timer and End State (Host)
As a player or AAC user, I want the game to end automatically after 3 minute so we know when the round is over.
- The host starts the game. (See Use Case 3.)
- The backend WebSocket server starts the timer and tracks the countdown for the game session.
- When the timer reaches 0, the backend sets the game state in PostgreSQL to ended.
- The backend broadcasts the game end and scores to all clients via WebSocket.
- A score screen is shown to all players.
- The host sees a “Play Again” or “End Game” option.
Use Case 7 – Play Again (AAC User or Player)
As an AAC user or player, I want to play another game session after a round ends.
- After the game ends, if the host taps or uses audio to “Play Again”, go to Use Case 3.
- If the host taps or uses audio to “End Game”, all users are redirected to the game homescreen.