Created
May 9, 2014 10:35
-
-
Save anonymous/39aa102bd2ccf3b29670 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Phaser.Particles.Arcade.Emitter.prototype.paused = false; | |
Phaser.Particles.Arcade.Emitter.prototype.setPaused = function(val){ | |
if(val == this.paused){ | |
}else{ | |
this.paused = val; | |
var i = this.children.length; | |
while (i--) | |
{ | |
this.children[i].body.moves = !val; | |
} | |
} | |
} | |
Phaser.Particles.Arcade.Emitter.prototype.update = function () { | |
if (this.paused)return; | |
if (this.on) | |
{ | |
if (this._explode) | |
{ | |
this._counter = 0; | |
do | |
{ | |
this.emitParticle(); | |
this._counter++; | |
} | |
while (this._counter < this._quantity); | |
this.on = false; | |
} | |
else | |
{ | |
if (this.game.time.now >= this._timer) | |
{ | |
this.emitParticle(); | |
this._counter++; | |
if (this._quantity > 0) | |
{ | |
if (this._counter >= this._quantity) | |
{ | |
this.on = false; | |
} | |
} | |
this._timer = this.game.time.now + this.frequency; | |
} | |
} | |
} | |
var i = this.children.length; | |
while (i--) | |
{ | |
if (this.children[i].exists) | |
{ | |
this.children[i].update(); | |
} | |
} | |
}; | |
Phaser.Particle.prototype.preUpdate = function() { | |
if(this.parent.paused){ | |
return; | |
} | |
Phaser.Sprite.prototype.preUpdate.call(this); | |
} | |
Phaser.Particles.Arcade.Emitter.prototype = Phaser.Particles.Arcade.Emitter.prototype; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is amazing, thank you!