Back to projects

Dice Game

Arunabh Sen / January 17, 2025

Dice Game is a simple yet interactive web game built using ReactJS. Players predict the outcome of a dice roll and earn or lose points based on their guesses.

Features

  • Score System: Earn points for correct guesses and lose points for incorrect ones.
  • Total Score Tracker: Keep track of your total score throughout the game.
  • Reset Button: Start a new game with a single click.
  • Interactive Gameplay: Clean and intuitive interface with real-time score updates.

Technologies

  • ReactJS: Frontend library used for building the UI and handling interactivity.
  • HTML & CSS: Structure and styling of the application.
  • React Hooks: Used for managing state and logic.

How to Play

  1. Select a number between 1 and 6.
  2. Click to roll the dice.
  3. If the dice matches your selected number:
    • Correct Guess: +10 points (example)
    • Incorrect Guess: -2 points
  4. Click Reset to start fresh and play again.

Getting Started

Prerequisites

Make sure you have the following installed:

  • Node.js
  • npm (comes with Node.js) or yarn

Installation

Clone the repository:

git clone https://github.com/your-username/dice-game.git
cd dice-game

Install dependencies:

npm install

Start the development server:

npm run dev

Open your browser and navigate to:

http://localhost:3000

GitHub Repository:

https://github.com/Arunabh-Sen/dice_game

Live Demo:

https://as07-dice-game.netlify.app/

Conclusion:

This Dice Game is a fun and lightweight project to demonstrate the use of React hooks and basic game logic. Great for beginners looking to learn React through interactive development.