Skip to content

Commit 7ff4c59

Browse files
committed
Fire particle from follower position. Fix phaserjs#5437
1 parent 675e83e commit 7ff4c59

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/gameobjects/particles/ParticleEmitter.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,9 @@ var ParticleEmitter = new Class({
19221922

19231923
var dead = this.dead;
19241924

1925+
var followX = (this.follow) ? this.follow.x + this.followOffset.x : x;
1926+
var followY = (this.follow) ? this.follow.y + this.followOffset.y : y;
1927+
19251928
for (var i = 0; i < count; i++)
19261929
{
19271930
var particle = dead.pop();
@@ -1931,7 +1934,7 @@ var ParticleEmitter = new Class({
19311934
particle = new this.particleClass(this);
19321935
}
19331936

1934-
particle.fire(x, y);
1937+
particle.fire(followX, followY);
19351938

19361939
if (this.particleBringToTop)
19371940
{

0 commit comments

Comments
 (0)