Skip to content

Commit 0f4c95c

Browse files
committed
Add variables to create the game
Storing the scores each player gets and keeping track of the active player.
1 parent 00bcbac commit 0f4c95c

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

.DS_Store

-6 KB
Binary file not shown.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11

22
JS_Basic_Challenges/cat
3+
4+
\.DS_Store

JS_Basic_Challenges/.DS_Store

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

JS_Basic_Challenges/4-DOM-pig-game/starter/app.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ GAME RULES:
1111
1212
*/
1313

14+
var totalScore, currentScore, activePlayer;
1415

15-
var scores = [0,0];
16+
var totalScore = [0,0]; // the total score each player has, added together, after multiple rounds of rolling the dice
17+
var currentScore = 0; // the score each player has per round/ session, when it's they're actively rolling the dice
18+
var activePlayer = 0; // the player that is currently rolling the dice

0 commit comments

Comments
 (0)