Skip to content

super3/dicerun.io

Repository files navigation

🎲 DiceRun.io · Play Now →

A browser-based roguelike dice game with 3D physics built with Three.js and Cannon-ES.

Frontend Build Status Test Status Coverage Status License

🚀 Quick Start

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.

🎮 How to Play

Objective

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.

Controls

  • 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

Game Mechanics

Rounds

  • 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...

Scoring & Earnings

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

Store

Between rounds, spend your earnings on:

  • Extra Dice: Starting at $10, price increases by 50% with each purchase
  • More dice = higher potential scores

Strategy Tips

  • 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

🛠️ Development

Local Setup

# 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

Project Structure

├── 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

📜 Credits

The 3D dice rolling physics implementation is based on the excellent tutorial by uuuulala:

About

A browser-based roguelike dice game with 3D physics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •