Conversation
Full implementation of a 1-2 player turn-based ring toss game: Server: - 6 endpoints: game-state, join, start, toss, end-game, reset - Skill-based power meter determines hit/miss - Peg images update on canvas via updateWebImageLayers - Missed rings drop as scattered assets on canvas - Players teleported to mats on game start (using stored interactiveNonce) - 9 achievement badges via processGameCompletion shared util - Per-visitor game stats (gamesPlayed, gamesWon) for badge eligibility - getVisitor util initializes visitor data before any updates - Reset clears board, removes ring assets, resets peg images Client: - GameLobby: Join/Start/Reset with player slot display - GameBoard: Peg selection, power meter, 20s turn timer with auto-miss - PowerMeter: 5-section animated oscillating meter - GameOver: Final scores, winner display, Play Again - GameInProgress: Spectator view for non-players - BadgesDisplay: Tabbed badges UI (earned/unearned) - 3s polling for lobby updates and opponent turns - Background image from S3 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add in-memory SSE connection manager (sseManager.ts) with connection registration, heartbeat tracking, publish-to-others filtering, and stale connection pruning (10min timeout, 60s interval) - Add SSE endpoint (GET /sse) and heartbeat endpoint (POST /heartbeat) - All 5 game controllers now publish SSE events after state changes (player_joined, game_started, toss, game_ended, game_reset) - Client replaces 3-second polling with EventSource connection - Includes 5-minute heartbeat interval to keep connections alive - Reduces API load from N/3 requests/second (continuous) to ~14 events per game total Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mes, reset fixes - Add InstructionsModal with 6-step how-to-play guide - Auto-open instructions for first-time players (gamesPlayed === 0) - Info icon button next to page title (PageContainer updated with onInfoClick + tabs props) - Game auto-ends when all pegs are full (no more points possible) - Show player names next to Red/Blue on ScoreBoard and GameOver - Play Again visible only for current players, others see Reset - Reset button always visible in lobby - Re-fetch game state on game end for both players to update badges - Server returns visitorGameData from /game-state endpoint Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rogressive meter fix - Add admin Difficulty setting (Easy/Hard/Progressive) saved to key asset data object - New PUT /settings endpoint for admin to update difficulty - PowerMeter speed adapts to difficulty: Easy=280ms, Hard=140ms, Progressive=280→140ms - Fix progressive tossNumber calculation for solo mode (was counting blue's 0 rings as 6 used) - Fix Comeback Kid badge: now tracks wasLosing per player, only awards if actually came from behind - Extract cleanupBoard util from duplicate logic in handleReset and handleStart - handleStart now resets all gameplay fields via DEFAULT_GAME_STATE before starting - Preserve difficulty setting across game resets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
Generated with Claude Code (https://claude.com/claude-code)