function timerFunc() {
    let timer = setInterval(function () {
        sec--;
        document.getElementById('timer').innerHTML = "Timer: " + sec;

        if (sec <= 0) {
            document.getElementById('timer').innerHTML = "Timer: " + sec;
            clearInterval(timer);
            gameOver();
        }
    }, 1000);
}
// This function sets the timer to count down every second, once the start button is clicked
This function sets the timer to count down every second, once the start button is clicked
This function sets the timer to count down every second once the start button is clicked
function timerFunc() {
    let timer = setInterval(function () {
        sec--;
        document.getElementById('timer').innerHTML = "Timer: " + sec;
        if (sec <= 0) {
            document.getElementById('timer').innerHTML = "Timer: " + sec;
            clearInterval(timer);
            gameOver();
        }
    }, 1000);
}
function timerFunc ( ) { let timer = setInterval ( function ( ) { sec -- ; document . getElementById ( 'timer' ) . innerHTML = "Timer: " + sec ; if ( sec <= 0 ) { document . getElementById ( 'timer' ) . innerHTML = "Timer: " + sec ; clearInterval ( timer ) ; gameOver ( ) ; } } , 1000 ) ; }
This function sets the timer to count down every second, once the start button is clicked
This function sets the timer to count down every second once the start button is clicked