Skip to content

prashantchauhan-12/Pig-Game-JS

Repository files navigation

Pig Game 🐷

Pig Game Preview

A interactive two-player dice game built with JavaScript, HTML, and CSS. This project demonstrates DOM manipulation, event handling, and game logic implementation.

🎮 Game Rules

The game involves two players fighting to reach the winning score first (default is 50, though custom variations may apply).

  1. Roll the Dice: In each turn, a player rolls a dice as many times as they wish. Each result gets added to their current score.
  2. Lose Turn: If the player rolls a 1, they lose their entire current score, and it becomes the next player's turn.
  3. Hold: The player can choose to 'Hold', which adds their current score to their total score. After holding, it becomes the next player's turn.
  4. Win: The first player to reach the winning score on their total score wins the game!

🚀 Technologies Used

  • HTML5: Structural markup.
  • CSS3: Styling and layout.
  • JavaScript: Game logic and DOM manipulation.

📂 Project Structure

  • index.html: The main game interface.
  • style.css: Custom styles for the game board and components.
  • script.js: Contains the game logic/mechanics.
  • dice-*.png: Assets for the dice faces.

📸 How to Run

  1. Clone this repository or download the source code.
  2. Open the index.html file in any modern web browser.
  3. Enjoy the game!

About

A interactive two-player dice game, The game involves two players fighting to reach the winning score first (default is 50, though custom variations may apply).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors