Phaser.Particle = function (game, x, y, key, frame){ Phaser.Sprite.call(this, game, x, y, key, frame); this.autoScale = false ; this.scaleData = null ; this._s = 0; this.autoAlpha = false ; this.alphaData = null ; this._a = 0; } ; Phaser.Particle.prototype = Object.create(Phaser.Sprite.prototype); Phaser.Particle.prototype.constructor = Phaser.Particle; Phaser.Particle.prototype.update = function (){ if (this.autoScale) { this._s-- ; if (this._s) { this.scale.set(this.scaleData[this._s].x, this.scaleData[this._s].y); } else { this.autoScale = false ; } } if (this.autoAlpha) { this._a-- ; if (this._a) { this.alpha = this.alphaData[this._a].v; } else { this.autoAlpha = false ; } } } ; Phaser.Particle.prototype.onEmit = function (){ } ; Phaser.Particle.prototype.setAlphaData = function (data){ this.alphaData = data; this._a = _AN_Read_length('length', data) - 1; this.alpha = this.alphaData[this._a].v; this.autoAlpha = true ; } ; Phaser.Particle.prototype.setScaleData = function (data){ this.scaleData = data; this._s = _AN_Read_length('length', data) - 1; this.scale.set(this.scaleData[this._s].x, this.scaleData[this._s].y); this.autoScale = true ; } ; Phaser.Particle.prototype.reset = function (x, y, health){ Phaser.Component.Reset.prototype.reset.call(this, x, y, health); this.alpha = 1; this.scale.set(1); this.autoScale = false ; this.autoAlpha = false ; return this; } ;