Skip to content

shailawazeer/Pig-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฒ Pig Game

A fun and simple dice game for two players built with HTML, CSS, and JavaScript.

๐Ÿ“– About The Game

Pig Game is a classic dice game where two players race to reach 100 points first. Players take turns rolling a dice and accumulating points, but there's a catch - if you roll a 1, you lose all your current round points!

๐ŸŽฎ How to Play

  1. Roll Dice: Click "Roll Dice" to roll a random number (1-6)
  2. Add Points: If you roll 2-6, points are added to your current score
  3. Hold: Click "Hold" to add your current score to your total score
  4. Avoid 1: If you roll a 1, you lose all current points and turn switches
  5. Win: First player to reach 100 total points wins!

๐ŸŽฏ Game Rules

  • Players take turns rolling the dice
  • Rolling 2-6: Points are added to current score
  • Rolling 1: Current score becomes 0 and turn switches to other player
  • Hold: Add current score to total score and switch turns
  • First to reach 100 points wins the game

๐Ÿš€ How to Run

  1. Download or clone this repository
  2. Open index.html in your web browser
  3. Start playing!
git clone https://github.com/yourusername/pig-game.git
cd pig-game
# Open index.html in your browser

๐Ÿ› ๏ธ Technologies Used

  • HTML5 - Game structure
  • CSS3 - Styling and animations
  • JavaScript - Game logic and functionality

๐Ÿ“ File Structure

pig-game/
โ”‚
โ”œโ”€โ”€ index.html          # Main HTML file
โ”œโ”€โ”€ style.css           # CSS styling (if separate)
โ”œโ”€โ”€ script.js           # JavaScript game logic (if separate)
โ”œโ”€โ”€ dice-1.png          # Dice images
โ”œโ”€โ”€ dice-2.png
โ”œโ”€โ”€ dice-3.png
โ”œโ”€โ”€ dice-4.png
โ”œโ”€โ”€ dice-5.png
โ”œโ”€โ”€ dice-6.png
โ””โ”€โ”€ README.md           # This file

๐ŸŽจ Features

  • โœ… Two-player gameplay
  • โœ… Random dice rolling
  • โœ… Score tracking
  • โœ… Current score display
  • โœ… Winner detection
  • โœ… Game reset functionality
  • โœ… Responsive design
  • โœ… Smooth animations

๐ŸŽฒ Game Screenshots

Screenshot (119)

๐Ÿค Contributing

Feel free to fork this project and submit pull requests for any improvements!

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“ License

This project is open source and available under the MIT License.

๐Ÿ™ Acknowledgments

  • Inspired by the classic Pig dice game
  • Built as part of JavaScript learning journey
  • Thanks to The Complete JavaScript Course for guidance

Enjoy the game! ๐ŸŽ‰

Made with โค๏ธ and JavaScript

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published