@@ -38,7 +38,7 @@ var ParticleEmitter = new Class({
3838 this . x = new EmitterOp ( config , 'x' , 0 ) ;
3939 this . y = new EmitterOp ( config , 'y' , 0 ) ;
4040
41- // A radial emitter will emit particles in all directions between emitterAngle min and max, using speed as the value
41+ // A radial emitter will emit particles in all directions between angle min and max, using speed as the value
4242 // A point emitter will emit particles only in the direction derived from the speedX and speedY values
4343 this . radial = GetFastValue ( config , 'radial' , true ) ;
4444
@@ -77,9 +77,9 @@ var ParticleEmitter = new Class({
7777
7878 this . lifespan = new EmitterOp ( config , 'lifespan' , 1000 ) ;
7979
80- this . emitterAngle = new EmitterOp ( config , 'angle' , { min : 0 , max : 360 } ) ;
80+ this . angle = new EmitterOp ( config , 'angle' , { min : 0 , max : 360 } ) ;
8181
82- this . particleAngle = new EmitterOp ( config , 'particleAngle ' , 0 ) ;
82+ this . rotate = new EmitterOp ( config , 'rotate ' , 0 ) ;
8383
8484 // Callbacks
8585
@@ -97,11 +97,11 @@ var ParticleEmitter = new Class({
9797 this . deathCallbackScope = callbackScope ;
9898 }
9999
100- // Set to hard limit the amount of particle objects this emitter is allowed to create
100+ // Set to hard limit the amount of particle objects this emitter is allowed to create. 0 means unlimited.
101101 this . maxParticles = GetFastValue ( config , 'maxParticles' , 0 ) ;
102102
103103 // How many particles are emitted each time the emitter updates
104- this . quantity = GetFastValue ( config , 'quantity' , 1 ) ;
104+ this . quantity = new EmitterOp ( config , 'quantity' , 1 ) ;
105105
106106 // How often a particle is emitted in ms (if emitter is a constant / flow emitter)
107107 // If emitter is an explosion emitter this value will be -1.
@@ -297,7 +297,7 @@ var ParticleEmitter = new Class({
297297
298298 setEmitterAngle : function ( value )
299299 {
300- this . emitterAngle . onChange ( value ) ;
300+ this . angle . onChange ( value ) ;
301301
302302 return this ;
303303 } ,
@@ -318,7 +318,7 @@ var ParticleEmitter = new Class({
318318
319319 setQuantity : function ( quantity )
320320 {
321- this . quantity = quantity ;
321+ this . quantity . onChange ( quantity ) ;
322322
323323 return this ;
324324 } ,
@@ -331,7 +331,7 @@ var ParticleEmitter = new Class({
331331
332332 if ( quantity )
333333 {
334- this . quantity = quantity ;
334+ this . quantity . onChange ( quantity ) ;
335335 }
336336
337337 return this ;
@@ -506,7 +506,7 @@ var ParticleEmitter = new Class({
506506
507507 this . frequency = frequency ;
508508
509- this . quantity = count ;
509+ this . quantity . onChange ( count ) ;
510510
511511 return this . start ( ) ;
512512 } ,
@@ -525,13 +525,16 @@ var ParticleEmitter = new Class({
525525
526526 emit : function ( count , x , y )
527527 {
528- if ( count === undefined ) { count = this . quantity ; }
529-
530528 if ( this . atLimit ( ) )
531529 {
532530 return ;
533531 }
534532
533+ if ( count === undefined )
534+ {
535+ count = this . quantity . onEmit ( ) ;
536+ }
537+
535538 var dead = this . dead ;
536539
537540 for ( var i = 0 ; i < count ; i ++ )
0 commit comments