Skip to content

JS-GodMode/Pig-game

Repository files navigation

ezgif com-video-to-gif-converter(3)

Pig Game 🐷🎲

Overview

Pig Game is a fun, interactive 2-player game built using pure JavaScript. The objective of the game is to reach 100 points before your opponent does. Players take turns rolling a dice, accumulating points during their turn. However, there's a catch! If the player rolls a 1, their turn ends and all points collected during that turn are lost.

How to Play

  • The game consists of 2 players.
  • On each turn, a player rolls a dice:
    • If they roll any number other than 1, that number is added to their current turn's score.
    • The player can then choose to either:
      • Continue rolling to accumulate more points.
      • Hold to add their current turn's score to their total score and pass the dice to the next player.
    • If the player rolls a 1, their current turn's score is reset, and it's the next player's turn.
  • The first player to reach 100 points wins!

Features

  • Simple Gameplay: Roll the dice, hold, or risk it all!
  • Pure JavaScript: No external libraries or frameworks needed.
  • Great for Friends: Enjoy playing the Pig Game with friends at gatherings or during downtime.

Rules

  1. Roll the dice to accumulate points.
  2. Hold to add the current points to your total score and pass the turn to the next player.
  3. Rolling a 1 ends your turn and resets your turn's score.
  4. First player to reach 100 points wins!

Play

You can play this game now on : https://js-godmode.github.io/Pig-game/

Installation

To play the Pig Game, simply clone the repository and open the index.html file in your browser.

git clone https://github.com/yourusername/pig-game.git

Then, open index.html in your preferred browser to start playing.

Screenshot

Screenshot 2024-10-02 215203 Screenshot 2024-10-02 215232

Author

  • Anonav0 (Swarnavo Khanra) - Developer of Pig Game.

Feel free to reach out on LinkedIn or GitHub for any questions or feedback.