From ebd1de253cf9dc9f34efe60ce6dc05442e4dbf08 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sat, 14 Jun 2014 00:19:07 -0700 Subject: [PATCH] Add positional sounds from the tilemap --- moonlight/js/moonlight-skulk.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 4a7d269..115d26e 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -92,6 +92,13 @@ SoundSprite.prototype.update_new_values = function() { } return; } + this.sound_marker = parseInt(this.sound_marker); + this.sound_position = parseInt(this.sound_marker); + this.sound_volume = Number(this.sound_volume); + this.sound_loop = Boolean(this.sound_loop); + this.sound_forcerestart = Boolean(this.sound_forcerestart); + this.sound_nofade = Boolean(this.sound_nofade); + this.sound = game.add.audio(this.sound_key); this.sound.play( this.sound_marker, @@ -104,7 +111,7 @@ SoundSprite.prototype.update_new_values = function() { SoundSprite.prototype.adjust_relative_to = function(spr) { if ( this.sound_nofade == true ) { - this.sound.volume = 1.0; + this.sound.volume = this.sound_volume; return; }