Sound effect... WHAAAT?

This commit is contained in:
Sami 2025-08-02 00:36:39 -04:00
parent c448a63b7c
commit 1a0b855d99
2 changed files with 9 additions and 0 deletions

BIN
Celebration.mp3 Normal file

Binary file not shown.

View File

@ -239,9 +239,18 @@ function shakeTiles(tiles) {
)
})
}
// The CELEBRATION SOUND EFFECT
function playCelebrationSound() {
const audio = new Audio('celebration.mp3')
audio.volume = 0.5 // Adjust volume as needed
audio.play().catch(error => {
console.error('Error playing celebration sound:', error)
})
}
// IT'S RIGHT HERE YOU BLIND MOFO"
function checkWinLose(guess, tiles) {
if (guess === targetWord) {
playCelebrationSound()
showAlert("Congratulations, You win!", 5000)
danceTiles(tiles)
celebrateWithConfetti()