mirror of
https://github.com/overte-org/overte.git
synced 2025-04-12 10:42:10 +02:00
Added sound effect (temp) when you hit a ball, plus added a check to ensure the game doesn't hang waiting for balls out of the arena.
This commit is contained in:
parent
135beb2d48
commit
394560c979
3 changed files with 15 additions and 2 deletions
|
@ -11,6 +11,8 @@
|
||||||
(function() {
|
(function() {
|
||||||
Script.include('utils.js');
|
Script.include('utils.js');
|
||||||
|
|
||||||
|
var BOOF_SOUND = SoundCache.getSound(Script.resolvePath("sounds/boof.wav"));
|
||||||
|
|
||||||
function Enemy() {
|
function Enemy() {
|
||||||
}
|
}
|
||||||
Enemy.prototype = {
|
Enemy.prototype = {
|
||||||
|
@ -74,6 +76,11 @@
|
||||||
type: 'ParticleEffect'
|
type: 'ParticleEffect'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Audio.playSound(BOOF_SOUND, {
|
||||||
|
volume: 1.0,
|
||||||
|
position: Entities.getEntityProperties(entityA, 'position').position
|
||||||
|
});
|
||||||
|
|
||||||
Entities.addEntity(smokeImage);
|
Entities.addEntity(smokeImage);
|
||||||
|
|
||||||
Messages.sendMessage(this.gameChannel, JSON.stringify({
|
Messages.sendMessage(this.gameChannel, JSON.stringify({
|
||||||
|
|
|
@ -336,6 +336,13 @@ ShortbowGameManager.prototype = {
|
||||||
volume: 1.0,
|
volume: 1.0,
|
||||||
position: this.rootPosition
|
position: this.rootPosition
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var liveChecker = setInterval(function() {
|
||||||
|
if (this.livesLeft <= 0) {
|
||||||
|
this.endGame();
|
||||||
|
clearInterval(liveChecker);
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
},
|
},
|
||||||
startNextWave: function() {
|
startNextWave: function() {
|
||||||
if (this.gameState !== GAME_STATES.BETWEEN_WAVES) {
|
if (this.gameState !== GAME_STATES.BETWEEN_WAVES) {
|
||||||
|
@ -464,11 +471,11 @@ ShortbowGameManager.prototype = {
|
||||||
print("EXPIRING: ", enemy.id);
|
print("EXPIRING: ", enemy.id);
|
||||||
Entities.deleteEntity(enemy.id);
|
Entities.deleteEntity(enemy.id);
|
||||||
this.remainingEnemies.splice(i, 1);
|
this.remainingEnemies.splice(i, 1);
|
||||||
|
// Play the sound when you hit an enemy
|
||||||
Audio.playSound(TARGET_HIT_SOUND, {
|
Audio.playSound(TARGET_HIT_SOUND, {
|
||||||
volume: 1.0,
|
volume: 1.0,
|
||||||
position: this.rootPosition
|
position: this.rootPosition
|
||||||
});
|
});
|
||||||
print("CAINK - BALL KILLED");
|
|
||||||
this.setScore(this.score + POINTS_PER_KILL);
|
this.setScore(this.score + POINTS_PER_KILL);
|
||||||
enemiesEscaped = true;
|
enemiesEscaped = true;
|
||||||
}
|
}
|
||||||
|
@ -562,7 +569,6 @@ ShortbowGameManager.prototype = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onEnemyKilled: function(entityID, position) {
|
onEnemyKilled: function(entityID, position) {
|
||||||
|
|
||||||
if (this.gameState !== GAME_STATES.PLAYING) {
|
if (this.gameState !== GAME_STATES.PLAYING) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
BIN
unpublishedScripts/marketplace/shortbow/sounds/boof.wav
Normal file
BIN
unpublishedScripts/marketplace/shortbow/sounds/boof.wav
Normal file
Binary file not shown.
Loading…
Reference in a new issue