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

Function switchPlayer

assets/js/PigGame.js:38–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36init();
37
38const switchPlayer = function () {
39 document.getElementById(`current--${activePlayer}`).textContent = 0;
40 currentScore = 0;
41 activePlayer = activePlayer === 0 ? 1 : 0;
42 player0El.classList.toggle("player--active");
43 player1El.classList.toggle("player--active");
44};
45
46// Rolling dice functionality
47btnRoll.addEventListener("click", function () {

Callers 1

PigGame.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected