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> <body>
<audio id="bgm" src="/assets/music/game.mp3"></audio> <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="container-first">
<div class="content"> <div class="content">
<div class="boss"> <div class="boss">

View File

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