Skip to content

Commit

Permalink
Fix scores value; Update main score when player clicks the Hold button
Browse files Browse the repository at this point in the history
  • Loading branch information
kenvilar committed Dec 3, 2017
1 parent 84a037f commit 1c2aff6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ document.querySelector('.btn-roll-dice').addEventListener('click', function () {
});

document.querySelector('.btn-hold').addEventListener('click', function () {
//Add player current rolled score to his/her main score
scores[activePlayer - 1] = scores[activePlayer - 1] = rolledScore;
scores[activePlayer - 1] = scores[activePlayer - 1] + rolledScore;

document.querySelector('#score-' + activePlayer).textContent = scores[activePlayer - 1];
});


Expand Down

0 comments on commit 1c2aff6

Please sign in to comment.