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

  1. function hitCheck()
  2. {
  3.    if(hitTest(_root.ship) && _root.ship.alive == true && alive == true)
  4.    {
  5.       clearInterval(hitCheckInterval);
  6.       _root.ship.gotoAndPlay("die");
  7.       gotoAndPlay(15);
  8.    }
  9. }
  10. function fire()
  11. {
  12.    if(Math.random() < firePercent)
  13.    {
  14.       shoot();
  15.       clearInterval(fireInterval);
  16.    }
  17. }
  18. function shoot()
  19. {
  20.    _root.layer = _root.layer + 1;
  21.    _root.attachMovie("fighterShot","fighterShot" + _root.layer,_root.layer);
  22.    _root["fighterShot" + _root.layer]._x = this._x;
  23.    _root["fighterShot" + _root.layer]._y = this._y;
  24.    _root.layer = _root.layer + 1;
  25. }
  26. function destroy()
  27. {
  28.    clearInterval(hitCheckInterval);
  29.    clearInterval(fireInterval);
  30.    for(name in this)
  31.    {
  32.       delete this[name];
  33.    }
  34.    delete this;
  35.    this.removeMovieClip();
  36. }
  37. stop();
  38. process = "goFunct";
  39. PUprob = 0.2;
  40. worth = 200;
  41. firePercent = _root.currentWave.shotProb;
  42. count = 0;
  43. Hspeed = 4;
  44. Vspeed = 25;
  45. alive = true;
  46.