home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / kung_fu.swf / scripts / __Packages / com / KidFighting / effects / EffBlade.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  954 b   |  36 lines

  1. class com.KidFighting.effects.EffBlade extends com.KidFighting.objects.CEffect
  2. {
  3.    var type;
  4.    var ani;
  5.    var owner;
  6.    var hurtValue;
  7.    var movingSpeed = 15;
  8.    function EffBlade($ani, twn, ch, x, y)
  9.    {
  10.       super();
  11.       $ani._xscale *= ch.side;
  12.       this.type = "flyItem";
  13.       this.init($ani,twn,ch,x,y);
  14.    }
  15.    function onEffectMotionUpdated()
  16.    {
  17.       this.ani._x += this.movingSpeed;
  18.       var _loc2_ = com.KidFighting.EffectSys.getOpponentFlyEffItem(this.ani);
  19.       if(_loc2_ && this.ani.hitTest(_loc2_))
  20.       {
  21.          com.KidFighting.EffectSys.generate("Hurt",null,this.owner,this.ani._x,this.ani._y);
  22.          _loc2_.owner.stop();
  23.          this.stop();
  24.          return undefined;
  25.       }
  26.       if(this.ani._x < -50 || this.ani._x > Stage.width + 50)
  27.       {
  28.          this.stop();
  29.       }
  30.       if(this.owner.hitTest(this.ani,null,this.hurtValue))
  31.       {
  32.          this.stop();
  33.       }
  34.    }
  35. }
  36.