This repository contains the source code and assets for a browser-based dice game app. The game is based on the popular dice game "421", where players roll three dice and aim to reach the highest score by combining different dice combinations.
You can try out the live demo of the game here.
- 1 to 7 players.
- Scores tracking according to 421 game rules.
- 3D dice rolling animation.
- Clone the repository.
- Launch
python server.py
to create a small http server. - Open
http://localhost:8000/
in your preferred web browser (no online dependencies).
- Select the number of players (1-7).
- Click the 'Play' button to start the game.
- Roll the dice by clicking the 'Dice roll' button.
- Choose the dice combinations to keep or re-roll.
- Continue rolling until you reach a good combination or the limit.
- Push the 'Next Player' button to start the next player turn.
- Once everyone has played, the results will be showed in an alert.
(Broken dice are rerolled automatically)
-
First Player set the maximum number of available throws (max 3).
-
3 dices are rolled and any of them can be kept for the next roll.
-
Scoring is done as :
Score Range Score Formula Points 421 10,000 8pts 111 7,000 7pts 11x 1,000 * x xpts xxx 1,000 + xxx xpts x x+1 x+2 700 / 800 / 900 / 1,000 (4 possibilities) 2pts xyz xyz [0 - 666] 1pt 221 221 (lowest) 4pts
- HTML, CSS, and JavaScript (+ Python for the simple webserver).
- Three.js for 3D graphics rendering.
- Cannon.es for physics simulation.
- Three.js Rolling Dice Tutorial from this article : Crafting a Dice Roller with Three.js and Cannon.es.
- 3D dice model from Free3D.