Skip to content

Commit

Permalink
sum up the points #11
Browse files Browse the repository at this point in the history
  • Loading branch information
michivonah committed Jan 29, 2023
1 parent f7f43ff commit 0f5e496
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions game.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,14 @@ function countPoints(){
case 2:
scores[0].score = parseInt(scores[0].score) + sum;
if(givenCards > 35) scores[0].score = parseInt(scores[0].score) + 5;
if(givenCards > 35 && parseInt(scores[1].score) == 0) scores[0].score = parseInt(scores[0].score) + 100;
yourPoints.textContent = "" + scores[0].score;
break;
case 1:
case 3:
scores[1].score = parseInt(scores[1].score) + sum;
if(givenCards > 35) scores[1].score = parseInt(scores[1].score) + 5;
if(givenCards > 35 && parseInt(scores[0].score) == 0) scores[1].score = parseInt(scores[1].score) + 100;
opponentPoints.textContent = "" + scores[1].score;
break;
default:
Expand Down Expand Up @@ -704,8 +706,8 @@ function newGame(withoutStart){
var opponentPoints = document.getElementById('opponentPoints');
var yourPointsOld = document.getElementById('yourPointsOld');
var opponentPointsOld = document.getElementById('opponentPointsOld');
scores[0].lastRound = parseInt(scores[0].score);
scores[1].lastRound = parseInt(scores[1].score);
scores[0].lastRound = parseInt(scores[0].lastRound) + parseInt(scores[0].score);
scores[1].lastRound = parseInt(scores[1].lastRound) + parseInt(scores[1].score);
scores[0].score = 0;
scores[1].score = 0;
yourPoints.textContent = scores[0].score;
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ <h2>Changelog</h2>
<p>29. Januar 2023</p>
<ul>
<li>Namen der Mitspieler werden nun angezeigt</li>
<li>Die Punkte der vorherigen Runde werden nun zusammengez&auml;hlt</li>
<li>Wenn man 157:0 gewinnt, erh&auml;lt man nun 100 Punkte zus&auml;tzlich</li>
</ul>
<p>28. Januar 2023</p>
<ul>
Expand Down

0 comments on commit 0f5e496

Please sign in to comment.