Skip to content

shanmugapriyar0/PigGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Pig Game

Overview

Pig Game is a simple two-player dice game developed using HTML, CSS, and JavaScript. Players take turns rolling a dice to accumulate points, but rolling a '1' will switch the turn to the other player. The first player to reach 100 points wins.

How to Play

  1. The game starts with Player 1.
  2. Click the "Roll Dice" button to roll a dice.
  3. The dice will generate a random number between 1 and 6:
    • If the dice shows 1, the current score resets to 0, and the turn switches to the other player.
    • If the dice shows 2-6, the value is added to the player's current score.
  4. Players can choose to click the "Hold" button to save their current score to their total score and pass the turn to the other player.
  5. The first player to reach 100 points wins the game.
  6. When a player wins, the background changes to black to indicate the winner.

Technologies Used

  • HTML
  • CSS
  • JavaScript

Features

  • Two-player gameplay
  • Randomized dice rolling
  • Score tracking
  • Turn-based switching
  • Winner indication with a black background

Installation

  1. Download the project files.
  2. Open index.html in a browser to start playing.

Future Enhancements

  • Add animations for rolling the dice.
  • Include sound effects for game interactions.
  • Improve UI design for a better user experience.

Enjoy the game!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors