Skip to content

xue-bin/piggame

Repository files navigation

Pig Game

This is a simple dice game where players take turns rolling a dice to accumulate points. The objective of the game is to be the first player to reach a target score.

Game Rules

Pig Game Flowchart

  1. The game is played by two players, who take turns rolling a six-sided dice.
  2. On each turn, a player rolls the dice and accumulates points based on the number rolled.
    • If the player rolls a 1, their turn ends, and they lose all the points accumulated in that turn.
    • If the player rolls any other number (2-6), the rolled number is added to their turn score.
  3. The player can choose to roll the dice again to accumulate more points or end their turn.
    • If the player ends their turn, their turn score is added to their total score.
  4. The first player to reach the target score (e.g., 100 points) wins the game.

Getting Started

To play the Pig Game, go here

Game Controls

  • To roll the dice, click on the "Roll Dice" button or press the spacebar.
  • To end your turn, click on the "Hold" button or press the Enter key.

Technologies Used

  • HTML
  • CSS
  • JavaScript

Credits

This game is inspired by the Pig Dice Game from the JavaScript Course by Jonas Schmedtmann on Udemy.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published