Frame 1
var loading = true;
stop();
onEnterFrame = function () {
if (loading) {
var _local2 = _root.getBytesTotal();
var _local3 = _root.getBytesLoaded();
var _local4 = (_local3 / _local2) * 100;
loadingText.text = Math.round(_local4) + "%";
if (_local3 == _local2) {
gotoAndPlay (3);
loading = false;
} else {
gotoAndStop (1);
}
}
};
Frame 2
gotoAndStop (203);
Frame 202
gotoAndStop (203);
Frame 203
function saveGame() {
myLSO = SharedObject.getLocal("someCoolName");
if (myLSO.data.myObj == undefined) {
trace("Saved Game");
} else {
trace("Overwrote Saved Game");
}
myObj = {};
myObj.objArray = new Array();
myObj.objArray[0] = level;
myObj.objArray[1] = totalScore;
myObj.objArray[2] = shipLoad;
myLSO.data.myObj = myObj;
}
function loadGame() {
myLSO = SharedObject.getLocal("someCoolName");
if (myLSO.data.myObj == undefined) {
trace("No Saved Game");
} else {
trace("Loaded Game");
level = myLSO.data.myObj.objArray[0];
totalScore = myLSO.data.myObj.objArray[1];
shipLoad = myLSO.data.myObj.objArray[2];
}
}
function powerUp() {
randomPowerNum = random(100);
if (randomPowerNum > 95) {
rndPower = "missile";
}
if ((randomPowerNum < 90) && (randomPowerNum > 80)) {
if (HN < 4) {
rndPower = "heart";
}
}
if (randomPowerNum < 30) {
rndPower = "coin";
}
if (rndPower == "coin") {
cn++;
attachMovie("Coin", "coin" + cn, d++);
_root["coin" + cn]._x = enemyX;
_root["coin" + cn]._y = enemyY;
_root["coin" + cn]._xscale = 20;
_root["coin" + cn]._yscale = 20;
_root["coin" + cn].speedX = random(5) + 1;
_root["coin" + cn].speedY = random(10) + 2;
_root["coin" + cn].onEnterFrame = function () {
this._x = this._x - this.speedX;
this._y = this._y + this.speedY;
if (this._y > (SH + 20)) {
this.removeMovieClip();
}
if (this.hitTest(_root.man)) {
this.removeMovieClip();
score = score + 10;
takePowerSound.start();
}
};
}
if (rndPower == "heart") {
hn++;
attachMovie("heartLib", "heartF" + hn, d++);
_root["heartF" + hn]._x = enemyX;
_root["heartF" + hn]._y = enemyY;
_root["heartF" + hn]._xscale = 100;
_root["heartF" + hn]._yscale = 100;
_root["heartF" + hn].speedX = random(5) + 1;
_root["heartF" + hn].speedY = random(10) + 2;
_root["heartF" + hn].onEnterFrame = function () {
this._x = this._x - this.speedX;
this._y = this._y + this.speedY;
if (this._y > (SH + 20)) {
this.removeMovieClip();
}
if ((((this.hitTest(man._x - (man._width / 2), man._y, true) || (this.hitTest(man._x + (man._width / 2), man._y, true))) || (this.hitTest(man._x, man._y + (man._height / 2), true))) || (this.hitTest(man._x, man._y - (man._height / 2), true))) || (this.hitTest(man._x, man._y, true))) {
if (HN == 4) {
} else {
_root["heart" + HN]._alpha = 100;
HN = HN + 1;
takePowerSound.start();
this.removeMovieClip();
}
}
};
}
if (rndPower == "missile") {
mn++;
attachMovie("missileLib", "missile" + mn, d++);
_root["missile" + mn]._x = enemyX;
_root["missile" + mn]._y = enemyY;
_root["missile" + mn]._xscale = 100;
_root["missile" + mn]._yscale = 100;
_root["missile" + mn].speedX = random(5) + 1;
_root["missile" + mn].speedY = random(10) + 2;
_root["missile" + mn].onEnterFrame = function () {
this._x = this._x - 2;
this._y = this._y + 5;
if (this._y > (SH + 20)) {
this.removeMovieClip();
}
if (this.hitTest(man)) {
if (MN == 3) {
} else {
_root["rocket" + MN]._alpha = 100;
MN = MN + 1;
takePowerSound.start();
this.removeMovieClip();
}
}
};
}
}
function metorite(enemys) {
i = 0;
while (i < enemys) {
attachMovie("Enemy", "enemy" + i, d++);
_root["enemy" + i]._x = random(SW * 2) + SW;
_root["enemy" + i]._y = random(SH);
_root["enemy" + i]._xscale = random(30) + 80;
_root["enemy" + i]._yscale = random(30) + 80;
_root["enemy" + i].enemySpeed = random(10) + 5;
_root["enemy" + i].rndRot = random(2);
rndFrame = random(4) + 1;
_root["enemy" + i].gotoAndStop(rndFrame);
radius = _root["enemy" + i]._width / 2;
_root["enemy" + i].onEnterFrame = function () {
this._x = this._x - this.enemySpeed;
if (this.rndRot == 1) {
this._rotation = this._rotation + 2;
} else {
this._rotation = this._rotation - 2;
}
if (this._x < (-this._width)) {
this._x = random(SW * 2) + SW;
this._y = random(SH);
this.enemySpeed = random(10) + 5;
this.rndRot = random(2);
this._width = random(30) + 80;
this._height = random(30) + 80;
}
if ((((this.hitTest(man._x - (man._width / 2), man._y, true) || (this.hitTest(man._x + (man._width / 2), man._y, true))) || (this.hitTest(man._x, man._y + (man._height / 2), true))) || (this.hitTest(man._x, man._y - (man._height / 2), true))) || (this.hitTest(man._x, man._y, true))) {
if (hit == false) {
this.swapDepths(0);
this.removeMovieClip();
enemysLeft = enemysLeft - 1;
life = life - 1;
HN = HN - 1;
_root.man._alpha = 50;
_root["heart" + HN]._alpha = 0;
hit = true;
clearInterval(timerAlpha);
timerAlpha = setInterval(alphaTimer, 2000);
hitByEnemy.start();
}
}
};
i++;
}
}
function xplusion(whichXplusion, howHigh, howWide, whereX, whereY, endFrame) {
xplNum++;
attachMovie(whichXplusion, "xplusion" + xplNum, d++);
_root["xplusion" + xplNum]._x = whereX;
_root["xplusion" + xplNum]._y = whereY;
_root["xplusion" + xplNum]._width = howWide;
_root["xplusion" + xplNum]._height = howHigh;
i = 0;
while (i < xplNum) {
_root["xplusion" + xplNum].onEnterFrame = function () {
if (this._currentframe == endFrame) {
this.onEnterFrame = null;
this.removeMovieClip();
}
};
i++;
}
metoSound.start();
}
function hitFunc() {
if (hit == false) {
life = life - 1;
HN = HN - 1;
_root.man._alpha = 50;
_root["heart" + HN]._alpha = 0;
hit = true;
clearInterval(timerAlpha);
timerAlpha = setInterval(alphaTimer, 2000);
hitByEnemy.start();
}
}
function goToNextLevel() {
gotoAndStop ("nextLevel");
}
function alphaTimer() {
hit = false;
_root.man._alpha = 100;
}
stop();
playBtn.onRelease = function () {
nextFrame();
_root.gotoAndStop(undefined);
};
loadBtn.onRelease = function () {
loadGame();
if (myLSO.data.myObj == undefined) {
} else {
level = level;
totalScore = totalScore;
gotoAndStop ("nextLevel");
if (shipLoad == "ship1") {
ship1 = true;
} else if (shipLoad == "ship2") {
ship2 = true;
} else if (shipLoad == "ship3") {
ship3 = true;
}
score = 0;
}
};
var newMenu = new ContextMenu();
newMenu.hideBuiltInItems();
this.menu = newMenu;
man.removeMovieClip();
var shot = new Sound();
shot.attachSound("shotSound");
var rocketSound = new Sound();
rocketSound.attachSound("missileSound");
var metoSound = new Sound();
metoSound.attachSound("enemyHitSound");
var takePowerSound = new Sound();
takePowerSound.attachSound("pickupSound");
var hitByEnemy = new Sound();
hitByEnemy.attachSound("playerHitSound");
var pointsDown = new Sound();
pointsDown.attachSound("pointsDownSound");
rndPowerArr = ["coin", "heart", "missile"];
cn = 0;
hn = 0;
mn = 0;
nextBG.removeMovieClip();
Instance of Symbol 474 MovieClip in Frame 203
//component parameters
onClipEvent (construct) {
partical_linkage = "partical";
max_length = 600;
frame_release = 5;
spread = "5";
wave_amplitude = 0;
wave_length = 0;
max_speed = 10;
min_speed = 5;
rotation = 0;
max_scale = 100;
min_scale = 50;
max_alpha = 100;
min_alpha = 100;
frames = 1;
}
Frame 204
stop();
ship1 = false;
ship2 = false;
ship3 = false;
ship1b.onRelease = function () {
ship1 = true;
shipNum = 1;
nextFrame();
_root.gotoAndStop(undefined);
};
ship2b.onRelease = function () {
ship2 = true;
shipNum = 2;
nextFrame();
_root.gotoAndStop(undefined);
};
ship3b.onRelease = function () {
ship3 = true;
shipNum = 3;
nextFrame();
_root.gotoAndStop(undefined);
};
ship1b.onRollOver = function () {
shipText.gotoAndStop("ship1Text");
};
ship2b.onRollOver = function () {
shipText.gotoAndStop("ship2Text");
};
ship3b.onRollOver = function () {
shipText.gotoAndStop("ship3Text");
};
ship1b.onRollOut = function () {
shipText.gotoAndStop("empty");
};
ship2b.onRollOut = function () {
shipText.gotoAndStop("empty");
};
ship3b.onRollOut = function () {
shipText.gotoAndStop("empty");
};
Instance of Symbol 504 MovieClip [ship1] in Frame 204
on (press) {
_root.ship = 3;
}
Instance of Symbol 506 MovieClip [ship2] in Frame 204
on (press) {
_root.ship = 4;
}
Frame 205
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
bc2 = 0;
laserSpeed = 20;
enemys = 10;
enemysLeft = enemys;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
wave = 3;
firstT = false;
level = 1;
hit = false;
_root.man._alpha = 100;
missileFirst = false;
firstPizuz = false;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 60, 90, enemyX, enemyY, 50);
}
i++;
}
};
}
}
};
xplNum = 0;
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 60, 90, enemyX, enemyY, 50);
}
i++;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 60, 90, enemyX, enemyY, 50);
}
i++;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 60, 90, enemyX, enemyY, 50);
}
i++;
}
};
}
};
_root.onEnterFrame = function () {
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
if (enemysLeft == 0) {
if (firstT == false) {
wave = wave - 1;
enemys = 10;
enemysLeft = enemys;
metorite(enemys);
firstT = true;
}
}
if (wave == 0) {
_root.gotoAndStop("nextLevel");
}
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (MN >= 1) {
if (Key.isDown(32)) {
if (missileFirst == false) {
num++;
attachMovie("missileLib", "til" + num, d++);
_root["til" + num]._x = _root.man._x;
_root["til" + num]._y = _root.man._y;
_root["til" + num]._rotation = 120;
MN = MN - 1;
_root["rocket" + MN]._alpha = 0;
tilSpeed = 1;
missileFirst = true;
firstT = false;
_root["til" + num].onEnterFrame = function () {
tilSpeed = tilSpeed + 0.5;
this._x = this._x + tilSpeed;
if ((tilSpeed > 10) || (this._x > SW)) {
if (firstPizuz == false) {
this.gotoAndPlay("explode");
firstPizuz = true;
}
}
if (this._currentframe == 5) {
rocketSound.start();
}
if (this._currentframe == 20) {
firstPizuz = false;
missileFirst = false;
this.removeMovieClip();
}
if (this._currentframe == 10) {
i = 0;
while (i < enemys) {
_root["enemy" + i].removeMovieClip();
i++;
}
enemysLeft = 0;
}
};
}
}
}
};
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
xplNum = 0;
metorite(enemys);
Frame 206
function makeShip() {
j = 0;
while (j < shipsNum) {
attachMovie("shipLib", "shipE" + j, d++);
_root["shipE" + j]._x = random(SW) + SW;
_root["shipE" + j]._y = random(SH);
_root["shipE" + j].shipDir = random(2) - 1;
shipR = _root["shipE" + j]._width / 2;
shipStartSpeed = 20;
_root["shipE" + j].onEnterFrame = function () {
shipX = this._x;
shipY = this._y;
this._x = this._x - shipStartSpeed;
if (this._x < 500) {
shipStartSpeed = 0;
updown = true;
}
if (updown == true) {
if (this.shipDir == 1) {
this.speedY = (SH - this._y) / shipSpeedEnemy;
this._y = this._y + this.speedY;
if (this._y > (SH - this._height)) {
this.shipDir = -1;
}
if (this._y < (0 + this._height)) {
this.shipDir = -1;
}
} else {
this.speedY = (-this._y) / shipSpeedEnemy;
this._y = this._y + this.speedY;
if (this._y > (SH - this._height)) {
this.shipDir = 1;
}
if (this._y < (0 + this._height)) {
this.shipDir = 1;
}
}
}
if (_root.man.hitTest(this._x - (this._width / 2), this._y, true)) {
if (hit == false) {
this.swapDepths(0);
this.removeMovieClip();
life = life - 1;
HN = HN - 1;
_root.man._alpha = 50;
_root["heart" + HN]._alpha = 0;
hit = true;
clearInterval(timerAlpha);
timerAlpha = setInterval(alphaTimer, 2000);
hitByEnemy.start();
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
makeShip();
}
}
}
};
j++;
}
clearInterval(shootShip);
shootShip = setInterval(shipShoot, 1000);
}
function shipShoot() {
if (waveOfShips >= 0) {
shipShot++;
attachMovie("shipLaserLib", "shipLaser" + shipShot, d++);
_root["shipLaser" + shipShot]._x = shipX - _root["shipLaser" + shipShot]._width;
_root["shipLaser" + shipShot]._y = shipY;
_root["shipLaser" + shipShot].onEnterFrame = function () {
this._x = this._x - laserSpeed;
if (this._x < 0) {
this.removeMovieClip();
}
if (_root.man.hitTest(this._x, this._y, true)) {
if (hit == false) {
this.removeMovieClip();
life = life - 1;
HN = HN - 1;
_root.man._alpha = 50;
_root["heart" + HN]._alpha = 0;
hit = true;
clearInterval(timerAlpha);
timerAlpha = setInterval(alphaTimer, 2000);
hitByEnemy.start();
}
}
};
}
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
laserSpeed = 20;
enemys = 5;
enemysLeft = enemys;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
wave = 3;
firstT = false;
level = 2;
hit = false;
_root.man._alpha = 100;
missileFirst = false;
firstPizuz = false;
nextBG.removeMovieClip();
shipsNum = 1;
shipSpeedEnemy = 50;
shipStartSpeed = 20;
waveOfShips = 7;
shipShot = 0;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 60, 90, enemyX, enemyY, 50);
}
i++;
}
j = 0;
while (j < shipsNum) {
if (_root["shipE" + j].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["shipE" + j]._x;
enemyY = _root["shipE" + j]._y;
_root["shipE" + j].removeMovieClip();
powerUp();
firstT = false;
waveOfShips = waveOfShips - 1;
if (waveOfShips > 0) {
makeShip();
} else {
clearInterval(shootShip);
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
j++;
}
};
}
}
};
xplNum = 0;
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 60, 90, enemyX, enemyY, 50);
}
i++;
}
j = 0;
while (j < shipsNum) {
if (_root["shipE" + j].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["shipE" + j]._x;
enemyY = _root["shipE" + j]._y;
_root["shipE" + j].removeMovieClip();
powerUp();
firstT = false;
waveOfShips = waveOfShips - 1;
if (waveOfShips > 0) {
makeShip();
} else {
clearInterval(shootShip);
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
j++;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 60, 90, enemyX, enemyY, 50);
}
i++;
}
j = 0;
while (j < shipsNum) {
if (_root["shipE" + j].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["shipE" + j]._x;
enemyY = _root["shipE" + j]._y;
_root["shipE" + j].removeMovieClip();
powerUp();
firstT = false;
waveOfShips = waveOfShips - 1;
if (waveOfShips > 0) {
makeShip();
} else {
clearInterval(shootShip);
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
j++;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 60, 90, enemyX, enemyY, 50);
}
i++;
}
j = 0;
while (j < shipsNum) {
if (_root["shipE" + j].hitTest(this._x, this._y, true)) {
this.removeMovieClip();
enemyX = _root["shipE" + j]._x;
enemyY = _root["shipE" + j]._y;
_root["shipE" + j].removeMovieClip();
powerUp();
firstT = false;
waveOfShips = waveOfShips - 1;
if (waveOfShips > 0) {
makeShip();
} else {
clearInterval(shootShip);
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
j++;
}
};
}
};
_root.onEnterFrame = function () {
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
if (enemysLeft == 0) {
if (firstT == false) {
if (wave > 0) {
wave = wave - 1;
enemys = 5;
enemysLeft = enemys;
metorite(enemys);
firstT = true;
}
}
}
if (wave < 0) {
wave = 0;
}
if ((wave == 0) && (waveOfShips == 0)) {
_root.gotoAndStop("nextLevel");
}
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (MN >= 1) {
if (Key.isDown(32)) {
if (missileFirst == false) {
num++;
attachMovie("missileLib", "til" + num, d++);
_root["til" + num]._x = _root.man._x;
_root["til" + num]._y = _root.man._y;
_root["til" + num]._rotation = 120;
MN = MN - 1;
_root["rocket" + MN]._alpha = 0;
tilSpeed = 1;
missileFirst = true;
firstT = false;
_root["til" + num].onEnterFrame = function () {
tilSpeed = tilSpeed + 0.5;
this._x = this._x + tilSpeed;
if ((tilSpeed > 10) || (this._x > SW)) {
if (firstPizuz == false) {
this.gotoAndPlay("explode");
firstPizuz = true;
}
}
if (this._currentframe == 5) {
rocketSound.start();
j = 0;
while (j < shipsNum) {
_root["shipE" + j].gotoAndPlay("shield");
j++;
}
}
if (this._currentframe == 20) {
firstPizuz = false;
missileFirst = false;
this.removeMovieClip();
}
if (this._currentframe == 10) {
i = 0;
while (i < enemys) {
_root["enemy" + i].removeMovieClip();
i++;
}
enemysLeft = 0;
}
};
}
}
}
};
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
metorite(enemys);
makeShip();
Frame 207
function makeShip() {
shipsLeft = shipsNum;
i = 0;
while (i < shipsNum) {
attachMovie("shipLib", "shipE" + i, d++);
_root["shipE" + i]._x = random(SW) + SW;
_root["shipE" + i]._y = random(SH);
_root["shipE" + i].shipDir = random(2);
_root["shipE" + i].updown = false;
shipR = _root["shipE" + i]._width / 2;
_root["shipE" + i].shipStartSpeed = 20;
_root["shipE" + i].onEnterFrame = function () {
shipX = this._x;
shipY = this._y;
this._x = this._x - this.shipStartSpeed;
if (this._x < 500) {
this.shipStartSpeed = 0;
this.updown = true;
}
if (this.updown == true) {
if (this.shipDir == 1) {
this.speedY = (SH - this._y) / shipSpeedEnemy;
this._y = this._y + this.speedY;
if (this._y > (SH - this._height)) {
this.shipDir = -1;
}
if (this._y < (0 + this._height)) {
this.shipDir = -1;
}
} else {
this.speedY = (-this._y) / shipSpeedEnemy;
this._y = this._y + this.speedY;
if (this._y > (SH - this._height)) {
this.shipDir = 1;
}
if (this._y < (0 + this._height)) {
this.shipDir = 1;
}
}
if (_root.man.hitTest(this._x - (this._width / 2), this._y, true)) {
if (hit == false) {
this.swapDepths(0);
this.removeMovieClip();
life = life - 1;
HN = HN - 1;
_root.man._alpha = 50;
_root["heart" + HN]._alpha = 0;
hit = true;
clearInterval(timerAlpha);
timerAlpha = setInterval(alphaTimer, 2000);
hitByEnemy.start();
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
}
}
}
};
i++;
}
clearInterval(shootShip);
shootShip = setInterval(shipShoot, 1000);
}
function shipShoot() {
if (waveOfShips >= 0) {
i = 0;
while (i < shipsLeft) {
shipX = _root["shipE" + i]._x;
shipY = _root["shipE" + i]._y;
myLaser = attachMovie("shipLaserLib", "shipLaser" + shipShot, d++);
shipShot++;
myLaser._x = shipX - myLaser._width;
myLaser._y = shipY;
myLaser.onEnterFrame = function () {
this._x = this._x - laserSpeed;
if (this._x < 0) {
this.swapDepths(0);
this.removeMovieClip();
}
if (_root.man.hitTest(this._x, this._y, true)) {
if (hit == false) {
this.swapDepths(0);
this.removeMovieClip();
life = life - 1;
HN = HN - 1;
_root.man._alpha = 50;
_root["heart" + HN]._alpha = 0;
hit = true;
clearInterval(timerAlpha);
timerAlpha = setInterval(alphaTimer, 2000);
hitByEnemy.start();
}
}
};
i++;
}
}
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
bc2 = 0;
laserSpeed = 20;
enemys = 5;
enemysLeft = enemys;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
wave = 3;
firstT = false;
level = 3;
hit = false;
_root.man._alpha = 100;
missileFirst = false;
firstPizuz = false;
nextBG.removeMovieClip();
shipSpeedEnemy = 50;
waveOfShips = 7;
shipsNum = 2;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
i = 0;
while (i < shipsNum) {
if (_root["shipE" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["shipE" + i]._x;
enemyY = _root["shipE" + i]._y;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
powerUp();
firstT = false;
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
};
}
}
};
xplNum = 0;
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
i = 0;
while (i < shipsNum) {
if (_root["shipE" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["shipE" + i]._x;
enemyY = _root["shipE" + i]._y;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
powerUp();
firstT = false;
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
i = 0;
while (i < shipsNum) {
if (_root["shipE" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["shipE" + i]._x;
enemyY = _root["shipE" + i]._y;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
powerUp();
firstT = false;
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
i = 0;
while (i < shipsNum) {
if (_root["shipE" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["shipE" + i]._x;
enemyY = _root["shipE" + i]._y;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
powerUp();
firstT = false;
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
};
}
};
shipShot = 0;
laserSpeed = 20;
_root.onEnterFrame = function () {
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
if (enemysLeft == 0) {
if (firstT == false) {
if (wave > 0) {
wave = wave - 1;
enemys = 5;
enemysLeft = enemys;
metorite(enemys);
firstT = true;
}
}
}
if (wave < 0) {
wave = 0;
}
if ((wave == 0) && (waveOfShips == 0)) {
_root.gotoAndStop("nextLevel");
}
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (MN >= 1) {
if (Key.isDown(32)) {
if (missileFirst == false) {
num++;
attachMovie("missileLib", "til" + num, d++);
_root["til" + num]._x = _root.man._x;
_root["til" + num]._y = _root.man._y;
_root["til" + num]._rotation = 120;
MN = MN - 1;
_root["rocket" + MN]._alpha = 0;
tilSpeed = 1;
missileFirst = true;
firstT = false;
_root["til" + num].onEnterFrame = function () {
tilSpeed = tilSpeed + 0.5;
this._x = this._x + tilSpeed;
if ((tilSpeed > 10) || (this._x > SW)) {
if (firstPizuz == false) {
this.gotoAndPlay("explode");
firstPizuz = true;
}
}
if (this._currentframe == 5) {
rocketSound.start();
i = 0;
while (i < shipsNum) {
_root["shipE" + i].gotoAndPlay("shield");
i++;
}
}
if (this._currentframe == 20) {
firstPizuz = false;
missileFirst = false;
this.swapDepths(0);
this.removeMovieClip();
}
if (this._currentframe == 10) {
i = 0;
while (i < enemys) {
_root["enemy" + i].swapDepths(0);
_root["enemy" + i].removeMovieClip();
i++;
}
enemysLeft = 0;
}
};
}
}
}
};
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
metorite(enemys);
makeShip();
Frame 208
function makeShip() {
shipsLeft = shipsNum;
i = 0;
while (i < shipsNum) {
attachMovie("shipLib", "shipE" + i, d++);
_root["shipE" + i]._x = random(SW) + SW;
_root["shipE" + i]._y = random(SH);
_root["shipE" + i].shipDir = random(2);
_root["shipE" + i].updown = false;
shipR = _root["shipE" + i]._width / 2;
_root["shipE" + i].shipStartSpeed = 20;
_root["shipE" + i].onEnterFrame = function () {
shipX = this._x;
shipY = this._y;
this._x = this._x - this.shipStartSpeed;
if (this._x < 500) {
this.shipStartSpeed = 0;
this.updown = true;
}
if (this.updown == true) {
if (this.shipDir == 1) {
this.speedY = (SH - this._y) / shipSpeedEnemy;
this._y = this._y + this.speedY;
if (this._y > (SH - this._height)) {
this.shipDir = -1;
}
if (this._y < (0 + this._height)) {
this.shipDir = -1;
}
} else {
this.speedY = (-this._y) / shipSpeedEnemy;
this._y = this._y + this.speedY;
if (this._y > (SH - this._height)) {
this.shipDir = 1;
}
if (this._y < (0 + this._height)) {
this.shipDir = 1;
}
}
if (_root.man.hitTest(this._x - (this._width / 2), this._y, true)) {
if (hit == false) {
this.swapDepths(0);
this.removeMovieClip();
life = life - 1;
HN = HN - 1;
_root.man._alpha = 50;
_root["heart" + HN]._alpha = 0;
hit = true;
clearInterval(timerAlpha);
timerAlpha = setInterval(alphaTimer, 2000);
hitByEnemy.start();
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
}
}
}
};
i++;
}
clearInterval(shootShip);
shootShip = setInterval(shipShoot, 1000);
}
function shipShoot() {
if (waveOfShips >= 0) {
i = 0;
while (i < shipsLeft) {
shipX = _root["shipE" + i]._x;
shipY = _root["shipE" + i]._y;
myLaser = attachMovie("shipLaserLib", "shipLaser" + shipShot, d++);
shipShot++;
myLaser._x = shipX - myLaser._width;
myLaser._y = shipY;
myLaser.onEnterFrame = function () {
this._x = this._x - laserSpeed;
if (this._x < 0) {
this.swapDepths(0);
this.removeMovieClip();
}
if (_root.man.hitTest(this._x, this._y, true)) {
if (hit == false) {
this.swapDepths(0);
this.removeMovieClip();
life = life - 1;
HN = HN - 1;
_root.man._alpha = 50;
_root["heart" + HN]._alpha = 0;
hit = true;
clearInterval(timerAlpha);
timerAlpha = setInterval(alphaTimer, 2000);
hitByEnemy.start();
}
}
};
i++;
}
}
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
bc2 = 0;
laserSpeed = 20;
enemys = 2;
enemysLeft = enemys;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
wave = 3;
firstT = false;
level = 4;
hit = false;
_root.man._alpha = 100;
missileFirst = false;
firstPizuz = false;
nextBG.removeMovieClip();
shipSpeedEnemy = 50;
waveOfShips = 6;
shipsNum = 4;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
i = 0;
while (i < shipsNum) {
if (_root["shipE" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["shipE" + i]._x;
enemyY = _root["shipE" + i]._y;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
powerUp();
firstT = false;
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
};
}
}
};
xplNum = 0;
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
i = 0;
while (i < shipsNum) {
if (_root["shipE" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["shipE" + i]._x;
enemyY = _root["shipE" + i]._y;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
powerUp();
firstT = false;
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
i = 0;
while (i < shipsNum) {
if (_root["shipE" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["shipE" + i]._x;
enemyY = _root["shipE" + i]._y;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
powerUp();
firstT = false;
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < enemys) {
if (_root["enemy" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["enemy" + i]._x;
enemyY = _root["enemy" + i]._y;
_root["enemy" + i].removeMovieClip();
enemysLeft = enemysLeft - 1;
powerUp();
firstT = false;
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
i = 0;
while (i < shipsNum) {
if (_root["shipE" + i].hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = _root["shipE" + i]._x;
enemyY = _root["shipE" + i]._y;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
powerUp();
firstT = false;
shipsLeft = shipsLeft - 1;
if (shipsLeft == 0) {
if (waveOfShips > 0) {
waveOfShips = waveOfShips - 1;
shipsNum = 2;
shipsLeft = shipsNum;
makeShip();
}
}
xplusion("xplusionLib", 100, 160, enemyX, enemyY, 50);
}
i++;
}
};
}
};
shipShot = 0;
laserSpeed = 20;
_root.onEnterFrame = function () {
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
if (enemysLeft == 0) {
if (firstT == false) {
if (wave > 0) {
wave = wave - 1;
enemys = 5;
enemysLeft = enemys;
metorite(enemys);
firstT = true;
}
}
}
if (wave < 0) {
wave = 0;
}
if ((wave == 0) && (waveOfShips == 0)) {
_root.gotoAndStop("nextLevel");
}
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (MN >= 1) {
if (Key.isDown(32)) {
if (missileFirst == false) {
num++;
attachMovie("missileLib", "til" + num, d++);
_root["til" + num]._x = _root.man._x;
_root["til" + num]._y = _root.man._y;
_root["til" + num]._rotation = 120;
MN = MN - 1;
_root["rocket" + MN]._alpha = 0;
tilSpeed = 1;
missileFirst = true;
firstT = false;
_root["til" + num].onEnterFrame = function () {
tilSpeed = tilSpeed + 0.5;
this._x = this._x + tilSpeed;
if ((tilSpeed > 10) || (this._x > SW)) {
if (firstPizuz == false) {
this.gotoAndPlay("explode");
firstPizuz = true;
}
}
if (this._currentframe == 5) {
rocketSound.start();
i = 0;
while (i < shipsNum) {
_root["shipE" + i].gotoAndPlay("shield");
i++;
}
}
if (this._currentframe == 20) {
firstPizuz = false;
missileFirst = false;
this.swapDepths(0);
this.removeMovieClip();
}
if (this._currentframe == 10) {
i = 0;
while (i < enemys) {
_root["enemy" + i].swapDepths(0);
_root["enemy" + i].removeMovieClip();
i++;
}
enemysLeft = 0;
}
};
}
}
}
};
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
metorite(enemys);
makeShip();
Frame 209
function hitTest(mc) {
if (mc.hitTest((man._x + (man._width / 2)) || (man._x - (man._width / 2)), man._y, true)) {
hitFunc();
}
}
function bossIn(mc, speed) {
if (mc._x < 400) {
speed = 0;
rotating = true;
comingIn = false;
}
mc._x = mc._x - speed;
lastBoss.lastBossShield._visible = true;
canHit = false;
}
function randomRotation(mc, speed) {
lastBoss.lastBossShield._visible = true;
canHit = false;
if (oneNum) {
mc.rot = mc._rotation;
rndX = Math.random() * SW;
rndY = Math.random() * SH;
radians = Math.atan2(rndY - mc._y, rndX - mc._x);
degrees = ((radians * 180) / Math.PI) + 90;
oneNum = false;
}
if (mc.rot > degrees) {
mc.rot = degrees;
moving = true;
rotating = false;
} else {
mc.rot = mc.rot + 6;
}
mc._rotation = mc.rot;
}
function randomMovement(mc, speed) {
mc._x = mc._x + ((rndX - mc._x) / speed);
mc._y = mc._y + ((rndY - mc._y) / speed);
lastBoss.lastBossShield._visible = false;
canHit = true;
nDisX = Math.round(mc._x - rndX);
nDisY = Math.round(mc._y - rndY);
flag = Math.sqrt(Math.abs(nDisX * nDisY));
if (flag <= 1) {
oneNum = true;
rotating = true;
moving = false;
lastRot = degrees;
}
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
bc2 = 0;
laserSpeed = 20;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
level = 5;
_root.man._alpha = 100;
hit = false;
nextBG.removeMovieClip();
firstXplusion = false;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if (canHit) {
if (lastBoss.lastBossIn.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
lastBoss.life = lastBoss.life - 2;
lastBossHealthBar._xscale = lastBossHealthBar._xscale - 2;
}
} else if (lastBoss.lastBossShield.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
}
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
};
}
}
};
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if (canHit) {
if (lastBoss.lastBossIn.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
lastBoss.life = lastBoss.life - 2;
lastBossHealthBar._xscale = lastBossHealthBar._xscale - 2;
}
} else if (lastBoss.lastBossShield.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
}
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if (canHit) {
if (lastBoss.lastBossIn.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
lastBoss.life = lastBoss.life - 2;
lastBossHealthBar._xscale = lastBossHealthBar._xscale - 2;
}
} else if (lastBoss.lastBossShield.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
}
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
if (canHit) {
if (lastBoss.lastBossIn.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
lastBoss.life = lastBoss.life - 2;
lastBossHealthBar._xscale = lastBossHealthBar._xscale - 2;
}
} else if (lastBoss.lastBossShield.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
}
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
};
}
};
lastBoss = attachMovie("lastBossLib", "lastBoss", d++);
lastBoss._x = SW + (SW / 2);
lastBoss._y = SH / 2;
lastBoss._width = 110;
lastBoss._height = 103.5;
lastBoss._rotation = lastBoss._rotation - 90;
lastBoss.life = 100;
oneNum = true;
lastRot = 0;
comingIn = true;
rotating = false;
moving = false;
onEnterFrame = function () {
if (comingIn) {
bossIn(lastBoss, 10);
}
if (rotating) {
randomRotation(lastBoss, 5);
}
if (moving) {
randomMovement(lastBoss, 10);
}
hitTest(lastBoss);
lastBossText.text = lastBoss.life;
if (lastBoss.life <= 0) {
lastBossText.text = 0;
lastBoss._alpha = lastBoss._alpha - 10;
if (lastBoss._alpha <= 10) {
lastBoss.removeMovieClip();
}
if (firstXplusion == false) {
attachMovie("lvl5bossXplusion", "lvl5bossX", d++);
lvl5bossX._x = lastBoss._x;
lvl5bossX._y = lastBoss._y;
lvl5bossX._width = 320;
lvl5bossX._height = 240;
metoSound.start();
firstXplusion = true;
}
if (lvl5bossX._currentframe == 35) {
score = score + 100;
gotoAndStop ("nextLevel");
}
}
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
};
Frame 210
function makeZigZag() {
if (firstTime) {
i = 0;
while (i < howManyZigZagStart) {
zigNum++;
zigZag = attachMovie("zigzagELib", "zigzag" + i, d++);
zigZag._x = random(SW) + SW;
zigZag._y = random(SH);
zigZag.down = true;
zigZag.startPoint = zigZag._y;
zigZag.speed = random(8) + 15;
i++;
}
firstTime = false;
} else {
zigNum++;
zigZag = attachMovie("zigzagELib", "zigzag" + i, d++);
zigZag._x = random(SW) + SW;
zigZag._y = random(SH);
zigZag.down = true;
zigZag.startPoint = zigZag._y;
zigZag.speed = random(8) + 15;
}
}
function moveZigZag() {
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag._x < 490) {
if ((zigZag._y > (zigZag.startPoint + zig)) || (zigZag._y < (zigZag.startPoint - zig))) {
zigZag.down = !zigZag.down;
}
if (zigZag.down) {
zigZag._y = zigZag._y + 4;
} else {
zigZag._y = zigZag._y - 4;
}
}
zigZag._x = zigZag._x - zigZag.speed;
if (zigZag._x < (-zigZag._width)) {
zigZag._x = SW + (SW / 2);
zigZag._y = random(SH);
zigZag.startPoint = zigZag._y;
zigZag.speed = random(8) + 15;
}
if ((((zigZag.hitTest(man._x - (man._width / 2), man._y, true) || (zigZag.hitTest(man._x + (man._width / 2), man._y, true))) || (zigZag.hitTest(man._x, man._y + (man._height / 2), true))) || (zigZag.hitTest(man._x, man._y - (man._height / 2), true))) || (zigZag.hitTest(man._x, man._y, true))) {
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
makeZigZag();
hitFunc();
}
i++;
}
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
bc2 = 0;
laserSpeed = 20;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
level = 6;
_root.man._alpha = 100;
hit = false;
nextBG.removeMovieClip();
zig = 50;
howManyZigZagStart = 2;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
radius = man._width / 2;
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = zigZag._x;
enemyY = zigZag._y;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
powerUp();
makeZigZag();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
}
}
};
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = zigZag._x;
enemyY = zigZag._y;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
powerUp();
makeZigZag();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = zigZag._x;
enemyY = zigZag._y;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
powerUp();
makeZigZag();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = zigZag._x;
enemyY = zigZag._y;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
powerUp();
makeZigZag();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
}
};
firstTime = true;
zigNum = 0;
num = 0;
missileFirst = false;
firstPizuz = false;
firsT = false;
onEnterFrame = function () {
moveZigZag();
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (MN >= 1) {
if (Key.isDown(32)) {
if (missileFirst == false) {
num++;
attachMovie("missileLib", "til" + num, d++);
_root["til" + num]._x = _root.man._x;
_root["til" + num]._y = _root.man._y;
_root["til" + num]._rotation = 120;
MN = MN - 1;
_root["rocket" + MN]._alpha = 0;
tilSpeed = 1;
missileFirst = true;
firstT = false;
_root["til" + num].onEnterFrame = function () {
tilSpeed = tilSpeed + 0.5;
this._x = this._x + tilSpeed;
if ((tilSpeed > 10) || (this._x > SW)) {
if (firstPizuz == false) {
this.gotoAndPlay("explode");
firstPizuz = true;
}
}
if (this._currentframe == 5) {
rocketSound.start();
j = 0;
while (j < shipsNum) {
_root["shipE" + j].gotoAndPlay("shield");
j++;
}
}
if (this._currentframe == 20) {
firstPizuz = false;
missileFirst = false;
this.swapDepths(0);
this.removeMovieClip();
}
if (this._currentframe == 10) {
i = 0;
while (i < zigNum) {
firstTime = true;
zigZag = _root["zigzag" + i];
zigZag.removeMovieClip();
i++;
}
makeZigZag();
}
};
}
}
}
};
makeZigZag();
xplNum = 0;
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
clearInterval(nextLvl);
nextLvl = setInterval(goToNextLevel, 50000);
Frame 211
function makeZigZag() {
if (firstTime) {
i = 0;
while (i < howManyZigZagStart) {
zigNum++;
zigZag = attachMovie("zigzagELib", "zigzag" + i, d++);
zigZag._x = random(SW) + SW;
zigZag._y = random(SH);
zigZag.down = true;
zigZag.startPoint = zigZag._y;
zigZag.speed = random(8) + 15;
i++;
}
firstTime = false;
} else {
zigNum++;
zigZag = attachMovie("zigzagELib", "zigzag" + i, d++);
zigZag._x = random(SW) + SW;
zigZag._y = random(SH);
zigZag.down = true;
zigZag.startPoint = zigZag._y;
zigZag.speed = random(8) + 15;
}
}
function moveZigZag() {
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag._x < 490) {
if ((zigZag._y > (zigZag.startPoint + zig)) || (zigZag._y < (zigZag.startPoint - zig))) {
zigZag.down = !zigZag.down;
}
if (zigZag.down) {
zigZag._y = zigZag._y + 4;
} else {
zigZag._y = zigZag._y - 4;
}
}
zigZag._x = zigZag._x - zigZag.speed;
if (zigZag._x < (-zigZag._width)) {
zigZag._x = SW + (SW / 2);
zigZag._y = random(SH);
zigZag.startPoint = zigZag._y;
zigZag.speed = random(8) + 15;
}
if ((((zigZag.hitTest(man._x - (man._width / 2), man._y, true) || (zigZag.hitTest(man._x + (man._width / 2), man._y, true))) || (zigZag.hitTest(man._x, man._y + (man._height / 2), true))) || (zigZag.hitTest(man._x, man._y - (man._height / 2), true))) || (zigZag.hitTest(man._x, man._y, true))) {
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
makeZigZag();
hitFunc();
}
i++;
}
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
bc2 = 0;
laserSpeed = 20;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
level = 7;
_root.man._alpha = 100;
hit = false;
nextBG.removeMovieClip();
zig = 50;
howManyZigZagStart = 4;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
radius = man._width / 2;
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = zigZag._x;
enemyY = zigZag._y;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
powerUp();
makeZigZag();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
}
}
};
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = zigZag._x;
enemyY = zigZag._y;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
powerUp();
makeZigZag();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = zigZag._x;
enemyY = zigZag._y;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
powerUp();
makeZigZag();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
if (zigZag.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = zigZag._x;
enemyY = zigZag._y;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
zigNum = zigNum - 1;
powerUp();
makeZigZag();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
}
};
firstTime = true;
zigNum = 0;
num = 0;
missileFirst = false;
firstPizuz = false;
firsT = false;
onEnterFrame = function () {
moveZigZag();
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (MN >= 1) {
if (Key.isDown(32)) {
if (missileFirst == false) {
num++;
attachMovie("missileLib", "til" + num, d++);
_root["til" + num]._x = _root.man._x;
_root["til" + num]._y = _root.man._y;
_root["til" + num]._rotation = 120;
MN = MN - 1;
_root["rocket" + MN]._alpha = 0;
tilSpeed = 1;
missileFirst = true;
firstT = false;
_root["til" + num].onEnterFrame = function () {
tilSpeed = tilSpeed + 0.5;
this._x = this._x + tilSpeed;
if ((tilSpeed > 10) || (this._x > SW)) {
if (firstPizuz == false) {
this.gotoAndPlay("explode");
firstPizuz = true;
}
}
if (this._currentframe == 5) {
rocketSound.start();
j = 0;
while (j < shipsNum) {
_root["shipE" + j].gotoAndPlay("shield");
j++;
}
}
if (this._currentframe == 20) {
firstPizuz = false;
missileFirst = false;
this.swapDepths(0);
this.removeMovieClip();
}
if (this._currentframe == 10) {
i = 0;
while (i < zigNum) {
firstTime = true;
zigZag = _root["zigzag" + i];
zigZag.removeMovieClip();
i++;
}
makeZigZag();
}
};
}
}
}
};
makeZigZag();
xplNum = 0;
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
clearInterval(nextLvl);
nextLvl = setInterval(goToNextLevel, 50000);
Frame 212
function makeBugs() {
if (firstBugs) {
i = 0;
while (i < numOfBugs) {
bugNum++;
bugs = attachMovie("bugLib", "bug" + i, d++);
bugs._x = random(SW) + SW;
bugs._y = random(SH);
bugs._width = 50;
bugs._height = 50;
bugs.startspeed = 5;
bugs.endX = (random(40) + SW) - 50;
bugs.rotation = 0;
i++;
}
firstBugs = false;
} else {
bugNum++;
bugs = attachMovie("bugLib", "bug" + i, d++);
bugs._x = random(SW) + SW;
bugs._y = random(SH);
bugs._width = 50;
bugs._height = 50;
bugs.startspeed = 5;
bugs.endX = (random(40) + SW) - 50;
bugs.rotation = 0;
}
}
function bugMovement() {
i = 0;
while (i < bugNum) {
bugs = _root["bug" + i];
bugs._x = bugs._x - bugs.startspeed;
if (bugs._x < bugs.endX) {
bugs.rotation = bugs.rotation + 2;
bugs.startspeed = 0;
bugs._rotation = bugs._rotation - bugs.rotation;
if (bugs.rotation > 60) {
bugs.rotation = 60;
bugs.startspeed = bugs.rotation / 2;
if (bugs._x < 0) {
bugs.swapDepths(0);
bugs.removeMovieClip();
bugNum--;
makeBugs();
}
}
}
if (hit == false) {
if ((((bugs.hitTest(man._x - (man._width / 2), man._y, true) || (bugs.hitTest(man._x + (man._width / 2), man._y, true))) || (bugs.hitTest(man._x, man._y + (man._height / 2), true))) || (bugs.hitTest(man._x, man._y - (man._height / 2), true))) || (bugs.hitTest(man._x, man._y, true))) {
bugs.swapDepths(0);
bugs.removeMovieClip();
bugNum--;
hitFunc();
makeBugs();
}
}
i++;
}
}
function addBug() {
makeBugs();
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
bc2 = 0;
laserSpeed = 20;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
level = 8;
_root.man._alpha = 100;
hit = false;
nextBG.removeMovieClip();
missileFirst = false;
firstPizuz = false;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < bugNum) {
bugs = _root["bug" + i];
if (bugs.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = bugs._x;
enemyY = bugs._y;
bugs.swapDepths(0);
bugs.removeMovieClip();
bugNum = bugNum - 1;
powerUp();
makeBugs();
xplusion("zigZagXplusionLib", 100, 160, enemyX, enemyY, 35);
}
i++;
}
};
}
}
};
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
shot.start();
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < bugNum) {
bugs = _root["bug" + i];
if (bugs.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = bugs._x;
enemyY = bugs._y;
powerUp();
bugs.swapDepths(0);
bugs.removeMovieClip();
bugNum--;
makeBugs();
xplusion("bugBombLib", 120, 200, enemyX, enemyY, 30);
}
i++;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < bugNum) {
bugs = _root["bug" + i];
if (bugs.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = bugs._x;
enemyY = bugs._y;
powerUp();
bugs.swapDepths(0);
bugs.removeMovieClip();
bugNum--;
makeBugs();
xplusion("bugBombLib", 120, 200, enemyX, enemyY, 30);
}
i++;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < bugNum) {
bugs = _root["bug" + i];
if (bugs.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = bugs._x;
enemyY = bugs._y;
powerUp();
bugs.swapDepths(0);
bugs.removeMovieClip();
bugNum--;
makeBugs();
xplusion("bugBombLib", 120, 200, enemyX, enemyY, 30);
}
i++;
}
};
}
};
firstBugs = true;
numOfBugs = 5;
bugNum = 0;
makeBugs();
onEnterFrame = function () {
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
bugMovement();
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (MN >= 1) {
if (Key.isDown(32)) {
if (missileFirst == false) {
num++;
attachMovie("missileLib", "til" + num, d++);
_root["til" + num]._x = _root.man._x;
_root["til" + num]._y = _root.man._y;
_root["til" + num]._rotation = 120;
MN = MN - 1;
_root["rocket" + MN]._alpha = 0;
tilSpeed = 1;
missileFirst = true;
firstT = false;
_root["til" + num].onEnterFrame = function () {
tilSpeed = tilSpeed + 0.5;
this._x = this._x + tilSpeed;
if ((tilSpeed > 10) || (this._x > SW)) {
if (firstPizuz == false) {
this.gotoAndPlay("explode");
firstPizuz = true;
}
}
if (this._currentframe == 5) {
rocketSound.start();
j = 0;
while (j < shipsNum) {
_root["shipE" + j].gotoAndPlay("shield");
j++;
}
}
if (this._currentframe == 20) {
firstPizuz = false;
missileFirst = false;
this.swapDepths(0);
this.removeMovieClip();
}
if (this._currentframe == 10) {
i = 0;
while (i < bugNum) {
bugs = _root["bug" + i];
bugs.swapDepths(0);
bugs.removeMovieClip();
i++;
}
firstBugs = true;
makeBugs();
}
};
}
}
}
};
xplNum = 0;
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
clearInterval(nextLvl);
nextLvl = setInterval(goToNextLevel, 50000);
clearInterval(bugMake);
bugMake = setInterval(addBug, 5000);
Frame 213
function makelvl9e() {
if (firstlvl9e) {
i = 0;
while (i < numOflvl9e) {
lvl9eNum++;
lvl9e = attachMovie("level9enemyLib", "lvl9e" + i, d++);
lvl9e._x = random(SW) + SW;
lvl9e._y = random(SH) - (lvl9e._height / 2);
lvl9e._width = 50;
lvl9e._height = 100;
lvl9e.startspeed = 15;
lvl9e.endX = 50 + random(300);
lvl9e.hitable = true;
i++;
}
firstlvl9e = false;
} else {
lvl9eNum++;
lvl9e = attachMovie("level9enemyLib", "lvl9e" + i, d++);
lvl9e._x = random(SW) + SW;
lvl9e._y = random(SH) - (lvl9e._height / 2);
lvl9e._width = 50;
lvl9e._height = 100;
lvl9e.startspeed = 15;
lvl9e.endX = 50 + random(300);
lvl9e.hitable = true;
}
}
function shake(mc) {
mc._x = mc.sX;
mc._y = mc.sY;
mc.sX = ((mc._x + random(10)) - 5) - mc.startspeed;
mc.sY = (mc._y + random(10)) - 5;
}
function lvl9eMovement() {
i = 0;
while (i < lvl9eNum) {
lvl9e = _root["lvl9e" + i];
shake(lvl9e);
if (lvl9e._x < lvl9e.endX) {
lvl9e.startspeed = 0;
lvl9e.endX = 0;
lvl9e.gotoAndPlay("bomb");
lvl9e.hitable = false;
metoSound.start();
}
if (lvl9e._currentframe == 14) {
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
lvl9eNum--;
makelvl9e();
}
if (hit == false) {
if (lvl9e.hitTest(man._x - (man._width / 2), man._y, true) || (lvl9e.hitTest(man._x + (man._width / 2), man._y, true))) {
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
lvl9eNum--;
hitFunc();
makelvl9e();
}
}
if ((lvl9e._y + (lvl9e._height / 2)) < 0) {
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
lvl9eNum--;
makelvl9e();
}
i++;
}
}
function goToNextLevel() {
gotoAndStop ("nextLevel");
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
bc2 = 0;
laserSpeed = 20;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
level = 9;
_root.man._alpha = 100;
hit = false;
nextBG.removeMovieClip();
missileFirst = false;
firstPizuz = false;
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < lvl9eNum) {
lvl9e = _root["lvl9e" + i];
if (lvl9e.hitable) {
if (lvl9e.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = lvl9e._x;
enemyY = lvl9e._y;
powerUp();
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
lvl9eNum--;
makelvl9e();
xplusion("bugBombLib", 120, 200, enemyX, enemyY, 30);
}
}
i++;
}
};
}
}
};
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < lvl9eNum) {
lvl9e = _root["lvl9e" + i];
if (lvl9e.hitable) {
if (lvl9e.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = lvl9e._x;
enemyY = lvl9e._y;
powerUp();
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
lvl9eNum--;
makelvl9e();
xplusion("bugBombLib", 120, 200, enemyX, enemyY, 30);
}
}
i++;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < lvl9eNum) {
lvl9e = _root["lvl9e" + i];
if (lvl9e.hitable) {
if (lvl9e.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = lvl9e._x;
enemyY = lvl9e._y;
powerUp();
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
lvl9eNum--;
makelvl9e();
xplusion("bugBombLib", 120, 200, enemyX, enemyY, 30);
}
}
i++;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
i = 0;
while (i < lvl9eNum) {
lvl9e = _root["lvl9e" + i];
if (lvl9e.hitable) {
if (lvl9e.hitTest(this._x + (this._width / 2), this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
enemyX = lvl9e._x;
enemyY = lvl9e._y;
powerUp();
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
lvl9eNum--;
makelvl9e();
xplusion("bugBombLib", 120, 200, enemyX, enemyY, 30);
}
}
i++;
}
};
}
};
firstlvl9e = true;
numOflvl9e = 5;
lvl9eNum = 0;
makelvl9e();
onEnterFrame = function () {
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
lvl9eMovement();
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (MN >= 1) {
if (Key.isDown(32)) {
if (missileFirst == false) {
num++;
attachMovie("missileLib", "til" + num, d++);
_root["til" + num]._x = _root.man._x;
_root["til" + num]._y = _root.man._y;
_root["til" + num]._rotation = 120;
MN = MN - 1;
_root["rocket" + MN]._alpha = 0;
tilSpeed = 1;
missileFirst = true;
firstT = false;
_root["til" + num].onEnterFrame = function () {
tilSpeed = tilSpeed + 0.5;
this._x = this._x + tilSpeed;
if ((tilSpeed > 10) || (this._x > SW)) {
if (firstPizuz == false) {
this.gotoAndPlay("explode");
firstPizuz = true;
}
}
if (this._currentframe == 5) {
rocketSound.start();
j = 0;
while (j < shipsNum) {
_root["shipE" + j].gotoAndPlay("shield");
j++;
}
}
if (this._currentframe == 20) {
firstPizuz = false;
missileFirst = false;
this.swapDepths(0);
this.removeMovieClip();
}
if (this._currentframe == 10) {
i = 0;
while (i < lvl9eNum) {
lvl9e = _root["lvl9e" + i];
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
i++;
}
firstlvl9e = true;
makelvl9e();
}
};
}
}
}
};
xplNum = 0;
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
clearInterval(nextLvl);
nextLvl = setInterval(goToNextLevel, 50000);
Frame 214
function comeIn() {
if (comeInStart) {
lvl5boss._x = lvl5boss._x - lvl5boss.startSpeed;
if (lvl5boss._x < (SW - lvl5boss._width)) {
comeInStart = false;
startX = lvl5boss._x - (lvl5boss._width / 2);
startY = lvl5boss._y;
chooseMove();
}
}
}
function chooseMove() {
if (chooseOne) {
var _local2 = ["bulletShoot", "circleBoss", "bigBoss"];
var _local1 = _local2[random(_local2.length)];
if (_local1 == "bulletShoot") {
moveToShoot = true;
}
if (_local1 == "circleBoss") {
bossCircle();
}
if (_local1 == "bigBoss") {
bossBig();
}
chooseOne = false;
}
}
function bossCircle() {
angle = 0;
circle = true;
}
function shootBullet() {
numOfBullets = maxBullets;
var _local2 = 0;
while (_local2 < maxBullets) {
var _local1 = bulletArray[bulletIndex];
_local1._x = lvl5boss._x;
_local1._y = lvl5boss._y;
_local1.speed = 20;
_local1.difx = random(500) - _local1._x;
_local1.dify = random(400) - _local1._y;
_local1.atan = Math.atan2(_local1.dify, _local1.difx);
_local1.angle = (_local1.atan * 57.2957795130823) - 100;
_local1._rotation = _local1.angle;
_local1._visible = true;
_local1.notInPlace = false;
bulletIndex++;
if (bulletIndex >= bulletArray.length) {
bulletIndex = 0;
}
_local2++;
}
shoot = true;
}
function bossBig() {
maxH = lvl5boss._height * 2;
maxW = lvl5boss._width * 2;
startGrowing = true;
}
stop();
SW = Stage.width;
SH = Stage.height;
bc = 0;
laserSpeed = 20;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
level = 10;
_root.man._alpha = 100;
hit = false;
nextBG.removeMovieClip();
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
shipSpeed = 4;
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
shipSpeed = 6;
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
shipSpeed = 2;
}
Mouse.hide();
radius = man._width / 2;
man.onEnterFrame = function () {
this.speedX = (_root._xmouse - this._x) / shipSpeed;
this.speedY = (_root._ymouse - this._y) / shipSpeed;
this._x = this._x + this.speedX;
this._y = this._y + this.speedY;
if (ship2) {
if (Key.isDown(1)) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
if (_root.lvl5boss.shieldAround.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
shieldHitByBullet = true;
}
if (_root.lvl5boss.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
hitByBullet = true;
}
};
}
}
i = 0;
while (i < 360) {
Xaround = (Math.cos(i * (Math.PI/180)) * radius) + this._x;
Yaround = (Math.sin(i * (Math.PI/180)) * radius) + this._y;
if (_root.lvl5boss.shieldAround.hitTest(Xaround, Yaround, true)) {
shieldHitByBullet = true;
hitFunc();
}
if (_root.lvl5boss.hitTest(Xaround, Yaround, true)) {
if (hit == false) {
hitByBullet = true;
hitFunc();
}
}
i = i + 5;
}
};
xplNum = 0;
_root.onMouseDown = function () {
if (ship1) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y + 10;
bc2++;
laser.duplicateMovieClip("laser2" + bc2, d++);
_root["laser2" + bc2]._x = _root.man._x + (_root.man._width / 2);
_root["laser2" + bc2]._y = _root.man._y - 10;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
if (_root.lvl5boss.shieldAround.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
shieldHitByBullet = true;
}
if (_root.lvl5boss.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
hitByBullet = true;
}
};
_root["laser2" + bc2].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
if (_root.lvl5boss.shieldAround.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
shieldHitByBullet = true;
}
if (_root.lvl5boss.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
hitByBullet = true;
}
};
}
if (ship3) {
bc++;
laser.duplicateMovieClip("laser" + bc, d++);
_root["laser" + bc]._x = _root.man._x + (_root.man._width / 2);
_root["laser" + bc]._y = _root.man._y;
shot.start();
_root["laser" + bc].onEnterFrame = function () {
this._x = this._x + laserSpeed;
if ((this._x - this._width) > SW) {
this.swapDepths(0);
this.removeMovieClip();
}
if (_root.lvl5boss.shieldAround.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
shieldHitByBullet = true;
}
if (_root.lvl5boss.hitTest(this._x, this._y, true)) {
this.swapDepths(0);
this.removeMovieClip();
hitByBullet = true;
}
};
}
};
attachMovie("lvl5bossLib", "lvl5boss", d++);
lvl5boss._x = (SW / 2) + SW;
lvl5boss._y = SH / 2;
lvl5boss.health = 100;
lvl5boss.shield = 100;
lvl5boss.startSpeed = 10;
hitByBullet = false;
shieldHitByBullet = false;
comeInStart = true;
cirR = 100;
shoot = false;
centerX = SW / 2;
bulletToShoot.notInPlace = false;
firstXplusion = false;
startGrowing = false;
_root.onEnterFrame = function () {
_root.lifeT.text = life;
_root.scoreT.text = "score " + score;
if (HN == 0) {
_root.gotoAndStop("deadScreen");
}
if (hitByBullet) {
lvl5boss.health = lvl5boss.health - 1;
lvl5boss.healthBar._xscale = lvl5boss.healthBar._xscale - 1;
hitByBullet = false;
}
if (shieldHitByBullet) {
if (lvl5boss.shield > 0) {
lvl5boss.shieldAround._alpha = lvl5boss.shieldAround._alpha - 5;
if (lvl5boss.shieldAround._alpha <= 0) {
lvl5boss.shieldAround.swapDepths(0);
lvl5boss.shieldAround.removeMovieClip();
}
lvl5boss.shield = lvl5boss.shield - 5;
shieldHitByBullet = false;
}
}
if (circle) {
lvl5boss._x = startX + (cirR * Math.cos((angle * 3.1415) / 180));
lvl5boss._y = startY + (cirR * Math.sin((angle * 3.1415) / 180));
angle = angle + 5;
if (angle > 360) {
circle = false;
cirR = cirR + 10;
if (cirR >= 200) {
cirR = 200;
}
chooseOne = true;
chooseMove();
}
}
if (shoot) {
i = 0;
while (i < maxBullets) {
bulletToShoot = bulletArray[bulletIndex];
if (bulletToShoot.hitTest(_root.man)) {
bulletToShoot._x = 2000;
bulletToShoot._y = 2000;
bulletToShoot._visible = false;
hitFunc();
}
if (bulletToShoot.angle > 180) {
bulletToShoot._x = bulletToShoot._x + (bulletToShoot.speed * Math.sin((Math.PI/180) * bulletToShoot.angle));
bulletToShoot._y = bulletToShoot._y - (bulletToShoot.speed * Math.cos((Math.PI/180) * bulletToShoot.angle));
} else {
bulletToShoot._x = bulletToShoot._x + (bulletToShoot.speed * Math.sin((Math.PI/180) * bulletToShoot.angle));
bulletToShoot._y = bulletToShoot._y - (bulletToShoot.speed * Math.cos((Math.PI/180) * bulletToShoot.angle));
}
if ((((bulletToShoot._x > SW) || (bulletToShoot._x < 0)) || (bulletToShoot._y > SH)) || (bulletToShoot._y < 0)) {
if (bulletToShoot.notInPlace == false) {
bulletToShoot._visible = false;
bulletToShoot._x = 2000;
bulletToShoot._y = 2000;
numOfBullets = numOfBullets - 1;
if (numOfBullets <= 0) {
shoot = false;
chooseOne = true;
chooseMove();
}
bulletToShoot.notInPlace = true;
}
}
bulletIndex++;
if (bulletIndex >= bulletArray.length) {
bulletIndex = 0;
}
i++;
}
}
if (moveToShoot) {
lvl5boss._x = lvl5boss._x - lvl5boss.startSpeed;
if (lvl5boss._x < centerX) {
moveToShoot = false;
shootBullet();
}
}
if (startGrowing) {
lvl5boss._width = lvl5boss._width + 5;
lvl5boss._height = lvl5boss._height + 5;
if ((lvl5boss._width > maxW) || (lvl5boss._height > maxH)) {
startGrowing = false;
startGrowingSmall = true;
}
}
if (startGrowingSmall) {
lvl5boss._width = lvl5boss._width - 5;
lvl5boss._height = lvl5boss._height - 5;
if ((lvl5boss._width < maxWsmall) && (lvl5boss._height < maxHsmall)) {
startGrowingSmall = false;
chooseOne = true;
chooseMove();
}
}
if (lvl5boss.health <= 0) {
lvl5boss._alpha = lvl5boss._alpha - 10;
if (lvl5boss._alpha <= 10) {
lvl5boss.removeMovieClip();
}
if (firstXplusion == false) {
attachMovie("lvl5bossXplusion", "lvl5bossX", d++);
lvl5bossX._x = lvl5boss._x;
lvl5bossX._y = lvl5boss._y;
lvl5bossX._width = 320;
lvl5bossX._height = 240;
firstXplusion = true;
}
if (lvl5bossX._currentframe == 35) {
score = score + 100;
gotoAndStop ("nextLevel");
}
}
lvl5boss.healthText.text = lvl5boss.health;
comeIn();
};
hearts = 4;
i = 0;
while (i < hearts) {
_root["heart" + i]._alpha = 100;
i++;
}
rockets = 3;
i = 0;
while (i < rockets) {
_root["rocket" + i]._alpha = 0;
i++;
}
chooseOne = true;
var bulletIndex = 0;
var bulletArray = new Array();
var maxBullets = 30;
var numOfBullets = maxBullets;
var i = 0;
while (i < maxBullets) {
var newbullet = attachMovie("bossBullet", "bossBullet" + i, d++);
newbullet._x = 2000;
newbullet._y = 2000;
newbullet._visible = false;
bulletArray.push(newbullet);
i++;
}
maxHsmall = lvl5boss._height;
maxWsmall = lvl5boss._width;
Frame 217
stop();
i = 0;
while (i < enemys) {
_root["enemy" + i].onEnterFrame = null;
_root["enemy" + i].swapDepths(0);
_root["enemy" + i].removeMovieClip();
i++;
}
i = 0;
while (i < shipsNum) {
_root["shipE" + i].onEnterFrame = null;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
i++;
}
clearInterval(shootShip);
i = 0;
while (i < shipShot) {
_root["shipLaser" + shipShot].onEnterFrame = null;
_root["shipLaser" + shipShot].swapDepths(0);
_root["shipLaser" + shipShot].removeMovieClip();
i++;
}
i = 0;
while (i < zigNum) {
zigZag = _root["zigzag" + i];
zigZag.swapDepths(0);
zigZag.removeMovieClip();
i++;
}
clearInterval(bugMake);
i = 0;
while (i < bugNum) {
bugs = _root["bug" + i];
bugs.swapDepths(0);
bugs.removeMovieClip();
i++;
}
i = 0;
while (i < lvl9eNum) {
lvl9e = _root["lvl9e" + i];
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
i++;
}
lvl5bossX.removeMovieClip();
clearInterval(shootShip);
man.onEnterFrame = null;
man.swapDepths(nextBG);
Mouse.show();
onMouseDown = null;
i = 0;
while (i < cn) {
_root["coin" + cn].swapDepths(0);
_root["coin" + cn].removeMovieClip();
i++;
}
i = 0;
while (i < hn) {
_root["heartF" + hn].swapDepths(0);
_root["heartF" + hn].removeMovieClip();
i++;
}
i = 0;
while (i < mn) {
_root["missile" + mn].swapDepths(0);
_root["missile" + mn].removeMovieClip();
i++;
}
if (level == 1) {
totalScore = 0;
}
clearInterval(nextLvl);
wlevelT.text = "well done you finished level " + level;
scoreText.text = ("you picked up " + score) + " coins!";
totalScore = totalScore + score;
pointsDown.start();
totalScoreText.text = "total score : " + totalScore;
nextLevelBtn.onRelease = function () {
if (level == 10) {
gotoAndStop ("finishedTheGame");
}
_root.level = _root.level + 1;
_root.gotoAndStop("level" + level);
};
saveBtn.onRelease = function () {
saveGame();
};
Frame 227
stop();
i = 0;
while (i < enemys) {
_root["enemy" + i].onEnterFrame = null;
_root["enemy" + i].swapDepths(0);
_root["enemy" + i].removeMovieClip();
i++;
}
i = 0;
while (i < shipsNum) {
_root["shipE" + i].onEnterFrame = null;
_root["shipE" + i].swapDepths(0);
_root["shipE" + i].removeMovieClip();
i++;
}
clearInterval(shootShip);
i = 0;
while (i < shipShot) {
_root["shipLaser" + shipShot].onEnterFrame = null;
_root["shipLaser" + shipShot].swapDepths(0);
_root["shipLaser" + shipShot].removeMovieClip();
i++;
}
i = 0;
while (i < zigNUm) {
zigZag = _root["zigzag" + i];
zigzag.onEnterFrame = null;
zigZag.swapDepths(0);
zigZag.removeMovieClip();
i++;
}
clearInterval(bugMake);
i = 0;
while (i < bugNum) {
bugs = _root["bug" + i];
bugs.onEnterFrame = null;
bugs.swapDepths(0);
bugs.removeMovieClip();
i++;
}
i = 0;
while (i < lvl9eNum) {
lvl9e = _root["lvl9e" + i];
lvl9e.onEnterFrame = null;
lvl9e.swapDepths(0);
lvl9e.removeMovieClip();
i++;
}
man.onEnterFrame = false;
man.removeMovieClip();
Mouse.show();
onMouseDown = false;
chooseMove = false;
lvl5boss._visible = false;
i = 0;
while (i < cn) {
_root["coin" + cn].removeMovieClip();
i++;
}
i = 0;
while (i < hn) {
_root["heartF" + hn].removeMovieClip();
i++;
}
i = 0;
while (i < mn) {
_root["missile" + mn].removeMovieClip();
i++;
}
if (totalScore == undefined) {
totalScore = 0;
}
pointsTotal = totalScore + score;
howManyPointsText.text = ("you got " + totalScore) + " points!";
if (pointsTotal <= 0) {
gradeText.text = "grade : you suck!";
} else if (poinsTotal <= 50) {
gradeText.text = "grade : my mom can do better";
} else if (pointsTotal <= 200) {
gradeText.text = "grade : getting better";
} else if (pointsTotal <= 300) {
gradeText.text = "grade : nice";
} else if (pointsTotal <= 500) {
gradeText.text = "grade : sweet";
} else if (pointsTotal <= 800) {
gradeText.text = "grade : you rock!";
} else if (pointsTotal <= 1000) {
gradeText.text = "grade : amazing!! ";
} else if (pointsTotal <= 1200) {
gradeText.text = "grade : godlike";
}
Frame 232
stop();
_root.createEmptyMovieClip("man", d++);
if (ship1 == true) {
man.attachMovie("ship1", "ship", _root.getNextHighestDepth());
shipLoad = "ship1";
}
if (ship2 == true) {
man.attachMovie("ship2", "ship", _root.getNextHighestDepth());
shipLoad = "ship2";
}
if (ship3 == true) {
man.attachMovie("ship3", "ship", _root.getNextHighestDepth());
shipLoad = "ship3";
}
man._x = Stage.width / 2;
man._y = Stage.height / 2;
pointsTotal = totalScore + score;
howManyPointsText.text = ("you got " + pointTotal) + " points!";
Symbol 14 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 129 MovieClip [level9enemyLib] Frame 1
stop();
Symbol 129 MovieClip [level9enemyLib] Frame 14
stop();
Symbol 205 MovieClip [Enemy] Frame 1
stop();
Symbol 205 MovieClip [Enemy] Frame 2
stop();
Symbol 205 MovieClip [Enemy] Frame 3
stop();
Symbol 205 MovieClip [Enemy] Frame 4
stop();
Symbol 209 MovieClip [missileLib] Frame 1
stop();
Symbol 209 MovieClip [missileLib] Frame 20
stop();
Symbol 222 MovieClip [shipLib] Frame 1
stop();
Symbol 222 MovieClip [shipLib] Frame 15
gotoAndStop ("start");
Symbol 466 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 469 MovieClip Frame 60
stop();
Symbol 474 MovieClip Frame 1
function release_partical() {
var _local5 = min_alpha + random(max_alpha - min_alpha);
var speed = (min_speed + random(max_speed - min_speed));
var _local3 = min_scale + random(max_scale - min_scale);
var _local4 = random(controller._height);
var spread_direction = random(2);
if (spread_direction == 0) {
spread_direction = -1;
}
var _local2 = this.attachMovie(partical_linkage, partical_linkage + counter, counter);
_local2.gotoAndStop(random(frames) + 1);
_local2.trotation = random(rotation);
_local2.spreader = random(spread);
_local2._xscale = _local3;
_local2._yscale = _local3;
_local2._y = _local4;
_local2._alpha = _local5;
_local2.counter = 0;
_local2.wave_l = wave_length;
_local2.amplitude = wave_amplitude;
_local2.onEnterFrame = function () {
this._x = this._x + speed;
this._y = this._y + ((Math.cos(this.counter / this.wave_l) * this.amplitude) + (this.spreader * spread_direction));
this.counter++;
this._rotation = this._rotation + this.trotation;
if (this._x >= max_length) {
delete this.onEnterFrame;
this.removeMovieClip();
}
updateAfterEvent();
};
}
var counter = 0;
this.onEnterFrame = function () {
counter++;
if ((counter % frame_release) == 0) {
release_partical();
}
};
Symbol 484 Button
on (rollOver) {
gotoAndPlay ("rollover");
}
on (press) {
_root.gotoAndPlay("spaceship");
}
Symbol 485 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 25
gotoAndStop (1);
Symbol 495 MovieClip Frame 20
stop();
Symbol 497 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 519 MovieClip Frame 1
stop();
Symbol 521 MovieClip Frame 1
stop();
Symbol 588 MovieClip Frame 10
stop();
Symbol 601 MovieClip Frame 16
stop();
Symbol 607 Button
on (press) {
_root.gotoAndStop("menu");
laserSpeed = 20;
enemys = 10;
enemysLeft = enemys;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
wave = 3;
firstT = false;
level = 1;
hit = false;
_root.man._alpha = 100;
missileFirst = false;
firstPizuz = false;
}
Symbol 610 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 618 Button
on (press) {
_root.gotoAndStop("menu");
laserSpeed = 20;
enemys = 10;
enemysLeft = enemys;
d = getNextHighestDepth();
score = 0;
life = 3;
HN = 4;
MN = 0;
_root.BG._alpha = 100;
wave = 3;
firstT = false;
level = 1;
hit = false;
_root.man._alpha = 100;
missileFirst = false;
firstPizuz = false;
}