MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / init

Function init

assets/js/PigGame.js:19–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17
18// Starting conditions
19const init = function () {
20 scores = [0, 0];
21 currentScore = 0;
22 activePlayer = 0;
23 playing = true;
24
25 score0El.textContent = 0;
26 score1El.textContent = 0;
27 current0El.textContent = 0;
28 current1El.textContent = 0;
29
30 diceEl.classList.add("hidden");
31 player0El.classList.remove("player--winner");
32 player1El.classList.remove("player--winner");
33 player0El.classList.add("player--active");
34 player1El.classList.remove("player--active");
35};
36init();
37
38const switchPlayer = function () {

Callers 1

PigGame.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected