home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / roam-and-protect.swf / scripts / DefineSprite_378 / frame_4 / DoAction.as
Encoding:
Text File  |  2005-09-29  |  1.3 KB  |  59 lines

  1. if(hits < 0)
  2. {
  3.    gotoAndStop("explode");
  4.    play();
  5. }
  6. else
  7. {
  8.    flight();
  9.    if(key.isdown(key.space))
  10.    {
  11.       if(cnt > 30)
  12.       {
  13.          cnt = 0;
  14.       }
  15.       else
  16.       {
  17.          cnt += 1;
  18.       }
  19.       cnt += 1;
  20.       duplicateMovieClip(eval("_root." + _root.weapon),cnt,16384 + (1000 + cnt));
  21.       eval("_root." add cnt).bullet._xscale *= direct;
  22.       eval("_root." add cnt).xmove = bulletxmove;
  23.       eval("_root." add cnt).ymove = 0;
  24.       eval("_root." add cnt).xorg = _X + bulletxorg;
  25.       eval("_root." add cnt).yorg = _Y - bulletyorg;
  26.       eval("_root." add cnt).gotoAndPlay("fire");
  27.    }
  28.    gotoAndPlay(_currentframe - 1);
  29. }
  30. if(blink eq "true")
  31. {
  32.    _root.weapon = "bullet";
  33.    blinkcnt += 1;
  34.    hits = 20;
  35.    _root.field1.power.gotoAndStop(1);
  36.    _alpha = _alpha + 2;
  37.    if(blinkcnt > 32)
  38.    {
  39.       blink = "false";
  40.       _alpha = 100;
  41.    }
  42. }
  43. if(_root.arrows._currentframe < 80)
  44. {
  45.    dist = _root.chopper._x - _root.truck1._x;
  46.    if(dist > 500 && _root.arrows._currentframe < 5)
  47.    {
  48.       _root.arrows.gotoAndPlay("left");
  49.    }
  50.    else if(dist < -500 && _root.arrows._currentframe < 5)
  51.    {
  52.       _root.arrows.gotoAndPlay("right");
  53.    }
  54.    if(Math.abs(dist) < 500)
  55.    {
  56.       _root.arrows.gotoAndStop("blank");
  57.    }
  58. }
  59.