Skip to content

Latest commit

 

History

History
44 lines (37 loc) · 1.15 KB

README.md

File metadata and controls

44 lines (37 loc) · 1.15 KB

Pig Game

How To Run

  1. Download and unzip directory
  2. Open index.html in your browser

Overview

Rules

  • Two players take turn rolling the dice.
  • Each time a player rolls the dice, the roll is added to their current score.
  • If a player rolls a 1, they gain no points and their turn ends.
  • If a player decides to hold their current score, it will be added to their overall score and their turn ends.
  • First to 100 points wins.

Planning

Functionality

  1. Player rolls dice
  2. Dice displays on screen
  3. If roll != 1, add dice value to current score
  4. If roll = 1, switch player
  5. If player holds score, add current score to total score
  6. If player score reaches 100, display winner and stop game
  7. When player starts new game, reset scores and start at player 1

Styling

  • Gradient background
  • Dice images appear on roll
  • Active player has different style
  • Buttons have dynamic shadows

Design & Testing

  • Chrome dev tools debugger

Skills Practiced

  • DOM manipulation
  • Event listeners/handlers
  • Implementing random numbers
  • Dynamically selecting DOM elements
  • Editing element classes

Technologies Used

  • HTML
  • CSS
  • JavaScript