diff --git a/Snake Game/script.js b/Snake Game/script.js index b6dd8f4..c89e190 100644 --- a/Snake Game/script.js +++ b/Snake Game/script.js @@ -114,6 +114,15 @@ else{ hiscoreBox.innerHTML = "HiScore: " + hiscore; } +function toggleMute(){ + if(musicSound.paused){ + musicSound.play(); + } + else{ + musicSound.pause(); + } +} + window.requestAnimationFrame(main); window.addEventListener('keydown', e =>{ inputDir = {x: 0, y: 1} // Start the game