home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / sleepless-knight.swf / scripts / DefineSprite_136 / frame_1 / DoAction.as
Encoding:
Text File  |  2008-09-11  |  602 b   |  27 lines

  1. function onEnterFrame()
  2. {
  3.    if(ragDollTime > 0)
  4.    {
  5.       _rotation = _rotation + ragDollSpin;
  6.       if(_rotation > ragDollStart + ragDollLimit)
  7.       {
  8.          _rotation = ragDollStart + ragDollLimit;
  9.          ragDollSpin *= -1;
  10.       }
  11.       else if(_rotation < ragDollStart - ragDollLimit)
  12.       {
  13.          _rotation = ragDollStart - ragDollLimit;
  14.          ragDollSpin *= -1;
  15.       }
  16.       ragDollTime--;
  17.    }
  18.    else
  19.    {
  20.       _rotation = _rotation / 1.1;
  21.    }
  22. }
  23. ragDollTime = random(40) + 40;
  24. ragDollLimit = 30;
  25. ragDollStart = _rotation;
  26. ragDollSpin = random(3) + 2;
  27.