Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Bug 738332: Make other players play a sound when they hit, kill or die
Browse files Browse the repository at this point in the history
  • Loading branch information
glecollinet committed Mar 24, 2012
1 parent a6234bf commit 3f97029
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/js/game.js
Expand Up @@ -1189,6 +1189,10 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
self.removeFromEntityGrid(entity, entity.gridX, entity.gridY);
self.removeFromPathingGrid(entity.gridX, entity.gridY);

if(self.camera.isVisible(entity)) {
self.audioManager.playSound("kill"+Math.floor(Math.random()*2+1));
}

self.updateCursor();
});

Expand Down Expand Up @@ -1358,8 +1362,6 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
if(kind === Types.Entities.BOSS) {
self.tryUnlockingAchievement("HERO");
}

self.audioManager.playSound("kill"+Math.floor(Math.random()*2+1));
});

self.client.onPlayerChangeHealth(function(points, isRegen) {
Expand Down Expand Up @@ -2033,6 +2035,9 @@ function(InfoManager, BubbleManager, Renderer, Map, Animation, Sprite, AnimatedT
character.hit();
if(character.id === this.playerId) {
this.client.sendHit(character.target);
}

if(character instanceof Player && this.camera.isVisible(character)) {
this.audioManager.playSound("hit"+Math.floor(Math.random()*2+1));
}

Expand Down

0 comments on commit 3f97029

Please sign in to comment.