Skip to content

Pig Game - Version 4: Simple game to demonstrate JS DOM manipulation

Notifications You must be signed in to change notification settings

mauricegreenland/piggame-v4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

piggame-v4

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:

  1. 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

  1. 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.

  2. 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.

*/

About

Pig Game - Version 4: Simple game to demonstrate JS DOM manipulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published