Skip to content

hoangtuong1102/pig-game

Repository files navigation

Pig Game

Pig Game is a simple and fun dice game developed using HTML, CSS, and JavaScript. Players take turns rolling a dice to accumulate points, and the first player to reach 100 points wins the game.

Demo

You can view a live demo of the game here: Pig Game Demo

How to Play

  1. The game is for 2 players.
  2. Players take turns rolling the dice by clicking the "🎲 Roll dice" button.
  3. Each roll adds the dice value to the current score of the player.
  4. If a player rolls a 1, their current score is lost, and it's the next player's turn.
  5. Players can choose to "📥 Hold" their current score, which adds the current score to their total score and passes the turn to the other player.
  6. The game ends when a player reaches 100 points.

Project Structure

  • index.html: The HTML file that contains the structure of the game.
  • style.css: The CSS file that contains the styling of the game.
  • script.js: The JavaScript file that contains the game logic.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published