Skip to content

Commit 8c434a8

Browse files
committed
Fixed issue with Particles not being updated by the Emitter and rebuilt the dist files.
1 parent 2f46a9c commit 8c434a8

10 files changed

Lines changed: 75 additions & 51 deletions

File tree

build/custom/phaser-arcade-physics.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 01:53:26
10+
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 04:19:06
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -9702,7 +9702,7 @@ PIXI.RenderTexture.tempMatrix = new PIXI.Matrix();
97029702
*
97039703
* Phaser - http://phaser.io
97049704
*
9705-
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 01:53:26
9705+
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 04:19:06
97069706
*
97079707
* By Richard Davey http://www.photonstorm.com @photonstorm
97089708
*
@@ -31901,6 +31901,9 @@ Phaser.Particle.prototype.reset = function(x, y, health) {
3190131901

3190231902
this._cache[4] = 1;
3190331903

31904+
this.alpha = 1;
31905+
this.scale.set(1);
31906+
3190431907
this.autoScale = false;
3190531908
this.autoAlpha = false;
3190631909

@@ -48026,13 +48029,6 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () {
4802648029

4802748030
if (this.on)
4802848031
{
48029-
var i = this.children.length;
48030-
48031-
while (i--)
48032-
{
48033-
this.children[i].update();
48034-
}
48035-
4803648032
if (this._explode)
4803748033
{
4803848034
this._counter = 0;
@@ -48067,6 +48063,16 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () {
4806748063
}
4806848064
}
4806948065

48066+
var i = this.children.length;
48067+
48068+
while (i--)
48069+
{
48070+
if (this.children[i].exists)
48071+
{
48072+
this.children[i].update();
48073+
}
48074+
}
48075+
4807048076
};
4807148077

4807248078
/**
@@ -48367,7 +48373,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setAlpha = function (min, max, rate, e
4836748373
this.maxParticleAlpha = max;
4836848374
this.autoAlpha = false;
4836948375

48370-
if (rate > 0)
48376+
if (rate > 0 && min !== max)
4837148377
{
4837248378
var tweenData = { v: min };
4837348379
var tween = this.game.make.tween(tweenData).to( { v: max }, rate, ease);
@@ -48406,7 +48412,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setScale = function (min, max, rate, e
4840648412
this.maxParticleScale = max;
4840748413
this.autoScale = false;
4840848414

48409-
if (rate > 0)
48415+
if (rate > 0 && min !== max)
4841048416
{
4841148417
var tweenData = { v: min };
4841248418
var tween = this.game.make.tween(tweenData).to( { v: max }, rate, ease);

build/custom/phaser-arcade-physics.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-no-libs.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 01:53:26
10+
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 04:19:06
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -22206,6 +22206,9 @@ Phaser.Particle.prototype.reset = function(x, y, health) {
2220622206

2220722207
this._cache[4] = 1;
2220822208

22209+
this.alpha = 1;
22210+
this.scale.set(1);
22211+
2220922212
this.autoScale = false;
2221022213
this.autoAlpha = false;
2221122214

@@ -38331,13 +38334,6 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () {
3833138334

3833238335
if (this.on)
3833338336
{
38334-
var i = this.children.length;
38335-
38336-
while (i--)
38337-
{
38338-
this.children[i].update();
38339-
}
38340-
3834138337
if (this._explode)
3834238338
{
3834338339
this._counter = 0;
@@ -38372,6 +38368,16 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () {
3837238368
}
3837338369
}
3837438370

38371+
var i = this.children.length;
38372+
38373+
while (i--)
38374+
{
38375+
if (this.children[i].exists)
38376+
{
38377+
this.children[i].update();
38378+
}
38379+
}
38380+
3837538381
};
3837638382

3837738383
/**
@@ -38672,7 +38678,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setAlpha = function (min, max, rate, e
3867238678
this.maxParticleAlpha = max;
3867338679
this.autoAlpha = false;
3867438680

38675-
if (rate > 0)
38681+
if (rate > 0 && min !== max)
3867638682
{
3867738683
var tweenData = { v: min };
3867838684
var tween = this.game.make.tween(tweenData).to( { v: max }, rate, ease);
@@ -38711,7 +38717,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setScale = function (min, max, rate, e
3871138717
this.maxParticleScale = max;
3871238718
this.autoScale = false;
3871338719

38714-
if (rate > 0)
38720+
if (rate > 0 && min !== max)
3871538721
{
3871638722
var tweenData = { v: min };
3871738723
var tween = this.game.make.tween(tweenData).to( { v: max }, rate, ease);

build/custom/phaser-no-libs.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/phaser.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 01:53:26
10+
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 04:19:06
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -9702,7 +9702,7 @@ PIXI.RenderTexture.tempMatrix = new PIXI.Matrix();
97029702
*
97039703
* Phaser - http://phaser.io
97049704
*
9705-
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 01:53:26
9705+
* v2.0.3 "Allorallen" - Built: Thu Apr 10 2014 04:19:06
97069706
*
97079707
* By Richard Davey http://www.photonstorm.com @photonstorm
97089708
*
@@ -31901,6 +31901,9 @@ Phaser.Particle.prototype.reset = function(x, y, health) {
3190131901

3190231902
this._cache[4] = 1;
3190331903

31904+
this.alpha = 1;
31905+
this.scale.set(1);
31906+
3190431907
this.autoScale = false;
3190531908
this.autoAlpha = false;
3190631909

@@ -48026,13 +48029,6 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () {
4802648029

4802748030
if (this.on)
4802848031
{
48029-
var i = this.children.length;
48030-
48031-
while (i--)
48032-
{
48033-
this.children[i].update();
48034-
}
48035-
4803648032
if (this._explode)
4803748033
{
4803848034
this._counter = 0;
@@ -48067,6 +48063,16 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () {
4806748063
}
4806848064
}
4806948065

48066+
var i = this.children.length;
48067+
48068+
while (i--)
48069+
{
48070+
if (this.children[i].exists)
48071+
{
48072+
this.children[i].update();
48073+
}
48074+
}
48075+
4807048076
};
4807148077

4807248078
/**
@@ -48367,7 +48373,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setAlpha = function (min, max, rate, e
4836748373
this.maxParticleAlpha = max;
4836848374
this.autoAlpha = false;
4836948375

48370-
if (rate > 0)
48376+
if (rate > 0 && min !== max)
4837148377
{
4837248378
var tweenData = { v: min };
4837348379
var tween = this.game.make.tween(tweenData).to( { v: max }, rate, ease);
@@ -48406,7 +48412,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setScale = function (min, max, rate, e
4840648412
this.maxParticleScale = max;
4840748413
this.autoScale = false;
4840848414

48409-
if (rate > 0)
48415+
if (rate > 0 && min !== max)
4841048416
{
4841148417
var tweenData = { v: min };
4841248418
var tween = this.game.make.tween(tweenData).to( { v: max }, rate, ease);

build/phaser.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/phaser.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
568 KB
Loading

src/gameobjects/Particle.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ Phaser.Particle.prototype.reset = function(x, y, health) {
173173

174174
this._cache[4] = 1;
175175

176+
this.alpha = 1;
177+
this.scale.set(1);
178+
176179
this.autoScale = false;
177180
this.autoAlpha = false;
178181

src/particles/arcade/Emitter.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,6 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () {
249249

250250
if (this.on)
251251
{
252-
var i = this.children.length;
253-
254-
while (i--)
255-
{
256-
this.children[i].update();
257-
}
258-
259252
if (this._explode)
260253
{
261254
this._counter = 0;
@@ -290,6 +283,16 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () {
290283
}
291284
}
292285

286+
var i = this.children.length;
287+
288+
while (i--)
289+
{
290+
if (this.children[i].exists)
291+
{
292+
this.children[i].update();
293+
}
294+
}
295+
293296
};
294297

295298
/**
@@ -590,7 +593,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setAlpha = function (min, max, rate, e
590593
this.maxParticleAlpha = max;
591594
this.autoAlpha = false;
592595

593-
if (rate > 0)
596+
if (rate > 0 && min !== max)
594597
{
595598
var tweenData = { v: min };
596599
var tween = this.game.make.tween(tweenData).to( { v: max }, rate, ease);
@@ -629,7 +632,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setScale = function (min, max, rate, e
629632
this.maxParticleScale = max;
630633
this.autoScale = false;
631634

632-
if (rate > 0)
635+
if (rate > 0 && min !== max)
633636
{
634637
var tweenData = { v: min };
635638
var tween = this.game.make.tween(tweenData).to( { v: max }, rate, ease);

0 commit comments

Comments
 (0)