home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / pendekar.swf / scripts / DefineSprite_395 / frame_1 / DoAction.as
Text File  |  2006-05-08  |  1KB  |  63 lines

  1. this.onEnterFrame = function()
  2. {
  3.    tellTarget(_parent)
  4.    {
  5.       if(inStage())
  6.       {
  7.          _X = _X + dirValue(speed);
  8.       }
  9.       else if(!inStage() && _parent.isScroll && dir == 1)
  10.       {
  11.          _parent.scrollStage(speed);
  12.       }
  13.       if(attack)
  14.       {
  15.          if(weapon > 0)
  16.          {
  17.             attWeapon();
  18.          }
  19.          else
  20.          {
  21.             attCombo(1);
  22.          }
  23.       }
  24.       else if(duck)
  25.       {
  26.          duckDown();
  27.       }
  28.       else if(special)
  29.       {
  30.          if(weapon > 0)
  31.          {
  32.             releaseWeapon();
  33.          }
  34.          else if(weapon == 0)
  35.          {
  36.             attSpecial();
  37.          }
  38.       }
  39.       else if(dir == 1)
  40.       {
  41.          if(jump)
  42.          {
  43.             jumpRight();
  44.          }
  45.          if(left || !right)
  46.          {
  47.             gotoAndStop(getIdleState());
  48.          }
  49.       }
  50.       else if(dir == -1)
  51.       {
  52.          if(jump)
  53.          {
  54.             jumpLeft();
  55.          }
  56.          if(!left || right)
  57.          {
  58.             gotoAndStop(getIdleState());
  59.          }
  60.       }
  61.    }
  62. };
  63.