home *** CD-ROM | disk | FTP | other *** search
- function clean()
- {
- _root.status._visible = false;
- _root.ship._x = -200;
- _root.ship._y = -200;
- _root.target._x = 1200;
- _root.target._y = 100;
- _root.time = _root.bosscoming = _root.boss1electric = _root.boss1canon = _root.boss2laser = _root.boss2gun = _root.hitshipcounter = 0;
- _root.boss = false;
- _root.enemyticker = -25;
- _root.boss2firelaser = false;
- _root.fbosswave == 0;
- _root.fbossrest = false;
- _root.fbossrestcounter = 0;
- _root.boss3totalhealth = _root.boss3health = 299 * _root.health;
- _root.e1w1pos = _root.e2w1pos = _root.e3w1pos = _root.e4w1pos = _root.e4w2pos = _root.e5w1pos = _root.e6w1pos = _root.e7w1pos = _root.boss3counter = 0;
- _root.enemy1wavetimer5 = 100;
- _root.enemy2wavetimer5 = 500;
- _root.enemy3wavetimer5 = 800;
- _root.enemy4wavetimer5 = 900;
- _root.enemy4wave2timer5 = 1200;
- _root.enemy5wave1timer5 = 1500;
- _root.enemy6wave1timer5 = 1800;
- _root.enemy7wave1timer5 = 2100;
- _root.playField.removeMovieClip();
- _root.bg.gotoAndStop("blank");
- i = _root.enemyarray.length - 1;
- while(i >= 0)
- {
- _root.enemyarray[i].removeMovieClip();
- _root.enemyarray.pop();
- i--;
- }
- j = _root.bulletarray.length - 1;
- while(j >= 0)
- {
- _root.bulletarray[j].removeMovieClip();
- _root.bulletarray.pop;
- j--;
- }
- k = _root.poweruparray.length - 1;
- while(k >= 0)
- {
- _root.poweruparray[k].removeMovieClip();
- _root.poweruparray.pop;
- k--;
- }
- }
- _root.newlevel = function()
- {
- _root.e1w1pos = _root.e2w1pos = _root.e3w1pos = _root.e4w1pos = _root.e4w2pos = _root.e5w1pos = _root.e6w1pos = _root.e7w1pos = _root.boss3counter = 0;
- };
- _root.boss2lasersound.onSoundComplete = function()
- {
- if(_root.levelnumber == 4 and _root.gamestart == true)
- {
- _root.boss2lasersound2.stop();
- _root.boss2lasersound2.start(0,0);
- _root.enemybullet.duplicateMovieClip("enemybullet" + _root.depth,_root.depth);
- ec = 0;
- while(ec < _root.enemyarray.length)
- {
- if(_root.enemyarray[ec].enemytypevar == "fboss")
- {
- _root.fbosslaserx = _root.enemyarray[ec]._x + _root.enemyarray[ec].enemytype._x + _root.enemyarray[ec].enemytype.laser._x;
- _root.fbosslasery = _root.enemyarray[ec]._y + _root.enemyarray[ec].enemytype._y + _root.enemyarray[ec].enemytype.laser._y;
- _root.enemyarray[ec].enemytype.charge.gotoAndStop("blank");
- }
- ec++;
- }
- _root["enemybullet" + _root.depth]._x = _root.fbosslaserx;
- _root["enemybullet" + _root.depth]._y = _root.fbosslasery;
- _root["enemybullet" + _root.depth].xvalue = 2 * (- _root.enemy1bulletspeed);
- _root["enemybullet" + _root.depth].gotoAndStop("fbosslaser");
- _root["enemybullet" + _root.depth].shottype = "enemy";
- _root["enemybullet" + _root.depth].enemyshottype = "fbosslaser";
- _root.bulletarray[_root.bulletarray.length] = _root["enemybullet" + _root.depth];
- if(_root.depth < 100000)
- {
- _root.depth = _root.depth + 1;
- }
- else
- {
- _root.depth = 100;
- }
- }
- };
- _root.poweruparray = new Array();
- _root.weaponpowerupfunction = function()
- {
- _root.weaponPower.duplicateMovieClip("weaponpower" + _root.depth,_root.depth);
- _root.poweruparray[_root.poweruparray.length] = _root["weaponpower" + _root.depth];
- _root["weaponpower" + _root.depth].poweruptype = "weapon";
- whichcolor = random(3) + 1;
- if(whichcolor == 1)
- {
- _root["weaponpower" + _root.depth].gotoAndStop("red");
- }
- if(whichcolor == 2)
- {
- _root["weaponpower" + _root.depth].gotoAndStop("blue");
- }
- if(whichcolor == 3)
- {
- _root["weaponpower" + _root.depth].gotoAndStop("green");
- }
- _root["weaponpower" + _root.depth]._x = _root.assignx;
- _root["weaponpower" + _root.depth]._y = _root.assigny;
- if(_root.depth < 100000)
- {
- _root.depth = _root.depth + 1;
- }
- else
- {
- _root.depth = 100;
- }
- };
- _root.healthpowerupfunction = function()
- {
- _root.healthpower.duplicateMovieClip("healthpower" + _root.depth,_root.depth);
- _root.poweruparray[_root.poweruparray.length] = _root["healthpower" + _root.depth];
- _root["healthpower" + _root.depth].poweruptype = "health";
- _root["healthpower" + _root.depth]._y = random(300) + 100;
- _root["healthpower" + _root.depth]._x = 720;
- if(_root.depth < 100000)
- {
- _root.depth = _root.depth + 1;
- }
- else
- {
- _root.depth = 100;
- }
- };
- _root.minihealthpowerupfunction = function()
- {
- _root.healthpower.duplicateMovieClip("healthpower" + _root.depth,_root.depth);
- _root.poweruparray[_root.poweruparray.length] = _root["healthpower" + _root.depth];
- _root["healthpower" + _root.depth].poweruptype = "minihealth";
- _root["healthpower" + _root.depth]._x = _root.assignx;
- _root["healthpower" + _root.depth]._y = _root.assigny;
- _root["healthpower" + _root.depth]._xscale = _root["healthpower" + _root.depth]._yscale = 60;
- if(_root.depth < 100000)
- {
- _root.depth = _root.depth + 1;
- }
- else
- {
- _root.depth = 100;
- }
- };
- _root.missilepowerupfunction = function()
- {
- trace(_root.depth);
- _root.missilepower.duplicateMovieClip("missilepower" + _root.depth,_root.depth);
- _root.poweruparray[_root.poweruparray.length] = _root["missilepower" + _root.depth];
- _root["missilepower" + _root.depth].poweruptype = "missile";
- _root["missilepower" + _root.depth]._x = _root.assignx;
- _root["missilepower" + _root.depth]._y = _root.assigny;
- if(_root.depth < 100000)
- {
- _root.depth = _root.depth + 1;
- }
- else
- {
- _root.depth = 100;
- }
- };
- _root.bombpowerupfunction = function()
- {
- _root.bombpower.duplicateMovieClip("bombpower" + _root.depth,_root.depth);
- _root.poweruparray[_root.poweruparray.length] = _root["bombpower" + _root.depth];
- _root["bombpower" + _root.depth].poweruptype = "bomb";
- _root["bombpower" + _root.depth]._x = _root.assignx;
- _root["bombpower" + _root.depth]._y = _root.assigny;
- if(_root.depth < 100000)
- {
- _root.depth = _root.depth + 1;
- }
- else
- {
- _root.depth = 100;
- }
- };
- _root.protectorpowerupfunction = function()
- {
- _root.protectorpower.duplicateMovieClip("protectorpower" + _root.depth,_root.depth);
- _root.poweruparray[_root.poweruparray.length] = _root["protectorpower" + _root.depth];
- _root["protectorpower" + _root.depth].poweruptype = "protector";
- _root["protectorpower" + _root.depth]._x = _root.assignx;
- _root["protectorpower" + _root.depth]._y = _root.assigny;
- if(_root.depth < 100000)
- {
- _root.depth = _root.depth + 1;
- }
- else
- {
- _root.depth = 100;
- }
- };
- _root.targetenemyfunction = function()
- {
- if(_root.enemyarray.length >= 1)
- {
- _root.targeted = true;
- if(_root.targetdir == "forward")
- {
- if(_root.targetenemy >= _root.enemyarray.length - 1)
- {
- _root.targetenemy = 0;
- }
- else
- {
- _root.targetenemy = _root.targetenemy + 1;
- }
- trace(_root.targetenemy);
- trace(_root.enemyarray.length);
- }
- else if(_root.targetdir == "backward")
- {
- if(_root.targetenemy == 0)
- {
- _root.targetenemy = _root.enemyarray.length - 1;
- }
- else
- {
- _root.targetenemy--;
- }
- }
- _root.target._x = _root.enemyarray[_root.targetenemy]._x + _root.enemyarray[_root.targetenemy].enemytype._x;
- _root.target._y = _root.enemyarray[_root.targetenemy]._y + _root.enemyarray[_root.targetenemy].enemytype._y;
- }
- };
- _root.autorotatefunction = function()
- {
- if(_root.autorotate == false)
- {
- _root.autorotate = true;
- _root.ship.protector.play();
- _root.ship.protector2.play();
- }
- else
- {
- _root.autorotate = false;
- _root.ship.protector.stop();
- _root.ship.protector2.stop();
- }
- };
-