A real-time multiplayer word puzzle game built with Node.js and WebSockets where players race to solve word chains.
Chain Reaction is a chain reaction puzzle game where players must figure out the missing words in a chain. The first and last words are always visible, and players must discover the connecting words in between by revealing letters and making guesses.
Example Chain: foot → ball → game → point
- 10 Rounds per Game with varying chain lengths (4-7 words)
- First-to-solve scoring - First player to complete the chain wins the round
- Letter Reveal System - Click any unsolved word to reveal one letter (last letter cannot be revealed)
- Word Guessing - Click the blue guess button to attempt solving a word
- Directional Word Pairs - Word chains follow directional relationships from the word list
- Round 1: 5 words
- Round 2: 4 words
- Round 3: 6 words
- Round 4: 4 words
- Round 5: 7 words
- Round 6: 4 words
- Round 7: 7 words
- Round 8: 4 words
- Round 9: 7 words
- Round 10: 5 words
- Sticky Status Bar - Shows current round, name input, and theme toggle
- Play Area - Interactive word chain display
- Leaderboard - Real-time player rankings sorted by score
- Event Log - Live feed of game events
- Winner Modal - Celebration with confetti animation for game winners
- Auto-join - Players join immediately as "Guest" (no authentication required)
- Auto-save Name - Name updates automatically as you type (saved to localStorage)
- Light/Dark Mode - Toggle between themes with preference saved
- Fully Responsive - Optimized for desktop, tablet, and mobile devices
- Real-time Updates - WebSocket communication for instant synchronization
- Node.js with Express
- WebSocket (ws) for real-time communication
- BFS Algorithm for chain generation from word pairs
- jQuery for DOM manipulation
- Vanilla JavaScript for game logic
- Canvas API for confetti animations
- CSS3 with custom properties for theming
ChainReaction/
├── data/
│ └── words.json # Word pair database
├── public/
│ ├── client.js # Client-side game logic
│ ├── shared.js # Shared utilities
│ ├── index.html # Main HTML structure
│ ├── styles.css # Responsive styling with themes
│ └── jquery-3.7.1.min.js
├── src/
│ └── server.js # Server and WebSocket logic
└── package.json
- Join the Game - Enter your name in the status bar (optional)
- View the Chain - First and last words are always visible
- Reveal Letters - Click on an unsolved word to reveal one letter at a time
- Make Guesses - Click the blue button next to a word to guess it
- Complete the Chain - First player to solve all words wins the round
- Win the Game - Player with the most round wins after 10 rounds is the champion
- Word pairs are directional (e.g.,
foot → ballbut notball → foot) - The last letter of each word cannot be revealed and must be guessed
- Incorrect guesses automatically reveal another letter
- All players compete on the same word chain each round
- Scores reset to zero after 10 rounds
# Install dependencies
npm install
# Start the server
npm start
# Access the game
http://localhost:3000The game uses a shared module pattern where shared.js contains functions used by both client and server, ensuring consistent game logic across the stack.
- Chain Generation - BFS algorithm creates valid word chains from directional pairs
- State Management - Server maintains authoritative game state
- Real-time Sync - WebSocket broadcasts keep all clients updated
- Player-specific State - Each player tracks their own revealed letters
The game includes a curated list of compound word pairs in data/words.json. Each pair represents a valid connection where the second word can follow the first (e.g., ["fire", "truck"]).
Built with Node.js, Express, WebSockets, and modern web technologies.