Frame 1
MochiAd.showPreGameAd({id:"4d28530eeb8d6b93", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
this._lockroot = true;
var gameName = "spaceace2";
vNum = "1.01";
flashVersionsNeeded = 8;
legalDomain = "http://www.terrypaton.com";
authorName = "Terry Paton";
authorContact = "terry@terrypaton.com";
authorsSite = "http://www.terrypaton.com";
gameLocation = _root._url.substr(0, legalDomain.length);
gameQuality = "AUTO";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem(authorsSite, gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
this._lockroot = true;
if (gameLocation != legalDomain) {
}
specialEffects = false;
Frame 3
loadingClip.onLoad = function () {
};
loadingClip.onEnterFrame = function () {
pL = Math.floor((this._parent.getBytesLoaded() / this._parent.getBytesTotal()) * 100);
if (pL < 100) {
this.mask._xscale = (pL / 100) * 100;
this._parent.stop();
} else {
i = 0;
while (i < stringLength) {
removeMovieClip(eval ("loadingHolder.l" + i));
i++;
}
this._parent.play();
}
};
wordString = "SPACE ACE 2";
stringLength = wordString.length;
wordOffset = (stringLength * 20) / 2;
this.createEmptyMovieClip("loadingHolder", 1);
loadingHolder._x = (320 - wordOffset) + 10;
loadingHolder._y = 175;
i = 0;
while (i < stringLength) {
t = loadingHolder.attachMovie("letter", "l" + i, i);
t._x = i * 20;
t.angle = i;
t.Lvar.text = wordString.charAt(i);
t._xscale = (t._yscale = 200);
i++;
}
stop();
Frame 4
if (false) {
}
Frame 5
Frame 6
storage = SharedObject.getLocal("spaceAce2store");
yourhigh = storage.data.myhighscore;
if (yourhigh == undefined) {
storage.data.myhighscore = 0;
yourhigh = 0;
}
function starClass() {
}
function makeStars() {
if (sA < sM) {
sC++;
if (sC > sD) {
sC = 0;
sA++;
starGen.attachMovie("star", "s" + sA, sA);
with (eval ("starGen.s" + sA)) {
_x = -5;
}
sA++;
starGen.attachMovie("star", "s" + sA, sA);
with (eval ("starGen.s" + sA)) {
_x = -5;
}
}
}
}
function calcX(tRot, tDepth) {
return(320 + (tDepth * Math.sin((tRot / 180) * Math.PI)));
}
function calcY(tRot, tDepth) {
return(240 + (tDepth * Math.cos((tRot / 180) * Math.PI)));
}
function calcScale(tDepth) {
return(10 + (90 * (tDepth / 200)));
}
starClass.prototype = new MovieClip();
starClass.prototype.onLoad = function () {
this.gotoAndStop(1 + random(4));
this.spd = 10;
this.tmpAngle = (random(360) * Math.PI) / 180;
this.bx = this.spd * Math.cos(this.tmpAngle);
this.by = this.spd * Math.sin(this.tmpAngle);
this.x = 320;
this.y = 240;
this._xscale = (this._yscale = 20);
};
starClass.prototype.onEnterFrame = function () {
this.x = this.x + this.bx;
this.y = this.y + this.by;
if ((((this.y > 460) || (this.y < 20)) || (this.x < 20)) || (this.x > 620)) {
this.tmpAngle = (random(360) * Math.PI) / 180;
this.bx = this.spd * Math.cos(this.tmpAngle);
this.by = this.spd * Math.sin(this.tmpAngle);
this.x = 320;
this.y = 240;
this._xscale = (this._yscale = 20);
}
this._x = this.x;
this._y = this.y;
this._xscale = (this._yscale = this._yscale * 1.06);
};
Object.registerClass("star", starClass);
sA = 0;
sM = 100;
sC = 0;
sD = 2;
function attachSoundFromLibrary(idname) {
var _local2 = new Sound(this);
_local2.attachSound(idname);
return(_local2);
}
function playSnd(t) {
switch (t) {
case 1 :
hitEnemySnd.start();
break;
case 2 :
enemyShootSnd.start();
break;
}
}
var shootSnd1 = attachSoundFromLibrary("playerShoot1.wav");
var shootSnd2 = attachSoundFromLibrary("playerShoot2.wav");
var shootSnd3 = attachSoundFromLibrary("playerShoot3.wav");
var explodeSnd1 = attachSoundFromLibrary("explosion1.wav");
var explodeSnd2 = attachSoundFromLibrary("explosion2.wav");
var explodeSnd3 = attachSoundFromLibrary("explosion2.wav");
var collectSnd1 = attachSoundFromLibrary("collect1.wav");
var collectSnd2 = attachSoundFromLibrary("collect2.wav");
var collectSnd3 = attachSoundFromLibrary("collect2.wav");
var playerExplodeSnd = attachSoundFromLibrary("playerExplode.wav");
var playerHitSnd = attachSoundFromLibrary("playerHit.wav");
var collectSnd3 = attachSoundFromLibrary("collect2.wav");
var levelCompleteSnd = attachSoundFromLibrary("levelCompleteSnd.wav");
var gameOverSnd = attachSoundFromLibrary("gameOverSnd.wav");
var hitEnemySnd = attachSoundFromLibrary("hitEnemySnd.wav");
var enemyShootSnd = attachSoundFromLibrary("enemyShoot.wav");
Frame 7
playBtn.onRelease = function () {
gotoAndPlay (52);
};
yourHighscore = "YOUR HIGHSCORE:" + yourhigh;
Instance of Symbol 224 MovieClip "starGen" in Frame 7
onClipEvent (enterFrame) {
_parent.makeStars();
}
Frame 51
stop();
Frame 52
function addEnemy() {
addEnemyType = 0;
d = Math.round(dist / 480);
switch (level) {
case 1 :
if ((d > 1) && (d < 5)) {
tArray = new Array(1, 5, 3);
addEnemyDelay = 30;
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 4) && (d < 11)) {
addEnemyDelay = 25;
tArray = new Array(5, 6, 7);
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 10) && (d < 21)) {
addEnemyDelay = 30;
tArray = new Array(7, 8, 9);
addEnemyType = tArray[random(tArray.length)];
} else if (d > 20) {
addEnemyDelay = 20;
tArray = new Array(7, 8, 9, 1, 5);
addEnemyType = tArray[random(tArray.length)];
} else {
addEnemyDelay = 20;
}
break;
case 2 :
if ((d > 1) && (d < 11)) {
tArray = new Array(13, 8, 3, 9);
addEnemyDelay = 30;
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 10) && (d < 21)) {
addEnemyDelay = 15;
tArray = new Array(13, 13, 8, 9);
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 20) && (d < 31)) {
addEnemyDelay = 30;
tArray = new Array(7, 8, 9);
addEnemyType = tArray[random(tArray.length)];
} else if (d > 30) {
addEnemyDelay = 15;
tArray = new Array(7, 8, 9, 1, 5);
addEnemyType = tArray[random(tArray.length)];
} else {
addEnemyDelay = 20;
}
break;
case 3 :
if ((d > 1) && (d < 8)) {
tArray = new Array(15, 14, 12, 5, 6, 6);
addEnemyDelay = 30;
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 7) && (d < 16)) {
addEnemyDelay = 15;
tArray = new Array(3, 14, 7, 10, 11);
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 15) && (d < 24)) {
addEnemyDelay = 30;
tArray = new Array(12, 15, 8, 9, 8, 9);
addEnemyType = tArray[random(tArray.length)];
} else if (d > 23) {
addEnemyDelay = 15;
tArray = new Array(2, 3, 1, 5, 7, 13);
addEnemyType = tArray[random(tArray.length)];
} else {
addEnemyDelay = 20;
}
break;
case 4 :
if ((d > 2) && (d < 16)) {
tArray = new Array(13, 8, 3, 9);
addEnemyDelay = 20;
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 15) && (d < 31)) {
addEnemyDelay = 15;
tArray = new Array(13, 13, 8, 9);
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 30) && (d < 46)) {
addEnemyDelay = 20;
tArray = new Array(7, 8, 9);
addEnemyType = tArray[random(tArray.length)];
} else if (d > 45) {
addEnemyDelay = 15;
tArray = new Array(7, 8, 9, 1, 5);
addEnemyType = tArray[random(tArray.length)];
} else {
addEnemyDelay = 20;
}
break;
case 5 :
if ((d > 1) && (d < 8)) {
tArray = new Array(13, 8, 3);
addEnemyDelay = 30;
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 7) && (d < 15)) {
addEnemyDelay = 15;
tArray = new Array(13, 13, 8, 9);
addEnemyType = tArray[random(tArray.length)];
} else if ((d > 14) && (d < 22)) {
addEnemyDelay = 30;
tArray = new Array(7, 8, 9);
addEnemyType = tArray[random(tArray.length)];
} else if (d > 21) {
addEnemyDelay = 15;
tArray = new Array(7, 8, 9, 1, 5);
addEnemyType = tArray[random(tArray.length)];
} else {
addEnemyDelay = 20;
}
break;
}
if (addEnemyType > 0) {
tmpE = enemyLayer.attachMovie("enemy", "e" + enemyNum, enemyNum);
tmpE.typeOfEnemy = addEnemyType;
enemyNum++;
}
}
function testHit(tempClip, playersBullet) {
if (playersBullet) {
i = enemyNum;
while (i > (enemyNum - 20)) {
if (eval ("enemyHolder.e" + i).enabled) {
hitResult = tempClip.hitTest(eval ("enemyHolder.e" + i));
if (hitResult) {
if (eval ("enemyHolder.e" + i).eState != "shot") {
eval ("enemyHolder.e" + i).eState = "shot";
return(true);
}
}
}
i--;
}
return(false);
}
if (tempClip.hitTest(playerHolder.player.hit)) {
hurtPlayer(8);
playerHitSnd.start();
return(true);
}
return(false);
}
function addPoints(temp) {
score = score + temp;
}
function addEnemyBullet(tx, ty, temp) {
switch (temp) {
case 1 :
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 90;
bTemp.x = (bTemp._x = tx);
bTemp.y = (bTemp._y = ty);
bulletNum++;
break;
case 2 :
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 70;
bTemp.x = (bTemp._x = tx);
bTemp.y = (bTemp._y = ty);
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 110;
bTemp.x = (bTemp._x = tx);
bTemp.y = (bTemp._y = ty);
bulletNum++;
break;
case 3 :
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 180;
bTemp.x = (bTemp._x = tx);
bTemp.y = (bTemp._y = ty);
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 0;
bTemp.x = (bTemp._x = tx);
bTemp.y = (bTemp._y = ty);
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 90;
bTemp.x = (bTemp._x = tx);
bTemp.y = (bTemp._y = ty);
bulletNum++;
break;
case 4 :
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 95;
bTemp.x = (bTemp._x = tx - 15);
bTemp.y = (bTemp._y = ty);
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 85;
bTemp.x = (bTemp._x = tx + 15);
bTemp.y = (bTemp._y = ty);
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 90;
bTemp.x = (bTemp._x = tx);
bTemp.y = (bTemp._y = ty);
bulletNum++;
break;
case 5 :
radians = Math.atan2(py - ty, px - tx);
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = (Math.floor((radians * 180) / Math.PI) + random(60)) - 30;
bTemp.x = (bTemp._x = tx - 15);
bTemp.y = (bTemp._y = ty);
bTemp.bulletType = 5;
bulletNum++;
break;
}
if (bulletNum > 99) {
bulletNum = 1;
}
}
function testBonusHit(clipName, pType) {
if (clipName.hitTest(playerHolder.player.hit)) {
switch (random(3)) {
case 0 :
collectSnd1.start();
break;
case 1 :
collectSnd2.start();
break;
case 2 :
collectSnd3.start();
break;
}
pTemp = playerHolder.attachMovie("tellBonus", "tb", 1000);
switch (pType) {
case 1 :
addPoints(250);
playerEnergy = playerEnergy + 25;
if (playerEnergy > 100) {
playerEnergy = 100;
}
energyBar.energyBar_clip._yscale = playerEnergy;
pTemp.tellText.text = "BONUS\nENERGY!";
break;
case 2 :
addPoints(250);
playersBulletType = 2;
firingMaxDelay = 15;
pTemp.tellText.text = "DOUBLE\nGUN!";
powerUpCountDown = powerUpCountDownDelay;
powerUpCounter._visible = true;
powerUpCounter.powerUpDisplay.text = "DOUBLE\nGUN!";
break;
case 3 :
addPoints(250);
playersBulletType = 3;
firingMaxDelay = 15;
pTemp.tellText.text = "TRI-GUN";
powerUpCountDown = powerUpCountDownDelay;
powerUpCounter._visible = true;
powerUpCounter.powerUpDisplay.text = "TRI-GUN";
break;
case 4 :
addPoints(250);
playersBulletType = 4;
firingMaxDelay = 5;
pTemp.tellText.text = "CRAZY\nGUN!";
powerUpCountDown = powerUpCountDownDelay;
powerUpCounter._visible = true;
powerUpCounter.powerUpDisplay.text = "CRAZY\nGUN!";
break;
case 5 :
addPoints(250);
playersBulletType = 5;
firingMaxDelay = 5;
pTemp.tellText.text = "MACHINE\nGUN";
powerUpCountDown = powerUpCountDownDelay;
powerUpCounter._visible = true;
powerUpCounter.powerUpDisplay.text = "MACHINE\nGUN";
break;
case 6 :
playerEnergy = 100;
energyBar.energyBar_clip._yscale = playerEnergy;
pTemp.tellText.text = "SUPER\nENERGY!";
addPoints(3000);
break;
case 7 :
addPoints(1000);
pTemp.tellText.text = "1000\nPOINTS!";
break;
case 8 :
addPoints(250);
playersBulletType = 6;
firingMaxDelay = 15;
pTemp.tellText.text = "SPRAY\nGUN";
powerUpCountDown = powerUpCountDownDelay;
powerUpCounter._visible = true;
powerUpCounter.powerUpDisplay.text = "SPRAY\nGUN";
break;
case 9 :
addPoints(250);
playersBulletType = 7;
firingMaxDelay = 15;
pTemp.tellText.text = "MULTI\nGUN";
powerUpCountDown = powerUpCountDownDelay;
powerUpCounter._visible = true;
powerUpCounter.powerUpDisplay.text = "MULTI\nGUN";
break;
}
return(true);
}
return(false);
}
function addPlayerBullet() {
switch (playersBulletType) {
case 1 :
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -90;
bTemp.playersBullet = true;
bulletNum++;
shootSnd1.start();
break;
case 2 :
shootSnd2.start();
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -80;
bTemp.playersBullet = true;
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -100;
bTemp.playersBullet = true;
bulletNum++;
break;
case 3 :
shootSnd3.start();
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 180;
bTemp.playersBullet = true;
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = 0;
bTemp.playersBullet = true;
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -90;
bTemp.playersBullet = true;
bulletNum++;
break;
case 4 :
shootSnd2.start();
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.bulletType = 2;
bTemp.angle = -90;
bTemp.playersBullet = true;
bulletNum++;
break;
case 5 :
shootSnd1.start();
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -90;
bTemp.playersBullet = true;
bulletNum++;
break;
case 6 :
shootSnd3.start();
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -110;
bTemp.playersBullet = true;
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -100;
bTemp.playersBullet = true;
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -90;
bTemp.playersBullet = true;
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -80;
bTemp.playersBullet = true;
bulletNum++;
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = -70;
bTemp.playersBullet = true;
bulletNum++;
break;
case 7 :
shootSnd1.start();
i = 0;
while (i < 8) {
bTemp = bulletHolder.attachMovie("bullet", "b" + bulletNum, bulletNum);
bTemp.angle = i * 45;
bTemp.playersBullet = true;
bulletNum++;
i++;
}
break;
}
if (bulletNum > 99) {
bulletNum = 1;
}
}
function setup() {
_quality = "MEDIUM";
level = 1;
playerEnergy = 100;
sideBarOffset = 140;
px = 560;
py = 420;
movepx = 0;
movepy = 0;
lives = 2;
livesIndicator.gotoAndStop(lives + 1);
score = 0;
enemyNum = 100;
bulletNum = 1;
firingBullet = false;
firingCount = 0;
onMouseDown = function () {
firingBullet = true;
};
onMouseUp = function () {
firingBullet = false;
firingCount = 3;
};
playersBulletType = 1;
firingMaxDelayDefault = 7;
firingMaxDelay = firingMaxDelayDefault;
powerUpCountDownDelay = 400;
powerUpCountDown = 0;
powerUpCounter._visible = false;
addEnemyDelay = 30;
addEnemyCount = addEnemyDelay;
addPowerUpDelay = random(400) + 400;
addPowerUpCount = addPowerUpDelay;
effectsBtn.onRelease = function () {
toggleSpecialEffects();
};
levelBtn.onRelease = function () {
if (level == 1) {
level = 2;
} else {
level = 1;
}
t = attachMovie("tellPlayer", "tellPlayer", 10);
t.textBox.text = "LEVEL " + level;
};
pauseBtn.onRelease = function () {
pauseToggle();
};
}
function pauseToggle() {
if (gameState == "playing") {
t = attachMovie("gamePaused", "gamePaused", 10);
t.unPauseBtn.onRelease = function () {
pauseToggle();
};
gameState = "paused";
} else if (gameState == "paused") {
removeMovieClip("gamePaused");
gameState = "playing";
}
}
function addExplosion(tx, ty) {
switch (random(3)) {
case 0 :
explodeSnd1.start();
break;
case 1 :
explodeSnd2.start();
break;
case 2 :
explodeSnd3.start();
break;
}
temp = 2000 + enemyLayer.getNextHighestDepth();
enemyLayer.attachMovie("explosion", "ex" + temp, temp);
eval ("enemyLayer.ex" + temp)._x = tx;
eval ("enemyLayer.ex" + temp)._y = ty;
}
onEnterFrame = function () {
switch (this.gameState) {
case "playing" :
dist = dist + _global.tileSpeed;
progressBar.progDot._y = -((dist / levelDist) * 224);
if (dist > levelDist) {
removeMovieClip(playerHolder.tellBonus);
gameState = "level complete";
levelCompleteSnd.start();
}
if (powerUpCountDown > 0) {
powerUpCountDown--;
if (powerUpCountDown < 1) {
powerUpCounter._visible = false;
playersBulletType = 1;
firingMaxDelay = firingMaxDelayDefault;
}
}
addPowerUpCount--;
if (addPowerUpCount < 1) {
addPowerUpCount = random(200) + 250;
pTemp = bulletHolder.attachMovie("powerUp", "pu" + bulletNum, bulletNum);
pTemp.powerUpType = random(9) + 1;
bulletNum++;
}
addEnemyCount--;
if (addEnemyCount < 1) {
addEnemyCount = addEnemyDelay;
addEnemy();
}
movepx = (-(px - playerHolder._xmouse)) / 5;
movepy = (-(py - playerHolder._ymouse)) / 5;
playerHolder.player.gotoAndStop(11 + int(movepx / 2));
if (playerHolder._xmouse < 0) {
playerHolder.player.gotoAndStop(11);
}
px = px + movepx;
py = py + movepy;
if (px < 35) {
px = 35;
} else if (px > 490) {
px = 490;
} else if (py > 445) {
py = 445;
} else if (py < 35) {
py = 35;
}
playerHolder.player._x = px;
playerHolder.player._y = py;
if (firingBullet) {
firingCount--;
if (firingCount < 1) {
firingCount = firingMaxDelay;
addPlayerBullet();
}
}
return;
case "lose life" :
playerExplodeSnd.start();
removeMovieClip(playerHolder.tellBonus);
t = playerHolder.attachMovie("playerExplosion", "playerExplosion", 101);
t._x = px;
t._y = py;
px = 250;
py = 520;
playerHolder.player._x = 250;
playerHolder.player._y = 520;
t = attachMovie("tellPlayer", "tellPlayer", 9);
t.textBox.text = "LIFE LOST";
lives--;
livesIndicator.gotoAndStop(lives + 1);
if (lives < 0) {
lives = 0;
gameState = "game over";
} else {
energyBar.energyBar_clip._yscale = (playerEnergy = 100);
gameState = "start again wait";
saCount = 100;
}
return;
case "start again wait" :
saCount--;
if (saCount < 1) {
gameState = "playing";
i = 0;
while (i < 101) {
removeMovieClip(eval ("bulletHolder.b" + i));
i++;
}
removeMovieClip(playerHolder.tellBonus);
i = 100;
while (i < 1001) {
removeMovieClip(eval ("enemyLayer.e" + i));
i++;
}
}
return;
case "game over" :
t = attachMovie("tellPlayer", "tellPlayer", 10);
t.textBox.text = "GAME OVER";
gameState = "game over wait";
gow = 60;
return;
case "game over wait" :
gow--;
if (gow < 1) {
gotoAndPlay (55);
}
return;
case "setup" :
setup();
var container = setUpContainer();
var window = (new flash.geom.Rectangle(0, 0, 500, 480));
scrollHolder.scrollRect = window;
enemyHolder.scrollRect = window;
setupLevel();
playerHolder.attachMovie("player", "player", 100);
playerHolder.player.hit._visible = false;
playerHolder.attachMovie("irisOpens", "irisOpens", 200);
playerHolder.irisOpens._x = 238;
playerHolder.irisOpens._y = 240;
gameState = "playing";
return;
case "level complete" :
i = 0;
while (i < 101) {
removeMovieClip(eval ("bulletHolder.b" + i));
i++;
}
i = 100;
while (i < 1001) {
removeMovieClip(eval ("enemyLayer.e" + i));
i++;
}
playerHolder.attachMovie("irisCloses", "irisCloses", 200);
playerHolder.irisCloses._x = 238;
playerHolder.irisCloses._y = 240;
lcw = 90;
t = attachMovie("tellPlayer", "tellPlayer", 10);
t.textBox.text = "COMPLETE!";
this.gameState = "level complete wait";
return;
case "level complete wait" :
lcw--;
if (lcw < 1) {
level++;
if (level > 5) {
trace("game completed");
gotoAndPlay (65);
} else {
this.gameState = "start next level";
}
}
return;
case "start next level" :
px = 560;
py = 420;
playerEnergy = 100;
energyBar.energyBar_clip._yscale = playerEnergy;
setupLevel();
playerHolder.attachMovie("irisOpens", "irisOpens", 200);
playerHolder.irisOpens._x = 238;
playerHolder.irisOpens._y = 240;
gameState = "playing";
return;
}
};
function setupLevel() {
enemyNum = 100;
dist = 0;
scrollHolder.attachMovie("tile", "t1", 1);
scrollHolder.attachMovie("tile", "t2", 2);
scrollHolder.t1._y = 480;
scrollHolder.t2._y = 0;
scrollHolder.c1._y = 480;
scrollHolder.c2._y = 0;
scrollHolder.cacheAsBitmap = true;
enemyLayer = enemyHolder;
t = attachMovie("tellPlayer", "tellPlayer", 10);
t.textBox.text = "LEVEL " + level;
switch (level) {
case 1 :
_global.tileSpeed = 5;
levelDist = 12000;
addEnemyDelay = 15;
break;
case 2 :
_global.tileSpeed = 7;
levelDist = 20000;
addEnemyDelay = 6;
break;
case 3 :
_global.tileSpeed = 5;
levelDist = 15000;
addEnemyDelay = 15;
break;
case 4 :
_global.tileSpeed = 9;
addEnemyDelay = 7;
levelDist = 30000;
break;
case 5 :
_global.tileSpeed = 5;
addEnemyDelay = 15;
levelDist = 17000;
levelDist = 1000;
break;
}
}
function hurtPlayer(num) {
trace("hurt player");
playerEnergy = playerEnergy - num;
if (playerEnergy < 0) {
playerEnergy = 0;
gameState = "lose life";
}
energyBar.energyBar_clip._yscale = playerEnergy;
}
Frame 54
gameState = "setup";
stop();
Frame 55
delete gameState;
_quality = "HIGH";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
storage.flush();
}
if (score >= 999) {
enterHigh._visible = true;
} else {
enterHigh._visible = false;
}
mainMenuBtn.onRelease = function () {
gotoAndPlay (7);
};
Frame 64
stop();
Frame 65
delete gameState;
_quality = "HIGH";
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
storage.flush();
}
if (score >= 999) {
enterHigh._visible = true;
}
mainMenuBtn.onRelease = function () {
gotoAndPlay (7);
};
Frame 74
stop();
Symbol 323 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.3");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local27);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0) {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Symbol 324 MovieClip [__Packages.letterClass] Frame 0
class letterClass extends MovieClip
{
var centerY, radiusY, speed, y, _y, x, _x, angle;
function letterClass () {
super();
}
function onLoad() {
centerY = 48;
radiusY = 5;
speed = 0.05;
y = _y;
x = _x;
}
function onEnterFrame() {
if (angle != undefined) {
y = centerY + (Math.sin(angle) * radiusY);
angle = angle + speed;
_x = x;
_y = y;
}
}
}
Symbol 325 MovieClip [__Packages.cloudClass] Frame 0
class cloudClass extends MovieClip
{
var y, _y, gotoAndStop, speed;
function cloudClass () {
super();
}
function onLoad() {
y = _y;
gotoAndStop(random(10) + 1);
speed = _global.tileSpeed / 2;
}
function onEnterFrame() {
if (_root.gameState == "playing") {
switch (_root.level) {
case 1 :
y = y + (_global.tileSpeed / 2);
break;
case 2 :
y = y + (_global.tileSpeed / 1.5);
break;
case 3 :
y = y + (_global.tileSpeed / 1.2);
break;
case 4 :
y = y + (_global.tileSpeed / 2);
break;
case 5 :
y = y + (_global.tileSpeed / 2);
break;
default :
y = y + (_global.tileSpeed / 2);
}
if (y > 480) {
trace(_root.level);
y = -480;
gotoAndStop(((_root.level - 1) * 10) + (random(10) + 1));
}
_y = y;
}
}
}
Symbol 326 MovieClip [__Packages.explosionClass] Frame 0
class explosionClass extends MovieClip
{
var c, _y, _xscale, _yscale, _alpha, removeMovieClip;
function explosionClass () {
super();
}
function onLoad() {
c = 15;
}
function onEnterFrame() {
_y = _y + _global.tileSpeed;
_xscale = (_yscale = _yscale + 5);
_alpha = _alpha - 3;
c--;
if (c < 1) {
removeMovieClip();
}
}
}
Symbol 327 MovieClip [__Packages.enemyClass] Frame 0
class enemyClass extends MovieClip
{
var eState, piNum, angle, x, y, bulletType, fireDelay, health, typeOfEnemy, speed, swerveMax, enemyValue, _rotation, xMove, yMove, _x, _y, gotoAndStop, fireCount, hitClip, yDistP, xDistP, removeMovieClip;
function enemyClass () {
super();
}
function onLoad() {
eState = "norm";
piNum = (Math.PI/180);
angle = random(360);
x = random(300) + 100;
y = -50;
bulletType = 1;
fireDelay = 20 + random(40);
health = 1;
switch (typeOfEnemy) {
case 1 :
speed = 4;
swerveMax = 3;
enemyValue = 50;
_rotation = 180;
break;
case 2 :
speed = 4;
swerveMax = 3;
enemyValue = 50;
health = 2;
_rotation = 180;
break;
case 3 :
speed = 4;
swerveMax = 6;
enemyValue = 50;
_rotation = 180;
bulletType = 4;
fireDelay = 30;
health = 2;
break;
case 4 :
speed = 2;
swerveMax = 2;
enemyValue = 50;
_rotation = 0;
_rotation = 180;
health = 2;
break;
case 5 :
speed = 2;
swerveMax = 6;
enemyValue = 50;
bulletType = 5;
health = 2;
break;
case 6 :
speed = 0;
swerveMax = 6;
enemyValue = 50;
bulletType = 5;
health = 2;
break;
case 7 :
y = 500;
speed = -1;
swerveMax = 6;
enemyValue = 450;
health = 3;
_rotation = 0;
fireDelay = 50;
bulletType = 5;
break;
case 8 :
x = -30;
y = 50;
speed = -1;
enemyValue = 50;
_rotation = 90;
bulletType = 5;
fireDelay = 40;
break;
case 9 :
x = 530;
y = 50;
speed = -1;
enemyValue = 50;
_rotation = 270;
bulletType = 5;
fireDelay = 40;
break;
case 10 :
x = -30;
y = 50;
speed = -1;
swerveMax = 4;
enemyValue = 50;
_rotation = 120;
bulletType = 5;
break;
case 11 :
x = 530;
y = 50;
speed = -1;
swerveMax = 4;
enemyValue = 50;
_rotation = 230;
bulletType = 5;
break;
case 12 :
speed = -2;
swerveMax = 2;
enemyValue = 450;
health = 10;
_rotation = 180;
bulletType = 4;
break;
case 13 :
speed = -3;
enemyValue = 100;
health = 6;
_rotation = 0;
break;
case 14 :
speed = 5;
enemyValue = 100;
health = 1;
angle = Math.floor((Math.atan2(_root.py - y, _root.px - x) * 180) / Math.PI);
xMove = speed * Math.cos((angle * Math.PI) / 180);
yMove = speed * Math.sin((angle * Math.PI) / 180);
_rotation = 90 + angle;
break;
case 15 :
speed = 5;
enemyValue = 100;
health = 2;
angle = Math.floor((Math.atan2(_root.py - y, _root.px - x) * 180) / Math.PI);
xMove = speed * Math.cos((angle * Math.PI) / 180);
yMove = speed * Math.sin((angle * Math.PI) / 180);
_rotation = 90 + angle;
break;
}
_x = x;
_y = y;
gotoAndStop(typeOfEnemy);
fireCount = random(20) + 2;
hitClip.gotoAndStop(1);
}
function onEnterFrame() {
if (_root.gameState == "playing") {
if (eState == "norm") {
fireCount--;
if (fireCount < 1) {
if (typeOfEnemy != 13) {
_root.playSnd(2);
fireCount = fireDelay;
_root.addEnemyBullet(x, y + 15, bulletType);
}
}
yDistP = Math.abs(y - _root.py);
if (yDistP < 25) {
xDistP = Math.abs(x - _root.px);
if (xDistP < 25) {
trace("hit player");
_root.hurtPlayer(35);
eState = "die from hit player";
}
}
} else if (eState == "die from hit player") {
_root.addExplosion(x, y);
removeMovieClip();
} else if (eState == "shot") {
health = health - 1;
if (health < 1) {
_root.addPoints(enemyValue);
_root.addExplosion(x, y);
removeMovieClip();
} else {
_root.playSnd(1);
hitClip.gotoAndPlay(2);
eState = "norm";
}
}
switch (typeOfEnemy) {
case 1 :
xMove = swerveMax * Math.sin(angle * piNum);
x = x + xMove;
angle = angle + 4;
y = y + (_global.tileSpeed + speed);
break;
case 2 :
xMove = swerveMax * Math.cos(angle * piNum);
x = x + xMove;
angle = angle + 4;
y = y + (_global.tileSpeed + speed);
break;
case 3 :
xMove = swerveMax * Math.sin(angle * piNum);
x = x + xMove;
angle = angle + 4;
y = y + (_global.tileSpeed + speed);
break;
case 4 :
yMove = swerveMax * Math.sin(angle * piNum);
angle = angle + 6;
y = y + ((_global.tileSpeed + speed) + yMove);
break;
case 5 :
yMove = swerveMax * Math.sin(angle * piNum);
angle = angle + 6;
y = y + ((_global.tileSpeed + speed) + yMove);
x = x + yMove;
break;
case 6 :
yMove = swerveMax * Math.cos(angle * piNum);
xMove = swerveMax * Math.sin(angle * piNum);
angle = angle + 6;
y = y + ((_global.tileSpeed + speed) + yMove);
x = x + xMove;
break;
case 7 :
y = y - (_global.tileSpeed + speed);
if (y < -20) {
removeMovieClip();
}
break;
case 8 :
x = x + 4;
if (x > 520) {
removeMovieClip();
}
y = y + (_global.tileSpeed + speed);
break;
case 9 :
x = x - 4;
if (x < -20) {
removeMovieClip();
}
y = y + (_global.tileSpeed + speed);
break;
case 10 :
yMove = swerveMax * Math.cos(angle * piNum);
angle = angle + 6;
y = y + ((_global.tileSpeed + speed) + yMove);
x = x + 4;
if (x > 520) {
removeMovieClip();
}
break;
case 10 :
yMove = swerveMax * Math.cos(angle * piNum);
angle = angle + 6;
y = y + ((_global.tileSpeed + speed) + yMove);
x = x + 4;
if (x > 520) {
removeMovieClip();
}
break;
case 11 :
yMove = swerveMax * Math.cos(angle * piNum);
angle = angle + 6;
y = y + ((_global.tileSpeed + speed) + yMove);
x = x - 4;
if (x < -20) {
removeMovieClip();
}
break;
case 12 :
xMove = swerveMax * Math.sin(angle * piNum);
x = x + xMove;
angle = angle + 1;
y = y + (_global.tileSpeed + speed);
break;
case 13 :
y = y + (_global.tileSpeed + speed);
break;
case 14 :
x = x + xMove;
y = y + yMove;
case 15 :
angle = Math.floor((Math.atan2(_root.py - y, _root.px - x) * 180) / Math.PI);
xMove = speed * Math.cos((angle * Math.PI) / 180);
yMove = speed * Math.sin((angle * Math.PI) / 180);
_rotation = 90 + angle;
x = x + xMove;
y = y + ((_global.tileSpeed + yMove) + (speed / 2));
break;
}
if (y > 520) {
y = -random(500);
removeMovieClip();
}
_y = y;
_x = x;
}
}
}
Symbol 328 MovieClip [__Packages.bulletClass] Frame 0
class bulletClass extends MovieClip
{
var bState, speed, bulletType, playersBullet, _x, x, _y, y, gotoAndStop, tmpAngle, angle, bx, by, temp, removeMovieClip;
function bulletClass () {
super();
}
function onLoad() {
bState = "normal";
speed = 10;
if (bulletType == undefined) {
bulletType = 1;
} else if (bulletType == 5) {
speed = 4;
}
if (playersBullet) {
_x = (x = _root.px);
_y = (y = _root.py - 15);
gotoAndStop(1);
speed = 15;
} else {
gotoAndStop(2);
}
tmpAngle = (angle * Math.PI) / 180;
bx = speed * Math.cos(tmpAngle);
by = speed * Math.sin(tmpAngle);
}
function onMouseDown() {
}
function onEnterFrame() {
if (_root.gameState == "playing") {
_x = x;
_y = y;
if (bulletType == 2) {
temp = random(30) - 15;
angle = angle + temp;
tmpAngle = (angle * Math.PI) / 180;
bx = speed * Math.cos(tmpAngle);
by = speed * Math.sin(tmpAngle);
}
x = x + bx;
y = y + by;
if ((((y > 480) || (y < 0)) || (x > 500)) || (x < 0)) {
removeMovieClip();
}
if (angle > 360) {
angle = angle - 360;
} else if (angle < 0) {
angle = angle + 360;
}
if (_root.testHit(this, playersBullet)) {
removeMovieClip();
}
}
}
}
Symbol 329 MovieClip [__Packages.powerUpClass] Frame 0
class powerUpClass extends MovieClip
{
var bState, speed, x, _x, y, _y, gotoAndStop, powerUpType, c, _xscale, _yscale, _alpha, removeMovieClip;
function powerUpClass () {
super();
}
function onLoad() {
bState = "normal";
speed = 6;
x = (_x = random(450) + 25);
y = (_y = -50);
gotoAndStop(powerUpType);
}
function onEnterFrame() {
if (_root.gameState == "playing") {
if (bState == "remove wait") {
c--;
_xscale = (_yscale = _yscale * 1.05);
_alpha = _alpha * 0.9;
if (c < 1) {
removeMovieClip();
}
}
if (bState == "normal") {
y = y + speed;
if (y > 490) {
removeMovieClip();
}
if (_root.testBonusHit(this, powerUpType)) {
bState = "remove wait";
c = 15;
}
}
_x = x;
_y = y;
}
}
}
Symbol 330 MovieClip [__Packages.tellBonusClass] Frame 0
class tellBonusClass extends MovieClip
{
var x, _x, y, _y, speed, c, _alpha, removeMovieClip;
function tellBonusClass () {
super();
}
function onLoad() {
x = (_x = _root.px);
y = (_y = _root.py);
speed = 2;
c = 60;
}
function onEnterFrame() {
if (_root.gameState == "playing") {
y = y + speed;
c--;
_alpha = _alpha * 0.98;
if (c < 1) {
removeMovieClip();
}
_y = y;
}
}
}
Symbol 331 MovieClip [__Packages.tellPlayerClass] Frame 0
class tellPlayerClass extends MovieClip
{
var _x, _y, _yscale, _xscale, speed, phase, c, _alpha, removeMovieClip;
function tellPlayerClass () {
super();
}
function onLoad() {
_x = 390;
_y = 100;
_yscale = (_xscale = 10);
speed = 5;
phase = 1;
c = 60;
}
function onEnterFrame() {
trace(_yscale);
if (phase == 1) {
_yscale = (_xscale = _xscale * 1.1);
if (_yscale > 100) {
phase = 2;
c = 60;
}
}
if (phase == 2) {
c--;
if (c < 1) {
_yscale = (_xscale = _xscale + 2);
phase = 3;
}
}
if (phase == 3) {
_yscale = (_xscale = _xscale * 1.05);
_alpha = _alpha - 9;
if (_yscale > 200) {
removeMovieClip();
}
}
}
}
Symbol 332 MovieClip [__Packages.tileClass] Frame 0
class tileClass extends MovieClip
{
var y, _y, gotoAndStop;
function tileClass () {
super();
}
function onLoad() {
y = _y;
gotoAndStop(((_root.level - 1) * 10) + (random(10) + 1));
}
function onEnterFrame() {
if (_root.gameState == "playing") {
y = y + _global.tileSpeed;
if (y > 480) {
y = y - 960;
gotoAndStop(((_root.level - 1) * 10) + (random(10) + 1));
}
_y = y;
}
}
}
Symbol 18 MovieClip [letter] Frame 1
#initclip 11
Object.registerClass("letter", letterClass);
#endinitclip
Symbol 75 MovieClip [tile] Frame 1
#initclip 19
Object.registerClass("tile", tileClass);
#endinitclip
Symbol 76 MovieClip [cloudTile] Frame 1
#initclip 12
Object.registerClass("cloudTile", cloudClass);
#endinitclip
Symbol 96 MovieClip [explosion] Frame 1
#initclip 13
Object.registerClass("explosion", explosionClass);
#endinitclip
Symbol 96 MovieClip [explosion] Frame 10
stop();
Symbol 97 MovieClip Frame 11
stop();
Symbol 121 MovieClip [enemy] Frame 1
#initclip 14
Object.registerClass("enemy", enemyClass);
#endinitclip
Symbol 151 MovieClip [bullet] Frame 1
#initclip 15
Object.registerClass("bullet", bulletClass);
#endinitclip
Symbol 158 MovieClip [powerUp] Frame 1
#initclip 16
Object.registerClass("powerUp", powerUpClass);
#endinitclip
Symbol 160 MovieClip [tellBonus] Frame 1
#initclip 17
Object.registerClass("tellBonus", tellBonusClass);
#endinitclip
Symbol 165 MovieClip [tellPlayer] Frame 1
#initclip 18
Object.registerClass("tellPlayer", tellPlayerClass);
#endinitclip
Symbol 195 MovieClip [playerExplosion] Frame 44
removeMovieClip(this);
Symbol 197 MovieClip Frame 15
stop();
Symbol 198 MovieClip [irisOpens] Frame 15
removeMovieClip(this);
stop();
Symbol 199 MovieClip Frame 15
stop();
Symbol 200 MovieClip [irisCloses] Frame 1
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 222 MovieClip Frame 1
_root.stop();
Symbol 222 MovieClip Frame 75
_root.play();
Symbol 258 MovieClip Frame 1
this.onPress = function () {
getURL ("http://www.terrypaton.com", "_blank");
};
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.stop();
Symbol 304 MovieClip Frame 1
stop();