Skip to content

Commit 3a142d5

Browse files
authored
Merge pull request phaserjs#2901 from keksmampfer/emitter-gravity
change Emitter.gravity from number to Phaser.Point
2 parents 54590c2 + ce752d3 commit 3a142d5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

v2-community/src/particles/arcade/Emitter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
115115
this.alphaData = null;
116116

117117
/**
118-
* @property {number} gravity - Sets the `body.gravity.y` of each particle sprite to this value on launch.
118+
* @property {Phaser.Point} gravity - Sets the `body.gravity` of each particle sprite to this on launch.
119119
* @default
120120
*/
121-
this.gravity = 100;
121+
this.gravity = new Phaser.Point(0, 100);
122122

123123
/**
124124
* @property {any} particleClass - For emitting your own particle class types. They must extend Phaser.Particle.
@@ -675,7 +675,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function (x, y, key, fr
675675
body.velocity.y = rnd.between(this.minParticleSpeed.y, this.maxParticleSpeed.y);
676676
body.angularVelocity = rnd.between(this.minRotation, this.maxRotation);
677677

678-
body.gravity.y = this.gravity;
678+
body.gravity = this.gravity;
679679
body.angularDrag = this.angularDrag;
680680

681681
particle.onEmit();

0 commit comments

Comments
 (0)