PigGame is a two-player dice game built using vanilla JavaScript, HTML, and CSS. The objective of the game is to reach a target score before your opponent by rolling dice and accumulating points. This project serves as a practice in JavaScript programming, focusing on interactive web development and game logic implementation. Check out the live demo of PigGame.
- Practiced JavaScript fundamentals including variables, functions, and loops.
- Applied DOM manipulation techniques to create an interactive gaming experience.
- Developed game logic including state management, event handling, and user interactions.
- Enhanced understanding of HTML and CSS for structuring and styling web applications.
Make sure you have the following installed on your system:
- Git
- A web browser
- Clone the repository:
git clone https://github.com/FilonenkoDima/PigGame.git - Navigate to the project directory:
cd PigGame - Running the Application: Open the index.html file in your preferred web browser to start the game.
The project is organized as follows:
/css: Contains the stylesheets for the game interface./img: Contains images used in the game, such as dice faces./js: Contains JavaScript files responsible for game logic and user interactions.index.html: The main HTML file that serves as the game's entry point.
- Game Objective: The first player to reach the target score wins the game.
- Rolling the Dice: Players take turns to roll a pair of dice. The rolled number is added to their current score.
- Holding: Players can choose to "hold" their score, adding it to their total score and passing the turn to the other player.
- Losing Points: If a player rolls a 1, they lose their current score for that turn and their turn ends.
- Winning the Game: The game ends when a player reaches or exceeds the target score (default is 100 points).
