🎲 DiceRun.io · Play Now →
A browser-based roguelike dice game with 3D physics built with Three.js and Cannon-ES.
git clone https://github.com/super3/dicerun.io.git && cd dicerun.io
npm install && npm start
Open http://localhost:8000
in your browser to start playing.
Roll dice to meet or exceed target scores across increasingly difficult rounds. Earn money based on your performance and spend it on additional dice to improve your chances.
- Double-tap or click Roll Dice button to throw the dice
- Click on individual dice to lock/unlock them (locked dice won't reroll)
- Locked dice show a 🔒 indicator
- Each round has a target score you must reach
- You have 3 rerolls per round to achieve the target
- Target scores increase with each round: 7, 12, 18, 25, 33, 42...
Complete a round to earn money based on:
- Base earnings: Score minus target score
- Perfect Roll Bonus: +$10 for hitting the exact target
- Efficiency Bonus: +$2 per unused reroll
Between rounds, spend your earnings on:
- Extra Dice: Starting at $10, price increases by 50% with each purchase
- More dice = higher potential scores
- Lock high-value dice to preserve good rolls
- Balance risk vs reward - perfect rolls give bonuses but are harder to achieve
- Save rerolls when possible for efficiency bonuses
- Buy additional dice to make higher targets achievable
# Clone the repository
git clone https://github.com/super3/dicerun.io.git && cd dicerun.io
# Run tests
npm test
# Start development server (cache disabled)
npm run dev
# Server will open automatically at http://localhost:8000
├── index.html # Main HTML file
├── src/
│ ├── script.js # Game logic and physics
│ ├── style.css # UI styling
│ └── gameLogic.js # Extracted game logic for testing
├── tests/
│ ├── gameLogic.test.js # Unit tests
│ └── __mocks__/ # Test mocks for Three.js and Cannon
└── .github/
└── workflows/
├── frontend.yml # GitHub Pages deployment
└── test.yml # CI testing workflow
The 3D dice rolling physics implementation is based on the excellent tutorial by uuuulala:
- Original Tutorial: Three.js Rolling Dice Tutorial
- The dice geometry, physics setup, and core rolling mechanics are adapted from this tutorial