Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
MajesticWafer authored Nov 13, 2024
1 parent 80f2aa5 commit 1b0a01e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion slots/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ <h1>🎰 Slot Machine 🎰</h1>
const slotMachine = document.getElementById("slot-machine");
const moneyRainDiv = document.getElementById("money-rain");
const scoreDisplay = document.getElementById("score");
var sound = false
let score = 0;
let highScore = getCookie("highScore") || 0;

Expand All @@ -155,7 +156,12 @@ <h1>🎰 Slot Machine 🎰</h1>

function pullsfx() {
const sfx = document.getElementById("pull-audio");
sfx.play();

if (sound === "false") {
return
} else {
sfx.play();
}
}

function spin() {
Expand Down Expand Up @@ -222,10 +228,12 @@ <h1>🎰 Slot Machine 🎰</h1>
if (bgm.paused) {
bgm.play();
sfx.play();
sound = "true";
audioIcon.classList.replace("bi-volume-mute-fill", "bi-volume-up-fill");
} else {
bgm.pause();
sfx.pause();
sound = "false";
audioIcon.classList.replace("bi-volume-up-fill", "bi-volume-mute-fill");
}
}
Expand Down

0 comments on commit 1b0a01e

Please sign in to comment.