A simple dice game where two players take turns rolling a dice to accumulate points. The objective is to be the first player to reach a score of 50.
- Player One always starts the game.
- Both players use the same "Roll Dice" button when it's their turn.
- To win the game, a player must roll the dice until they get a value other than 1.
- If a player rolls a 1, their turn ends, and it automatically becomes the other player's turn.
- Before rolling a 1, a player can choose to "Hold" their current score, which adds it to their total score. It becomes the other player's turn.
- Players continue taking turns, accumulating points by rolling the dice and holding their scores until one player reaches a score of 50.
- The first player to reach or exceed a score of 50 wins the game.
https://onedice.netlify.app/
- Open the
welcome.html
file in a web browser. - Player One (Player 1) starts the game with an initial score of 0.
- Click the "Roll Dice" button to roll the dice. The current score will be updated based on the dice roll.
- Keep rolling the dice or choose to "Hold" your current score.
- If you roll a 1, your turn ends, and it becomes the other player's turn.
- The game continues until one player reaches a score of 50.
- Once a player wins, a "WINNER" message will be displayed.
- HTML
- CSS
- JavaScript
index.html
: The welcoming page that displays the welcome interface.game.html
: The main HTML file that displays the game interface.style.css
: The CSS file that styles the game elements.app.js
: The JavaScript file that contains the game logic.
This project is licensed under the MIT License.
Feel free to explore, modify, and distribute this code as per the terms of the license.