A real-time multiplayer word guessing game built with Ruby on Rails 8, ActionCable, Hotwire (Turbo + Stimulus), and Tailwind CSS.
Word Cipher is a team-based guessing game where players compete to guess words within a time limit. Players join either the Red or Blue team, and teams alternate turns. During each turn, one player becomes the "clue-giver" who can see a list of words that other players cannot see. The clue-giver gives verbal clues to help their teammates guess the words before time runs out!
- ✅ Real-time multiplayer using ActionCable WebSockets
- ✅ Team-based gameplay (Red Team vs Blue Team)
- ✅ Turn-based system with automatic rotation
- ✅ 60-second timer for each turn
- ✅ Live scoring and point tracking
- ✅ Word visibility control (only clue-giver sees the word list)
- ✅ Instant guess validation and feedback
- ✅ Room code system for easy game joining
- ✅ Modern, responsive UI with Tailwind CSS
- Backend: Ruby on Rails 8
- Database: SQLite (development)
- Real-time: ActionCable (WebSockets)
- Frontend: Hotwire (Turbo + Stimulus.js)
- Styling: Tailwind CSS (CDN)
-
Clone the repository
-
Install dependencies:
bundle install
-
Set up the database:
bin/rails db:migrate bin/rails db:seed
-
Start the Rails server:
bin/rails server
-
Visit
http://localhost:3000in your browser
-
Create or Join a Game
- Create a new game from the homepage
- Share the room code with other players
- Or join an existing game by entering a room code
-
Choose Your Team
- Select either Red Team or Blue Team
- Wait for players on both teams
-
Start the Game
- Once both teams have players, click "Start Game"
-
Playing a Turn
- One player from the active team becomes the clue-giver
- The clue-giver sees a list of 10 words
- Other teammates type guesses in real-time
- Correct guesses award 1 point to both the player and team
- Each turn lasts 60 seconds
-
Winning
- Teams alternate turns
- The game continues until manually ended
- The team with the most points wins!
- Game: Manages game state, scores, and settings
- Player: Represents each connected player
- Word: Master list of words (99 words across 10 categories)
- GameWord: Words assigned to a specific game turn
- Guess: Tracks all guess attempts
The game uses ActionCable to broadcast:
- Player joins/leaves
- Game state changes
- Turn transitions
- Guess submissions (correct/incorrect)
- Score updates
- Timer synchronization
The game includes 99 words across 10 categories:
- Animals
- Food
- Sports
- Objects
- Places
- Actions
- Professions
- Nature
- Entertainment
- Technology
To add more words, edit db/seeds.rb and run:
bin/rails db:seedTo reset the database:
bin/rails db:resetGameService: Handles game flow, turn management, and clue-giver selectionGuessService: Processes guesses, validates matches, awards points
GameChannel: ActionCable channel for broadcasting game eventsgame_controller.js: Stimulus controller handling WebSocket messages and UI updates
- Timer: Server-authoritative with client-side display
- Word Visibility: Conditional rendering based on player role
- Guess Matching: Normalized string comparison (case-insensitive)
- Session Management: UUID-based player sessions
Potential features to add:
- Sound effects and animations
- Player avatars
- Chat functionality
- Game history and statistics
- Difficulty levels
- Custom word lists
- Mobile app version
- Tournament mode
This project is open source and available under the MIT License.