diff --git a/public/js/classes/Projectile.js b/public/js/classes/Projectile.js index 21dc640..f5a0e71 100644 --- a/public/js/classes/Projectile.js +++ b/public/js/classes/Projectile.js @@ -18,6 +18,7 @@ class Projectile { draw() { if (this.gunName === 'CrossBow'){ c.save() + c.lineWidth = 6 c.fillStyle = 'rgb(200,200,200)' c.beginPath() c.arc(this.x,this.y, 10, this.startangle, this.endangle, false) // 10 is about the speed at terminal diff --git a/public/js/eventListeners.js b/public/js/eventListeners.js index 5758ebd..ba663a0 100644 --- a/public/js/eventListeners.js +++ b/public/js/eventListeners.js @@ -40,7 +40,7 @@ function shootProj(event){ listen = false // block const consumeSound = frontEndConsumableSounds[currentItemName]// new Audio(`/consumeSound/${currentItemName}.mp3`) - consumeSound.cloneNode(true).play() + consumeSound.play() // decrease amount here (if needed in future) @@ -182,7 +182,7 @@ function reloadGun(){ //console.log("reloading!") let reloadSound = frontEndGunReloadSounds[currentGunName] //new Audio(`/reloadSound/${currentGunName}.mp3`) - reloadSound.cloneNode(true).play() + reloadSound.play() // reload ammo here!!!!! frontEndPlayer.reloading = true diff --git a/public/js/frontend.js b/public/js/frontend.js index 72a732f..a4afbb6 100644 --- a/public/js/frontend.js +++ b/public/js/frontend.js @@ -69,7 +69,7 @@ socket.on('serverVars',( {gunInfo, ammoInfo, consumableInfo, PLAYERSPEED})=>{ - //console.log("front end got the variables from the server") + console.log("front end got the variables from the server") }) @@ -263,11 +263,12 @@ socket.on('updateFrontEnd',({backEndPlayers, backEndEnemies, backEndProjectiles, const DISTANCE = Math.hypot(backEndProjectile.x - me.x, backEndProjectile.y - me.y) const thatGunSoundDistance = gunInfoFrontEnd[gunName].projectileSpeed * 20 if (gunName && (DISTANCE-100 < thatGunSoundDistance) ){ - let gunSound = frontEndGunSounds[gunName] //new Audio(`/sound/${gunName}.mp3`) + let gunSound = frontEndGunSounds[gunName].cloneNode(true) //new Audio(`/sound/${gunName}.mp3`) if (DISTANCE > 100){ gunSound.volume = Math.round( 10*(thatGunSoundDistance - (DISTANCE-100))/thatGunSoundDistance ) / 10 } - gunSound.cloneNode(true).play() + gunSound.play() + gunSound.remove() } } @@ -301,7 +302,7 @@ socket.on('updateFrontEnd',({backEndPlayers, backEndEnemies, backEndProjectiles, const DISTANCE = Math.hypot(backendDrawable.start.x - me.x, backendDrawable.start.y - me.y) if (DISTANCE < GUNHEARRANGE) { let gunSound = frontEndGunSounds['railgun']// new Audio('/sound/railgun.mp3') - gunSound.cloneNode(true).play() + gunSound.play() } }