function toggleSound(givenSound){
            if (!givenSound.isPlaying){
                givenSound.play()
            }
            if (global.soundEffectsOn == true){
                givenSound.volume = 1;
            } else {
                givenSound.volume = 0;
            }
        }
//so it doesn't play from the beginning every time.
so it doesn't play from the beginning every time.
so it doesn ' t play from the beginning every time .
function toggleSound(givenSound){
            if (!givenSound.isPlaying){
                givenSound.play()
            }
            if (global.soundEffectsOn == true){
                givenSound.volume = 1;
            } else {
                givenSound.volume = 0;
            }
        }
function toggleSound ( givenSound ) { if ( ! givenSound . isPlaying ) { givenSound . play ( ) } if ( global . soundEffectsOn == true ) { givenSound . volume = 1 ; } else { givenSound . volume = 0 ; } }
so it doesn't play from the beginning every time.
so it doesn ' t play from the beginning every time .