Skip to content

This repository contains a small JavaScript project featuring a simple dice game known as Pig game. The game was developed using HTML5, CSS3, and JavaScript.

License

Notifications You must be signed in to change notification settings

yutaasakura96/Pig-Game

Repository files navigation

Pig Dice Game

This is a simple Pig dice game implemented using HTML, CSS, and JavaScript. The game involves two players taking turns rolling a dice to accumulate points. The first player to reach or exceed 100 points wins the game.

How to Play

  • The game starts with Player 1 rolling the dice by clicking the "ROLL" button.
  • Each player accumulates points by rolling the dice. The player's current score is displayed.
  • If a player rolls a 1, their current score is reset to 0, and it becomes the next player's turn.
  • Players can click the "HOLD" button to add their current score to their total score.
  • The first player to reach or exceed 100 points wins the game.
  • Clicking the "NEW GAME" button resets the game to its initial state.

Features

  • Dynamic dice rolling functionality.
  • Switching between players during gameplay.
  • Updating scores in real-time.
  • Winner declaration when a player reaches or exceeds 100 points.
  • Ability to start a new game.

Click the link below to play the game ↓

PIG DICE GAME

Tech Stack

  • HTML5
  • CSS3
  • JavaScript

About

This repository contains a small JavaScript project featuring a simple dice game known as Pig game. The game was developed using HTML5, CSS3, and JavaScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published