Pig Game - Version 4: Simple game to demonstrate JS DOM manipulation /* GAME RULES:
- The game has 2 players, playing in rounds
- In each turn, a player rolls a dice as many times as he whishes. Each result get added to his ROUND score
- BUT, if the player rolls a 1, all his ROUND score gets lost. After that, it's the next player's turn
- The player can choose to 'Hold', which means that his ROUND score gets added to his GLBAL score. After that, it's the next player's turn
- The first player to reach 100 points on GLOBAL score wins the game
EXTENDED CHALLENGES:
- A player loses his Entire score when he rolls two 6 in a row. After that it is the next players turn.(HINT: Always save your previous dice roll in a separate variabe)
1.2 Display a reason why it is the next players turn
-
Add an input field so that the players can set the winning score BEFORE the game starts. If no score has been entered then an error message is displayed. User must input a score before the game can start! Hint: you can read that value with the .value proprty in Javascript.
-
Add a second dice to the game, so there are two dice. Position the second dice using HTML and CSS. If a player rolls a 1 on either one of the dice, then he looses his current score.
*/