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() } }