@@ -28,34 +28,44 @@ var ParticleEmitter = new Class({
2828
2929 function ParticleEmitter ( scene , x , y , texture , frame )
3030 {
31-
3231 GameObject . call ( this , scene , 'ParticleEmitter' ) ;
3332
3433 this . dead = [ ] ;
3534 this . alive = [ ] ;
35+
3636 this . minSpeed = 0 ;
3737 this . maxSpeed = 0 ;
38+
3839 this . startScale = 1.0 ;
3940 this . endScale = 1.0 ;
41+
4042 this . startAlpha = 1.0 ;
4143 this . endAlpha = 1.0 ;
44+
4245 this . minEmitAngle = 0 ;
4346 this . maxEmitAngle = 360 ;
47+
4448 this . startAngle = 0 ;
4549 this . endAngle = 0 ;
50+
4651 this . gravityX = 0 ;
4752 this . gravityY = 0 ;
53+
4854 this . life = 1.0 ;
55+
4956 this . delay = 0.0 ;
5057 this . delayCounter = 0.0 ;
58+
5159 this . deathCallback = null ;
5260 this . emitCount = 1 ;
5361 this . enabled = true ;
5462 this . allowCreation = true ;
5563 this . emitShape = null ;
64+
5665 this . easingFunctionAlpha = Easing . Linear ;
5766 this . easingFunctionScale = Easing . Linear ;
5867 this . easingFunctionRotation = Easing . Linear ;
68+
5969 this . setTexture ( texture , frame ) ;
6070 this . setPosition ( x , y ) ;
6171 } ,
@@ -155,6 +165,8 @@ var ParticleEmitter = new Class({
155165 setEmitterDelay : function ( delay )
156166 {
157167 this . delay = delay ;
168+
169+ return this ;
158170 } ,
159171
160172 reserve : function ( particleCount )
@@ -236,27 +248,36 @@ var ParticleEmitter = new Class({
236248 pause : function ( )
237249 {
238250 this . active = false ;
251+
252+ return this ;
239253 } ,
240254
241255 resume : function ( )
242256 {
243257 this . active = true ;
258+
259+ return this ;
244260 } ,
245261
246262 explode : function ( count )
247263 {
248- if ( ! count ) { count = 100 ; }
264+ if ( count === undefined ) { count = 100 ; }
265+
249266 this . emitParticle ( count ) ;
267+
268+ return this ;
250269 } ,
251270
252271 setShape : function ( shape )
253272 {
254273 this . emitShape = shape ;
274+
275+ return this ;
255276 } ,
256277
257278 emitParticle : function ( count )
258279 {
259- count = count || 1 ;
280+ if ( count === undefined ) { count = 1 ; }
260281
261282 var particle = null ;
262283
@@ -308,6 +329,7 @@ var ParticleEmitter = new Class({
308329
309330 this . alive . push ( particle ) ;
310331 }
332+
311333 return particle ;
312334 } ,
313335
0 commit comments