Commit graph

18 commits

Author SHA1 Message Date
5190ec19a3 feat(frontend): add in-match orchestrator and multiplayer scoreboard
New multiplayerMatch.ts (MultiplayerMatch class) drives one round: syncs
ThemeGuessGame/OpponentView to a round:start payload, relays local
category assignments as round:progress, forwards opponent round:progress
to OpponentView, drives timerHud's countdown (submitting the local color
map as round:submit at expiry), and renders a two-column scoreboard on
round:reveal via computeMatchResult.

ThemeGuessGame gains an optional onCategoryAssigned?(id, hex) constructor
callback, invoked as the last step of applyColor.

timerHud's TimerHudOptions gains an optional onExpire?() callback on the
countdown variant, fired once when endsAt passes.

resultView.ts gains renderMultiplayerResult() for the two-column
you/opponent scoreboard + winner banner (equal overall -> explicit draw).

index.html/style.css: additive #mp-scoreboard/#mp-winner-banner/#mp-you-*/
#mp-opponent-* markup and .mp-* styles; existing single-player result
markup untouched aside from adding id="solo-score-meter-wrap" so it can
be toggled off during a multiplayer reveal.
2026-09-10 12:16:15 -03:00
a7cc3e7d8c feat(backend): add private rooms with create/join and match repeat
Implements PROTOCOL.md's private-room flow: room:create/room:join
with a collision-checked numeric code, up to a 5-match repeating
series per room via game/session.js, random-theme selection that
excludes the previous match's theme, and room:closed for matchLimit
or quit (rooms never touch matchmaking's ban store). themeMode:
'chosen' gets a narrow resolveChosenTheme() stand-in pending #7's
real theme-voting flow.

Also adds a minimal opponentName lookup to registry.js
(registerSocket's new optional name arg + getPlayerName) since
room:joined needs it, mirroring the same addition landing on #5's
branch.
2026-09-10 12:16:13 -03:00
ea003453af feat(backend): add matchmaking queue with random mode and quit ban
Registers queue:join/queue:leave handlers that FIFO-pair waiting players,
randomly assign timeMode (1 or 2, uniform) and theme via themeIds.js, and
hand off to game/session.js's createSession. Tracks a 2-minute
matchmaking-only quit ban (in-memory, resets on restart) via onEnd's
'quit' reason, scoped to sessions this module produced. Exports
isBanned() and registerMatchmakingHandlers(), wired into index.js at
boot.

Also extends ws/registry.js with a playerId -> display name store
(registerSocket's new optional third arg, getPlayerName()) so
match:found.opponentName (and future room:joined.opponentName) can be
populated; connectionHandler.js's identify handler now passes name
through.
2026-09-10 12:15:52 -03:00
611b588db6 chore(backend): add shared theme id catalog for matchmaking/rooms 2026-09-10 12:04:33 -03:00
30a2d9f3dd feat(frontend): add in-match timer HUD with countdown and time warning 2026-09-10 12:03:42 -03:00
4b8c402e43 feat(frontend): add in-match split-view opponent progress pane 2026-09-10 12:03:42 -03:00
fea76e94cc feat(backend): add match/round session engine 2026-09-10 12:03:42 -03:00
5162f090cb feat(frontend): add solo mode config flow (time/theme/opponent) 2026-09-10 11:54:48 -03:00
906fe59add feat(frontend): add WebSocket client service with identity and typed messages 2026-09-10 11:54:48 -03:00
66db5b1931 feat(backend): add WS connection lifecycle and player identity registry 2026-09-10 11:54:48 -03:00
0047da5aab feat(frontend): add bot AI engine for pacing and accuracy 2026-09-10 11:45:28 -03:00
18cf6a00ca feat(frontend): restructure main menu into Solo/Private/Matchmaking
Replace the single pick-a-theme-and-start intro modal with a three-section
menu (Solo/Private/Matchmaking). Solo keeps the existing gameplay reachable
via a direct Play button; Private (Enter Code/Create Room) and Matchmaking
(Find Match) are stubbed with console.log no-ops pending tickets #17/#15/#14.

main.ts gains a small showView(name) helper that toggles .hidden across the
menu/result overlay screens, keeping it a thin composition root.
2026-09-10 11:45:28 -03:00
d51113469f feat(frontend): expand code snippet catalog for random selection 2026-09-10 11:45:28 -03:00
629f52caa3 docs(backend): add multiplayer protocol spec 2026-09-10 11:45:28 -03:00
a58b1512fc docs: rename trunk branch references from master to main 2026-09-10 10:41:42 -03:00
970206fb99 feat(backend): scaffold matchmaking server project
Bare HTTP + WebSocket bootstrap (health check route, ws upgrade,
connection logging) with matchmaking/ and rooms/ reserved but
unimplemented. No matchmaking logic yet.

Also adds root README.md (project overview) and AGENTS.md (architecture
map, code style, git workflow).
2026-09-10 10:37:52 -03:00
6f9a298aef refactor(frontend): move to frontend/, port to Vite + TypeScript
Splits the single game.js god-class into layered modules (types, data,
engine, game, preview, ui, main) and converts every source file to
TypeScript, built and served by Vite instead of a plain static server.
No behavior change: verified against the previous JS version via a full
play-through (theme select, preview countdown, coloring, reveal) in a
real browser.
2026-09-10 10:37:44 -03:00
467447b51a initial commit (first version of game) 2026-09-10 10:15:02 -03:00