home *** CD-ROM | disk | FTP | other *** search
- class com.KidFighting.effects.EffDynamite extends com.KidFighting.objects.CEffect
- {
- var _twnY;
- var ani;
- var func;
- var onMotionFinished;
- var continueTo;
- var owner;
- var hurtValue;
- var skill;
- var movingSpeed = 15;
- function EffDynamite($ani, twn, ch, x, y)
- {
- super();
- $ani._xscale *= ch.side;
- this.init($ani,twn,ch,x,y);
- this._twnY = new ds.transitions.Tween(this.ani,"_y",mx.transitions.easing.Bounce.easeOut,y,y - 60,12);
- var lastY = ch.orgY;
- this._twnY.onMotionFinished = function(twn)
- {
- this.func = null;
- this.onMotionFinished = undefined;
- this.continueTo(lastY,6);
- };
- }
- function onEffectMotionUpdated()
- {
- this.ani._x += this.movingSpeed;
- this.movingSpeed -= 0.5 * this.owner.side;
- if(this.ani._x < -50 || this.ani._x > Stage.width + 50)
- {
- this.stop();
- }
- if(this.owner.hitTest(this.ani,"Explosion",this.hurtValue,"Explosion"))
- {
- this.stop();
- }
- else if(this.ani._y >= this.owner.orgY)
- {
- this.skill.explode(this.ani._x);
- this.stop();
- }
- }
- function destroy()
- {
- super.destroy();
- delete this._twnY;
- }
- function onPauseGame()
- {
- super.onPauseGame();
- if(this._twnY.isPlaying)
- {
- this._twnY.pause();
- }
- }
- function onResumeGame()
- {
- super.onResumeGame();
- this._twnY.resume();
- }
- }
-