Skip to content

Scribble lab#85

Open
durgamkeerthana wants to merge 20 commits into
everest-engineering:mainfrom
durgamkeerthana:scribble-lab
Open

Scribble lab#85
durgamkeerthana wants to merge 20 commits into
everest-engineering:mainfrom
durgamkeerthana:scribble-lab

Conversation

@durgamkeerthana
Copy link
Copy Markdown

@durgamkeerthana durgamkeerthana commented Jun 4, 2026

Summary

This PR implements five features for the multiplayer Scribble drawing game. Backend uses Express/TypeScript/Zod with in-memory state (no DB). Frontend uses React 18/TypeScript with HTTP polling (no WebSockets).

Phase 1: Room Setup & Lobby

  • POST /rooms — Create room with 4-char code, returns participantId
  • POST /rooms/:code/join — Join lobby, up to N players
  • GET /rooms/:code — Poll room state (used throughout all features)
  • Lobby UI with player list, room code badge, start button (host-only)
  • POST /rooms/:code/start — Host starts game; validates ≥2 players, non-empty names

Phase 2: Game Start & Drawer Flow

  • Round creation with single drawer, hidden secret word (hidden from guessers until round ends)
  • Canvas drawing with stroke persistence in memory
  • POST /rooms/:code/canvas — Add stroke (drawer only)
  • POST /rooms/:code/canvas/clear — Clear canvas (drawer only)
  • Drawer sees secret word; guessers see "Waiting for drawer"

Phase 3: Gameplay Interaction

  • POST /rooms/:code/guess — Guess submission (case-insensitive, trimmed)
  • Correct guess validation, round completion on all-correct
  • Guess history with correct/incorrect indicators
  • 2s HTTP polling for real-time sync
  • Validation: drawer cannot guess, empty guesses rejected, unknown room/participant errors

Phase 4: Result & Restart + Enhanced Results Screen

Result Screen: Shows secret word, final scores, read-only canvas replay, guess activity
POST /rooms/:code/restart — Host-only full reset: lobby status, cleared scores/rounds, preserved participants
All-correct detection transitions round to result immediately
Scoring: 100 points per correct guess; duplicate correct guesses award no additional points

Contributor

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