diff --git a/Phaser/SoundManager.ts b/Phaser/SoundManager.ts index 4a47964b..c30d86ef 100644 --- a/Phaser/SoundManager.ts +++ b/Phaser/SoundManager.ts @@ -111,7 +111,7 @@ module Phaser { var tempSound: Sound = new Sound(this._context, this._gainNode, null, volume, loop); // this is an async process, so we can return the Sound object anyway, it just won't be playing yet - this.decode(key, () => this.play(key), tempSound); + this.decode(key, () => tempSound.play(), tempSound); return tempSound; } diff --git a/Phaser/system/Sound.ts b/Phaser/system/Sound.ts index 1ee00b77..fdd0d9a2 100644 --- a/Phaser/system/Sound.ts +++ b/Phaser/system/Sound.ts @@ -54,7 +54,7 @@ module Phaser { this._buffer = data; this.isDecoding = false; - this.play(); + //this.play(); } diff --git a/README.md b/README.md index a4857f9f..7ddc83e2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Phaser ====== -Version: 0.9.5 - Released: XXX 2013 +Version: 0.9.5 - Released: 2nd May 2013 By Richard Davey, [Photon Storm](http://www.photonstorm.com) @@ -50,6 +50,7 @@ V0.9.5 * Added TilemapLayer.fillTiles - fills the given region of the map with the tile specified. * Added TilemapLayer.randomiseTiles - fills the given region of the map with a random tile from the list specified. * Added fun new "map draw" test - reflect those carrots! :) +* Changed SoundManager class to respect volume on first place (thanks initials and hackmaniac) Requirements ------------ diff --git a/Tests/Flash.js b/Tests/Flash.js deleted file mode 100644 index 21661d9d..00000000 --- a/Tests/Flash.js +++ /dev/null @@ -1,73 +0,0 @@ -var Phaser; -(function (Phaser) { - (function (FX) { - /// - /// - /** - * Phaser - FX - Camera - Flash - * - * - */ - (function (Camera) { - var Flash = (function () { - function Flash(game) { - this._fxFlashComplete = null; - this._fxFlashDuration = 0; - this._fxFlashAlpha = 0; - this._game = game; - } - Flash.prototype.start = /** - * The camera is filled with this color and returns to normal at the given duration. - * - * @param Color The color you want to use in 0xRRGGBB format, i.e. 0xffffff for white. - * @param Duration How long it takes for the flash to fade. - * @param OnComplete An optional function you want to run when the flash finishes. Set to null for no callback. - * @param Force Force an already running flash effect to reset. - */ - function (color, duration, onComplete, force) { - if (typeof color === "undefined") { color = 0xffffff; } - if (typeof duration === "undefined") { duration = 1; } - if (typeof onComplete === "undefined") { onComplete = null; } - if (typeof force === "undefined") { force = false; } - if(force === false && this._fxFlashAlpha > 0) { - // You can't flash again unless you force it - return; - } - if(duration <= 0) { - duration = 1; - } - var red = color >> 16 & 0xFF; - var green = color >> 8 & 0xFF; - var blue = color & 0xFF; - this._fxFlashColor = 'rgba(' + red + ',' + green + ',' + blue + ','; - this._fxFlashDuration = duration; - this._fxFlashAlpha = 1; - this._fxFlashComplete = onComplete; - }; - Flash.prototype.postUpdate = function () { - // Update the Flash effect - if(this._fxFlashAlpha > 0) { - this._fxFlashAlpha -= this._game.time.elapsed / this._fxFlashDuration; - this._fxFlashAlpha = this._game.math.roundTo(this._fxFlashAlpha, -2); - if(this._fxFlashAlpha <= 0) { - this._fxFlashAlpha = 0; - if(this._fxFlashComplete !== null) { - this._fxFlashComplete(); - } - } - } - }; - Flash.prototype.postRender = function (cameraX, cameraY, cameraWidth, cameraHeight) { - if(this._fxFlashAlpha > 0) { - this._game.stage.context.fillStyle = this._fxFlashColor + this._fxFlashAlpha + ')'; - this._game.stage.context.fillRect(cameraX, cameraY, cameraWidth, cameraHeight); - } - }; - return Flash; - })(); - Camera.Flash = Flash; - })(FX.Camera || (FX.Camera = {})); - var Camera = FX.Camera; - })(Phaser.FX || (Phaser.FX = {})); - var FX = Phaser.FX; -})(Phaser || (Phaser = {}));