function checkClickInGame(e) {
    if (fieldActive) {
      playerHasClicked = true;
      //if you didn't hit. Play audio. Lose a life.
      if (
        this.getAttribute("data-active") === "true" &&
        this.getAttribute("data-img") === "hole"
      ) {
        loseAudio.play();
        life.value--;
      } else {
        //Counter goes up. Audio plays. Mole changes. Mole shakes.
        hitAudio.play();
        this.src = "img/mole_hitted.png";
        this.classList.add("shake");
        ++molesKilled;
      }

      //Check if you have lives left
      if (life.value === "0") {
        showGameOverCard();
      }
    }
  }
//Here we check if you hit the mole or missed it. A Miss = you lose a life. fieldActive is used to prevent multi-clicking per round.

Here we check if you hit the mole or missed it. A Miss = you lose a life. fieldActive is used to prevent multi-clicking per round.
Here we check if you hit the mole or missed it . A Miss = you lose a life . fieldActive is used to prevent multi - clicking per round .
function checkClickInGame(e) {
    if (fieldActive) {
      playerHasClicked = true;
      if (
        this.getAttribute("data-active") === "true" &&
        this.getAttribute("data-img") === "hole"
      ) {
        loseAudio.play();
        life.value--;
      } else {
        hitAudio.play();
        this.src = "img/mole_hitted.png";
        this.classList.add("shake");
        ++molesKilled;
      }
      if (life.value === "0") {
        showGameOverCard();
      }
    }
  }
function checkClickInGame ( e ) { if ( fieldActive ) { playerHasClicked = true ; if ( this . getAttribute ( "data-active" ) === "true" && this . getAttribute ( "data-img" ) === "hole" ) { loseAudio . play ( ) ; life . value -- ; } else { hitAudio . play ( ) ; this . src = "img/mole_hitted.png" ; this . classList . add ( "shake" ) ; ++ molesKilled ; } if ( life . value === "0" ) { showGameOverCard ( ) ; } } }
Here we check if you hit the mole or missed it.
Here we check if you hit the mole or missed it .
//if you didn't hit. Play audio. Lose a life.
 //Counter goes up. Audio plays. Mole changes. Mole shakes.
 //Check if you have lives left
