@@ -46,15 +46,25 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) {
4646 */
4747 this . maxParticleSpeed = new Phaser . Point ( 100 , 100 ) ;
4848
49+ /**
50+ * The minimum possible scale of a particle.
51+ * The default value is 1.
52+ */
53+ this . minParticleScale = 1 ;
54+
55+ /**
56+ * The maximum possible scale of a particle.
57+ * The default value is 1.
58+ */
59+ this . maxParticleScale = 1 ;
60+
4961 /**
5062 * The minimum possible angular velocity of a particle. The default value is -360.
51- * NOTE: rotating particles are more expensive to draw than non-rotating ones!
5263 */
5364 this . minRotation = - 360 ;
5465
5566 /**
5667 * The maximum possible angular velocity of a particle. The default value is 360.
57- * NOTE: rotating particles are more expensive to draw than non-rotating ones!
5868 */
5969 this . maxRotation = 360 ;
6070
@@ -325,7 +335,6 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () {
325335
326336 if ( this . width > 1 || this . height > 1 )
327337 {
328- // particle.reset(this.x - this.game.rnd.integerInRange(this.left, this.right), this.y - this.game.rnd.integerInRange(this.top, this.bottom));
329338 particle . reset ( this . x - this . game . rnd . integerInRange ( this . left , this . right ) , this . y - this . game . rnd . integerInRange ( this . top , this . bottom ) ) ;
330339 }
331340 else
@@ -366,6 +375,12 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () {
366375 particle . body . angularVelocity = this . minRotation ;
367376 }
368377
378+ if ( this . minParticleScale !== 1 || this . maxParticleScale !== 1 )
379+ {
380+ var scale = this . game . rnd . realInRange ( this . minParticleScale , this . maxParticleScale ) ;
381+ particle . scale . setTo ( scale , scale ) ;
382+ }
383+
369384 particle . body . drag . x = this . particleDrag . x ;
370385 particle . body . drag . y = this . particleDrag . y ;
371386
0 commit comments