home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / 30k_starfighter.swf / scripts / DefineSprite_17_laser / frame_1 / DoAction.as
Encoding:
Text File  |  2006-07-26  |  723 b   |  37 lines

  1. function laserGo()
  2. {
  3.    counter++;
  4.    if(counter > lifeSpan_p)
  5.    {
  6.       this.onEnterFrame = null;
  7.       this.destroy();
  8.    }
  9.    _Y = _Y - speed_p;
  10.    for(name in _root.enemyArray)
  11.    {
  12.       if(hitTest(_root.enemyArray[name]) && _root.enemyArray[name].alive == true)
  13.       {
  14.          _root.enemyArray[name].gotoAndPlay("hit");
  15.          gotoAndPlay(2);
  16.       }
  17.    }
  18. }
  19. function destroy()
  20. {
  21.    for(name in this)
  22.    {
  23.       delete this[name];
  24.    }
  25.    delete this;
  26.    this.removeMovieClip();
  27. }
  28. stop();
  29. ship = _root.ship;
  30. ship.armed = false;
  31. speed_p = ship.shotSpeed;
  32. lifeSpan_p = ship.shotLifeSpan;
  33. damage_p = ship.shotDamage;
  34. counter = 0;
  35. process = "laserGo";
  36. this.onEnterFrame = laserGo;
  37.