A browser-based implementation of the popular push-your-luck board game Diamant (also known as Diamond), integrated with Twitch chat.
Diamant is a push-your-luck cave exploration game where players explore a cave over 5 rounds, deciding when to continue deeper or exit safely. The deeper they go, the more treasures they can find, but also more risks. When identical traps appear twice, everyone still in the cave loses all collected treasures.
- Twitch Chat Integration: Viewers can join and play directly from Twitch chat
- Real-time Gameplay: Game state updates in real-time as players make decisions
- Visual Feedback: Cards are displayed visually with animations
- Sound Effects: Audio cues for key game events (can be toggled on/off)
- Game Log: Detailed log of game events
- Scoreboard: Real-time tracking of player scores
- Streamer Controls: Simple controls for the streamer to manage the game
- Security: Input sanitization to prevent XSS attacks
- Dynamic Balancing: Treasure values scale based on the number of players
- Player Limit Options: Choose between unlimited players or set a specific player cap
- The game consists of 5 rounds of cave exploration
- Players automatically continue exploring unless they choose to leave
- The first card revealed in each round is always a treasure card (never a trap)
- Treasure values dynamically scale based on player count:
- Minimum treasure value = 40% of player count (at least 1)
- Maximum treasure value = 2x player count (at least 5)
- Values are distributed evenly between min and max
- Treasure Collection System:
- When a treasure card is revealed, its value is immediately divided among players in the cave
- Each player gets an equal share (rounded down), and any remainder stays on the card
- For example, if 3 players find 10 treasure, each player gets 3 and 1 remains on the card
- When players leave the cave (roach), they keep their collected treasure plus a share of any remaining treasure on the path
- If multiple players leave at once, they divide the remaining treasure equally
- Cards show both the original treasure value and the current remaining value
- When identical traps appear twice, everyone still in the cave loses all treasures collected in that round
- Type
!joinin the Twitch chat during the joining phase to enter the game - You will automatically continue exploring deeper into the cave
- Type
!roachto leave the cave with your treasures - If the same trap appears twice, everyone still in the cave loses all treasures collected in that round
- The game lasts 5 rounds - the player with the most rubies at the end wins!
- Click "Start New Game" to begin a new game session
- Choose whether to allow unlimited players or set a specific player limit
- The game will automatically handle the joining phase and start the first round
- Use "Force Start Game" to skip the joining timer and start immediately (optional)
- Use "Reveal Next Card" to manually reveal the next card (optional)
- Use "Start Decision Phase" to manually start a decision phase (optional)
- Use "Force End Decisions" to skip the decision timer and process decisions immediately (optional)
- The game will automatically progress through rounds and end after 5 rounds
- Make sure you have Node.js installed
- Install dependencies with
npm install - Update the Twitch channel name in
server.jsto your channel - Start the server with
node server.js - Open
http://localhost:3001in your browser
- Node.js
- Express
- Socket.io
- tmi.js (Twitch Messaging Interface)
- HTML5/CSS3/JavaScript
This project is open source and available under the MIT License.
- Sound effects from Mixkit
- Game design based on the board game Diamant/Diamond by Bruno Faidutti and Alan R. Moon