Phrase Chain
Connect words. Beat the clock. Last player standing wins.
Context & The Problem
Most casual party games need a low-friction way for friends to start playing together, without lengthy setup.
Create or join a room, play with 2–4 players, and compete using three lives and 10-second turns.
My Contribution & Ownership
Built the playable web experience for room-based, turn-driven word chaining.
Architecture & System Flow
A room-based multiplayer game organized around timed turns and shared game state.
Players enter a nickname, create a room, or join an existing game.
Short timed word-chaining rounds with lives and elimination-based play.
Players participate in a shared game session through the browser.
Keeping multiplayer turns consistent
Multiplayer word submissions are enforced by a strict atomic gate on the game server. Before locking turn resolution, it checks room status, turn ID, and active player identity. This prevents duplicate submissions, resolves race conditions between players and timers, and verifies phrase validity against chain history before advancing state.
123456789101112131415161718192021222324252627282930313233submitWord(playerId: string, turnId: number, word: string): boolean {
// Strict atomic gate — all conditions must pass
if (this.state.status !== "PLAYING") return false;
if (turnId !== this.state.currentTurnId) return false;
if (playerId !== this.activePlayerId()) return false;
if (this.resolutionLocked) return false;
this.resolutionLocked = true;
this.clearTurnTimer();
const normalized = normalizeWord(word);
if (!normalized) {
this.resolutionLocked = false;
this.clearTurnTimer();
return false;
}
// Check duplicate
if (isWordAlreadyUsed(this.state.usedWords, normalized)) {
this.resolveInvalid(playerId, "Word already used");
return true;
}
// Check phrase validity
if (!isValidPhrase(this.state.currentWord, normalized)) {
this.resolveInvalid(playerId, "Invalid phrase");
return true;
}
// Valid!
this.resolveValid(playerId, normalized);
return true;
}Engineering Decisions & Trade-offs
Short turns
Word games can lose momentum when players have too long to respond.
Use a 10-second turn limit to keep rounds quick and competitive.
Small rooms
Large lobbies make it harder to keep a casual game moving.
Keep sessions focused on 2–4 players.
Limitations & What I'd Improve
- The public landing page describes the core room and game rules; no unsupported claims about its internal networking stack are made here.
RepoMedic
Diagnose GitHub issues and inspect AI-generated repairs with evidence.