GrandTabernacleAutoVI/js/sound.js
Marty Killian 8be4120b36 commit
2023-12-07 13:45:38 +01:00

17 lines
No EOL
380 B
JavaScript

class Sound{
constructor(url){
this.assetsUrl = url;
}
loadSounds(){
console.log(this.assetsUrl + "shoot.mp3")
this.shootSound = new Audio(this.assetsUrl + "shoot.mp3");
this.shootSound.type = "audio/mp3";
}
shoot(){
this.shootSound.pause()
this.shootSound.currentTime=0;
this.shootSound.play()
}
}