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

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