function toggleAudio() {
    if(audio.isSoundMuted === false && audio.isMusicMuted === false)
    {
        audio.isSoundMuted = true;
        audio.isMusicMuted = true;
        audio.gameMusic.pause();
        audio.gameMusic.currentTime = 0;
        audio.clickAudio.pause();
        gameAudioButton.innerHTML = "<i class='fas fa-volume-mute'></i>";
    } else if(audio.isSoundMuted === false) {
        audio.isSoundMuted = true;
        audio.clickAudio.pause();
        gameAudioButton.innerHTML = "<i class='fas fa-volume-mute'></i>";
    } else if(audio.isMusicMuted === false) {
        audio.isMusicMuted = true;
        audio.gameMusic.pause();
        gameAudioButton.innerHTML = "<i class='fas fa-volume-mute'></i>";
    } else {
        audio.isSoundMuted = false;
        audio.isMusicMuted = false;
        audio.clickAudio.play();
        audio.gameMusic.play();
        audio.gameMusic.loop = true;
        gameAudioButton.innerHTML = "<i class='fas fa-volume-up'></i>";
    }
}
// Toggles both Music and Sound together
Toggles both Music and Sound together
Toggles both Music and Sound together
function toggleAudio() {
    if(audio.isSoundMuted === false && audio.isMusicMuted === false)
    {
        audio.isSoundMuted = true;
        audio.isMusicMuted = true;
        audio.gameMusic.pause();
        audio.gameMusic.currentTime = 0;
        audio.clickAudio.pause();
        gameAudioButton.innerHTML = "<i class='fas fa-volume-mute'></i>";
    } else if(audio.isSoundMuted === false) {
        audio.isSoundMuted = true;
        audio.clickAudio.pause();
        gameAudioButton.innerHTML = "<i class='fas fa-volume-mute'></i>";
    } else if(audio.isMusicMuted === false) {
        audio.isMusicMuted = true;
        audio.gameMusic.pause();
        gameAudioButton.innerHTML = "<i class='fas fa-volume-mute'></i>";
    } else {
        audio.isSoundMuted = false;
        audio.isMusicMuted = false;
        audio.clickAudio.play();
        audio.gameMusic.play();
        audio.gameMusic.loop = true;
        gameAudioButton.innerHTML = "<i class='fas fa-volume-up'></i>";
    }
}
function toggleAudio ( ) { if ( audio . isSoundMuted === false && audio . isMusicMuted === false ) { audio . isSoundMuted = true ; audio . isMusicMuted = true ; audio . gameMusic . pause ( ) ; audio . gameMusic . currentTime = 0 ; audio . clickAudio . pause ( ) ; gameAudioButton . innerHTML = "<i class='fas fa-volume-mute'></i>" ; } else if ( audio . isSoundMuted === false ) { audio . isSoundMuted = true ; audio . clickAudio . pause ( ) ; gameAudioButton . innerHTML = "<i class='fas fa-volume-mute'></i>" ; } else if ( audio . isMusicMuted === false ) { audio . isMusicMuted = true ; audio . gameMusic . pause ( ) ; gameAudioButton . innerHTML = "<i class='fas fa-volume-mute'></i>" ; } else { audio . isSoundMuted = false ; audio . isMusicMuted = false ; audio . clickAudio . play ( ) ; audio . gameMusic . play ( ) ; audio . gameMusic . loop = true ; gameAudioButton . innerHTML = "<i class='fas fa-volume-up'></i>" ; } }
Toggles both Music and Sound together
Toggles both Music and Sound together