home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / sleepless-knight.swf / scripts / DefineSprite_137 / frame_1 / DoAction.as
Encoding:
Text File  |  2008-09-11  |  650 b   |  28 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(60) + 50;
  24. ragDollLimit = 60;
  25. ragDollStart = _rotation;
  26. ragDollSpin = random(10) - 5;
  27. _rotation = _rotation + random(ragDollLimit);
  28.