Skip to content

feat: implement entire game flow — rounds, scoring, host/skip/leave/restart#148

Open
asifEverest wants to merge 7 commits into
everest-engineering:mainfrom
asifEverest:assignment
Open

feat: implement entire game flow — rounds, scoring, host/skip/leave/restart#148
asifEverest wants to merge 7 commits into
everest-engineering:mainfrom
asifEverest:assignment

Conversation

@asifEverest

@asifEverest asifEverest commented Jun 27, 2026

Copy link
Copy Markdown

Summary

Implements the full multiplayer drawing game flow across multiple phases, plus a final bug fix for host-disconnect popup on exit.

Features

  • Room Setup & Lobby — Create/join rooms, polling-based participant sync, host-only game start
  • Game Start & Drawer Flow — Transition to playing state, drawer assignment, canvas drawing with strokes
  • Round Advancement & Scoring — Guess submission with correct/incorrect feedback, round progression, persistent round-result overlay with Continue/Restart/Exit Game buttons
  • Host Disconnect Detection — 30s inactivity threshold, hostDisconnected flag, "Claim Host" popup for non-host players
  • Drawer Disconnect & Skip Round — Drawer inactivity detection, "Notify Host" → badge on host's Skip Round button, host can skip the round
  • Game Over on Player ExitremoveParticipant() service, DELETE /:code/leave route, "finished" room status, persistent result card with Exit-only view
  • Name Validation — 20-char max enforced via Zod schema and frontend maxLength

Bug Fixes

  • Host-disconnected popup on exit — When the host (last active player) exits after other participants disconnected, removeParticipant now ends the game (status → "finished") instead of reassigning host to a stale participant, preventing the false "Host Disconnected" popup. Added room.status !== "finished" guard to HostDisconnectedBanner in LobbyPage for defense-in-depth.
  • Notify Host dismisses banner — Locally patch drawerDisconnected: false after suggestSkip() API call succeeds

Contributor

…advancement

- Canvas component with pen, color picker, clear; in-progress stroke survives polling redraws
- GuessForm with API submission and inline feedback (correct/wrong/rejected)
- GuessHistory, Scoreboard, RoundResultCard components
- Backend submitGuess/advanceRound with case-insensitive comparison, 100pt scoring
- POST /rooms/:code/guess endpoint
- Polling integration in GamePage with RoundResultCard overlay
- Server-managed 6s expiry for lastRoundResult
- Fix: in-progress stroke color now tracks current picker selection on every mousemove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant