home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / dragonforce.swf / scripts / frame_2 / DoAction_10.as next >
Encoding:
Text File  |  2006-06-13  |  8.0 KB  |  248 lines

  1. function clean()
  2. {
  3.    _root.status._visible = false;
  4.    _root.ship._x = -200;
  5.    _root.ship._y = -200;
  6.    _root.target._x = 1200;
  7.    _root.target._y = 100;
  8.    _root.time = _root.bosscoming = _root.boss1electric = _root.boss1canon = _root.boss2laser = _root.boss2gun = _root.hitshipcounter = 0;
  9.    _root.boss = false;
  10.    _root.enemyticker = -25;
  11.    _root.boss2firelaser = false;
  12.    _root.fbosswave == 0;
  13.    _root.fbossrest = false;
  14.    _root.fbossrestcounter = 0;
  15.    _root.boss3totalhealth = _root.boss3health = 299 * _root.health;
  16.    _root.e1w1pos = _root.e2w1pos = _root.e3w1pos = _root.e4w1pos = _root.e4w2pos = _root.e5w1pos = _root.e6w1pos = _root.e7w1pos = _root.boss3counter = 0;
  17.    _root.enemy1wavetimer5 = 100;
  18.    _root.enemy2wavetimer5 = 500;
  19.    _root.enemy3wavetimer5 = 800;
  20.    _root.enemy4wavetimer5 = 900;
  21.    _root.enemy4wave2timer5 = 1200;
  22.    _root.enemy5wave1timer5 = 1500;
  23.    _root.enemy6wave1timer5 = 1800;
  24.    _root.enemy7wave1timer5 = 2100;
  25.    _root.playField.removeMovieClip();
  26.    _root.bg.gotoAndStop("blank");
  27.    i = _root.enemyarray.length - 1;
  28.    while(i >= 0)
  29.    {
  30.       _root.enemyarray[i].removeMovieClip();
  31.       _root.enemyarray.pop();
  32.       i--;
  33.    }
  34.    j = _root.bulletarray.length - 1;
  35.    while(j >= 0)
  36.    {
  37.       _root.bulletarray[j].removeMovieClip();
  38.       _root.bulletarray.pop;
  39.       j--;
  40.    }
  41.    k = _root.poweruparray.length - 1;
  42.    while(k >= 0)
  43.    {
  44.       _root.poweruparray[k].removeMovieClip();
  45.       _root.poweruparray.pop;
  46.       k--;
  47.    }
  48. }
  49. _root.newlevel = function()
  50. {
  51.    _root.e1w1pos = _root.e2w1pos = _root.e3w1pos = _root.e4w1pos = _root.e4w2pos = _root.e5w1pos = _root.e6w1pos = _root.e7w1pos = _root.boss3counter = 0;
  52. };
  53. _root.boss2lasersound.onSoundComplete = function()
  54. {
  55.    if(_root.levelnumber == 4 and _root.gamestart == true)
  56.    {
  57.       _root.boss2lasersound2.stop();
  58.       _root.boss2lasersound2.start(0,0);
  59.       _root.enemybullet.duplicateMovieClip("enemybullet" + _root.depth,_root.depth);
  60.       ec = 0;
  61.       while(ec < _root.enemyarray.length)
  62.       {
  63.          if(_root.enemyarray[ec].enemytypevar == "fboss")
  64.          {
  65.             _root.fbosslaserx = _root.enemyarray[ec]._x + _root.enemyarray[ec].enemytype._x + _root.enemyarray[ec].enemytype.laser._x;
  66.             _root.fbosslasery = _root.enemyarray[ec]._y + _root.enemyarray[ec].enemytype._y + _root.enemyarray[ec].enemytype.laser._y;
  67.             _root.enemyarray[ec].enemytype.charge.gotoAndStop("blank");
  68.          }
  69.          ec++;
  70.       }
  71.       _root["enemybullet" + _root.depth]._x = _root.fbosslaserx;
  72.       _root["enemybullet" + _root.depth]._y = _root.fbosslasery;
  73.       _root["enemybullet" + _root.depth].xvalue = 2 * (- _root.enemy1bulletspeed);
  74.       _root["enemybullet" + _root.depth].gotoAndStop("fbosslaser");
  75.       _root["enemybullet" + _root.depth].shottype = "enemy";
  76.       _root["enemybullet" + _root.depth].enemyshottype = "fbosslaser";
  77.       _root.bulletarray[_root.bulletarray.length] = _root["enemybullet" + _root.depth];
  78.       if(_root.depth < 100000)
  79.       {
  80.          _root.depth = _root.depth + 1;
  81.       }
  82.       else
  83.       {
  84.          _root.depth = 100;
  85.       }
  86.    }
  87. };
  88. _root.poweruparray = new Array();
  89. _root.weaponpowerupfunction = function()
  90. {
  91.    _root.weaponPower.duplicateMovieClip("weaponpower" + _root.depth,_root.depth);
  92.    _root.poweruparray[_root.poweruparray.length] = _root["weaponpower" + _root.depth];
  93.    _root["weaponpower" + _root.depth].poweruptype = "weapon";
  94.    whichcolor = random(3) + 1;
  95.    if(whichcolor == 1)
  96.    {
  97.       _root["weaponpower" + _root.depth].gotoAndStop("red");
  98.    }
  99.    if(whichcolor == 2)
  100.    {
  101.       _root["weaponpower" + _root.depth].gotoAndStop("blue");
  102.    }
  103.    if(whichcolor == 3)
  104.    {
  105.       _root["weaponpower" + _root.depth].gotoAndStop("green");
  106.    }
  107.    _root["weaponpower" + _root.depth]._x = _root.assignx;
  108.    _root["weaponpower" + _root.depth]._y = _root.assigny;
  109.    if(_root.depth < 100000)
  110.    {
  111.       _root.depth = _root.depth + 1;
  112.    }
  113.    else
  114.    {
  115.       _root.depth = 100;
  116.    }
  117. };
  118. _root.healthpowerupfunction = function()
  119. {
  120.    _root.healthpower.duplicateMovieClip("healthpower" + _root.depth,_root.depth);
  121.    _root.poweruparray[_root.poweruparray.length] = _root["healthpower" + _root.depth];
  122.    _root["healthpower" + _root.depth].poweruptype = "health";
  123.    _root["healthpower" + _root.depth]._y = random(300) + 100;
  124.    _root["healthpower" + _root.depth]._x = 720;
  125.    if(_root.depth < 100000)
  126.    {
  127.       _root.depth = _root.depth + 1;
  128.    }
  129.    else
  130.    {
  131.       _root.depth = 100;
  132.    }
  133. };
  134. _root.minihealthpowerupfunction = function()
  135. {
  136.    _root.healthpower.duplicateMovieClip("healthpower" + _root.depth,_root.depth);
  137.    _root.poweruparray[_root.poweruparray.length] = _root["healthpower" + _root.depth];
  138.    _root["healthpower" + _root.depth].poweruptype = "minihealth";
  139.    _root["healthpower" + _root.depth]._x = _root.assignx;
  140.    _root["healthpower" + _root.depth]._y = _root.assigny;
  141.    _root["healthpower" + _root.depth]._xscale = _root["healthpower" + _root.depth]._yscale = 60;
  142.    if(_root.depth < 100000)
  143.    {
  144.       _root.depth = _root.depth + 1;
  145.    }
  146.    else
  147.    {
  148.       _root.depth = 100;
  149.    }
  150. };
  151. _root.missilepowerupfunction = function()
  152. {
  153.    trace(_root.depth);
  154.    _root.missilepower.duplicateMovieClip("missilepower" + _root.depth,_root.depth);
  155.    _root.poweruparray[_root.poweruparray.length] = _root["missilepower" + _root.depth];
  156.    _root["missilepower" + _root.depth].poweruptype = "missile";
  157.    _root["missilepower" + _root.depth]._x = _root.assignx;
  158.    _root["missilepower" + _root.depth]._y = _root.assigny;
  159.    if(_root.depth < 100000)
  160.    {
  161.       _root.depth = _root.depth + 1;
  162.    }
  163.    else
  164.    {
  165.       _root.depth = 100;
  166.    }
  167. };
  168. _root.bombpowerupfunction = function()
  169. {
  170.    _root.bombpower.duplicateMovieClip("bombpower" + _root.depth,_root.depth);
  171.    _root.poweruparray[_root.poweruparray.length] = _root["bombpower" + _root.depth];
  172.    _root["bombpower" + _root.depth].poweruptype = "bomb";
  173.    _root["bombpower" + _root.depth]._x = _root.assignx;
  174.    _root["bombpower" + _root.depth]._y = _root.assigny;
  175.    if(_root.depth < 100000)
  176.    {
  177.       _root.depth = _root.depth + 1;
  178.    }
  179.    else
  180.    {
  181.       _root.depth = 100;
  182.    }
  183. };
  184. _root.protectorpowerupfunction = function()
  185. {
  186.    _root.protectorpower.duplicateMovieClip("protectorpower" + _root.depth,_root.depth);
  187.    _root.poweruparray[_root.poweruparray.length] = _root["protectorpower" + _root.depth];
  188.    _root["protectorpower" + _root.depth].poweruptype = "protector";
  189.    _root["protectorpower" + _root.depth]._x = _root.assignx;
  190.    _root["protectorpower" + _root.depth]._y = _root.assigny;
  191.    if(_root.depth < 100000)
  192.    {
  193.       _root.depth = _root.depth + 1;
  194.    }
  195.    else
  196.    {
  197.       _root.depth = 100;
  198.    }
  199. };
  200. _root.targetenemyfunction = function()
  201. {
  202.    if(_root.enemyarray.length >= 1)
  203.    {
  204.       _root.targeted = true;
  205.       if(_root.targetdir == "forward")
  206.       {
  207.          if(_root.targetenemy >= _root.enemyarray.length - 1)
  208.          {
  209.             _root.targetenemy = 0;
  210.          }
  211.          else
  212.          {
  213.             _root.targetenemy = _root.targetenemy + 1;
  214.          }
  215.          trace(_root.targetenemy);
  216.          trace(_root.enemyarray.length);
  217.       }
  218.       else if(_root.targetdir == "backward")
  219.       {
  220.          if(_root.targetenemy == 0)
  221.          {
  222.             _root.targetenemy = _root.enemyarray.length - 1;
  223.          }
  224.          else
  225.          {
  226.             _root.targetenemy--;
  227.          }
  228.       }
  229.       _root.target._x = _root.enemyarray[_root.targetenemy]._x + _root.enemyarray[_root.targetenemy].enemytype._x;
  230.       _root.target._y = _root.enemyarray[_root.targetenemy]._y + _root.enemyarray[_root.targetenemy].enemytype._y;
  231.    }
  232. };
  233. _root.autorotatefunction = function()
  234. {
  235.    if(_root.autorotate == false)
  236.    {
  237.       _root.autorotate = true;
  238.       _root.ship.protector.play();
  239.       _root.ship.protector2.play();
  240.    }
  241.    else
  242.    {
  243.       _root.autorotate = false;
  244.       _root.ship.protector.stop();
  245.       _root.ship.protector2.stop();
  246.    }
  247. };
  248.