Skip to content

The Pig Game is a fun dice game for two players. Each player rolls a dice and adds the result to their current round score. They can choose to keep rolling or "hold" their points. If a player rolls a 1, they lose their round score. The objective is to be the first to reach 100 points. It’s a mix of luck and strategy!

Notifications You must be signed in to change notification settings

saleh-coder/Pig-Game

Repository files navigation

🎲 Pick Game: A Fun Dice Game

Welcome to Pick Game, an exciting multiplayer dice game where two players compete to reach 100 points first. This project was designed to practice and reinforce essential JavaScript, HTML, and CSS skills by implementing game logic, DOM manipulation, and user interaction.

🛠️ Current Status

The game is currently in development. Some features may not be fully implemented, and there may be bugs or incomplete functionality.

🚀 About the Game

Pick Game is a two-player dice game where players take turns rolling a dice to accumulate points. Here's how the game works:

  1. Rolling the Dice: Each player can roll the dice to get a number between 1 and 6. The number rolled gets added to the player's current round score.
  2. Holding the Score: Players can choose to "hold" their score, which adds the current round score to their total score and ends their turn.
  3. Rolling a 1: If a player rolls a 1, they lose their current round score, and the turn switches to the other player.
  4. Winning: The first player to reach 100 points wins the game!
  5. Resetting the Game: At any point, the game can be reset to start over.

🎮 Features

  • Two-player mode: Play against a friend or challenge yourself!
  • Interactive UI: Real-time updates for the current score, round score, and dice rolls.
  • Reset Functionality: Easily restart the game with the click of a button.
  • Flowchart-based Design: The game logic was designed using a flowchart, ensuring smooth gameplay and easy understanding of the code.

💻 Technical Overview

This project utilizes core web technologies and was built as a practice project for learning front-end development:

  • JavaScript: Game logic, DOM manipulation, and event handling.
  • HTML & CSS: Structuring the game layout and styling for a sleek user interface.
  • Live Demo: Hosted using Netlify.

🔀 Game Flowchart

The logic behind Pick Game is designed using a flowchart to make it easy to follow. This flowchart helps visualize the game's states, user actions, and the transitions between them.

pig-game-flowchart.png

The above flowchart illustrates the main actions and logic of the game.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


🎓 Credits

This project was developed based on the teachings of the course [The Complete JavaScript Course 2024: From Zero to Expert!] taught by Jonas Schmedtmann on Udemy.


Enjoy the game, and happy coding!

About

The Pig Game is a fun dice game for two players. Each player rolls a dice and adds the result to their current round score. They can choose to keep rolling or "hold" their points. If a player rolls a 1, they lose their round score. The objective is to be the first to reach 100 points. It’s a mix of luck and strategy!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published