From 8e49ca6dfc88ea691fe1630d6d588a0350374a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Wed, 22 Apr 2015 23:53:13 +0200 Subject: [PATCH] Fixed weapon effect not using audio manager --- src/app/view/battle/Arena.ts | 5 +++++ src/app/view/battle/WeaponEffect.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/view/battle/Arena.ts b/src/app/view/battle/Arena.ts index 1d8e73d..48b2ce8 100644 --- a/src/app/view/battle/Arena.ts +++ b/src/app/view/battle/Arena.ts @@ -77,6 +77,11 @@ module SpaceTac.View { }); } + // Get the current GameUI instance + getGame(): GameUI { + return this.battleview.gameui; + } + // Remove a ship sprite removeShip(ship: Game.Ship): void { var sprite = this.findShipSprite(ship); diff --git a/src/app/view/battle/WeaponEffect.ts b/src/app/view/battle/WeaponEffect.ts index 190a42e..2d2d416 100644 --- a/src/app/view/battle/WeaponEffect.ts +++ b/src/app/view/battle/WeaponEffect.ts @@ -69,7 +69,7 @@ module SpaceTac.View { // Submachine gun effect (small chain of bullets) private gunEffect(): void { - this.arena.game.sound.play("battle-weapon-bullets"); + this.arena.getGame().audio.playOnce("battle-weapon-bullets"); var source = this.arena.toGlobal(new PIXI.Point(this.source.x, this.source.y)); var destination = this.arena.toGlobal(new PIXI.Point(this.destination.x, this.destination.y));