diff --git a/unpublishedScripts/marketplace/shortbow/enemyClientEntity.js b/unpublishedScripts/marketplace/shortbow/enemyClientEntity.js index 23d85be560..a1ce6e8450 100644 --- a/unpublishedScripts/marketplace/shortbow/enemyClientEntity.js +++ b/unpublishedScripts/marketplace/shortbow/enemyClientEntity.js @@ -11,6 +11,8 @@ (function() { Script.include('utils.js'); + var BOOF_SOUND = SoundCache.getSound(Script.resolvePath("sounds/boof.wav")); + function Enemy() { } Enemy.prototype = { @@ -74,6 +76,11 @@ type: 'ParticleEffect' }; + Audio.playSound(BOOF_SOUND, { + volume: 1.0, + position: Entities.getEntityProperties(entityA, 'position').position + }); + Entities.addEntity(smokeImage); Messages.sendMessage(this.gameChannel, JSON.stringify({ diff --git a/unpublishedScripts/marketplace/shortbow/shortbowGameManager.js b/unpublishedScripts/marketplace/shortbow/shortbowGameManager.js index c19c5e3bd3..f7dc1b4516 100644 --- a/unpublishedScripts/marketplace/shortbow/shortbowGameManager.js +++ b/unpublishedScripts/marketplace/shortbow/shortbowGameManager.js @@ -336,6 +336,13 @@ ShortbowGameManager.prototype = { volume: 1.0, position: this.rootPosition }); + + var liveChecker = setInterval(function() { + if (this.livesLeft <= 0) { + this.endGame(); + clearInterval(liveChecker); + } + }, 1000); }, startNextWave: function() { if (this.gameState !== GAME_STATES.BETWEEN_WAVES) { @@ -464,11 +471,11 @@ ShortbowGameManager.prototype = { print("EXPIRING: ", enemy.id); Entities.deleteEntity(enemy.id); this.remainingEnemies.splice(i, 1); + // Play the sound when you hit an enemy Audio.playSound(TARGET_HIT_SOUND, { volume: 1.0, position: this.rootPosition }); - print("CAINK - BALL KILLED"); this.setScore(this.score + POINTS_PER_KILL); enemiesEscaped = true; } @@ -562,7 +569,6 @@ ShortbowGameManager.prototype = { } }, onEnemyKilled: function(entityID, position) { - if (this.gameState !== GAME_STATES.PLAYING) { return; } diff --git a/unpublishedScripts/marketplace/shortbow/sounds/boof.wav b/unpublishedScripts/marketplace/shortbow/sounds/boof.wav new file mode 100644 index 0000000000..7c5d154075 Binary files /dev/null and b/unpublishedScripts/marketplace/shortbow/sounds/boof.wav differ