Fixed an error that stopped 2 tweens from being able to run on the same object. Also refactored a lot of the classes to remove prototype properties and move them to local instance properties.

This commit is contained in:
Richard Davey
2013-09-10 20:40:34 +01:00
parent a486bf6b4a
commit e41e35fd09
23 changed files with 533 additions and 558 deletions
+7 -17
View File
@@ -3,6 +3,13 @@ Phaser.Sound = function (game, key, volume, loop) {
volume = volume || 1;
loop = loop || false;
this.game = game;
this.name = '';
this.key = key;
this.loop = loop;
this._volume = volume;
this.markers = {};
/**
* Reference to AudioContext instance.
*/
@@ -15,9 +22,6 @@ Phaser.Sound = function (game, key, volume, loop) {
this._muted = false;
this.name = '';
this.markers = {};
this.autoplay = false;
this.totalDuration = 0;
this.startTime = 0;
@@ -30,20 +34,6 @@ Phaser.Sound = function (game, key, volume, loop) {
this.pendingPlayback = false;
this.override = false;
this.onDecoded = null;
this.onPlay = null;
this.onPause = null;
this.onResume = null;
this.onLoop = null;
this.onStop = null;
this.onMute = null;
this.onMarkerComplete = null;
this.game = game;
this.key = key;
this._volume = volume;
this.loop = loop;
this.usingWebAudio = this.game.sound.usingWebAudio;
this.usingAudioTag = this.game.sound.usingAudioTag;
+15 -18
View File
@@ -7,29 +7,26 @@ Phaser.SoundManager = function (game) {
this.game = game;
this.onSoundDecode = new Phaser.Signal;
this._muted = false;
this._unlockSource = null;
this._volume = 1;
this._muted = false;
this._sounds = [];
this.context = null;
this.usingWebAudio = true;
this.usingAudioTag = false;
this.noAudio = false;
this.touchLocked = false;
this.channels = 32;
};
Phaser.SoundManager.prototype = {
game: null,
_muted: false,
_unlockSource: null,
_volume: 1,
_muted: false,
_sounds: [],
context: null,
usingWebAudio: true,
usingAudioTag: false,
noAudio: false,
touchLocked: false,
onSoundDecode: null,
channels: 32,
boot: function () {
if (this.game.device.iOS && this.game.device.webAudio == false)