forked from noxious/client
#209: Play sound when a button is pressed
This commit is contained in:
parent
43c0f0ab1e
commit
a299d5dc55
@ -37,4 +37,13 @@ watch(
|
||||
gameStore.game.loadedAssets = []
|
||||
}
|
||||
)
|
||||
|
||||
// #209: Play sound when a button is pressed
|
||||
addEventListener('click', (event) => {
|
||||
if (event.target !instanceof HTMLButtonElement) {
|
||||
return
|
||||
}
|
||||
const audio = new Audio('/assets/music/click-btn.mp3')
|
||||
audio.play()
|
||||
})
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user