Skip to content

ViNu-23/Dice-Game-Using-JS

Repository files navigation

Dice-Game-Using-JS

Preview

Screenshot 2023-11-12 011055 Screenshot 2023-11-12 011317

Overview

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.

Features

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

How to Play

  1. Roll the Dice: Click on the "Roll Dice" button to initiate the dice roll for each player.
  2. Winner Announcement: The game will announce the winner or declare a tie based on the dice rolls.
  3. Restart the Game: Use the "Reload" button to reset the game and start a new round.

Project Structure

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

How to Run Locally

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!


Live Demo

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published