1
0
Fork 0

Fixed music restarting on startMusic, even when the same key was used

This commit is contained in:
Michaël Lemaire 2015-04-26 21:38:04 +02:00
parent a0125d1a04
commit ee8bf3b4a3

View file

@ -27,12 +27,13 @@ module SpaceTac.View {
// Start a background music
startMusic(key: string): void {
key = "music-" + key;
if (this.isActive()) {
if (this.music && this.music.key !== key) {
this.stopMusic();
}
if (!this.music) {
this.music = this.game.sound.play("music-" + key, 1, true);
this.music = this.game.sound.play(key, 1, true);
}
}
}