home *** CD-ROM | disk | FTP | other *** search
- _root.powerupmove = function()
- {
- var pu = _root.poweruparray.length - 1;
- while(pu >= 0)
- {
- _root.poweruparray[pu]._x += _root.powerupspeed;
- if(_root.poweruparray[pu]._x < -50)
- {
- _root.poweruparray[pu].removeMovieClip();
- }
- if(_root.poweruparray[pu].poweruptype == "weapon")
- {
- if(_root.poweruparray[pu].needchange == true)
- {
- if(_root.poweruparray[pu].ticks2 < 20)
- {
- _root.poweruparray[pu].ticks2 = _root.poweruparray[pu].ticks2 + 1;
- }
- else
- {
- _root.poweruparray[pu].ticks2 = 0;
- _root.poweruparray[pu].needchange = false;
- _root.poweruparray[pu].play();
- }
- }
- }
- if(_root.poweruparray[pu].hitTest(_root.ship.shipmc))
- {
- if(_root.poweruparray[pu].poweruptype == "weapon")
- {
- _root.weaponpowersound.stop();
- _root.weaponpowersound.start(0,0);
- if(_root.weapontype == _root.poweruparray[pu].weaponpowercolor)
- {
- if(_root.levelnumber == 1)
- {
- if(_root.weaponnumber < 2)
- {
- _root.weaponnumber = _root.weaponnumber + 1;
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "red")
- {
- _root.sredx = _root.poweruparray[pu]._x;
- _root.sredy = _root.poweruparray[pu]._y;
- _root.sred();
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "blue")
- {
- _root.sbluex = _root.poweruparray[pu]._x;
- _root.sbluey = _root.poweruparray[pu]._y;
- _root.sblue();
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "green")
- {
- _root.sgreenfunction = true;
- _root.sgreentimer = 0;
- }
- }
- else if(_root.levelnumber == 2)
- {
- if(_root.weaponnumber < 3)
- {
- _root.weaponnumber = _root.weaponnumber + 1;
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "red")
- {
- _root.sredx = _root.poweruparray[pu]._x;
- _root.sredy = _root.poweruparray[pu]._y;
- _root.sred();
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "blue")
- {
- _root.sbluex = _root.poweruparray[pu]._x;
- _root.sbluey = _root.poweruparray[pu]._y;
- _root.sblue();
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "green")
- {
- _root.sgreenfunction = true;
- _root.sgreentimer = 0;
- }
- }
- else if(_root.levelnumber >= 3)
- {
- if(_root.weaponnumber < 4)
- {
- _root.weaponnumber = _root.weaponnumber + 1;
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "red")
- {
- _root.sredx = _root.poweruparray[pu]._x;
- _root.sredy = _root.poweruparray[pu]._y;
- _root.sred();
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "blue")
- {
- _root.sbluex = _root.poweruparray[pu]._x;
- _root.sbluey = _root.poweruparray[pu]._y;
- _root.sblue();
- }
- else if(_root.poweruparray[pu].weaponpowercolor == "green")
- {
- _root.sgreenfunction = true;
- _root.sgreentimer = 0;
- }
- }
- }
- else
- {
- _root.transform = true;
- }
- _root.weapontype = _root.poweruparray[pu].weaponpowercolor;
- _root.poweruparray[pu].removeMovieClip();
- }
- else if(_root.poweruparray[pu].poweruptype == "missile")
- {
- _root.missilepowersound.stop();
- _root.missilepowersound.start(0,0);
- if(_root.mhlevel < 5)
- {
- _root.mhlevel = _root.mhlevel + 1;
- _root.whichmissileframe = "level" + _root.mhlevel;
- _root.status.mask.missile.gotoAndStop(_root.whichmissileframe);
- }
- else if(_root.mode == "mission")
- {
- _root.totalscore += 10;
- _root.status.score = int(_root.totalscore);
- }
- else if(_root.mode == "survival")
- {
- _root.totalscore2 += 10;
- _root.status.score = int(_root.totalscore2);
- }
- }
- else if(_root.poweruparray[pu].poweruptype == "bomb")
- {
- _root.bombpowersound.stop();
- _root.bombpowersound.start(0,0);
- if(_root.numberofbombs < 15)
- {
- _root.numberofbombs = _root.numberofbombs + 1;
- _root.status.bomb.gotoAndStop(_root.numberofbombs + 1);
- }
- else if(_root.mode == "stage")
- {
- _root.totalscore += 10;
- _root.status.score = int(_root.totalscore);
- }
- else if(_root.mode == "survival")
- {
- _root.totalscore2 += 10;
- _root.status.score = int(_root.totalscore2);
- }
- }
- else if(_root.poweruparray[pu].poweruptype == "health")
- {
- _root.healthpowersound.stop();
- _root.healthpowersound.start(0,0);
- if(_root.shipshield > 35)
- {
- _root.shipshield = 50;
- }
- else
- {
- _root.shipshield += 15;
- }
- _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
- }
- else if(_root.poweruparray[pu].poweruptype == "minihealth")
- {
- _root.healthpowersound.stop();
- _root.healthpowersound.start(0,0);
- if(_root.shipshield > 45)
- {
- _root.shipshield = 50;
- }
- else
- {
- _root.shipshield += 5;
- }
- _root.status.mask.shield._xscale = 100 * (_root.shipshield / _root.shipshieldtotal);
- }
- else if(_root.poweruparray[pu].poweruptype == "protector")
- {
- _root.protectorpowersound.stop();
- _root.protectorpowersound.start(0,0);
- _root.protector1health = _root.protector2health = 15;
- _root.ship.protector.sphere.gotoAndStop("full");
- _root.ship.protector2.sphere.gotoAndStop("full");
- if(_root.protectorlevel < 4)
- {
- _root.protectorlevel = _root.protectorlevel + 1;
- if(_root.protectorlevel > 2)
- {
- _root.ship.protector2.gotoAndStop("protector");
- }
- else if(_root.protectorlevel == 1)
- {
- _root.ship.protector.gotoAndStop("protector");
- }
- }
- else if(_root.mode == "stage")
- {
- _root.totalscore += 10;
- _root.status.score = int(_root.totalscore);
- }
- else if(_root.mode == "survival")
- {
- _root.totalscore2 += 10;
- _root.status.score = int(_root.totalscore2);
- }
- }
- _root.poweruparray[pu].removeMovieClip();
- _root.poweruparray.splice(pu,1);
- }
- pu--;
- }
- };
-