https://github.com/kumaarbalbir/roll-your-dice
Simple dice game built using pure javascript ( ES6 ) for DOM manipulation. The logic uses generation of random numbers for dice using random function of javascript which uses xorshift128+ algorithm (PRNG) to generate random numbers.
https://github.com/kumaarbalbir/roll-your-dice
css3 html5 javascript
Last synced: 6 months ago
JSON representation
Simple dice game built using pure javascript ( ES6 ) for DOM manipulation. The logic uses generation of random numbers for dice using random function of javascript which uses xorshift128+ algorithm (PRNG) to generate random numbers.
- Host: GitHub
- URL: https://github.com/kumaarbalbir/roll-your-dice
- Owner: KumaarBalbir
- Created: 2021-03-22T17:56:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-03T15:07:46.000Z (over 1 year ago)
- Last Synced: 2024-04-04T16:12:15.648Z (over 1 year ago)
- Topics: css3, html5, javascript
- Language: JavaScript
- Homepage: https://kumaarbalbir.github.io/Roll-your-dice/
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Roll Your Dice Game
This web-based game allows users to roll a dice and see who wins (Me or you XD) based on the outcomes. The game is implemented using HTML, CSS, and JavaScript.
UI of the game!
## How to Play
1. Open the [game](https://kumaarbalbir.github.io/Roll-your-dice/) in a web browser.
2. Click the "Roll Your Dice" button.
3. Two dice images will be displayed, each representing a random number between 1 and 6.
4. The game will determine the winner based on the higher number rolled.
5. If both players roll the same number, it's a draw.So go there and beat me :)
## Game Implementation
- The game randomly generates two numbers between 1 and 6 to simulate rolling two dice.
- Each number corresponds to a different side of the dice, represented by images (`dice1.png` through `dice6.png`).
- The outcome of the roll is displayed using these images.
- The winner is determined by comparing the numbers rolled.
- The game dynamically updates the heading (``) to announce the winner or a draw.
## Files
- `index.html`: Contains the structure and layout of the game.
- `style.css`: Defines the visual styling and layout.
- `script.js`: Implements the game logic and behavior using JavaScript.## Future Improvements
- Add animations or transitions to enhance the rolling dice effect.
- Implement multiplayer functionality to allow multiple players to participate.
- Add sound effects to make the game more engaging.