This project is a simple and interactive 2-player dice game built using HTML, CSS, and JavaScript. The game provides a visually appealing interface where two players can take turns rolling dice to determine the winner. The game is designed to be fully responsive, ensuring an optimal user experience across various devices.
- Dice Rolling: Each player takes turns rolling a six-sided die, with the outcome visually represented using dynamic dice images.
- Winner Determination: The game determines the winner based on the higher roll of the dice. The winning player is highlighted with a distinct background color.
- Responsive Design: The user interface is responsive, adapting to different screen sizes and orientations for a seamless gaming experience on desktops, tablets, and mobile devices.
- Roll the Dice: Click on the "Roll Dice" button to initiate the dice roll for each player.
- Winner Announcement: The game will announce the winner or declare a tie based on the dice rolls.
- Restart the Game: Use the "Reload" button to reset the game and start a new round.
- HTML: The structure of the game interface is defined in HTML, including elements for displaying dice images, player areas, and the winner announcement.
- CSS: Styling is implemented using CSS to create an attractive and responsive layout. Background colors indicate the winner or a tie.
- JavaScript: The game logic is implemented in JavaScript, handling dice rolling, winner determination, and dynamic updates to the user interface.
To run the game locally, simply clone the repository and open the index.html
file in a web browser. The game can be played directly in the browser without the need for additional setup.
Feel free to explore, modify, and enhance the code to suit your preferences or use it as a foundation for more advanced features. Enjoy the game!
https://vinu-23.github.io/Dice-Game-Using-JS/
Feel free to customize this description based on any additional features or details you want to highlight in your project.