This commit is contained in:
Carolus Bramnatyo Seno Mahesworo 2025-12-03 16:13:11 +07:00
parent cca4a7ebbc
commit 97f09feccc
4 changed files with 6 additions and 0 deletions

BIN
src/assets/music/heart.mp3 Normal file

Binary file not shown.

BIN
src/assets/music/slash.mp3 Normal file

Binary file not shown.

View File

@ -13,6 +13,8 @@
<body>
<audio id="bgm" src="/assets/music/game.mp3"></audio>
<audio id="sfx" src="/assets/music/slash.mp3"></audio>
<audio id="sfxhrt" src="/assets/music/heart.mp3"></audio>
<div class="container-first">
<div class="content">
<div class="boss">

View File

@ -92,11 +92,15 @@ function selectAnswer(e){
score += 10;
shake(document.getElementById("boss"))
dmg();
const bgm = document.getElementById("sfx");
bgm.play()
} else {
selectedBtn.classList.add("Incorrect");
wrongCount ++;
shake(document.getElementById("hrt"))
updateHearts();
const bgm = document.getElementById("sfxhrt");
bgm.play()
if(wrongCount >= maxWrong){
setTimeout(()=>{