No description
Find a file
Gabriel Franco 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
backend feat(backend): add private rooms with create/join and match repeat 2026-09-10 12:16:13 -03:00
frontend feat(frontend): add in-match orchestrator and multiplayer scoreboard 2026-09-10 12:16:15 -03:00
.gitignore refactor(frontend): move to frontend/, port to Vite + TypeScript 2026-09-10 10:37:44 -03:00
AGENTS.md docs: rename trunk branch references from master to main 2026-09-10 10:41:42 -03:00
README.md feat(backend): scaffold matchmaking server project 2026-09-10 10:37:52 -03:00

Theme Guess

A browser game about syntax-highlighting themes. A snippet of code is rendered with every token type (keywords, strings, functions, variables, comments, ...) in a neutral color. You click a token, every token of that same kind lights up together, and you pick a color for it — repeat until the whole file is themed. Reveal shows how close your from-scratch palette landed to a real theme (Gruvbox, Tokyo Night, VS Code Dark+, GitHub Dark, Dracula, Catppuccin), token kind by token kind.

The project is moving from a single-player-only page toward supporting multiplayer matchmaking (race another player to the closest match on the same theme/snippet). This repo is split into a frontend game client and a backend matchmaking/realtime server so that work can land independently.

Layout

frontend/   Canvas game client: Vite + TypeScript, no UI framework.
backend/    Matchmaking + realtime session server: Node, HTTP + WebSocket.

Each package has its own package.json, dependencies, and scripts — see frontend/README.md-equivalent notes below and backend/src/*/README.md for what's reserved but not implemented yet.

Running the frontend

cd frontend
npm install
npm run dev       # Vite dev server with HMR
npm run build     # type-check + production bundle to dist/
npm run typecheck # tsc --noEmit only

Running the backend

cd backend
npm install
npm start         # node src/index.js
npm run dev       # same, with --watch

Boots a plain HTTP server (with a /health check) and attaches a WebSocket server to it. Matchmaking and room/session logic are not implemented yet — see backend/src/matchmaking/README.md and backend/src/rooms/README.md.

Status

Single-player game: playable. Multiplayer: backend is a bare HTTP+WS scaffold with no matchmaking logic yet; frontend has no multiplayer UI yet. See AGENTS.md for architecture notes and contribution conventions.