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

  1. function pulseGo()
  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.       }
  16.    }
  17. }
  18. function destroy()
  19. {
  20.    for(name in this)
  21.    {
  22.       delete this[name];
  23.    }
  24.    delete this;
  25.    this.removeMovieClip();
  26. }
  27. stop();
  28. ship = _root.ship;
  29. ship.armed = false;
  30. speed_p = ship.shotSpeed;
  31. lifeSpan_p = ship.shotLifeSpan;
  32. damage_p = ship.shotDamage;
  33. counter = 0;
  34. this.onEnterFrame = pulseGo;
  35. process = "pulseGo";
  36.