Section 1
//GameBadGuy (classesAS3.GameBadGuy)
package classesAS3 {
import flash.display.*;
import classesAS3.*;
import flash.filters.*;
class GameBadGuy {
var xVel:Number;// = 0
var hitVel;
var spriteData:Object;
var extraSpeed:Number;
var deadExplosion:Boolean;
var yPos:Number;// = 0
var limbsGone:Number;
var myValue:Number;
var inToGround:Number;
var numberOfMissiles;// = 0
var myDamage:Number;
var range:Number;
var energyMc:MovieClip;
var rt:Object;
public var speed:Number;// = 0
var myScore:Number;
var limbArm2:Boolean;
var gravity:Number;
var limbArm1:Boolean;
var myName:String;
var projectileMc:Object;
public var speedOld:Number;
var energyBarMc:GameEnergyBar;
var distanceArray:Array;
var glowFilter:GlowFilter;
var yVel:Number;// = 0
var dead:Boolean;
var mC:Object;
var zombieType:Number;
var explosionRot:Number;
var energy:Number;// = 0
var freeze:Number;
var walkType:Number;
var targetObj:Object;
var energyBarOn:Number;
var delayToStart:Number;
var Useful:GameUseful;
var energyStart:Number;// = 0
var xPos:Number;// = 0
var xOrigin:Number;// = 0
var myExplosion:Object;
var missileName:String;
var delayToFireMissile:Number;// = 1
var limbLeg1:Boolean;
var limbLeg2:Boolean;
var limbFoot1:Boolean;
var limbHead:Boolean;
var limbFoot2:Boolean;
var myRange:Number;
var xDir:Number;
var yOrigin:Number;// = 0
function GameBadGuy(clip, rt2, xStart, yStart, sp, uu, delayT, myR, myN, myD, myM, myV, zomType){
var rangeVary:Number;
var levelDelay:*;
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
speed = 0;
energyStart = 0;
energy = 0;
delayToFireMissile = 1;
numberOfMissiles = 0;
super();
rt = rt2;
Useful = uu;
myDamage = myD;
missileName = myM;
myName = myN;
rangeVary = Useful.RandomNumber(1, 20);
rangeVary = (rangeVary - 20);
myRange = (myR + rangeVary);
zombieType = zomType;
walkType = Useful.RandomNumber(1, 3);
myValue = myV;
gravity = 1;
xOrigin = 0;
yOrigin = yStart;
xPos = xStart;
yPos = 0;
xVel = 0;
yVel = 0;
hitVel = 0;
limbHead = true;
limbFoot1 = true;
limbFoot2 = true;
limbArm1 = true;
limbArm2 = true;
limbLeg1 = true;
limbLeg2 = true;
glowFilter = new GlowFilter(11184895, 1, 5, 5, 3, 1);
energyBarOn = 0;
extraSpeed = 0;
if (rt.waveDelay < 160){
levelDelay = (240 - rt.waveDelay);
extraSpeed = (extraSpeed + (levelDelay / 140));
};
extraSpeed = (extraSpeed + (rt.levelNumber / 100));
speed = sp;
speedOld = sp;
limbsGone = 0;
xDir = -1;
dead = false;
deadExplosion = false;
freeze = 0;
inToGround = 0;
delayToStart = delayT;
mC = clip;
numberOfMissiles = 0;
if (myName == "manStone"){
energyStart = 80;
} else {
energyStart = 100;
};
energy = energyStart;
distanceArray = new Array();
updatePosition();
}
function updatePosition(){
var sp2:Number;
if (speed == 0){
xVel = 0;
} else {
sp2 = (speed + extraSpeed);
xVel = (xDir * sp2);
};
xPos = (xPos + hitVel);
hitVel = 0;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
}
function killZombie(missileX){
var xx:Number;
var explosionData:Object;
var risingScoreMc:*;
rt.Sounds.playSoundFx("explosionFx");
xx = Useful.RandomNumber(1, 100);
explosionRot = 8;
if (missileX > mC.x){
xx = (xx - 100);
explosionRot = -8;
};
explosionData = Useful.getArcVelocity(6, 16, mC.x, mC.y, (mC.x + xx), (mC.y - 100));
gravity = explosionData.gravity;
xVel = explosionData.xStep;
yVel = explosionData.yStep;
deadExplosion = true;
dead = true;
rt.increaseMoney(myValue);
rt.increaseScore(myValue);
risingScoreMc = new GameRisingMoney(rt, rt.inGameScoreMc, myValue);
rt.inGameScoreMc.addChild(risingScoreMc);
risingScoreMc.x = mC.x;
risingScoreMc.y = (mC.y - 10);
}
function applyGravity(){
yVel = (yVel + gravity);
}
function decreaseEnergyE(missileX, explosion, energyD){
var e:Number;
var xx:Number;
var explosionData:Object;
var risingScoreMc:*;
energy = (energy - energyD);
if (energyBarOn == 0){
energyBarOn = 1;
energyBarMc = new GameEnergyBar(this);
mC.addChild(energyBarMc);
};
energyBarMc.x = 0;
energyBarMc.y = -60;
e = (energy / 10);
energyBarMc.bar.bar.y = int((10 - e));
if (energy <= 0){
rt.Sounds.playSoundFx("moanFx");
if (explosion == true){
xx = Useful.RandomNumber(1, 100);
explosionRot = 8;
if (missileX > mC.x){
xx = (xx - 100);
explosionRot = -8;
};
explosionData = Useful.getArcVelocity(6, 16, mC.x, mC.y, (mC.x + xx), (mC.y - 100));
gravity = explosionData.gravity;
xVel = explosionData.xStep;
yVel = explosionData.yStep;
deadExplosion = true;
dead = true;
} else {
inToGround = 0;
dead = true;
mC.gotoAndStop("deathBack");
};
rt.increaseMoney(myValue);
rt.increaseScore(myValue);
risingScoreMc = new GameRisingMoney(rt, rt.inGameScoreMc, myValue);
rt.inGameScoreMc.addChild(risingScoreMc);
risingScoreMc.x = mC.x;
risingScoreMc.y = (mC.y - 10);
rt.decreaseZombiesLeft(1);
} else {
risingScoreMc = new GameRisingScore(rt, rt.inGameScoreMc, energyD);
rt.inGameScoreMc.addChild(risingScoreMc);
risingScoreMc.x = mC.x;
risingScoreMc.y = (mC.y - 10);
if (xDir < 0){
if (missileX > mC.x){
loseLimb(mC.zombie, -1);
mC.gotoAndStop("hit");
hitVel = 20;
} else {
loseLimb(mC.zombie, 1);
mC.gotoAndStop("hit");
hitVel = 20;
};
} else {
if (missileX > mC.x){
loseLimb(mC.zombie, -1);
mC.gotoAndStop("hit");
hitVel = -20;
} else {
hitVel = 20;
loseLimb(mC.zombie, 1);
mC.gotoAndStop("hit");
};
};
};
updatePosition();
}
public function turnOffLimbs(zombieMc){
if (limbHead == false){
zombieMc.head.visible = false;
} else {
zombieMc.head.gotoAndStop(zombieType);
};
if (limbArm1 == false){
zombieMc.arm1.visible = false;
} else {
zombieMc.arm1.gotoAndStop(zombieType);
};
if (limbArm2 == false){
zombieMc.arm2.visible = false;
} else {
zombieMc.arm2.gotoAndStop(zombieType);
};
if (limbFoot1 == false){
zombieMc.foot1.visible = false;
};
if (limbFoot2 == false){
if (zombieMc.foot2 != null){
zombieMc.foot2.visible = false;
};
};
if (limbLeg1 == false){
zombieMc.leg1.visible = false;
} else {
zombieMc.leg1.gotoAndStop(zombieType);
};
if (limbLeg2 == false){
zombieMc.leg2.visible = false;
} else {
zombieMc.leg2.gotoAndStop(zombieType);
};
zombieMc.torso.gotoAndStop(zombieType);
}
function findEnemyGun(){
var distanceObject:Object;
distanceArray = new Array();
distanceObject = new Object();
distanceObject.distSprite = rt.Player;
distanceObject.dist = Useful.getDistanceQ(mC.x, mC.y, rt.Player.mC.x, rt.Player.mC.y);
if (distanceObject.dist < (myRange + 120)){
distanceArray.push(distanceObject);
};
}
function checkForFire(){
if (missileName == "enemyPhoton"){
delayToFireMissile--;
if (delayToFireMissile > 0){
rt.Sounds.playSoundFx("enemyPhotonFx");
mC.gotoAndStop("shoot");
targetObj = distanceArray[0].distSprite;
projectileMc = new enemyPhoton();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.pointTowards(targetObj.mC.x, (targetObj.mC.y - 20), mC.x, (mC.y - 140));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 140), missileName, Useful, spriteData, 20, this, myDamage));
} else {
if (delayToFireMissile < -60){
delayToFireMissile = 60;
};
};
} else {
delayToFireMissile--;
if (delayToFireMissile == 0){
rt.Sounds.playSoundFx("rockFx");
delayToFireMissile = 60;
mC.gotoAndStop("shoot");
targetObj = distanceArray[0].distSprite;
};
};
}
function loseLimb(zombieMc, dir){
var whatLimb:Number;
var limbDist:Number;
var spriteData:Object;
if (limbsGone < 3){
whatLimb = Useful.RandomNumber(1, 14);
limbDist = Useful.RandomNumber(40, 80);
limbDist = (limbDist * dir);
if (whatLimb == 1){
if (limbHead == true){
limbHead = false;
limbsGone++;
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, (mC.x + limbDist), (mC.y - 100));
rt.zombiePartsArray.push(new GameZombieParts(rt.inGameMissilesMc, rt, spriteData, "head", mC.x, mC.y, zombieType));
rt.inGameMissilesMc.addChild(rt.zombiePartsArray[(rt.zombiePartsArray.length - 1)]);
} else {
whatLimb = Useful.RandomNumber(2, 7);
};
};
if (whatLimb == 2){
if (limbArm1 == true){
limbArm1 = false;
limbsGone++;
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, (mC.x + limbDist), (mC.y - 100));
rt.zombiePartsArray.push(new GameZombieParts(rt.inGameMissilesMc, rt, spriteData, "arm", mC.x, mC.y, zombieType));
rt.inGameMissilesMc.addChild(rt.zombiePartsArray[(rt.zombiePartsArray.length - 1)]);
} else {
whatLimb = Useful.RandomNumber(3, 7);
};
};
if (whatLimb == 3){
if (limbArm2 == true){
limbArm2 = false;
limbsGone++;
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, (mC.x + limbDist), (mC.y - 100));
rt.zombiePartsArray.push(new GameZombieParts(rt.inGameMissilesMc, rt, spriteData, "arm", mC.x, mC.y, zombieType));
rt.inGameMissilesMc.addChild(rt.zombiePartsArray[(rt.zombiePartsArray.length - 1)]);
} else {
whatLimb = Useful.RandomNumber(4, 7);
};
};
if (whatLimb == 4){
if (limbFoot1 == true){
if (limbFoot2 == true){
limbFoot1 = false;
limbsGone++;
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, (mC.x + limbDist), (mC.y - 100));
rt.zombiePartsArray.push(new GameZombieParts(rt.inGameMissilesMc, rt, spriteData, "foot", mC.x, mC.y, zombieType));
rt.inGameMissilesMc.addChild(rt.zombiePartsArray[(rt.zombiePartsArray.length - 1)]);
};
} else {
whatLimb = Useful.RandomNumber(5, 7);
};
};
if (whatLimb == 5){
if (limbFoot2 == true){
if (limbFoot1 == true){
limbFoot2 = false;
limbsGone++;
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, (mC.x + limbDist), (mC.y - 100));
rt.zombiePartsArray.push(new GameZombieParts(rt.inGameMissilesMc, rt, spriteData, "foot", mC.x, mC.y, zombieType));
rt.inGameMissilesMc.addChild(rt.zombiePartsArray[(rt.zombiePartsArray.length - 1)]);
};
} else {
whatLimb = Useful.RandomNumber(6, 7);
};
};
if (whatLimb == 6){
if (limbLeg1 == true){
if (limbLeg2 == true){
limbLeg1 = false;
limbsGone++;
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, (mC.x + limbDist), (mC.y - 100));
rt.zombiePartsArray.push(new GameZombieParts(rt.inGameMissilesMc, rt, spriteData, "leg", mC.x, mC.y, zombieType));
rt.inGameMissilesMc.addChild(rt.zombiePartsArray[(rt.zombiePartsArray.length - 1)]);
};
} else {
whatLimb = 7;
};
};
if (whatLimb == 7){
if (limbLeg2 == true){
if (limbLeg1 == true){
limbLeg2 = false;
limbsGone++;
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, (mC.x + limbDist), (mC.y - 100));
rt.zombiePartsArray.push(new GameZombieParts(rt.inGameMissilesMc, rt, spriteData, "leg", mC.x, mC.y, zombieType));
rt.inGameMissilesMc.addChild(rt.zombiePartsArray[(rt.zombiePartsArray.length - 1)]);
};
};
};
};
}
function remove(){
var arrayIndex:Number;
var i1:*;
arrayIndex = 0;
i1 = 0;
while (i1 < rt.badGuysArray.length) {
if (this == rt.badGuysArray[i1]){
arrayIndex = i1;
};
i1++;
};
rt.inGameEnemyMc.removeChild(mC);
mC.stop();
rt.badGuysArray.splice(arrayIndex, 1);
}
function checkForGround():void{
var yVel2:Number;
var yVel3:Number;
var xm:Number;
var ym:Number;
var i:*;
var hit:*;
yVel2 = yVel;
yVel3 = yVel;
if (yVel3 < 0){
yVel3 = ((yVel3 - yVel3) - yVel3);
};
xm = (mC.x + rt.spritesMc.x);
ym = (mC.y + rt.spritesMc.y);
i = 0;
while (i < int(yVel3)) {
if (rt.backMc.hitTestPoint(xm, (ym + i), true)){
yVel = (yVel - int(yVel2));
yVel = (i + yVel);
break;
};
i++;
};
xVel = (xDir * speed);
updatePosition();
xm = (mC.x + rt.spritesMc.x);
ym = (mC.y + rt.spritesMc.y);
if (rt.backMc.hitTestPoint(xm, (ym + i), true)){
hit = 0;
i = 0;
while (i < 10) {
yPos--;
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
if (rt.backMc.hitTestPoint((mC.x + rt.spritesMc.x), mC.y, true) == false){
hit = 1;
break;
};
i++;
};
};
if (hit == 0){
changeDirection();
};
if (xPos > 1700){
xDir = -1;
} else {
if (xPos < 10){
xDir = 1;
};
};
}
function swordAttack(){
var targetObj:Object;
delayToFireMissile--;
if (delayToFireMissile == 0){
delayToFireMissile = 10;
if (mC.currentFrame != 4){
mC.gotoAndStop("shoot");
};
targetObj = distanceArray[0].distSprite;
if (targetObj == rt.Player){
rt.decreaseEnergy(1);
} else {
targetObj.decreaseEnergy(mC.x, myDamage);
};
};
}
function changeDirection(){
if (xDir < 0){
xDir = 1;
} else {
xDir = -1;
};
}
function checkForGround3():void{
var yVel2:Number;
var yVel3:Number;
var xm:Number;
var ym:Number;
var yy:Number;
yVel2 = yVel;
yVel3 = yVel;
if (yVel3 < 0){
yVel3 = ((yVel3 - yVel3) - yVel3);
};
xm = int(mC.x);
ym = (mC.y + rt.spritesMc.y);
yy = rt.groundArray[xm];
if (ym > yy){
remove();
};
}
function checkForGround2():void{
var i:*;
var xm:Number;
var ym:Number;
var yy:Number;
var explosionMc:*;
var leftC:Number;
var rightC:Number;
var yy1:Number;
var yy2:Number;
var rotData:Object;
i = 0;
while (i < rt.minesArray.length) {
if (rt.minesArray[i].hitTestObject(mC)){
rt.Sounds.playSoundFx("explosionFx");
explosionMc = new GameExplosionAnim(rt, rt.inGameZExplosionsMc);
rt.inGameZExplosionsMc.addChild(explosionMc);
explosionMc.x = (mC.x - 50);
explosionMc.y = (mC.y - 50);
rt.grenadeExArray.push(explosionMc);
explosionMc.myIndex = (rt.grenadeExArray.length - 1);
decreaseEnergyE(mC.x, true, 5);
rt.inGameEnemyMc.removeChild(rt.minesArray[i]);
rt.minesArray.splice(i, 1);
};
i++;
};
i = 0;
while (i < rt.grenadeExArray.length) {
if (myExplosion != rt.grenadeExArray[i]){
if (rt.grenadeExArray[i].hitTestObject(mC)){
decreaseEnergyE(mC.x, false, 5);
};
};
i++;
};
if (myName == "badGuyHoverTank"){
leftC = (mC.x - (mC.width / 2));
rightC = (mC.x + (mC.width / 2));
xm = int(leftC);
ym = (mC.y + rt.spritesMc.y);
yy1 = rt.groundArray[xm];
xm = int(rightC);
yy2 = rt.groundArray[xm];
rotData = Useful.pointTowards(leftC, yy1, rightC, yy2);
mC.rotation = (rotData.spriteRotation - 180);
};
xm = int(mC.x);
ym = (mC.y + rt.spritesMc.y);
yy = rt.groundArray[xm];
if (ym > yy){
ym = (ym - yy);
yVel = (yVel - ym);
};
xVel = (xDir * speed);
updatePosition();
xm = int(mC.x);
ym = (mC.y + rt.spritesMc.y);
if (ym > yy){
ym = (ym - yy);
yPos = (yPos - ym);
yVel = 0;
};
if (xPos > 1700){
xDir = -1;
} else {
if (xPos < 10){
xDir = 1;
};
};
}
function checkForGround4():void{
var yVel2:Number;
var yVel3:Number;
var xm:Number;
var ym:Number;
var yy:Number;
yVel2 = yVel;
yVel3 = yVel;
if (yVel3 < 0){
yVel3 = ((yVel3 - yVel3) - yVel3);
};
xm = int(mC.x);
ym = (mC.y + rt.spritesMc.y);
yy = rt.groundArray[xm];
if (ym > yy){
remove();
};
}
function decreaseEnergy(missileX, explosion, energyD){
var e:Number;
var explosionMc:*;
var xx:Number;
var explosionData:Object;
var risingScoreMc:*;
missileX = missileX.myParent.mC.x;
energy = (energy - energyD);
if (energyBarOn == 0){
energyBarOn = 1;
energyBarMc = new GameEnergyBar(this);
mC.addChild(energyBarMc);
};
energyBarMc.x = 0;
energyBarMc.y = -60;
e = (energy / 10);
energyBarMc.bar.bar.y = int((10 - e));
if (explosion == true){
rt.Sounds.playSoundFx("explosionFx");
explosionMc = new GameExplosionAnim(rt, rt.inGameZExplosionsMc);
rt.inGameZExplosionsMc.addChild(explosionMc);
explosionMc.x = (mC.x - 50);
explosionMc.y = (mC.y - 50);
rt.grenadeExArray.push(explosionMc);
explosionMc.myIndex = (rt.grenadeExArray.length - 1);
myExplosion = explosionMc;
};
if (energy <= 0){
rt.Sounds.playSoundFx("moanFx");
if (explosion == true){
xx = Useful.RandomNumber(1, 100);
explosionRot = 8;
if (missileX > mC.x){
xx = (xx - 100);
explosionRot = -8;
};
explosionData = Useful.getArcVelocity(6, 16, mC.x, mC.y, (mC.x + xx), (mC.y - 100));
gravity = explosionData.gravity;
xVel = explosionData.xStep;
yVel = explosionData.yStep;
deadExplosion = true;
dead = true;
} else {
inToGround = 0;
dead = true;
mC.gotoAndStop("deathBack");
};
rt.increaseMoney(myValue);
rt.increaseScore(myValue);
risingScoreMc = new GameRisingMoney(rt, rt.inGameScoreMc, myValue);
rt.inGameScoreMc.addChild(risingScoreMc);
risingScoreMc.x = mC.x;
risingScoreMc.y = (mC.y - 10);
rt.decreaseZombiesLeft(1);
} else {
risingScoreMc = new GameRisingScore(rt, rt.inGameScoreMc, energyD);
rt.inGameScoreMc.addChild(risingScoreMc);
risingScoreMc.x = mC.x;
risingScoreMc.y = (mC.y - 10);
if (xDir < 0){
if (missileX > mC.x){
loseLimb(mC.zombie, -1);
mC.gotoAndStop("hit");
hitVel = 20;
} else {
loseLimb(mC.zombie, 1);
mC.gotoAndStop("hit");
hitVel = 20;
};
} else {
if (missileX > mC.x){
loseLimb(mC.zombie, -1);
mC.gotoAndStop("hit");
hitVel = -20;
} else {
hitVel = 20;
loseLimb(mC.zombie, 1);
mC.gotoAndStop("hit");
};
};
};
updatePosition();
}
function findEnemyTarget(){
var i2:int;
var distanceObject:Object;
var xx:Number;
distanceArray = new Array();
i2 = 0;
while (i2 < rt.goodGuysArray.length) {
if (rt.goodGuysArray[i2].dead == false){
if (rt.goodGuysArray[i2].soldierState != 4){
distanceObject = new Object();
distanceObject.distSprite = rt.goodGuysArray[i2];
distanceObject.dist = Useful.getDistanceQ(mC.x, mC.y, (rt.goodGuysArray[i2].mC.x - 7), rt.goodGuysArray[i2].mC.y);
if (myName == "GameZombie"){
distanceArray.push(distanceObject);
} else {
if (distanceObject.dist < myRange){
distanceArray.push(distanceObject);
};
};
};
};
i2++;
};
distanceObject = new Object();
distanceObject.distSprite = rt.Player;
xx = rt.Player.mC.x;
xx = (xx - rt.Player.mC.baseFront.x);
distanceObject.dist = Useful.getDistanceQ(mC.x, mC.y, xx, rt.Player.mC.y);
distanceArray.push(distanceObject);
distanceArray.sortOn("dist", Array.NUMERIC);
}
function setupMissile(){
var rangeVary:Number;
rangeVary = Useful.RandomNumber(8, 20);
if (missileName == "enemyShell"){
projectileMc = new enemyShell();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.pointTowards(targetObj.mC.x, (targetObj.mC.y - 20), mC.x, (mC.y - 37));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 37), missileName, Useful, spriteData, 16, this, myDamage));
} else {
if (missileName == "enemyBullet"){
projectileMc = new enemyBullet();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.pointTowards(targetObj.mC.x, (targetObj.mC.y - 20), mC.x, (mC.y - 15));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 15), missileName, Useful, spriteData, 16, this, myDamage));
} else {
if (missileName == "rocket"){
projectileMc = new rocket();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.pointTowards(targetObj.mC.x, targetObj.mC.y, mC.x, (mC.y - 5));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 25), missileName, Useful, spriteData, 16, this, myDamage));
} else {
if (missileName == "grenade"){
rt.Sounds.playSoundFx("throwFx");
projectileMc = new projectiles();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.getArcVelocity(6, 16, mC.x, (mC.y - 10), (targetObj.mC.x - rangeVary), (targetObj.mC.y - 10));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, spriteData, 16, this, myDamage));
} else {
projectileMc = new projectiles();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.getArcVelocity(6, 26, mC.x, mC.y, (targetObj.mC.x - rangeVary), targetObj.mC.y);
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, spriteData, 16, this, myDamage));
};
};
};
};
}
function mainLoop(){
var attackingWall:Boolean;
var i:*;
var wallFrame:Number;
if (delayToStart == 0){
if (dead == false){
attackingWall = false;
i = 0;
while (i < rt.wallsArray.length) {
if (rt.wallsArray[i].hitTestObject(mC)){
attackingWall = true;
if (mC.currentFrame != 4){
mC.gotoAndStop("shoot");
};
rt.wallsArray[i].energy = (rt.wallsArray[i].energy - 0.2);
if (rt.wallsArray[i].energy <= 0){
rt.inGameEnemyMc.removeChild(rt.wallsArray[i]);
rt.wallsArray.splice(i, 1);
} else {
wallFrame = (rt.wallsArray[i].energy / 100);
wallFrame = int((wallFrame * 40));
rt.wallsArray[i].gotoAndStop((wallFrame + 1));
};
if (mC.x > rt.wallsArray[i].x){
xPos = (xPos + -((xVel * 2)));
} else {
xPos = (xPos + (xVel * 2));
};
};
i++;
};
findEnemyTarget();
if (distanceArray[0].dist < myRange){
if (distanceArray[0].dist < 15){
speed = 0;
swordAttack();
} else {
if (mC.currentFrame != 3){
if (attackingWall == false){
mC.gotoAndStop("walkFast");
};
};
speed = 1;
};
} else {
if (mC.currentFrame != 2){
if (mC.currentFrame != 9){
if (mC.currentFrame != 10){
if (attackingWall == false){
if (walkType == 1){
mC.gotoAndStop("walkSlow2");
} else {
if (walkType == 2){
mC.gotoAndStop("walkSlow1");
} else {
mC.gotoAndStop("walkSlow3");
};
};
};
};
};
};
};
if (mC.x > distanceArray[0].distSprite.mC.x){
xDir = -1;
mC.scaleX = 1;
} else {
xDir = 1;
mC.scaleX = -1;
};
applyGravity();
checkForGround2();
updatePosition();
} else {
if (deadExplosion == true){
applyGravity();
checkForGround3();
mC.rotation = (mC.rotation + explosionRot);
updatePosition();
} else {
speed = 0;
xVel = 0;
inToGround++;
if (inToGround > 100){
remove();
} else {
yVel = 0.1;
xVel = 0;
updatePosition();
};
};
};
} else {
delayToStart--;
};
}
}
}//package classesAS3
Section 2
//GameEnergyBar (classesAS3.GameEnergyBar)
package classesAS3 {
import flash.display.*;
public class GameEnergyBar extends MovieClip {
public var bar:energyBar;
var enemy:Object;
public function GameEnergyBar(enemySprite){
super();
addFrameScript(22, frame23);
enemy = enemySprite;
}
function frame23(){
this.enemy.energyBarOn = 0;
MovieClip(this.parent).removeChild(this);
stop();
}
}
}//package classesAS3
Section 3
//GameExplosion (classesAS3.GameExplosion)
package classesAS3 {
import classesAS3.*;
class GameExplosion {
var rt:Object;
var xPos:Number;// = 0
var xVel:Number;// = 0
var artillary:Number;
var explodeFrame:Number;
var Count:Number;
var numberOfParticles:Number;
var mType:Number;
var Useful:GameUseful;
var yPos:Number;// = 0
var gravity:Number;
var speed:Number;
var explodeDistance:Number;
var yVel:Number;// = 0
var fullRange:Boolean;
var numberOfLoops:Number;
var mC:Object;
var arrayIndex:Number;
var xOrigin:Number;// = 0
var yOrigin:Number;// = 0
function GameExplosion(rt2, xStart, yStart, type, useF, numberOfP, numberOfL, dist, gravityS, artillaryS, fullR, sp){
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
super();
rt = rt2;
Useful = useF;
fullRange = fullR;
numberOfParticles = numberOfP;
numberOfLoops = numberOfL;
explodeDistance = dist;
gravity = gravityS;
artillary = artillaryS;
speed = sp;
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
yPos = 0;
Count = 0;
mType = type;
}
function remove(){
var arrayIndex:Number;
var i1:*;
arrayIndex = 0;
i1 = 0;
while (i1 < rt.explosionsArray.length) {
if (this == rt.explosionsArray[i1]){
arrayIndex = i1;
};
i1++;
};
rt.explosionsArray.splice(arrayIndex, 1);
delete ??getglobalscope
[this];
}
function mainLoop(){
var z:int;
var rot:Number;
var vectors:Object;
var newMc:GameParticle;
z = 0;
while (z < numberOfParticles) {
if (fullRange == false){
rot = Useful.RandomNumber(1, 180);
rot = (rot + 180);
if (rot > 359){
rot = (rot - 359);
};
} else {
rot = Useful.RandomNumber(1, 360);
};
vectors = Useful.getVectorFromAngle(rot);
newMc = new GameParticle(rt, Useful, xOrigin, yOrigin, mType, vectors.vx, vectors.vy, ((vectors.vx * explodeDistance) + xOrigin), ((vectors.vy * explodeDistance) + yOrigin), artillary, gravity, explodeDistance, speed);
rt.inGameExplosionsMc.addChild(newMc);
rt.particlesArray.push(newMc);
newMc.rotation = rot;
z++;
};
Count++;
if (Count > numberOfLoops){
remove();
};
}
}
}//package classesAS3
Section 4
//GameExplosionAnim (classesAS3.GameExplosionAnim)
package classesAS3 {
import flash.display.*;
public class GameExplosionAnim extends MovieClip {
public var myParent:Object;
public var rt:Object;
public var myIndex:Number;
public function GameExplosionAnim(rt2, myP){
super();
addFrameScript(5, frame6);
rt = rt2;
myParent = myP;
}
public function removeMe(){
rt.grenadeExArray.splice(myIndex, 1);
myParent.removeChild(this);
}
function frame6(){
this.removeMe();
stop();
}
}
}//package classesAS3
Section 5
//GameGame (classesAS3.GameGame)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
public class GameGame extends MovieClip {
var left:Number;
var StartTimer:Number;
var badGuysArray:Array;
var selectionArray:Array;
var grenadeExArray:Array;
var bf:BlurFilter;
var sec:Number;
var playerMc:MovieClip;
var inGameColourMc:Sprite;
var bf2:BlurFilter;
var levelTime:Number;
var movieWidth:Number;
var movieHeight:Number;
var inGamePickupsMc:Sprite;
var shift:Matrix;
var inGameEnemyMc:Sprite;
var baseGunType:String;
var spritesMc:Sprite;
var moneyMax:Number;
var filterAlienDelay:Number;
var inGameMissilesMc:Sprite;
var levelWidth:Number;
var oldScore:Number;
var wallCost:Number;
var clickloc:Point;
var moneyDelay:Number;
var money:Number;
var zombiesLeft:Array;
var levelWidthBlocks:Number;
var gameOverMsgMc:GameOverMsgAnim;
var pauseSwitch:Boolean;
var backMc:backgroundMc;
var oldUpgrade3:Boolean;
var minutes:Number;
var oldUpgrade5:Boolean;
var oldUpgrade6:Boolean;
var oldUpgrade8:Boolean;
var oldUpgrade4:Boolean;
var oldUpgrade9:Boolean;
var oldUpgrade7:Boolean;
var oldUpgrade2:Boolean;
var filterDelay:Number;
var oldUpgrade1:Boolean;
var oldBaseType:String;
var lives:Number;
var inGameScoreMc:Sprite;
var groundArray:Array;
var explosionsArray:Array;
var planeMc:GamePlane;
var energyAlien:Number;
var itemsToBuyMc:Sprite;
var upgrade10:Boolean;
var cmf:ColorMatrixFilter;
var upgradeCost1:Number;
var upgradeCost2:Number;
var upgradeCost3:Number;
var upgradeCost5:Number;
var upgradeCost6:Number;
var levelData:Array;
var upgradeCost8:Number;
var upgradeCost9:Number;
var timeBonus:Number;
var top:Number;
var oldMouseY:Number;
var currentPickup:String;
var upgradeCost7:Number;
var oldMouseX:Number;
var upgradeCost4:Number;
var Sounds:GameSounds;
var levelCompleteMsg:GameLevelComplete;
var inGameGoodGuysMc:Sprite;
var maxScrollSpeed:Number;
var bmd:BitmapData;
var upgrade1:Boolean;
var upgrade2:Boolean;
var gameExplosions:GameMultipleExplosion;
var soundsSwitch:Boolean;// = true
var upgrade5:Boolean;
var upgrade6:Boolean;
var upgrade8:Boolean;
var upgrade9:Boolean;
var upgrade3:Boolean;
var upgradeMc1:GameUpgrade;
var upgradeMc2:GameUpgrade2;
var upgradeMc3:GameUpgrade3;
var upgrade7:Boolean;
var upgradeMc6:GameUpgrade6;
var upgradeMc7:GameUpgrade7;
var upgrade4:Boolean;
var upgradeMc4:GameUpgrade4;
var upgradeMc5:GameUpgrade5;
var upgradeMc8:GameUpgrade8;
var upgradeMc9:GameUpgrade9;
var scrollScreen:String;
var musicSwitch:Boolean;// = true
var marchingAntsMc:Sprite;
var baseType:String;
var mineDamage:Number;
var tilesArray:Array;
var releaseloc:Point;
var levelHeight:Number;
var fulltime:Number;
var panelItemsData:Array;
var backSkyMc:backgroundSkyMc;
var startGameMsgMc:GameStartMsg;
var badGuysLevels:Array;
var waveDelay:Number;
var spring:Number;
var zombiesLeftC:Number;
var minDisplay:String;
var clockDelay:Number;
var right:Number;
var zombiePartsArray:Array;
var bottom:Number;
var pauseMc:MovieClip;
var blockSize:Number;
var inGameActionMc:Sprite;
public var rt:Object;
var missilesArray:Array;
public var scrollvx:Number;
var presentationMc:Sprite;
var gravity:Number;
var inGameZExplosionsMc:Sprite;
var upgradeMc10:GameUpgrade10;
var goodGuysArray:Array;
var itemsArray:Array;
var energy:Number;
public var statsMc:GameWeaponsPanel;
public var score:Number;
var inGameExplosionsMc:Sprite;
var antsbmp:antsMc;
var inGameMc:Sprite;
var Useful:GameUseful;
var mineCost:Number;
var marquee_mc:MovieClip;
var oldUpgrade10:Boolean;
var oldMoney:Number;
var backMcWidth:Number;
var backMc2:backgroundP;
var wave;
var Player:GamePlayer;
var currentMoneyDelay:Number;
var friction:Number;
var bestScore:Number;
var scrollxPos:Number;
var pickupsArray:Array;
var backgroundLevelMc:Sprite;
var levelHeightBlocks:Number;
var secDisplay:String;
public var levelStart:Number;
var levelMax:Number;
var springLength:Number;
var glowFilter:GlowFilter;
var delayToWave;
var waveDelayD:Number;
var oldEnergy:Number;
var inGameGraphicsMc:Sprite;
var numberOfStartItems:Number;
var particlesArray:Array;
var itemsCost:Array;
var enemyArray:Array;
var minesArray:Array;
var inGameBackgroundMc:Sprite;
var inGameBackgroundMc2:Sprite;
var currentTimeBonus:Number;
var pickupType:String;
var inGameStatsMc:Sprite;
var inGameMsgsMc:Sprite;
var oldBaseGunType:String;
var pickupAdded:Boolean;
var upgradeCost10:Number;
var blockSizeY:Number;
public var levelNumber:Number;
var wallsArray:Array;
public var maxLevels:Number;
public static const SOLDIER_STATE_DEFEND:int = 1;
public static const SOLDIER_STATE_RETREAT:int = 3;
public static const SOLDIER_E_MOVE:int = 5;
public static const SOLDIER_STATE_CRYSTAL:int = 2;
public static const SOLDIER_E_STAND:int = 0;
public static const SOLDIER_STATE_ATTACK:int = 0;
public static const SOLDIER_STATE_MOVE:int = 5;
public static const SOLDIER_E_BUILD:int = 2;
public static const SOLDIER_STATE_FALLING:int = 4;
public function GameGame(rt2, stageWidth, stageHeight, levelW, levelH, startLives, uu, maxL){
var levelData:Array;
var badGuysLevel1:Array;
var badGuysLevel2:Array;
var badGuysLevel3:Array;
var badGuysLevel4:Array;
var badGuysLevel5:Array;
var badGuysLevel6:Array;
var badGuysLevel7:Array;
soundsSwitch = true;
musicSwitch = true;
super();
rt = rt2;
Useful = uu;
upgrade1 = false;
upgrade2 = false;
upgrade3 = false;
upgrade4 = false;
upgrade5 = false;
upgrade6 = false;
upgrade7 = false;
upgrade8 = false;
upgrade9 = false;
upgrade10 = false;
movieWidth = stageWidth;
movieHeight = stageHeight;
backMcWidth = 1700;
maxLevels = maxL;
mineDamage = 20;
blockSize = 100;
blockSizeY = 30;
Sounds = new GameSounds(this);
levelWidthBlocks = levelW;
levelHeightBlocks = levelH;
levelWidth = (levelWidthBlocks * blockSize);
levelHeight = (levelHeightBlocks * blockSize);
inGameMc = new Sprite();
addChild(inGameMc);
presentationMc = new Sprite();
addChild(presentationMc);
inGameActionMc = new Sprite();
inGameMc.addChild(inGameActionMc);
inGameStatsMc = new Sprite();
inGameMc.addChild(inGameStatsMc);
marchingAntsMc = new Sprite();
inGameMc.addChild(marchingAntsMc);
inGameGraphicsMc = new Sprite();
inGameActionMc.addChild(inGameGraphicsMc);
inGameMsgsMc = new Sprite();
inGameMc.addChild(inGameMsgsMc);
inGameBackgroundMc = new Sprite();
inGameGraphicsMc.addChild(inGameBackgroundMc);
inGameBackgroundMc2 = new Sprite();
inGameGraphicsMc.addChild(inGameBackgroundMc2);
spritesMc = new Sprite();
inGameGraphicsMc.addChild(spritesMc);
backgroundLevelMc = new Sprite();
spritesMc.addChild(backgroundLevelMc);
playerMc = new MovieClip();
spritesMc.addChild(playerMc);
inGameEnemyMc = new Sprite();
spritesMc.addChild(inGameEnemyMc);
inGameGoodGuysMc = new Sprite();
spritesMc.addChild(inGameGoodGuysMc);
inGameColourMc = new Sprite();
spritesMc.addChild(inGameColourMc);
inGamePickupsMc = new Sprite();
inGameColourMc.addChild(inGamePickupsMc);
inGameMissilesMc = new Sprite();
inGameColourMc.addChild(inGameMissilesMc);
inGameExplosionsMc = new Sprite();
inGameColourMc.addChild(inGameExplosionsMc);
inGameScoreMc = new Sprite();
inGameColourMc.addChild(inGameScoreMc);
bf = new BlurFilter(4, 4, BitmapFilterQuality.LOW);
bf2 = new BlurFilter(8, 8, BitmapFilterQuality.LOW);
cmf = new ColorMatrixFilter([1.3, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 14, 20, 0, 0, 0, 0, 1, 0]);
missilesArray = new Array();
enemyArray = new Array();
goodGuysArray = new Array();
missilesArray = new Array();
badGuysArray = new Array();
tilesArray = new Array();
explosionsArray = new Array();
particlesArray = new Array();
pickupsArray = new Array();
groundArray = new Array();
itemsArray = new Array();
selectionArray = new Array();
zombiePartsArray = new Array();
minesArray = new Array();
wallsArray = new Array();
grenadeExArray = new Array();
levelData = ["GameZombie"];
upgradeCost1 = 30;
upgradeCost2 = 40;
upgradeCost3 = 40;
upgradeCost4 = 50;
upgradeCost5 = 80;
upgradeCost6 = 140;
upgradeCost7 = 180;
upgradeCost8 = 120;
upgradeCost9 = 200;
upgradeCost10 = 140;
panelItemsData = new Array("basicMan", 20, "Machine Gunner $20", "Grenadier", 40, "Throws grenades $40", "Engineer", 70, "Has multiple uses $70", "rocketLauncher", 50, "Rocket launcher, $50", "heavyGunner", 170, "Battle droid, $170");
itemsCost = new Array(10, 10, 10, 10, 10, 10, 10, 10, 10, 10);
zombiesLeft = new Array(20, 30, 40, 50, 60, 70, 100);
badGuysLevel1 = new Array("GameZombie", 1, 230, (backMcWidth - 1), 100, 8, 7, "rock", 5);
badGuysLevel2 = new Array("GameZombie", 1, 230, (backMcWidth - 1), 100, 8, 7, "rock", 5);
badGuysLevel3 = new Array("GameZombie", 1, 230, (backMcWidth - 1), 100, 8, 7, "rock", 5);
badGuysLevel4 = new Array("GameZombie", 1, 230, (backMcWidth - 1), 100, 8, 7, "rock", 5);
badGuysLevel5 = new Array("GameZombie", 1, 230, (backMcWidth - 1), 100, 8, 7, "rock", 5);
badGuysLevel6 = new Array("GameZombie", 1, 230, (backMcWidth - 1), 100, 8, 7, "rock", 5);
badGuysLevel7 = new Array("GameZombie", 1, 230, (backMcWidth - 1), 100, 8, 7, "rock", 5);
badGuysLevels = new Array(badGuysLevel1, badGuysLevel2, badGuysLevel3, badGuysLevel4, badGuysLevel5, badGuysLevel6, badGuysLevel7);
scrollvx = 0;
glowFilter = new GlowFilter(0xFFFFFF, 1, 8, 8, 3, 1);
score = 0;
bestScore = 0;
lives = startLives;
energy = 100;
money = 0;
energyAlien = 100;
currentMoneyDelay = 40;
moneyDelay = currentMoneyDelay;
moneyMax = 100;
spring = 0.01;
friction = 0.8;
gravity = 0.3;
springLength = 10;
left = -20;
right = (movieWidth - 20);
top = 0;
bottom = movieHeight;
levelStart = 1;
levelNumber = levelStart;
levelMax = 7;
wave = 0;
delayToWave = 100;
maxScrollSpeed = 24;
scrollxPos = 0;
secDisplay = "00";
minDisplay = "00";
StartTimer = 1;
clockDelay = 10;
minutes = StartTimer;
sec = 0;
fulltime = 0;
numberOfStartItems = 3;
pauseSwitch = false;
antsbmp = new antsMc(0, 0);
shift = new Matrix();
clickloc = new Point(-10, -10);
releaseloc = new Point(-10, -10);
filterDelay = 1;
filterAlienDelay = 1;
scrollScreen = "";
mineCost = 10;
wallCost = 20;
baseType = "wooden";
baseGunType = "rifle";
}
function endLevelStuff(){
oldUpgrade1 = upgrade1;
oldUpgrade2 = upgrade2;
oldUpgrade3 = upgrade3;
oldUpgrade4 = upgrade4;
oldUpgrade5 = upgrade5;
oldUpgrade6 = upgrade6;
oldUpgrade7 = upgrade7;
oldUpgrade8 = upgrade8;
oldUpgrade9 = upgrade9;
oldUpgrade10 = upgrade10;
oldBaseType = baseType;
oldBaseGunType = baseGunType;
rt.gameState = 6;
killAllExplosions();
levelNumber++;
inGameMsgsMc.removeChild(levelCompleteMsg);
levelCompleteMsg = null;
backgroundLevelMc.removeChild(backMc);
backMc.stop();
backMc = null;
inGameBackgroundMc.removeChild(backSkyMc);
backSkyMc.stop();
backSkyMc = null;
spritesMc.x = 0;
newLevelStuff();
rt.setupMapScreen();
}
public function setupGame(){
oldEnergy = energy;
oldScore = score;
oldUpgrade1 = upgrade1;
oldUpgrade2 = upgrade2;
oldUpgrade3 = upgrade3;
oldUpgrade4 = upgrade4;
oldUpgrade5 = upgrade5;
oldUpgrade6 = upgrade6;
oldUpgrade7 = upgrade7;
oldUpgrade8 = upgrade8;
oldUpgrade9 = upgrade9;
oldUpgrade10 = upgrade10;
oldBaseType = baseType;
oldBaseGunType = baseGunType;
levelTime = 0;
waveDelayD = 1;
energy = 100;
wave = 0;
waveDelay = (220 - (levelNumber * 10));
money = 0;
moneyDelay = currentMoneyDelay;
moneyMax = (100 + ((levelNumber - 1) * 60));
zombiesLeftC = zombiesLeft[(levelNumber - 1)];
newArrays();
setupPanel();
setupBackground();
if (levelNumber == levelStart){
setupPlayer();
};
Player.mC.selectionMc.gotoAndStop(2);
Player.mC.y = (groundArray[50] - 70);
selectionArray.push(Player);
Player.mC.base.gotoAndStop(baseType);
Player.mC.gotoAndStop(baseGunType);
Player.mC.filters = [];
setupAnts();
soundFxBtn2();
musicBtn2();
setLevel();
if (levelNumber == 1){
setupStartGameMsg();
} else {
rt.finishSetup();
};
}
public function doBuildCommandBtn(event:MouseEvent):void{
doBuild();
}
function runWave(){
var badGuys:Array;
delayToWave--;
if (delayToWave == 0){
setupWave(wave);
wave++;
badGuys = badGuysLevels[(levelNumber - 1)];
if ((wave * 9) >= badGuys.length){
wave = 0;
};
waveDelayD--;
if (waveDelayD == 0){
waveDelayD = 1;
waveDelay = (waveDelay - 4);
if (waveDelay < 30){
waveDelay = 20;
};
};
delayToWave = waveDelay;
};
}
function setLevel(){
statsMc.levelTxt.text = String(levelNumber);
}
function setupSoldier(soldierType, xx, yy){
xx = (xx + 70);
yy = (yy + 140);
if (soldierType == 1){
goodGuysArray.push(new GameGoodGuy(this, xx, yy, 0.5, "man", 0, Useful, 250, "bullet"));
} else {
if (soldierType == 5){
goodGuysArray.push(new GameGoodGuy(this, xx, yy, 0.3, "rocket", 0, Useful, 300, "rocket"));
} else {
if (soldierType == 2){
goodGuysArray.push(new GameGoodGuy(this, xx, yy, 0.3, "grenader", 0, Useful, 250, "grenade"));
} else {
if (soldierType == 3){
goodGuysArray.push(new GameGoodGuy(this, xx, yy, 0.3, "sniper", 0, Useful, 400, "bullet"));
} else {
if (soldierType == 4){
goodGuysArray.push(new GameGoodGuy(this, xx, yy, 0.3, "heavyGunner", 0, Useful, 200, "Photon"));
};
};
};
};
};
}
function killAllWalls(){
var i2:*;
i2 = (wallsArray.length - 1);
while (i2 >= 0) {
inGameEnemyMc.removeChild(wallsArray[i2]);
i2--;
};
}
function soundFxBtn(){
if (statsMc.soundFxMc.currentFrame == 1){
statsMc.soundFxMc.gotoAndStop("off");
soundsSwitch = false;
} else {
statsMc.soundFxMc.gotoAndStop("on");
soundsSwitch = true;
};
}
function calcGroundPoints(){
var i:*;
var xm:Number;
var ym:Number;
var ie:Boolean;
var iy:Number;
groundArray = new Array();
i = 0;
while (i < 1700) {
xm = 0;
ym = 0;
ie = false;
iy = 150;
while (ie == false) {
if (backMc.ground.hitTestPoint((xm + i), (ym + iy), true)){
groundArray[i] = (ym + iy);
ie = true;
};
iy++;
if (iy > (backMc.height + 200)){
groundArray[i] = -1;
ie = true;
};
};
i++;
};
}
function doMoneyIncrease(){
moneyDelay--;
if (moneyDelay == 0){
moneyDelay = currentMoneyDelay;
money++;
if (money > moneyMax){
money = moneyMax;
};
};
checkForAfford();
}
function checkForAfford(){
var i:*;
i = 0;
while (i < numberOfStartItems) {
if (panelItemsData[((i * 3) + 1)] > money){
if (itemsArray[i].currentFrame != 2){
itemsArray[i].gotoAndStop("notBuy");
};
} else {
if (itemsArray[i].currentFrame != 1){
itemsArray[i].gotoAndStop(1);
};
};
i++;
};
if (upgrade1 == false){
if (upgradeMc1.back.currentFrame == 1){
if (upgradeCost1 > money){
upgradeMc1.gotoAndStop("notAfford");
} else {
upgradeMc1.gotoAndStop(1);
};
};
};
if (upgrade2 == false){
if (upgradeMc2.back.currentFrame == 1){
if (upgradeCost2 > money){
upgradeMc2.gotoAndStop("notAfford");
} else {
upgradeMc2.gotoAndStop(1);
};
};
};
if (upgrade3 == false){
if (upgradeMc3.back.currentFrame == 1){
if (upgradeCost3 > money){
upgradeMc3.gotoAndStop("notAfford");
} else {
upgradeMc3.gotoAndStop(1);
};
};
};
if (upgrade4 == false){
if (upgradeMc4.back.currentFrame == 1){
if (upgradeCost4 > money){
upgradeMc4.gotoAndStop("notAfford");
} else {
upgradeMc4.gotoAndStop(1);
};
};
};
if (upgrade5 == false){
if (upgradeMc5.back.currentFrame == 1){
if (upgradeCost5 > money){
upgradeMc5.gotoAndStop("notAfford");
} else {
upgradeMc5.gotoAndStop(1);
};
};
};
if (upgrade6 == false){
if (upgradeMc6.back.currentFrame == 1){
if (upgradeCost6 > money){
upgradeMc6.gotoAndStop("notAfford");
} else {
upgradeMc6.gotoAndStop(1);
};
};
};
if (upgrade7 == false){
if (upgradeMc7.back.currentFrame == 1){
if (upgradeCost7 > money){
upgradeMc7.gotoAndStop("notAfford");
} else {
upgradeMc7.gotoAndStop(1);
};
};
};
if (upgrade8 == false){
if (upgradeMc8.back.currentFrame == 1){
if (upgradeCost8 > money){
upgradeMc8.gotoAndStop("notAfford");
} else {
upgradeMc8.gotoAndStop(1);
};
};
};
if (upgrade9 == false){
if (upgradeMc9.back.currentFrame == 1){
if (upgradeCost9 > money){
upgradeMc9.gotoAndStop("notAfford");
} else {
upgradeMc9.gotoAndStop(1);
};
};
};
if (upgrade10 == false){
if (upgradeMc10.back.currentFrame == 1){
if (upgradeCost10 > money){
upgradeMc10.gotoAndStop("notAfford");
} else {
upgradeMc10.gotoAndStop(1);
};
};
};
setupSoldierCommands();
}
function doMarching(){
var currloc:*;
if (!clickloc){
return;
};
currloc = (releaseloc) ? releaseloc : new Point(stage.mouseX, stage.mouseY);
shift.translate(0, 1);
marquee_mc.graphics.clear();
marquee_mc.graphics.beginBitmapFill(antsbmp, shift);
drawSquare(marquee_mc, clickloc.x, clickloc.y, currloc.x, currloc.y);
drawSquare(marquee_mc, (clickloc.x + 1), (clickloc.y + 1), (currloc.x - 1), (currloc.y - 1));
marquee_mc.graphics.endFill();
}
function setupMine(xx){
var wallMc:*;
wallMc = new mine();
inGameEnemyMc.addChild(wallMc);
wallMc.x = xx;
wallMc.y = groundArray[xx];
wallMc.rotation = Useful.orientateToGround(this, wallMc);
minesArray.push(wallMc);
}
public function setupGoodGuys():void{
Sounds.playSoundFx("jetPassFx");
planeMc = new GamePlane(inGamePickupsMc, this);
planeMc.x = 1700;
planeMc.y = -60;
planeMc.xVel = -8;
planeMc.soldierStart = Useful.RandomNumber(130, 200);
planeMc.soldierType.push(1, 2, 3);
inGamePickupsMc.addChild(planeMc);
}
function decreaseScore(decrease){
score = int((score - decrease));
if (score >= 0){
setScore();
} else {
score = 0;
setScore();
};
}
public function buildDroid(droidType:Number){
var i2:*;
var cost:Number;
i2 = droidType;
cost = (money - itemsCost[i2]);
if (cost >= 0){
if (goodGuysArray.length < 60){
decreaseMoney(itemsCost[i2]);
filterDelay = 1;
itemsArray[i2].back.numberOrdered.text++;
if (upgrade1 == true){
itemsArray[i2].back.gotoAndStop(3);
} else {
itemsArray[i2].back.gotoAndStop(2);
};
Sounds.playSoundFx("clickBtnFx");
checkForAfford();
};
};
}
function turnMusicOff(){
var addd:MovieClip;
addd = inGameStatsMc["ingamestatsmc"];
addd = addd["wg"];
addd = addd["stats"];
addd["music"].gotoAndStop(2);
}
function doBuild(){
var i:*;
var cost:Number;
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(1);
statsMc.mine.gotoAndStop(1);
i = 0;
while (i < selectionArray.length) {
if (selectionArray[i].myName == "sniper"){
if (upgrade4 == true){
cost = (money - wallCost);
if (cost >= 0){
decreaseMoney(wallCost);
selectionArray[i].soldierState = 2;
setupWall(selectionArray[i]);
setupSoldierCommands();
};
};
};
i++;
};
}
function decreaseEnergy(dec:Number){
var risingScoreMc:*;
energy = (energy - dec);
if (energy < 0){
energy = 0;
};
if (energy > 60){
Player.mC.base.fence.gotoAndStop(1);
} else {
if (energy > 40){
Player.mC.base.fence.gotoAndStop(2);
} else {
if (energy > 10){
Player.mC.base.fence.gotoAndStop(3);
};
};
};
risingScoreMc = new GameRisingScore(rt, inGameScoreMc, dec);
inGameScoreMc.addChild(risingScoreMc);
risingScoreMc.x = Player.mC.x;
risingScoreMc.y = Player.mC.y;
if (filterDelay == 1){
Player.mC.filters = [glowFilter];
filterDelay = 10;
};
setEnergy();
}
public function doRetreatCommand(event:MouseEvent):void{
var i:*;
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(1);
i = 0;
while (i < selectionArray.length) {
selectionArray[i].soldierState = SOLDIER_STATE_RETREAT;
i++;
};
}
function setupBadGuys():void{
setupWave(wave);
wave++;
delayToWave = 200;
}
function musicBtn2(){
if (musicSwitch == false){
statsMc.musicMc.gotoAndStop("off");
} else {
statsMc.musicMc.gotoAndStop("on");
};
}
public function doMineCommandBtn(event:MouseEvent):void{
doMine();
}
function decreaseZombiesLeft(dec:Number){
zombiesLeftC = (zombiesLeftC - dec);
if (zombiesLeftC < 0){
zombiesLeftC = 0;
};
setZombiesLeft();
}
public function doDefendCommandBtn(event:MouseEvent):void{
doDefend();
}
function setBest(){
var addd:MovieClip;
addd = inGameStatsMc["ingamestatsmc"];
addd = addd["wg"];
addd = addd["stats"];
if (bestScore < 10){
addd.bestScore.text = ("0000" + bestScore);
} else {
if (bestScore < 100){
addd.bestScore.text = ("000" + bestScore);
} else {
if (bestScore < 1000){
addd.bestScore.text = ("00" + bestScore);
} else {
if (bestScore < 10000){
addd.bestScore.text = ("0" + bestScore);
} else {
addd.bestScore.text = bestScore;
};
};
};
};
}
function killAllGoodGuys(){
var i2:*;
i2 = (goodGuysArray.length - 1);
while (i2 >= 0) {
goodGuysArray[i2].remove();
i2--;
};
}
function scrollBackRight(){
scrollxPos = (scrollxPos + scrollvx);
if (scrollxPos > 0){
scrollxPos = 0;
scrollvx = 0;
spritesMc.x = 0;
} else {
spritesMc.x = (spritesMc.x + scrollvx);
inGameBackgroundMc2.x = (inGameBackgroundMc2.x + (scrollvx / 2));
inGameBackgroundMc.x = (inGameBackgroundMc.x + (scrollvx / 4));
};
}
function setMoney(){
statsMc.money.text = ((String(money) + "/") + moneyMax);
}
function increaseScore(increase){
score = int((score + increase));
if (score > 0){
setScore();
};
}
function setEnergy(){
statsMc.energy.text = String(energy);
if (filterDelay > 1){
filterDelay--;
if (filterDelay == 1){
Player.mC.filters = [];
};
};
}
public function setupPanel():void{
if (statsMc != null){
inGameStatsMc.removeChild(statsMc);
};
statsMc = new GameWeaponsPanel(this);
inGameStatsMc.addChild(statsMc);
statsMc.gunEnergy.gotoAndStop(1);
statsMc.y = (movieHeight - 77);
statsMc.msg.text = "Welcome Commander";
setupPanelItems();
}
function moveSelected(){
var i2:*;
var randomX:Number;
if (selectionArray[0] != Player){
i2 = 0;
while (i2 < selectionArray.length) {
selectionArray[i2].targetX = (root.mouseX - scrollxPos);
if (selectionArray.length > 1){
randomX = Useful.RandomNumber(1, 10);
randomX = (randomX - 5);
selectionArray[i2].targetX = (selectionArray[i2].targetX + randomX);
};
selectionArray[i2].soldierState = 5;
i2++;
};
};
}
function checkForGameOver(){
if (energy == 0){
gameOver("game_over");
} else {
if (zombiesLeftC == 0){
gameOver("level_complete");
};
};
}
function setLives(){
var addd:MovieClip;
addd = inGameStatsMc["ingamestatsmc"];
addd = addd["wg"];
addd = addd["stats"];
addd.lives.text = lives;
}
function clearSelection(){
var i2:*;
i2 = 0;
while (i2 < selectionArray.length) {
selectionArray[i2].mC.selectionMc.gotoAndStop(1);
i2++;
};
selectionArray = new Array();
}
function leftClick(){
var found:Boolean;
var i2:*;
found = false;
if (planeMc != null){
if (planeMc.hitTestPoint(stage.mouseX, stage.mouseY, true)){
planeMc.dropNow();
found = true;
};
};
if (found == false){
i2 = 0;
while (i2 < goodGuysArray.length) {
if (goodGuysArray[i2].mC.hitTestPoint(stage.mouseX, stage.mouseY, true)){
clearSelection();
selectGoodGuy(goodGuysArray[i2]);
found = true;
};
i2++;
};
if (found == false){
if (statsMc.quitBtn.hitTestPoint(stage.mouseX, stage.mouseY, true)){
quitGame();
} else {
if (statsMc.musicBtn.hitTestPoint(stage.mouseX, stage.mouseY, true)){
musicBtn();
} else {
if (statsMc.soundFxBtn.hitTestPoint(stage.mouseX, stage.mouseY, true)){
soundFxBtn();
} else {
if (statsMc.pausePanelBtn.hitTestPoint(stage.mouseX, stage.mouseY, true)){
rt.pauseGame();
} else {
releaseloc = null;
clickloc = new Point(stage.mouseX, stage.mouseY);
};
};
};
};
};
};
}
function killPlane(){
if (planeMc != null){
planeMc.myParent.removeChild(planeMc);
planeMc.stop();
planeMc = null;
};
}
function setupWall(soldierMc){
var wallMc:*;
wallMc = new GameWall(this, 100, soldierMc);
inGameEnemyMc.addChild(wallMc);
wallMc.x = soldierMc.mC.x;
wallMc.y = groundArray[wallMc.x];
wallsArray.push(wallMc);
}
function checkPanel(){
var i2:*;
i2 = 0;
while (i2 < itemsArray.length) {
if (itemsArray[i2].hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = panelItemsData[((i2 * 3) + 2)];
};
i2++;
};
if (statsMc.currentFrame == 1){
if (upgradeMc1.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Request soldiers quicker, $30";
} else {
if (upgradeMc2.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Body armour for soldiers, $40";
} else {
if (upgradeMc3.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Increase soldiers weapon fire rate, $40";
} else {
if (upgradeMc4.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Engineer able to build walls, $50";
} else {
if (upgradeMc5.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Engineer able to drop mines, $80";
} else {
if (upgradeMc6.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Upgrade Commander to Machine Gun, $140";
} else {
if (upgradeMc7.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Upgrade Commander to Artillery, $180";
} else {
if (upgradeMc8.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Upgrade base to Wire fencing, $120";
} else {
if (upgradeMc9.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Upgrade base to Stone wall, $200";
} else {
if (upgradeMc10.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Anti Zombie Injection, $140";
};
};
};
};
};
};
};
};
};
};
};
}
function setupSoldierCommands(){
var i:*;
if (selectionArray.length == 1){
if (selectionArray[0] != Player){
if (selectionArray[0].myName == "sniper"){
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(1);
if (upgrade4 == true){
if (money >= wallCost){
statsMc.build.gotoAndStop(3);
} else {
statsMc.build.gotoAndStop(2);
};
} else {
statsMc.build.gotoAndStop(1);
};
if (upgrade5 == true){
if (money >= mineCost){
statsMc.mine.gotoAndStop(3);
} else {
statsMc.mine.gotoAndStop(2);
};
} else {
statsMc.mine.gotoAndStop(1);
};
} else {
statsMc.mine.gotoAndStop(1);
statsMc.build.gotoAndStop(1);
if (selectionArray[0].soldierState == SOLDIER_STATE_ATTACK){
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(2);
} else {
statsMc.defend.gotoAndStop(2);
statsMc.attack.gotoAndStop(1);
};
};
};
} else {
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(1);
statsMc.mine.gotoAndStop(1);
statsMc.build.gotoAndStop(1);
i = 0;
while (i < selectionArray.length) {
if (selectionArray[i].myName == "sniper"){
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(1);
if (upgrade4 == true){
if (money >= wallCost){
statsMc.build.gotoAndStop(3);
} else {
statsMc.build.gotoAndStop(2);
};
} else {
statsMc.build.gotoAndStop(1);
};
if (upgrade5 == true){
if (money >= mineCost){
statsMc.mine.gotoAndStop(3);
} else {
statsMc.mine.gotoAndStop(2);
};
} else {
statsMc.mine.gotoAndStop(1);
};
} else {
if (selectionArray[0].soldierState == SOLDIER_STATE_ATTACK){
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(2);
} else {
statsMc.defend.gotoAndStop(2);
statsMc.attack.gotoAndStop(1);
};
};
i++;
};
};
}
function killAllExplosions(){
var i2:*;
i2 = (explosionsArray.length - 1);
while (i2 >= 0) {
explosionsArray[i2].remove();
i2--;
};
i2 = (particlesArray.length - 1);
while (i2 >= 0) {
particlesArray[i2].remove();
i2--;
};
}
function musicBtn(){
if (statsMc.musicMc.currentFrame == 1){
statsMc.musicMc.gotoAndStop("off");
rt.titleMusicChannel.stop();
} else {
statsMc.musicMc.gotoAndStop("on");
rt.titleMusicChannel = rt.titleMusic.play(0, 10000);
};
}
public function selectBase(){
clearSelection();
selectPlayer();
}
public function setupGoodGuy(panelBox):void{
Sounds.playSoundFx("jetPassFx");
if (planeMc == null){
planeMc = new GamePlane(inGamePickupsMc, this);
planeMc.x = 1700;
planeMc.y = -60;
planeMc.xVel = -8;
planeMc.soldierStart = Useful.RandomNumber(130, 200);
inGamePickupsMc.addChild(planeMc);
};
planeMc.soldierType.push(panelBox.parent.parent.itemsMc.currentFrame);
panelBox.parent.numberOrdered.text--;
}
public function doAttackCommandBtn(event:MouseEvent):void{
doAttack();
}
function doClock(){
clockDelay--;
if (clockDelay == 0){
clockDelay = 20;
countDown();
};
}
function countDown(){
sec--;
if (sec < 0){
minutes--;
sec = 59;
if (minutes < 0){
minutes = 0;
sec = 0;
gameOver("out_of_time");
};
};
}
function pauseOn(){
pauseSwitch = true;
}
function setupStartGameMsg(){
startGameMsgMc = new GameStartMsg(this);
inGameMsgsMc.addChild(startGameMsgMc);
startGameMsgMc.x = 140;
startGameMsgMc.y = 50;
}
function setupPanelItems(){
var i:*;
var upgradeX:*;
var upgradeY:*;
var upgradeWidth:*;
var itemMc:*;
itemsToBuyMc = new Sprite();
statsMc.addChild(itemsToBuyMc);
itemsToBuyMc.x = 13;
itemsToBuyMc.y = 23;
itemsArray = new Array();
i = 0;
while (i < numberOfStartItems) {
itemMc = new GamePanelBuyMc(this);
itemsToBuyMc.addChild(itemMc);
if (panelItemsData[((i * 3) + 1)] > money){
itemMc.gotoAndStop("notBuy");
};
itemsCost[i] = panelItemsData[((i * 3) + 1)];
itemMc.itemsMc.gotoAndStop((i + 1));
itemMc.x = (i * 43);
itemsArray.push(itemMc);
i++;
};
upgradeX = 170;
upgradeY = 41;
upgradeWidth = 30;
upgradeMc1 = new GameUpgrade(this);
statsMc.addChild(upgradeMc1);
upgradeMc1.x = upgradeX;
upgradeMc1.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade1 == true){
upgradeMc1.gotoAndStop(3);
upgradeMc1.back.gotoAndStop(3);
};
upgradeMc2 = new GameUpgrade2(this);
statsMc.addChild(upgradeMc2);
upgradeMc2.x = upgradeX;
upgradeMc2.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade2 == true){
upgradeMc2.gotoAndStop(3);
upgradeMc2.back.gotoAndStop(3);
};
upgradeMc3 = new GameUpgrade3(this);
statsMc.addChild(upgradeMc3);
upgradeMc3.x = upgradeX;
upgradeMc3.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade3 == true){
upgradeMc3.gotoAndStop(3);
upgradeMc3.back.gotoAndStop(3);
};
upgradeMc4 = new GameUpgrade4(this);
statsMc.addChild(upgradeMc4);
upgradeMc4.x = upgradeX;
upgradeMc4.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade4 == true){
upgradeMc4.gotoAndStop(3);
upgradeMc4.back.gotoAndStop(3);
};
upgradeMc5 = new GameUpgrade5(this);
statsMc.addChild(upgradeMc5);
upgradeMc5.x = upgradeX;
upgradeMc5.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade5 == true){
upgradeMc5.gotoAndStop(3);
upgradeMc5.back.gotoAndStop(3);
};
upgradeMc6 = new GameUpgrade6(this);
statsMc.addChild(upgradeMc6);
upgradeMc6.x = upgradeX;
upgradeMc6.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade6 == true){
upgradeMc6.gotoAndStop(3);
upgradeMc6.back.gotoAndStop(3);
};
upgradeMc7 = new GameUpgrade7(this);
statsMc.addChild(upgradeMc7);
upgradeMc7.x = upgradeX;
upgradeMc7.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade7 == true){
upgradeMc7.gotoAndStop(3);
upgradeMc7.back.gotoAndStop(3);
};
upgradeMc8 = new GameUpgrade8(this);
statsMc.addChild(upgradeMc8);
upgradeMc8.x = upgradeX;
upgradeMc8.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade8 == true){
upgradeMc8.gotoAndStop(3);
upgradeMc8.back.gotoAndStop(3);
};
upgradeMc9 = new GameUpgrade9(this);
statsMc.addChild(upgradeMc9);
upgradeMc9.x = upgradeX;
upgradeMc9.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade9 == true){
upgradeMc9.gotoAndStop(3);
upgradeMc9.back.gotoAndStop(3);
};
upgradeMc10 = new GameUpgrade10(this);
statsMc.addChild(upgradeMc10);
upgradeMc10.x = upgradeX;
upgradeMc10.y = upgradeY;
upgradeX = (upgradeX + upgradeWidth);
if (upgrade10 == true){
upgradeMc10.gotoAndStop(3);
upgradeMc10.back.gotoAndStop(3);
};
checkForAfford();
}
function killAllMissiles(){
var i2:*;
i2 = (missilesArray.length - 1);
while (i2 >= 0) {
missilesArray[i2].remove();
i2--;
};
}
function newLevelStuff(){
wave = 0;
}
public function scrollBackgroundLeft():void{
backMc.ground.x = (backMc.ground.x - 10);
}
function selectGoodGuy(goodGuy){
var selectionMc:*;
selectionMc = new manSelectionSquare();
goodGuy.mC.selectionMc.gotoAndStop(2);
selectionArray.push(goodGuy);
}
function doAttack(){
var i:*;
i = 0;
while (i < selectionArray.length) {
if (selectionArray[i].myName != "sniper"){
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(2);
selectionArray[i].soldierState = SOLDIER_STATE_ATTACK;
};
i++;
};
}
public function restartLevel(){
if (gameOverMsgMc != null){
inGameMsgsMc.removeChild(gameOverMsgMc);
};
gameOverMsgMc = null;
upgrade1 = oldUpgrade1;
upgrade2 = oldUpgrade2;
upgrade3 = oldUpgrade3;
upgrade4 = oldUpgrade4;
upgrade5 = oldUpgrade5;
upgrade6 = oldUpgrade6;
upgrade7 = oldUpgrade7;
upgrade8 = oldUpgrade8;
upgrade9 = oldUpgrade9;
upgrade10 = oldUpgrade10;
baseType = oldBaseType;
baseGunType = oldBaseGunType;
money = oldMoney;
energy = oldEnergy;
score = oldScore;
rt.gameState = 6;
killAllBadGuys();
killAllGoodGuys();
killAllMissiles();
killAllExplosions();
killAllMines();
killAllWalls();
killAllZombieParts();
if (levelCompleteMsg != null){
inGameMsgsMc.removeChild(levelCompleteMsg);
levelCompleteMsg = null;
};
backgroundLevelMc.removeChild(backMc);
backMc.stop();
backMc = null;
inGameBackgroundMc.removeChild(backSkyMc);
backSkyMc.stop();
backSkyMc = null;
spritesMc.x = 0;
newLevelStuff();
rt.setupMapScreen();
}
function displayTime(){
var addd:MovieClip;
if (sec < 10){
secDisplay = ("0" + sec);
} else {
secDisplay = String(sec);
};
if (minutes < 10){
minDisplay = ("0" + minutes);
} else {
minDisplay = String(minutes);
};
addd = inGameStatsMc["ingamestatsmc"];
addd = addd["wg"];
addd = addd["stats"];
addd.time.text = (((minDisplay + ":") + secDisplay) + "s");
}
function decreaseMoney(dec:Number){
money = (money - dec);
if (money < 0){
money = 0;
};
setMoney();
}
function setupSoldierZombie(xx){
var manMc:*;
var yy:*;
manMc = new GameZombie(inGameEnemyMc, this);
manMc.gotoAndStop(1);
inGameEnemyMc.addChild(manMc);
yy = groundArray[xx];
badGuysArray.push(new GameBadGuy(manMc, this, xx, yy, (0.5 / 10), Useful, badGuysArray.length, 210, "GameZombie", 10, "rock", 5, 10));
manMc.myObject = badGuysArray[(badGuysArray.length - 1)];
}
function killAllMines(){
var i2:*;
i2 = (minesArray.length - 1);
while (i2 >= 0) {
inGameEnemyMc.removeChild(minesArray[i2]);
i2--;
};
}
public function quitGame(){
Sounds.playSoundFx("gameOverFx");
killPlane();
killAllBadGuys();
killAllGoodGuys();
killAllMissiles();
killAllMines();
killAllWalls();
killAllZombieParts();
rt.gameState = 1;
killAllExplosions();
levelNumber = 1;
if (gameOverMsgMc != null){
inGameMsgsMc.removeChild(gameOverMsgMc);
};
gameOverMsgMc = null;
upgrade1 = false;
upgrade2 = false;
upgrade3 = false;
upgrade4 = false;
upgrade5 = false;
upgrade6 = false;
upgrade7 = false;
upgrade8 = false;
upgrade9 = false;
upgrade10 = false;
baseGunType = "rifle";
baseType = "wooden";
backgroundLevelMc.removeChild(backMc);
backMc.stop();
backMc = null;
inGameBackgroundMc.removeChild(backSkyMc);
backSkyMc.stop();
backSkyMc = null;
inGameBackgroundMc2.removeChild(backMc2);
backMc2.stop();
backMc2 = null;
playerMc.removeChildAt(0);
Player = null;
energy = 100;
(energyAlien == 100);
money = 0;
score = 0;
currentMoneyDelay = 40;
moneyDelay = currentMoneyDelay;
moneyMax = 100;
spritesMc.x = 0;
rt.setupTitleScreen();
}
function killAllZombieParts(){
var i2:*;
i2 = (zombiePartsArray.length - 1);
while (i2 >= 0) {
zombiePartsArray[i2].removeMC();
i2--;
};
}
function selectPlayer(){
var selectionMc:*;
selectionMc = new spaceGunSelection();
Player.mC.selectionMc.gotoAndStop(2);
selectionArray.push(Player);
statsMc.gotoAndStop(1);
setupPanelItems();
}
public function scrollBackgroundRight():void{
backMc.ground.x = (backMc.ground.x + 10);
}
function newArrays(){
missilesArray = new Array();
enemyArray = new Array();
goodGuysArray = new Array();
missilesArray = new Array();
badGuysArray = new Array();
tilesArray = new Array();
explosionsArray = new Array();
particlesArray = new Array();
pickupsArray = new Array();
zombiePartsArray = new Array();
minesArray = new Array();
wallsArray = new Array();
grenadeExArray = new Array();
groundArray = new Array();
itemsArray = new Array();
selectionArray = new Array();
}
function setZombiesLeft(){
statsMc.zombiesLeft.text = String(zombiesLeftC);
}
function setupWave(currentWave){
var badGuys:Array;
var i:*;
var manMc:*;
var xx:Number;
var zomType:Number;
var yy:*;
badGuys = badGuysLevels[(levelNumber - 1)];
i = 0;
while (i < badGuys[((currentWave * 9) + 1)]) {
manMc = new GameZombie(inGameEnemyMc, this);
manMc.gotoAndStop(1);
inGameEnemyMc.addChild(manMc);
xx = 1650;
zomType = Useful.RandomNumber(1, 8);
yy = groundArray[xx];
badGuysArray.push(new GameBadGuy(manMc, this, xx, yy, (badGuys[((currentWave * 9) + 5)] / 10), Useful, (i * 10), badGuys[((currentWave * 9) + 2)], badGuys[(currentWave * 9)], badGuys[((currentWave * 9) + 6)], badGuys[((currentWave * 9) + 7)], badGuys[((currentWave * 9) + 8)], zomType));
manMc.myObject = badGuysArray[(badGuysArray.length - 1)];
i++;
};
}
function doDefend(){
var i:*;
i = 0;
while (i < selectionArray.length) {
if (selectionArray[i].myName != "sniper"){
statsMc.attack.gotoAndStop(1);
statsMc.defend.gotoAndStop(2);
selectionArray[i].soldierState = SOLDIER_STATE_DEFEND;
selectionArray[i].speed = 0;
selectionArray[i].mC.gotoAndStop("stand");
};
i++;
};
}
function setupUpgrade4(){
upgradeMc4.gotoAndStop(3);
upgrade4 = true;
Sounds.playSoundFx("upgradeFx");
setupSoldierCommands();
}
function setupUpgrade5(){
upgrade5 = true;
upgradeMc5.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
setupSoldierCommands();
}
function setupUpgrade3(){
upgrade3 = true;
upgradeMc3.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
}
function setupUpgrade9(){
baseType = "stone";
Player.mC.base.gotoAndStop(baseType);
upgrade9 = true;
upgradeMc9.gotoAndStop(3);
upgrade8 = false;
upgradeMc8.gotoAndStop(1);
Sounds.playSoundFx("upgradeFx");
}
function setupUpgrade7(){
baseGunType = "artillery";
Player.mC.gotoAndStop(baseGunType);
upgrade7 = true;
upgrade6 = false;
upgradeMc6.gotoAndStop(1);
upgradeMc7.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
}
public function gameComplete(){
if (levelCompleteMsg != null){
inGameMsgsMc.removeChild(levelCompleteMsg);
levelCompleteMsg = null;
};
rt.gameState = 5;
Sounds.playSoundFx("gameOverFx");
increaseScore(money);
gameOverMsgMc = new GameOverMsgAnim(this);
inGameMsgsMc.addChild(gameOverMsgMc);
gameOverMsgMc.play();
gameOverMsgMc.x = (movieWidth / 2);
gameOverMsgMc.y = (movieHeight / 2);
}
function setupUpgrade1(){
upgradeMc1.gotoAndStop(3);
upgrade1 = true;
currentMoneyDelay = 30;
Sounds.playSoundFx("upgradeFx");
}
function setupUpgrade2(){
upgrade2 = true;
upgradeMc2.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
}
function setScore(){
if (score > 999999){
score = 999999;
};
if (score < 10){
statsMc.score.text = ("00000" + String(score));
} else {
if (score < 100){
statsMc.score.text = ("0000" + String(score));
} else {
if (score < 1000){
statsMc.score.text = ("000" + String(score));
} else {
if (score < 10000){
statsMc.score.text = ("00" + String(score));
} else {
if (score < 100000){
statsMc.score.text = ("0" + String(score));
} else {
statsMc.score.text = String(score);
};
};
};
};
};
}
function setupUpgrade8(){
baseType = "wire";
Player.mC.base.gotoAndStop(baseType);
upgrade8 = true;
upgradeMc8.gotoAndStop(3);
upgrade9 = false;
upgradeMc9.gotoAndStop(1);
Sounds.playSoundFx("upgradeFx");
}
function setupUpgrade10(){
upgrade10 = true;
upgradeMc10.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
}
function soundFxBtn2(){
if (soundsSwitch == false){
statsMc.soundFxMc.gotoAndStop("off");
} else {
statsMc.soundFxMc.gotoAndStop("on");
};
}
function increaseEnergy(dec:Number){
energy = (energy + dec);
if (energy > 10000){
energy = 10000;
};
setEnergy();
}
function setEnemies(){
}
function setupUpgrade6(){
upgrade6 = true;
baseGunType = "machineGun";
Player.mC.gotoAndStop(baseGunType);
upgradeMc6.gotoAndStop(3);
upgrade7 = false;
upgradeMc7.gotoAndStop(1);
Sounds.playSoundFx("upgradeFx");
}
function findSelected(){
var selectedArray2:Array;
var i2:*;
selectedArray2 = new Array();
if (clickloc != null){
if (clickloc.x < stage.mouseX){
i2 = 0;
while (i2 < goodGuysArray.length) {
if ((goodGuysArray[i2].mC.x + spritesMc.x) > clickloc.x){
if ((goodGuysArray[i2].mC.x + spritesMc.x) < stage.mouseX){
if (goodGuysArray[i2].mC.y > clickloc.y){
if (goodGuysArray[i2].mC.y < stage.mouseY){
selectedArray2.push(goodGuysArray[i2]);
};
};
};
};
i2++;
};
} else {
i2 = 0;
while (i2 < goodGuysArray.length) {
if ((goodGuysArray[i2].mC.x + spritesMc.x) > stage.mouseX){
if ((goodGuysArray[i2].mC.x + spritesMc.x) < clickloc.x){
if (goodGuysArray[i2].mC.y > clickloc.y){
if (goodGuysArray[i2].mC.y < stage.mouseY){
selectedArray2.push(goodGuysArray[i2]);
};
};
};
};
i2++;
};
};
if (selectedArray2.length > 0){
clearSelection();
i2 = 0;
while (i2 < selectedArray2.length) {
selectGoodGuy(selectedArray2[i2]);
i2++;
};
setupSoldierCommands();
} else {
if (selectionArray.length != 0){
moveSelected();
};
};
};
}
function checkForPanelClick(){
var i2:*;
var cost:Number;
if (statsMc.currentFrame == 1){
i2 = 0;
while (i2 < itemsArray.length) {
if (itemsArray[i2].hitTestPoint(stage.mouseX, stage.mouseY, true)){
cost = (money - itemsCost[i2]);
if (cost >= 0){
if (goodGuysArray.length < 60){
decreaseMoney(itemsCost[i2]);
filterDelay = 1;
itemsArray[i2].back.numberOrdered.text++;
if (upgrade1 == true){
itemsArray[i2].back.gotoAndStop(3);
} else {
itemsArray[i2].back.gotoAndStop(2);
};
Sounds.playSoundFx("clickBtnFx");
checkForAfford();
};
};
};
i2++;
};
if (upgradeMc1.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade1 == false){
if (upgradeMc1.back.currentFrame == 1){
cost = (money - upgradeCost1);
if (cost >= 0){
decreaseMoney(upgradeCost1);
upgradeMc1.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc2.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade2 == false){
if (upgradeMc2.back.currentFrame == 1){
cost = (money - upgradeCost2);
if (cost >= 0){
decreaseMoney(upgradeCost2);
upgradeMc2.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc3.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade3 == false){
if (upgradeMc3.back.currentFrame == 1){
cost = (money - upgradeCost3);
if (cost >= 0){
decreaseMoney(upgradeCost3);
upgradeMc3.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc4.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade4 == false){
if (upgradeMc4.back.currentFrame == 1){
cost = (money - upgradeCost4);
if (cost >= 0){
decreaseMoney(upgradeCost4);
upgradeMc4.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc5.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade5 == false){
if (upgradeMc5.back.currentFrame == 1){
cost = (money - upgradeCost5);
if (cost >= 0){
decreaseMoney(upgradeCost5);
upgradeMc5.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc6.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade6 == false){
if (upgradeMc6.back.currentFrame == 1){
cost = (money - upgradeCost6);
if (cost >= 0){
decreaseMoney(upgradeCost6);
upgradeMc6.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc7.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade7 == false){
if (upgradeMc7.back.currentFrame == 1){
cost = (money - upgradeCost7);
if (cost >= 0){
decreaseMoney(upgradeCost7);
upgradeMc7.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc8.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade8 == false){
if (upgradeMc8.back.currentFrame == 1){
cost = (money - upgradeCost8);
if (cost >= 0){
decreaseMoney(upgradeCost8);
upgradeMc8.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc9.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade9 == false){
if (upgradeMc9.back.currentFrame == 1){
cost = (money - upgradeCost9);
if (cost >= 0){
decreaseMoney(upgradeCost9);
upgradeMc9.back.gotoAndStop(2);
};
};
};
} else {
if (upgradeMc10.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade10 == false){
if (upgradeMc10.back.currentFrame == 1){
cost = (money - upgradeCost10);
if (cost >= 0){
decreaseMoney(upgradeCost10);
upgradeMc10.back.gotoAndStop(2);
};
};
};
};
};
};
};
};
};
};
};
};
};
};
if (statsMc.spaceGunUp.hitTestPoint(stage.mouseX, stage.mouseY, true)){
Player.rotateGunUp = true;
if (baseGunType == "artillery"){
Sounds.playSoundFx("mainGunRotSound");
};
} else {
if (statsMc.spaceGunDown.hitTestPoint(stage.mouseX, stage.mouseY, true)){
Player.rotateGunDown = true;
if (baseGunType == "artillery"){
Sounds.playSoundFx("mainGunRotSound");
};
} else {
if (statsMc.gunEnergy.hitTestPoint(stage.mouseX, stage.mouseY, true)){
Player.fireMissile();
};
};
};
}
function drawSquare(target, x1, y1, x2, y2){
target.graphics.moveTo(x1, y1);
target.graphics.lineTo(x2, y1);
target.graphics.lineTo(x2, y2);
target.graphics.lineTo(x1, y2);
target.graphics.lineTo(x1, y1);
}
function killAllBadGuys(){
var i2:*;
i2 = (badGuysArray.length - 1);
while (i2 >= 0) {
badGuysArray[i2].remove();
i2--;
};
}
function doMine(){
var i:*;
var cost:Number;
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(1);
statsMc.build.gotoAndStop(1);
i = 0;
while (i < selectionArray.length) {
if (selectionArray[i].myName == "sniper"){
if (upgrade5 == true){
cost = (money - mineCost);
if (cost >= 0){
decreaseMoney(mineCost);
selectionArray[i].soldierState = 2;
setupMine(selectionArray[i].mC.x);
setupSoldierCommands();
};
};
};
i++;
};
}
function setupAnts(){
marquee_mc = new MovieClip();
marchingAntsMc.addChild(marquee_mc);
}
function scrollBackLeft(){
scrollxPos = (scrollxPos + scrollvx);
if (scrollxPos < -((backMcWidth - movieWidth))){
scrollxPos = -((backMcWidth - movieWidth));
scrollvx = 0;
spritesMc.x = -((backMcWidth - movieWidth));
} else {
spritesMc.x = (spritesMc.x + scrollvx);
inGameBackgroundMc2.x = (inGameBackgroundMc2.x + (scrollvx / 2));
inGameBackgroundMc.x = (inGameBackgroundMc.x + (scrollvx / 4));
};
}
function setupBackground(){
inGameZExplosionsMc = new Sprite();
backgroundLevelMc.addChild(inGameZExplosionsMc);
backMc = new backgroundMc();
backgroundLevelMc.addChild(backMc);
backMc.ground.gotoAndStop(levelNumber);
backMc.gotoAndStop(levelNumber);
backSkyMc = new backgroundSkyMc();
backSkyMc.cacheAsBitmap = true;
backSkyMc.gotoAndStop(levelNumber);
backSkyMc.filters = [bf2];
inGameBackgroundMc.addChild(backSkyMc);
if (levelNumber == levelStart){
backMc2 = new backgroundP();
backMc2.cacheAsBitmap = true;
inGameBackgroundMc2.addChild(backMc2);
inGameBackgroundMc2.filters = [bf];
};
backMc2.gotoAndStop(levelNumber);
calcGroundPoints();
Sounds.playSoundFx("startGameFx");
spritesMc.x = -400;
inGameBackgroundMc.x = 0;
inGameBackgroundMc2.x = -300;
inGameBackgroundMc2.y = 200;
scrollxPos = spritesMc.x;
}
function pauseOff(){
pauseSwitch = false;
rt.gameState = "play";
}
function turnMusicOn(){
var addd:MovieClip;
addd = inGameStatsMc["ingamestatsmc"];
addd = addd["wg"];
addd = addd["stats"];
addd["music"].gotoAndStop(1);
}
public function gameOverLoop(){
if (levelCompleteMsg != null){
levelCompleteMsg.play();
};
}
function increaseMoney(dec:Number){
money = (money + dec);
if (money > 10000){
money = 10000;
};
setMoney();
checkForAfford();
}
function doBlurEffect(){
bmd.draw(inGameColourMc);
bmd.applyFilter(bmd, bmd.rect, new Point(0, 0), bf);
bmd.applyFilter(bmd, bmd.rect, new Point(0, 0), cmf);
}
function setupPlayer(){
var mC:MovieClip;
mC = new playerSprite();
playerMc.addChild(mC);
Player = new GamePlayer(mC, this, 50, (groundArray[50] - 70), Useful);
}
function setSelectedAmount(){
}
public function mainLoop(){
var i2:int;
var i:*;
var maxScrollSpeedNeg:Number;
levelTime++;
doMoneyIncrease();
doMarching();
Player.mainLoop();
checkPanel();
i2 = 0;
while (i2 < badGuysArray.length) {
badGuysArray[i2].mainLoop();
i2++;
};
i2 = 0;
while (i2 < goodGuysArray.length) {
goodGuysArray[i2].mainLoop();
i2++;
};
i2 = 0;
while (i2 < missilesArray.length) {
missilesArray[i2].mainLoop();
i2++;
};
i2 = (missilesArray.length - 1);
while (i2 >= 0) {
if (missilesArray[i2].dead == true){
missilesArray.splice(i2, 1);
};
i2--;
};
i2 = 0;
while (i2 < explosionsArray.length) {
explosionsArray[i2].mainLoop();
i2++;
};
i = 0;
while (i < particlesArray.length) {
particlesArray[i].mainLoop();
i++;
};
i = 0;
while (i < zombiePartsArray.length) {
zombiePartsArray[i].mainLoop();
i++;
};
i = 0;
while (i < zombiePartsArray.length) {
if (zombiePartsArray[i].dead2 == true){
zombiePartsArray.splice(i, 1);
};
i++;
};
if (planeMc != null){
planeMc.mainLoop();
};
runWave();
setEnergy();
setMoney();
setZombiesLeft();
setScore();
if (stage.mouseY < (500 - 77)){
if (stage.mouseX > 650){
scrollScreen = "left";
} else {
if (stage.mouseX < 50){
scrollScreen = "right";
} else {
if (rt.keyPressDown == false){
scrollScreen = "";
};
};
};
};
if (scrollScreen == "left"){
scrollvx = (scrollvx - 8);
maxScrollSpeedNeg = -(maxScrollSpeed);
if (scrollvx < maxScrollSpeedNeg){
scrollvx = maxScrollSpeedNeg;
};
scrollBackLeft();
} else {
if (scrollScreen == "right"){
scrollvx = (scrollvx + 8);
if (scrollvx > maxScrollSpeed){
scrollvx = maxScrollSpeed;
};
scrollBackRight();
} else {
if (rt.keyPressDown == false){
if (scrollvx > 0){
scrollvx = (scrollvx - 2);
if (scrollvx < 1){
scrollvx = 0;
} else {
scrollBackRight();
};
} else {
if (scrollvx < 0){
scrollvx = (scrollvx + 2);
if (scrollvx > -1){
scrollvx = 0;
} else {
scrollBackLeft();
};
};
};
};
};
};
checkForGameOver();
}
public function gameOver(gameOverType){
if (gameOverType == "game_over"){
rt.gameState = 5;
Sounds.playSoundFx("gameOverFx");
increaseScore(money);
gameOverMsgMc = new GameOverMsgAnim(this);
inGameMsgsMc.addChild(gameOverMsgMc);
gameOverMsgMc.play();
gameOverMsgMc.x = (movieWidth / 2);
gameOverMsgMc.y = (movieHeight / 2);
} else {
Sounds.playSoundFx("levelCompleteFx");
increaseScore(money);
rt.gameState = 5;
levelCompleteMsg = new GameLevelComplete(this);
inGameMsgsMc.addChild(levelCompleteMsg);
levelCompleteMsg.x = (movieWidth / 2);
levelCompleteMsg.y = ((movieHeight / 2) - 60);
killPlane();
killAllBadGuys();
killAllGoodGuys();
killAllMissiles();
killAllMines();
killAllWalls();
killAllZombieParts();
};
}
}
}//package classesAS3
Section 6
//GameGoodGuy (classesAS3.GameGoodGuy)
package classesAS3 {
import flash.display.*;
import flash.filters.*;
public class GameGoodGuy {
var xVel:Number;// = 0
var dead:Boolean;
var energy:Number;// = 0
var hitVel;
var yPos:Number;// = 0
var myFireDelay:Number;
var inToGround:Number;
var energyBarOn:Number;
var numberOfMissiles;// = 0
var soldierState:int;
var Useful:GameUseful;
var energyStart:Number;// = 0
var myDamage:Number;
var xPos:Number;// = 0
var range:Number;
var rt:Object;
var energyMc:MovieClip;
var myScore:Number;
var speed:Number;// = 0
var xOrigin:Number;// = 0
var gravity:Number;
var missileName:String;
var delayToFireMissile:Number;// = 1
var myName:String;
var projectileMc:Object;
var speedOld:Number;
var energyBarMc:GameEnergyBar;
var yVel:Number;// = 0
var glowFilter:GlowFilter;
var targetX:Number;
var targetY:Number;
var distanceArray:Array;
var myRange:Number;
var filterDelay:Number;
var xDir:Number;
var myParent:Object;
var mC:Object;
var yOrigin:Number;// = 0
public static const SOLDIER_STATE_DEFEND:int = 1;
public static const SOLDIER_STATE_RETREAT:int = 3;
public static const SOLDIER_E_MOVE:int = 5;
public static const SOLDIER_STATE_CRYSTAL:int = 2;
public static const SOLDIER_E_STAND:int = 0;
public static const SOLDIER_STATE_ATTACK:int = 0;
public static const SOLDIER_STATE_MOVE:int = 5;
public static const SOLDIER_E_BUILD:int = 2;
public static const SOLDIER_STATE_FALLING:int = 4;
public function GameGoodGuy(rt2, xStart, yStart, sp, spriteType, myP, uu, mR, mS){
var rangeVary:Number;
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
speed = 0;
energyStart = 0;
energy = 0;
delayToFireMissile = 1;
numberOfMissiles = 0;
super();
rt = rt2;
if (spriteType == "man"){
mC = new man();
rt.inGameGoodGuysMc.addChild(mC);
myDamage = 5;
myFireDelay = 30;
} else {
if (spriteType == "rocket"){
rt.inGameGoodGuysMc.addChild(mC);
myDamage = 20;
myFireDelay = 30;
} else {
if (spriteType == "grenader"){
mC = new GameManGrenader(this);
myDamage = 7;
myFireDelay = 60;
rt.inGameGoodGuysMc.addChild(mC);
} else {
if (spriteType == "sniper"){
mC = new sniper();
rt.inGameGoodGuysMc.addChild(mC);
myDamage = 20;
myFireDelay = 60;
} else {
if (spriteType == "heavyGunner"){
rt.inGameGoodGuysMc.addChild(mC);
myDamage = 2;
myFireDelay = 60;
};
};
};
};
};
mC.gotoAndStop("falling");
Useful = uu;
rangeVary = Useful.RandomNumber(1, 10);
rangeVary = (rangeVary - 10);
myRange = (mR + rangeVary);
missileName = mS;
dead = false;
inToGround = 0;
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
myParent = myP;
hitVel = 0;
energyBarOn = 0;
gravity = 0.1;
rangeVary = Useful.RandomNumber(1, 10);
rangeVary = (rangeVary / 100);
sp = (sp + rangeVary);
speed = sp;
speedOld = sp;
xDir = 1;
mC.scaleX = -1;
distanceArray = new Array();
glowFilter = new GlowFilter(0xFFFFFF, 1, 3, 3, 3, 1);
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
myName = spriteType;
soldierState = SOLDIER_STATE_FALLING;
filterDelay = 1;
updatePosition();
targetX = mC.x;
}
function applyGravity(){
yVel = (yVel + gravity);
}
function remove(){
var arrayIndex:Number;
var i1:*;
arrayIndex = 0;
i1 = 0;
while (i1 < rt.goodGuysArray.length) {
if (this == rt.goodGuysArray[i1]){
arrayIndex = i1;
};
i1++;
};
rt.inGameGoodGuysMc.removeChild(mC);
rt.goodGuysArray.splice(arrayIndex, 1);
}
function updatePosition(){
xPos = (xPos + hitVel);
hitVel = 0;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
}
function mainLoop(){
var dist:*;
var myRange2:*;
var makeZombie:Number;
if (dead == false){
if (filterDelay > 1){
filterDelay--;
if (filterDelay == 1){
mC.filters = [];
};
};
if (soldierState == SOLDIER_STATE_FALLING){
applyGravity();
checkForLanding();
updatePosition();
} else {
if (myName == "sniper"){
if (soldierState == SOLDIER_E_MOVE){
dist = Useful.getDistanceQ(mC.x, mC.y, targetX, mC.y);
if (dist < 5){
mC.gotoAndStop("stand");
speed = 0;
} else {
if (mC.currentFrame != 1){
mC.gotoAndStop("walk");
};
if (mC.x < targetX){
speed = -2;
xDir = -1;
mC.scaleX = 1;
} else {
speed = -2;
xDir = 1;
mC.scaleX = -1;
};
};
applyGravity();
checkForGround();
} else {
if (soldierState == SOLDIER_E_BUILD){
if (mC.currentFrame != 7){
mC.gotoAndStop("build");
};
speed = 0;
applyGravity();
checkForGround();
};
};
} else {
if (soldierState == SOLDIER_STATE_MOVE){
dist = Useful.getDistanceQ(mC.x, mC.y, targetX, mC.y);
if (dist < 5){
if (rt.badGuysArray.length > 0){
findEnemyTarget();
if (distanceArray.length > 0){
speed = 0;
checkForFire();
if (mC.currentFrame != 4){
if (myName == "grenader"){
if (mC.currentFrame != 3){
mC.gotoAndStop("stand");
};
} else {
mC.gotoAndStop("gunStand");
};
};
} else {
mC.gotoAndStop("stand");
speed = 0;
};
};
} else {
if (mC.currentFrame != 1){
mC.gotoAndStop("walk");
};
if (mC.x < targetX){
speed = -2;
xDir = -1;
mC.scaleX = 1;
} else {
speed = -2;
xDir = 1;
mC.scaleX = -1;
};
};
applyGravity();
checkForGround();
} else {
if (soldierState == SOLDIER_STATE_ATTACK){
if (rt.badGuysArray.length > 0){
findEnemy();
if (distanceArray.length > 0){
myRange2 = myRange;
if (distanceArray[0].dist < myRange2){
if (mC.currentFrame != 4){
if (myName == "grenader"){
if (mC.currentFrame != 3){
mC.gotoAndStop("stand");
};
} else {
mC.gotoAndStop("gunStand");
};
};
speed = 0;
checkForFire();
} else {
speed = speedOld;
if (mC.currentFrame != 1){
mC.gotoAndStop("walk");
};
if (mC.x > distanceArray[0].distSprite.mC.x){
xDir = -1;
mC.scaleX = 1;
} else {
xDir = 1;
mC.scaleX = -1;
};
};
} else {
mC.gotoAndStop("stand");
speed = 0;
};
} else {
speed = speedOld;
if (mC.currentFrame != 1){
mC.gotoAndStop("walk");
mC.scaleX = -1;
xDir = 1;
};
};
applyGravity();
checkForGround();
} else {
if (soldierState == SOLDIER_STATE_DEFEND){
if (rt.badGuysArray.length > 0){
findEnemyTarget();
};
speed = 0;
if (distanceArray.length > 0){
myRange2 = myRange;
if (distanceArray[0].dist < myRange2){
if (mC.currentFrame != 4){
if (myName == "grenader"){
if (mC.currentFrame != 3){
mC.gotoAndStop("stand");
};
} else {
mC.gotoAndStop("gunStand");
};
};
speed = 0;
checkForFire();
} else {
speed = speedOld;
if (mC.x > distanceArray[0].distSprite.mC.x){
xDir = -1;
mC.scaleX = 1;
} else {
xDir = 1;
mC.scaleX = -1;
};
};
} else {
mC.gotoAndStop("stand");
speed = 0;
};
applyGravity();
checkForGround();
};
};
};
};
updatePosition();
};
} else {
inToGround++;
if (inToGround > 100){
if (rt.upgrade10 == false){
makeZombie = Useful.RandomNumber(1, 100);
if (makeZombie > 50){
rt.setupSoldierZombie(mC.x);
};
};
remove();
} else {
yVel = 0.1;
xVel = 0;
updatePosition();
};
};
}
public function throwGrenade(){
var spriteData:Object;
var targetObj:Object;
targetObj = distanceArray[0].distSprite;
projectileMc = new grenadeMc();
rt.inGameMissilesMc.addChild(projectileMc);
if (distanceArray[0].distSprite == rt.alienBaseMc){
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, targetObj.x, targetObj.y);
} else {
spriteData = Useful.getArcVelocity(2, 16, mC.x, mC.y, targetObj.mC.x, targetObj.mC.y);
};
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, spriteData, 16, this, myDamage));
}
function decreaseEnergy(missileX, damage){
var risingScoreMc:*;
var e:Number;
if (myName == "man"){
damage = (damage + 10);
};
if (rt.upgrade2 == true){
damage = int((damage / 2));
filterDelay = 10;
mC.filters = [glowFilter];
};
energy = (energy - damage);
if (energyBarOn == 0){
energyBarOn = 1;
energyBarMc = new GameEnergyBar(this);
mC.addChild(energyBarMc);
};
risingScoreMc = new GameRisingScore(rt, rt.inGameScoreMc, damage);
rt.inGameScoreMc.addChild(risingScoreMc);
risingScoreMc.x = mC.x;
risingScoreMc.y = (mC.y - 10);
energyBarMc.x = 0;
energyBarMc.y = -35;
e = (energy / 10);
energyBarMc.bar.bar.y = int((10 - e));
if (energy <= 0){
inToGround = 0;
dead = true;
rt.Sounds.playSoundFx("explosionFx");
if (xDir < 0){
if (missileX > mC.x){
mC.gotoAndStop("deathBack");
hitVel = 14;
} else {
mC.gotoAndStop("deathBack");
hitVel = -14;
};
} else {
if (missileX > mC.x){
mC.gotoAndStop("deathBack");
hitVel = -14;
} else {
hitVel = 14;
mC.gotoAndStop("deathBack");
};
};
} else {
if (xDir < 0){
if (missileX > mC.x){
mC.gotoAndStop("hit");
hitVel = -4;
} else {
mC.gotoAndStop("hit");
hitVel = 4;
};
} else {
if (missileX > mC.x){
mC.gotoAndStop("hit");
hitVel = -4;
} else {
hitVel = 4;
mC.gotoAndStop("hit");
};
};
if (missileName == "Photon"){
hitVel = int((hitVel / 2));
};
};
updatePosition();
}
function checkForGround():void{
var xm:Number;
var ym:Number;
var yy:Number;
xm = int(mC.x);
ym = (mC.y + rt.spritesMc.y);
yy = rt.groundArray[xm];
if (ym > yy){
ym = (ym - yy);
yVel = (yVel - ym);
};
xVel = (xDir * speed);
updatePosition();
xm = int(mC.x);
ym = (mC.y + rt.spritesMc.y);
if (ym > yy){
ym = (ym - yy);
yPos = (yPos - ym);
yVel = 0;
};
if (xPos > 1500){
xDir = -1;
} else {
if (xPos < 5){
xDir = 1;
};
};
if (xVel > 0){
mC.scaleX = -1;
} else {
if (xVel < 0){
mC.scaleX = 1;
};
};
}
function findEnemy(){
var i2:int;
var distanceObject:Object;
distanceArray = new Array();
i2 = 0;
while (i2 < rt.badGuysArray.length) {
if (rt.badGuysArray[i2].dead == false){
distanceObject = new Object();
distanceObject.distSprite = rt.badGuysArray[i2];
distanceObject.dist = Useful.getDistanceQ(mC.x, mC.y, rt.badGuysArray[i2].mC.x, rt.badGuysArray[i2].mC.y);
distanceArray.push(distanceObject);
};
i2++;
};
distanceArray.sortOn("dist", Array.NUMERIC);
}
public function checkForTower():void{
var yVel2:Number;
var yVel3:Number;
var xm:Number;
var ym:Number;
var i:*;
yVel2 = yVel;
yVel3 = yVel;
if (yVel3 < 0){
yVel3 = ((yVel3 - yVel3) - yVel3);
};
xm = (mC.x + rt.spritesMc.x);
ym = (mC.y + rt.spritesMc.y);
ym = (ym - 2);
i = 0;
while (i < int(yVel3)) {
if (myParent.mC.hitTestPoint(xm, (ym + i), true)){
yVel = (yVel - int(yVel2));
yVel = (i + yVel);
gravity = 0;
mC.gotoAndStop("stand");
break;
};
i++;
};
}
function checkForLanding(){
var xm:Number;
var ym:Number;
var yy:Number;
xm = int(mC.x);
ym = (mC.y + rt.spritesMc.y);
yy = rt.groundArray[xm];
if (ym > yy){
if (myName == "sniper"){
soldierState = SOLDIER_E_MOVE;
} else {
soldierState = SOLDIER_STATE_DEFEND;
};
};
}
function findEnemyBase(){
var distanceObject:Object;
distanceArray = new Array();
distanceObject = new Object();
distanceObject.distSprite = rt.alienBaseMc;
distanceObject.dist = Useful.getDistanceQ(mC.x, mC.y, distanceObject.distSprite.x, distanceObject.distSprite.y);
if (distanceObject.dist < myRange){
if (myName == "grenader"){
distanceArray.push(distanceObject);
} else {
if (Useful.checkForLOS(mC.x, mC.y, distanceObject.distSprite.x, distanceObject.distSprite.y, distanceObject.distSprite) == false){
distanceArray.push(distanceObject);
};
};
};
}
function checkForFire(){
var myFireDelay2:*;
var targetObj:Object;
var spriteData:Object;
if (missileName == "Photon"){
delayToFireMissile--;
if (delayToFireMissile > 0){
mC.gotoAndStop("shoot");
targetObj = distanceArray[0].distSprite;
projectileMc = new Photon();
rt.inGameMissilesMc.addChild(projectileMc);
if (targetObj.myName == "badGuyRollingBomb"){
spriteData = Useful.pointTowards(targetObj.mC.x, (targetObj.mC.y - 10), mC.x, (mC.y - 50));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 50), missileName, Useful, spriteData, 20, this, myDamage));
} else {
spriteData = Useful.pointTowards(targetObj.mC.x, (targetObj.mC.y - 20), mC.x, (mC.y - 50));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 50), missileName, Useful, spriteData, 20, this, myDamage));
};
} else {
if (delayToFireMissile < -(myFireDelay)){
delayToFireMissile = myFireDelay;
};
};
} else {
delayToFireMissile--;
if (delayToFireMissile == 0){
myFireDelay2 = myFireDelay;
if (rt.upgrade3 == true){
myFireDelay2 = int((myFireDelay / 1.5));
};
delayToFireMissile = myFireDelay2;
mC.gotoAndStop("shoot");
targetObj = distanceArray[0].distSprite;
if (targetObj.mC.x > mC.x){
xDir = 1;
mC.scaleX = -1;
} else {
xDir = -1;
mC.scaleX = 1;
};
if (missileName == "bullet"){
rt.Sounds.playSoundFx("pistolFx");
projectileMc = new bullet();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.pointTowards(targetObj.mC.x, (targetObj.mC.y - 20), mC.x, (mC.y - 15));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 20), missileName, Useful, spriteData, 16, this, myDamage));
} else {
if (missileName == "rocket"){
rt.Sounds.playSoundFx("fireMissileFx");
projectileMc = new rocket();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.pointTowards(targetObj.mC.x, targetObj.mC.y, mC.x, (mC.y - 5));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 30), missileName, Useful, spriteData, 16, this, myDamage));
} else {
if (missileName == "grenade"){
rt.Sounds.playSoundFx("throwFx");
projectileMc = new projectiles();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.getArcVelocity(1, 8, mC.x, (mC.y - 10), targetObj.mC.x, (targetObj.mC.y - 10));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, spriteData, 16, this, myDamage));
} else {
projectileMc = new projectiles();
rt.inGameMissilesMc.addChild(projectileMc);
spriteData = Useful.getArcVelocity(6, 26, mC.x, mC.y, targetObj.mC.x, targetObj.mC.y);
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, spriteData, 16, this, myDamage));
};
};
};
};
};
}
function findEnemyTarget(){
var i2:int;
var noCheck:Boolean;
var distanceObject:Object;
var myRange2:*;
distanceArray = new Array();
i2 = 0;
while (i2 < rt.badGuysArray.length) {
if (rt.badGuysArray[i2].dead == false){
noCheck = false;
distanceObject = new Object();
distanceObject.distSprite = rt.badGuysArray[i2];
distanceObject.dist = Useful.getDistanceQ(mC.x, mC.y, rt.badGuysArray[i2].mC.x, rt.badGuysArray[i2].mC.y);
myRange2 = myRange;
if (distanceObject.dist < myRange2){
if (myName == "grenader"){
distanceArray.push(distanceObject);
} else {
if (Useful.checkForLOS(mC.x, (mC.y - 5), distanceObject.distSprite.mC.x, (distanceObject.distSprite.mC.y - 25), distanceObject.distSprite.mC) == false){
distanceArray.push(distanceObject);
};
};
};
};
i2++;
};
distanceArray.sortOn("dist", Array.NUMERIC);
}
}
}//package classesAS3
Section 7
//GameIntroAnim (classesAS3.GameIntroAnim)
package classesAS3 {
import flash.display.*;
import flash.events.*;
public class GameIntroAnim extends MovieClip {
var rt:Object;
public var minijuegos:MovieClip;
public function GameIntroAnim(rt2){
super();
addFrameScript(0, frame1, 1, frame2);
rt = rt2;
this.play();
}
function frame1(){
stop();
}
function frame2(){
this.rt.introFinished();
stop();
}
}
}//package classesAS3
Section 8
//GameLevelComplete (classesAS3.GameLevelComplete)
package classesAS3 {
import flash.display.*;
public class GameLevelComplete extends MovieClip {
public var rt:Object;
public var msg:MovieClip;
public var howWellDone:Number;
public function GameLevelComplete(rt2){
super();
addFrameScript(0, frame1, 14, frame15, 30, frame31, 98, frame99);
rt = rt2;
howWellDone = 1;
this.play();
}
function frame15(){
msg.scoreBonus.text = String(this.rt.money);
if (this.rt.levelTime < 7000){
msg.timeBonus.text = String((1000 * (this.rt.levelNumber / 10)));
} else {
if (this.rt.levelTime < 8000){
msg.timeBonus.text = String((800 * (this.rt.levelNumber / 10)));
} else {
if (this.rt.levelTime < 9000){
msg.timeBonus.text = String((600 * (this.rt.levelNumber / 10)));
} else {
if (this.rt.levelTime < 10000){
msg.timeBonus.text = String((400 * (this.rt.levelNumber / 10)));
} else {
if (this.rt.levelTime < 11000){
msg.timeBonus.text = String((200 * (this.rt.levelNumber / 10)));
} else {
if (this.rt.levelTime < 12000){
msg.timeBonus.text = String((100 * (this.rt.levelNumber / 10)));
} else {
msg.timeBonus.text = "0";
};
};
};
};
};
};
this.rt.score = (this.rt.score + Number(msg.timeBonus.text));
msg.totalScore.text = String(this.rt.score);
}
function frame1(){
play();
}
function frame31(){
}
function frame99(){
if (this.rt.levelNumber == this.rt.levelMax){
this.rt.gameComplete();
} else {
this.rt.endLevelStuff();
};
stop();
}
}
}//package classesAS3
Section 9
//GameLoop (classesAS3.GameLoop)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import mochi.as3.*;
import flash.media.*;
import flash.text.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import flash.ui.*;
public dynamic class GameLoop extends MovieClip {
public var gperc2:Number;// = 0
public var pauseScreen:pauseMc;
public var mouseNumberDown:Number;
public var mapScreen2:GameMapScreen;
public var gskip:Number;// = 0
public var leaderBoardDone:Boolean;// = false
public var mochiId:String;// = "093bb782be5c7833"
public var MindJolt_Site:Boolean;// = false
public var introAnim:GameIntroAnim;
public var titleMusic:SoundMusic1;
public var percentLoaded:int;
public var Useful:GameUseful;
public var domain:String;
var FPS:TextField;
public var titleScreen:GameTitleScreen;
public var GameMain:GameGame;
public var loaderStarted:Boolean;// = false
public var loadingBox:LoadingBox;
public var CPMStarCode:String;// = "521Q49EF9CAC"
public var titleStarted:Boolean;// = false
public var mochiScoreId:String;// = "ab3c4af5d1b31ca7"
var Memory:TextField;
public var Kongregate_Site:Boolean;// = false
public var mochiOn:Boolean;// = false
public var mainBtnsSetup;
public var ArcadeBomb_Site:Boolean;// = false
public var titleMusicChannel:SoundChannel;
public var allowed_site:String;// = "arcadebomb.com"
var Instructions:TextField;
public var gperc:Number;// = 0
public var gameState:int;// = 0
public var policyLoaded:Boolean;// = false
var currentTime:int;// = 0
public var keyPressDown:Boolean;// = false
public static const STATE_SYSTEM_MOCHI:int = 2;
public static const STATE_SYSTEM_NEW_LEVEL:int = 7;
public static const STATE_SYSTEM_GAME_COMPLETE:int = 6;
public static const STATE_SYSTEM_SETUP_GAME:int = 8;
public static const STATE_SYSTEM_INTRO:int = 9;
public static const STATE_SYSTEM_PAUSE:int = 4;
public static const STATE_SYSTEM_LOADER:int = 0;
public static const STATE_SYSTEM_TITLE:int = 1;
public static const STATE_SYSTEM_PLAY:int = 3;
public static const STATE_SYSTEM_GAME_OVER:int = 5;
public function GameLoop():void{
policyLoaded = false;
mochiOn = false;
mochiId = "093bb782be5c7833";
mochiScoreId = "ab3c4af5d1b31ca7";
CPMStarCode = "521Q49EF9CAC";
gameState = STATE_SYSTEM_LOADER;
loaderStarted = false;
titleStarted = false;
gperc = 0;
gperc2 = 0;
gskip = 0;
currentTime = 0;
FPS = new TextField();
Instructions = new TextField();
Memory = new TextField();
allowed_site = "arcadebomb.com";
MindJolt_Site = false;
Kongregate_Site = false;
ArcadeBomb_Site = false;
keyPressDown = false;
leaderBoardDone = false;
super();
addFrameScript(0, frame1, 2, frame3);
if (Kongregate_Site == true){
//unresolved jump
};
MochiBot.track(this, "a6754153");
mouseNumberDown = 0;
mainBtnsSetup = false;
MochiServices.connect(mochiId, this);
Useful = new GameUseful(root);
GameMain = new GameGame(root, 700, 500, (700 * 2), 500, 3, Useful, 10);
addChild(GameMain);
addEventListener(Event.ENTER_FRAME, runGame);
stage.addEventListener(KeyboardEvent.KEY_UP, keyListener);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyListenerDown);
}
public function doTitleScreenStuff(){
if (titleMusicChannel == null){
titleMusicChannel = titleMusic.play(0, 10000);
};
titleScreen.playBtn.addEventListener(MouseEvent.MOUSE_UP, doMapScreen);
mainBtnsSetup = true;
leaderBoardDone = false;
titleScreen.instructionsBtn.addEventListener(MouseEvent.MOUSE_UP, doInstScreen);
titleScreen.controlsBtn.addEventListener(MouseEvent.MOUSE_UP, doControlsScreen);
titleScreen.musicBtn.addEventListener(MouseEvent.MOUSE_UP, doSoundBtn);
}
public function showLeaderBoard2(msgMc){
var o:Object;
var boardID:String;
var msgMc = msgMc;
o = {n:[5, 4, 9, 9, 5, 14, 9, 14, 0, 11, 2, 7, 8, 1, 7, 7], f:function (i:Number, s:String):String{
if (s.length == 16){
return (s);
};
return (this.f((i + 1), (s + this.n[i].toString(16))));
}};
boardID = o.f(0, mochiScoreId);
MochiScores.showLeaderboard({boardID:boardID, onClose:leadboardClose()});
}
public function showLeaderBoard(msgMc){
var o:Object;
var boardID:String;
var msgMc = msgMc;
o = {n:[5, 4, 9, 9, 5, 14, 9, 14, 0, 11, 2, 7, 8, 1, 7, 7], f:function (i:Number, s:String):String{
if (s.length == 16){
return (s);
};
return (this.f((i + 1), (s + this.n[i].toString(16))));
}};
boardID = o.f(0, mochiScoreId);
MochiScores.showLeaderboard({boardID:boardID, score:GameMain.score, onClose:msgMc.play});
}
public function doControlsScreen(event:MouseEvent):void{
titleScreen.gotoAndStop("controls");
}
public function setupTitleScreen(){
titleScreen = new GameTitleScreen(this);
titleScreen.x = 0;
addChild(titleScreen);
titleScreen.playBtn.addEventListener(MouseEvent.MOUSE_UP, doMapScreen);
if (GameMain.musicSwitch == false){
GameMain.musicSwitch = true;
titleMusic = new SoundMusic1();
titleMusicChannel = null;
} else {
if (titleMusic == null){
titleMusic = new SoundMusic1();
titleMusicChannel = null;
};
};
titleScreen.highScoresBtn2.addEventListener(MouseEvent.MOUSE_UP, showHighScores);
}
public function doScoresBtns(){
titleScreen.backBtn.addEventListener(MouseEvent.MOUSE_UP, doLastScoreScreen);
}
public function contGame(){
removeChild(loadingBox);
loadingBox = null;
finishPreload();
}
public function showLeaderboard(gameOverMc){
}
public function mouseMoveHandler(ev:Event):void{
}
public function doPlay():void{
GameMain.mainLoop();
leaderBoardDone = false;
}
public function keyListener(event:KeyboardEvent):void{
keyPressDown = false;
GameMain.scrollScreen = "";
GameMain.Player.gunFired = false;
GameMain.Player.rotateGunUp = false;
GameMain.Player.rotateGunDown = false;
if (event.keyCode == 80){
if (gameState != STATE_SYSTEM_PAUSE){
if (gameState == STATE_SYSTEM_PLAY){
gameState = STATE_SYSTEM_PAUSE;
pauseScreen = new pauseMc();
addChild(pauseScreen);
};
} else {
gameState = STATE_SYSTEM_PLAY;
removeChild(this.pauseScreen);
};
};
if (event.keyCode == 90){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.buildDroid(0);
};
} else {
if (event.keyCode == 88){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.buildDroid(1);
};
} else {
if (event.keyCode == 67){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.buildDroid(2);
};
} else {
if (event.keyCode == 82){
if (gameState == STATE_SYSTEM_PLAY){
if (GameMain.planeMc != null){
GameMain.planeMc.dropNow();
};
};
} else {
if (event.keyCode == 78){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.doMine();
};
} else {
if (event.keyCode == 77){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.doBuild();
};
};
};
};
};
};
};
}
public function doInstrBtns(){
GameMain.Sounds.playSoundFx("clickBtnFx");
titleScreen.nextBtn.addEventListener(MouseEvent.MOUSE_UP, doNextInstScreen);
titleScreen.backBtn.addEventListener(MouseEvent.MOUSE_UP, doLastInstScreen);
}
function frame1(){
stop();
}
function frame3(){
stop();
}
public function doMainScreen(event:MouseEvent):void{
titleScreen.gotoAndStop("mainScreen");
}
public function doSoundBtn(event:MouseEvent):void{
if (titleScreen.musicMc.currentFrame == 1){
titleScreen.musicMc.gotoAndStop("off");
GameMain.musicSwitch = false;
titleMusicChannel.stop();
} else {
titleScreen.musicMc.gotoAndStop("on");
GameMain.musicSwitch = true;
titleMusicChannel = titleMusic.play(0, 10000);
};
}
public function loadingComplete(){
this.loaderInfo.removeEventListener(Event.ENTER_FRAME, loadingUpdater, false);
this.loaderInfo.removeEventListener(Event.INIT, loadingComplete);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadingProgress);
if (loadingBox != null){
loadingBox.continueGame.gotoAndStop(2);
};
}
public function mouseLeftClick(ev:Event):void{
if (gameState == STATE_SYSTEM_PLAY){
if (stage.mouseY < (500 - 80)){
GameMain.leftClick();
} else {
GameMain.checkForPanelClick();
};
};
}
public function doMapScreen(event:MouseEvent):void{
removeChild(titleScreen);
setupMapScreen();
}
public function mapLeftUpClick(event:MouseEvent):void{
}
public function showHUD():void{
FPS.text = "FPS";
FPS.textColor = 0xFFFFFF;
Memory.text = "mem";
Memory.x = 200;
stage.addChild(FPS);
stage.addChild(Memory);
}
public function doSetup(event:MouseEvent):void{
removeChild(mapScreen2);
GameMain.setupGame();
}
public function openURL(pageToOpen:String){
var url:String;
var req:URLRequest;
url = pageToOpen;
req = new URLRequest(url);
navigateToURL(req, "_blank");
}
function doLastContScreen(event:MouseEvent):void{
if (titleScreen.currentFrame > 6){
titleScreen.gotoAndStop((titleScreen.currentFrame - 1));
} else {
titleScreen.gotoAndStop("mainScreen");
};
}
public function doContrBtns(){
titleScreen.nextBtn.addEventListener(MouseEvent.MOUSE_UP, doNextContScreen);
titleScreen.backBtn.addEventListener(MouseEvent.MOUSE_UP, doLastContScreen);
}
function pauseGame(){
if (gameState != 4){
if (gameState == 3){
gameState = 4;
pauseScreen = new pauseMc();
addChild(pauseScreen);
};
} else {
gameState = 3;
removeChild(pauseScreen);
};
}
function setupMapScreen(){
mapScreen2 = new GameMapScreen(this);
mapScreen2.x = 0;
addChild(mapScreen2);
mapScreen2.addEventListener(MouseEvent.MOUSE_UP, mapLeftUpClick);
}
function doNextInstScreen(event:MouseEvent):void{
if (titleScreen.currentFrame < 4){
titleScreen.nextFrame();
} else {
titleScreen.gotoAndStop("mainScreen");
};
}
function doNextContScreen(event:MouseEvent):void{
if (titleScreen.currentFrame < 7){
titleScreen.nextFrame();
} else {
titleScreen.gotoAndStop("mainScreen");
};
}
function doLastInstScreen(event:MouseEvent):void{
if (titleScreen.currentFrame > 2){
titleScreen.gotoAndStop((titleScreen.currentFrame - 1));
} else {
titleScreen.gotoAndStop("mainScreen");
};
}
public function introFinished(){
removeChild(introAnim);
gameState = STATE_SYSTEM_TITLE;
}
public function leadboardClose(){
titleScreen.gotoAndStop("mainScreen");
titleScreen.playBtn.visible = true;
titleScreen.instructionsBtn.visible = true;
titleScreen.controlsBtn.visible = true;
titleScreen.musicBtn.visible = true;
titleScreen.highScoresBtn2.visible = true;
titleScreen.moreGamesBtn2.visible = true;
}
public function runGame(e:Event):void{
switch (gameState){
case STATE_SYSTEM_INTRO:
break;
case STATE_SYSTEM_MOCHI:
doMochi();
break;
case STATE_SYSTEM_LOADER:
doLoadScreen();
break;
case STATE_SYSTEM_TITLE:
doTitleScreen();
break;
case STATE_SYSTEM_PLAY:
doPlay();
break;
case STATE_SYSTEM_GAME_OVER:
GameMain.gameOverLoop();
break;
case STATE_SYSTEM_GAME_COMPLETE:
break;
case STATE_SYSTEM_NEW_LEVEL:
GameMain.gameOver("level_complete");
break;
case STATE_SYSTEM_PAUSE:
break;
};
}
public function doInstScreen(event:MouseEvent):void{
titleScreen.gotoAndStop("instructions");
}
function doLastScoreScreen(event:MouseEvent):void{
titleScreen.gotoAndStop("mainScreen");
}
public function showHighScores(e:Event){
showLeaderBoard2(titleScreen);
}
public function doMapScreenStuff(){
mapScreen2.playBtn.addEventListener(MouseEvent.MOUSE_UP, doSetup);
if (GameMain.levelNumber > 1){
mapScreen2.youarehereMc.gotoAndStop(GameMain.levelNumber);
} else {
mapScreen2.youarehereMc.gotoAndStop(1);
mapScreen2.backBtn.addEventListener(MouseEvent.MOUSE_UP, doMainScreen2);
};
}
public function updateHUD():void{
var fps:Number;
fps = (1 / ((getTimer() - currentTime) / 1000));
currentTime = getTimer();
FPS.text = ("FPS: " + Math.round(fps).toString());
Memory.text = (("Mem :" + (Math.round(((System.totalMemory / 0x100000) * 10)) / 10).toString()) + " MB");
}
public function doTitleScreen():void{
if (((!(titleStarted)) && ((currentFrame == 3)))){
setupTitleScreen();
titleStarted = true;
};
}
public function keyListenerDown(event:KeyboardEvent):void{
if (gameState == STATE_SYSTEM_PLAY){
if (event.keyCode == Keyboard.SPACE){
GameMain.Player.fireMissile();
} else {
if (event.keyCode == 87){
GameMain.Player.rotateGunUp = true;
if (GameMain.baseGunType == "artillery"){
GameMain.Sounds.playSoundFx("mainGunRotSound");
};
} else {
if (event.keyCode == 83){
GameMain.Player.rotateGunDown = true;
if (GameMain.baseGunType == "artillery"){
GameMain.Sounds.playSoundFx("mainGunRotSound");
};
} else {
if (event.keyCode == Keyboard.UP){
GameMain.Player.rotateGunUp = true;
if (GameMain.baseGunType == "artillery"){
GameMain.Sounds.playSoundFx("mainGunRotSound");
};
} else {
if (event.keyCode == Keyboard.DOWN){
GameMain.Player.rotateGunDown = true;
if (GameMain.baseGunType == "artillery"){
GameMain.Sounds.playSoundFx("mainGunRotSound");
};
} else {
if (event.keyCode == 65){
keyPressDown = true;
GameMain.scrollScreen = "right";
} else {
if (event.keyCode == 68){
keyPressDown = true;
GameMain.scrollScreen = "left";
} else {
if (event.keyCode == Keyboard.RIGHT){
keyPressDown = true;
GameMain.scrollScreen = "left";
} else {
if (event.keyCode == Keyboard.LEFT){
keyPressDown = true;
GameMain.scrollScreen = "right";
};
};
};
};
};
};
};
};
};
};
}
public function loadingProgress(e:Event):void{
percentLoaded = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
gperc2 = int(percentLoaded);
}
public function finishSetup(){
gameState = STATE_SYSTEM_PLAY;
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseLeftClick);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseLeftUpClick);
GameMain.setupBadGuys();
GameMain.setupGoodGuys();
}
public function adFinished(){
mochiOn = false;
gameState = STATE_SYSTEM_LOADER;
}
public function mouseLeftUpClick(ev:Event):void{
if (gameState == STATE_SYSTEM_PLAY){
GameMain.Player.gunFired = false;
GameMain.Player.rotateGunUp = false;
GameMain.Player.rotateGunDown = false;
if (stage.mouseY < (500 - 80)){
GameMain.findSelected();
GameMain.clickloc = null;
GameMain.marquee_mc.graphics.clear();
};
} else {
GameMain.clickloc = null;
GameMain.marquee_mc.graphics.clear();
mouseNumberDown++;
if (mouseNumberDown > 1){
mouseNumberDown = 0;
if (gameState == 4){
pauseGame();
};
};
};
}
public function doMainScreen2(event:MouseEvent):void{
removeChild(mapScreen2);
addChild(titleScreen);
titleScreen.gotoAndStop("mainScreen");
titleScreen.playBtn.addEventListener(MouseEvent.MOUSE_UP, doMapScreen);
}
public function doLoadScreen():void{
if (!loaderStarted){
loadingBox = new LoadingBox(this);
loadingBox.addEventListener(Event.ENTER_FRAME, loadingUpdater);
loaderStarted = true;
loadingBox.x = 350;
loadingBox.y = 250;
addChild(loadingBox);
};
}
public function checkDomain(){
domain = this.root.loaderInfo.url.split("/")[2];
if (domain.indexOf(allowed_site) == (domain.length - allowed_site.length)){
ArcadeBomb_Site = true;
} else {
ArcadeBomb_Site = false;
};
}
public function loadingUpdater(e:Event):void{
percentLoaded = ((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100);
gperc2 = int(percentLoaded);
if (gskip < 2){
gskip++;
return;
};
gskip = 0;
gperc = (gperc + 1);
if (gperc < gperc2){
gperc++;
loadingBox.loaderbar.gotoAndStop(gperc);
};
if (gperc >= 100){
loadingComplete();
};
if (loadingBox != null){
loadingBox.update(percentLoaded);
};
}
public function doMochi():void{
if (!mochiOn){
MochiAd.showPreGameAd({clip:root, id:mochiId, res:"700x500", ad_finished:this.adFinished});
mochiOn = true;
};
}
public function finishPreload():void{
this.play();
gameState = STATE_SYSTEM_INTRO;
introAnim = new GameIntroAnim(this);
addChild(introAnim);
introAnim.x = 350;
introAnim.y = 238;
}
}
}//package classesAS3
Section 10
//GameManGrenader (classesAS3.GameManGrenader)
package classesAS3 {
import flash.display.*;
public class GameManGrenader extends MovieClip {
public var myParent:Object;
public var selectionMc:manSelectionSquare;
public var manThrow:badGuyThrow;
public function GameManGrenader(myP){
super();
myParent = myP;
}
}
}//package classesAS3
Section 11
//GameMapScreen (classesAS3.GameMapScreen)
package classesAS3 {
import flash.display.*;
import flash.events.*;
public class GameMapScreen extends MovieClip {
public var backBtn:SimpleButton;
var rt:Object;
public var playBtn:SimpleButton;
public var youarehereMc:MovieClip;
public var planets:MovieClip;
public function GameMapScreen(rt2){
super();
addFrameScript(9, frame10);
rt = rt2;
}
function frame10(){
rt.doMapScreenStuff();
stop();
}
}
}//package classesAS3
Section 12
//GameMissile (classesAS3.GameMissile)
package classesAS3 {
import classesAS3.*;
class GameMissile {
var rt:Object;
var xPos:Number;// = 0
var xVel:Number;// = 0
var myDamage:Number;
var mType:String;
var yPos:Number;// = 0
var trailDelay:Number;
var speed:Number;
var Useful:GameUseful;
var yVel:Number;// = 0
var dead:Boolean;
var myParent:Object;
var mC:Object;
var arrayIndex:Number;
var velocities:Object;
var xOrigin:Number;// = 0
var yOrigin:Number;// = 0
function GameMissile(clip, rt2, xStart, yStart, type, useF, velocityObj, sp, myP, myD){
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
super();
rt = rt2;
Useful = useF;
myParent = myP;
myDamage = myD;
xOrigin = xStart;
yOrigin = yStart;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
speed = sp;
dead = false;
mC = clip;
mType = type;
trailDelay = 2;
updatePosition();
velocities = new Object();
velocities.gravity = velocityObj.gravity;
if (type == "playerMissile"){
xVel = (velocityObj.vx * speed);
yVel = (velocityObj.vy * speed);
} else {
if (type == "bullet"){
xVel = (velocityObj.vx * speed);
yVel = (velocityObj.vy * speed);
} else {
if (type == "Photon"){
xVel = (velocityObj.vx * speed);
yVel = (velocityObj.vy * speed);
} else {
if (type == "rocket"){
xVel = (velocityObj.vx * speed);
yVel = (velocityObj.vy * speed);
} else {
if (type == "grenade"){
velocities.gravity = velocityObj.gravity;
velocities.steps = velocityObj.steps;
velocities.xStep = velocityObj.xStep;
velocities.yStep = velocityObj.yStep;
xVel = velocities.xStep;
yVel = velocities.yStep;
} else {
velocities.gravity = velocityObj.gravity;
velocities.steps = velocityObj.steps;
velocities.xStep = velocityObj.xStep;
velocities.yStep = velocityObj.yStep;
xVel = velocities.xStep;
yVel = velocities.yStep;
};
};
};
};
};
}
function applyGravity(){
yVel = (yVel + velocities.gravity);
}
function mainLoop(){
var explodeLength:Number;
if (dead == true){
remove();
} else {
if (mType == "playerMissile"){
explodeLength = Useful.getDistance(myParent.mC.x, myParent.mC.y, mC.x, mC.y);
if (rt.baseGunType == "artillery"){
} else {
if (rt.baseGunType == "machineGun"){
if (explodeLength > 400){
remove();
};
} else {
if (explodeLength > 750){
remove();
};
};
};
applyGravity();
checkForOffStage();
collisionDetection();
} else {
if (mType == "bullet"){
checkForOffStage();
collisionDetection();
} else {
if (mType == "Photon"){
checkForOffStage();
collisionDetection();
} else {
if (mType == "rocket"){
doTrail();
checkForOffStage();
collisionDetection();
} else {
applyGravity();
collisionDetection();
};
};
};
};
updatePosition();
};
}
function checkForOffStage(){
if (mC.x < 0){
remove();
};
if (mC.y < -1000){
remove();
};
if (mC.x > 1700){
remove();
};
}
function updatePosition(){
var oldX:*;
var oldY:*;
var dx:Number;
var dy:Number;
var angle2:Number;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
oldX = mC.x;
oldY = mC.y;
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
dx = (mC.x - oldX);
dy = (mC.y - oldY);
angle2 = Math.atan2(dy, dx);
mC.rotation = ((angle2 * 180) / Math.PI);
}
function remove(){
var arrayIndex:Number;
var i1:*;
if (dead == false){
arrayIndex = -1;
i1 = 0;
while (i1 < rt.missilesArray.length) {
if (this == rt.missilesArray[i1]){
arrayIndex = i1;
};
i1++;
};
if (arrayIndex >= 0){
if (mC != null){
if (mC.parent != null){
rt.inGameMissilesMc.removeChild(mC);
};
};
};
dead = true;
};
}
function mCDeath(){
}
function collisionDetection(){
var i:*;
var xm:Number;
var ym:Number;
var yy:Number;
var explosionMc:*;
if (mType == "bullet"){
i = 0;
while (i < rt.badGuysArray.length) {
if (rt.badGuysArray[i].dead == false){
if (mC.hitTestObject(rt.badGuysArray[i].mC)){
rt.badGuysArray[i].decreaseEnergy(this, false, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 7, 1, 10, true, false, false, 8));
};
};
i++;
};
} else {
if (mType == "Photon"){
i = 0;
while (i < rt.badGuysArray.length) {
if (rt.badGuysArray[i].dead == false){
if (mC.hitTestObject(rt.badGuysArray[i].mC)){
rt.badGuysArray[i].decreaseEnergy(this, false, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 3, 1, 8, true, false, false, 8));
};
};
i++;
};
if (dead == false){
};
} else {
if (mType == "rocket"){
i = 0;
while (i < rt.badGuysArray.length) {
if (rt.badGuysArray[i].dead == false){
if (mC.hitTestObject(rt.badGuysArray[i].mC)){
rt.badGuysArray[i].decreaseEnergy(this, false, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
};
i++;
};
if (dead == false){
};
} else {
if (mType == "grenade"){
i = 0;
while (i < rt.badGuysArray.length) {
if (rt.badGuysArray[i].dead == false){
if (mC.hitTestObject(rt.badGuysArray[i].mC)){
rt.badGuysArray[i].decreaseEnergy(this, true, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 8, 3, 50, true, false, false, 8));
};
};
i++;
};
if (dead == false){
i = 0;
while (i < rt.wallsArray.length) {
if (rt.wallsArray[i].hitTestObject(mC)){
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 7, 1, 10, true, false, false, 8));
};
i++;
};
};
} else {
i = 0;
while (i < rt.badGuysArray.length) {
if (rt.badGuysArray[i].dead == false){
if (mC.hitTestObject(rt.badGuysArray[i].mC)){
if (rt.baseGunType == "artillery"){
rt.badGuysArray[i].decreaseEnergy(this, true, (myDamage * 2));
} else {
rt.badGuysArray[i].decreaseEnergy(this, false, myDamage);
};
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 2, 1, 16, true, false, false, 8));
remove();
dead = true;
};
};
i++;
};
};
};
};
};
if (dead == false){
xm = int(mC.x);
ym = (mC.y + rt.spritesMc.y);
ym = (ym + yVel);
yy = rt.groundArray[xm];
if (ym > yy){
rt.Sounds.playSoundFx("mainGunMissileHitFx");
ym = (ym - yy);
yVel = (yVel - ym);
updatePosition();
if (rt.baseGunType == "artillery"){
explosionMc = new GameExplosionAnim(rt, rt.inGameZExplosionsMc);
rt.inGameZExplosionsMc.addChild(explosionMc);
explosionMc.x = (mC.x - 50);
explosionMc.y = (mC.y - 50);
rt.grenadeExArray.push(explosionMc);
explosionMc.myIndex = (rt.grenadeExArray.length - 1);
};
if (rt.upgrade6 == true){
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 2, Useful, 1, 1, 50, true, false, false, 8));
} else {
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 2, Useful, 4, 1, 50, true, false, false, 8));
};
remove();
};
};
}
function doTrail(){
var projectileMc:*;
trailDelay--;
if (trailDelay == 0){
trailDelay = 2;
projectileMc = new GameRocketSmoke(rt.inGameExplosionsMc);
rt.inGameExplosionsMc.addChild(projectileMc);
projectileMc.x = mC.x;
projectileMc.y = mC.y;
};
}
}
}//package classesAS3
Section 13
//GameMultipleExplosion (classesAS3.GameMultipleExplosion)
package classesAS3 {
import flash.display.*;
public class GameMultipleExplosion extends MovieClip {
public var yPos:Number;
public var numberOfExplosions:Number;
public var areaWidth:Number;
var delayToExplosion:Number;
var mType:Number;
public var rt:Object;
var Useful:GameUseful;
public var xPos:Number;
public function GameMultipleExplosion(rt2, useF, numberOfE, xx, yy, areaW, delay, mT){
super();
rt = rt2;
mType = mT;
numberOfExplosions = numberOfE;
xPos = xx;
yPos = yy;
areaWidth = areaW;
Useful = useF;
delayToExplosion = delay;
}
function mainLoop(){
var xx:Number;
var yy:Number;
delayToExplosion--;
if (delayToExplosion == 0){
delayToExplosion = Useful.RandomNumber(1, 8);
xx = (xPos + Useful.RandomNumber(1, areaWidth));
yy = (rt.alienBaseMc.y + Useful.RandomNumber(1, areaWidth));
rt.explosionsArray.push(new GameExplosion(rt, xx, yy, mType, Useful, 8, 5, 76, false, false, true, 8));
};
}
}
}//package classesAS3
Section 14
//GameOverMsgAnim (classesAS3.GameOverMsgAnim)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import com.adobe.crypto.*;
import flash.text.*;
import flash.net.*;
import flash.system.*;
public class GameOverMsgAnim extends MovieClip {
public var m:MovieClip;
public var rt:Object;
public function GameOverMsgAnim(rt2){
super();
addFrameScript(9, frame10, 22, frame23);
rt = rt2;
this.play();
}
function frame10(){
stop();
}
function frame23(){
this.rt.quitGame();
stop();
}
public function buttonPressed(Name, Score){
var variables:URLVariables;
var request:URLRequest;
var loader:URLLoader;
if (rt.rt.policyLoaded == false){
rt.rt.policyLoaded = true;
Security.loadPolicyFile("http://hiscore.arcadebomb.com/crossdomain.xml");
};
variables = new URLVariables();
variables.n = Name;
variables.s = Score;
variables.t = new Date().getTime();
variables.k = Math.floor((Math.random() * 100));
variables.m = MD5.hash(("" + ((Score + variables.k) * 6061)));
request = new URLRequest("http://hiscore.arcadebomb.com/wardroids_submit.php");
request.method = "POST";
request.data = variables;
loader = new URLLoader();
loader.load(request);
loader.addEventListener(Event.COMPLETE, goodjob);
}
function goodjob(e:Event):void{
}
}
}//package classesAS3
Section 15
//GamePanelBuyMc (classesAS3.GamePanelBuyMc)
package classesAS3 {
import flash.display.*;
public class GamePanelBuyMc extends MovieClip {
var buildFinished:Boolean;
public var itemsMc:panelItems;
public var rt:Object;
public var back:panelManBack;
public function GamePanelBuyMc(rt2){
super();
addFrameScript(0, frame1);
rt = rt2;
buildFinished = false;
}
function frame1(){
stop();
}
}
}//package classesAS3
Section 16
//GameParticle (classesAS3.GameParticle)
package classesAS3 {
import flash.display.*;
public class GameParticle extends MovieClip {
var bounces:Number;
var yPos:Number;// = 0
var xVel:Number;// = 0
var gravity:Boolean;
var mType:Number;
var speed:Number;
var yVel:Number;// = 0
var mC:Object;
var rt:Object;
var dead:Boolean;
var artillary:Boolean;
var Useful:GameUseful;
var xOrigin:Number;// = 0
var xPos:Number;// = 0
var gravityValue:Number;
var endX:Number;
var endY:Number;
var arrayIndex:Number;
var explodeDistance:Number;
var yOrigin:Number;// = 0
public function GameParticle(rt2, useF, xStart, yStart, type, vx, vy, edX, edY, art, grav, dist, speed){
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
super();
rt = rt2;
Useful = useF;
artillary = art;
gravity = grav;
explodeDistance = dist;
xOrigin = xStart;
yOrigin = yStart;
gravityValue = 0;
endX = edX;
endY = edY;
xPos = 0;
yPos = 0;
bounces = 0;
dead = false;
xVel = (vx * speed);
yVel = (vy * speed);
mC = this;
mType = type;
mC.gotoAndStop(mType);
updatePosition();
}
function updatePosition(){
var oldX:Number;
var oldY:Number;
var dx:Number;
var dy:Number;
var angle2:Number;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
oldX = x;
oldY = y;
x = (xOrigin + xPos);
y = (yOrigin + yPos);
dx = (x - oldX);
dy = (y - oldY);
angle2 = Math.atan2(dy, dx);
rotation = ((angle2 * 180) / Math.PI);
}
function mainLoop(){
var explodeLength:Number;
if (dead == false){
explodeLength = Useful.getDistance(x, y, endX, endY);
if (artillary == true){
if (explodeLength > (explodeDistance / 2)){
scaleX = (scaleX + 40);
scaleY = scaleX;
} else {
scaleX = (scaleX - 35);
scaleY = scaleX;
};
};
if (gravity == true){
gravityValue = (gravityValue + 0.2);
yVel = (yVel + gravityValue);
};
if (explodeLength > (explodeDistance + 10)){
if (this.parent != null){
remove();
};
};
collisionDetection();
updatePosition();
};
}
function checkForOffStage(){
if (mC.x < 0){
remove();
};
if (mC.y < 0){
remove();
};
if (mC.x > 1700){
remove();
};
}
function collisionDetection(){
var xm:Number;
var ym:Number;
var yy:Number;
xm = int(this.x);
ym = (this.y + rt.spritesMc.y);
ym = (ym + yVel);
yy = rt.groundArray[xm];
if (ym > yy){
if (rotation > -40){
bounces++;
} else {
if (rotation < 40){
bounces++;
};
};
bounces++;
if (bounces > 4){
remove();
} else {
yVel = -(yVel);
yVel = (yVel * 0.3);
gravityValue++;
updatePosition();
};
};
}
function mCDeath(){
}
function remove(){
var arrayIndex:Number;
var i1:*;
arrayIndex = -1;
i1 = 0;
while (i1 < rt.particlesArray.length) {
if (this == rt.particlesArray[i1]){
arrayIndex = i1;
};
i1++;
};
if (this.parent != null){
this.parent.removeChild(this);
};
if (arrayIndex != -1){
rt.particlesArray.splice(arrayIndex, 1);
};
delete ??getglobalscope
[this];
}
}
}//package classesAS3
Section 17
//GamePlane (classesAS3.GamePlane)
package classesAS3 {
import flash.display.*;
public class GamePlane extends MovieClip {
public var soldierStart:Number;
public var xVel:Number;
public var soldierType:Array;
public var myObject:Object;
public var soldierDone:Number;
public var myParent:Object;
public var rt:Object;
public function GamePlane(myP, rt2){
super();
myParent = myP;
rt = rt2;
xVel = 0;
soldierDone = 0;
soldierType = new Array();
}
function updatePosition(){
this.x = (this.x + xVel);
}
function dropNow(){
rt.setupSoldier(soldierType[0], this.x, this.y);
soldierType.shift();
if (this.x < 200){
soldierStart = rt.Useful.RandomNumber(((this.x / 2) + 100), this.x);
} else {
soldierStart = rt.Useful.RandomNumber(((this.x / 2) + 100), 200);
};
}
public function mainLoop(){
updatePosition();
if (this.x < -100){
myParent.removeChild(this);
rt.planeMc = null;
this.stop();
};
if (soldierType.length > 0){
if (this.x < soldierStart){
rt.setupSoldier(soldierType[0], this.x, this.y);
soldierType.shift();
if (this.x < 200){
soldierStart = rt.Useful.RandomNumber(((this.x / 2) + 130), this.x);
} else {
soldierStart = rt.Useful.RandomNumber(((this.x / 2) + 130), 200);
};
};
};
}
}
}//package classesAS3
Section 18
//GamePlayer (classesAS3.GamePlayer)
package classesAS3 {
import flash.display.*;
public class GamePlayer {
var playerdown:Number;// = 0
var xVel:Number;// = 0
var moveplayerup:Number;// = 0
var multidirectional:Number;// = 0
var yPos:Number;// = 0
var santaspeed:Number;// = 2
var yVelOld:Number;// = 0
var rotateGunDown:Boolean;
var jumpTime:Number;
var numberOfMissiles:Number;
var jump:Number;// = 0
var mouseButton:Number;
var playerup:Number;// = 0
var energyMc:gunEnergyLevel;
var myinstance:Object;
var rt:Object;
var Oldplayerup:Number;// = 0
var keypress:Number;
var Oldplayerdown:Number;// = 0
var shotStrength:Number;
var rotateGunUp:Boolean;
var yVel:Number;// = 0
var playerleft:Number;// = 0
var levelDir:Number;
var n:Number;
var s:Number;// = 0
var Oldplayerright:Number;// = 0
var mC:MovieClip;
var scrollSpeed:Number;
var shotsLimit:Number;
var vectorData:Object;
var gunFired:Boolean;
var dy:Number;// = 0
var dx:Number;// = 0
var missileDistFromGun:Number;
var Oldplayerleft:Number;// = 0
var shotsFired:Number;
var xOrigin:Number;// = 0
var xPos:Number;// = 0
var Useful:GameUseful;
var mygraphic:Object;
var angle:Number;// = 0
var playerright:Number;// = 0
var gunRotation:Number;
var xVelOld:Number;// = 0
var energyLevel:Boolean;
var fireDelay:Number;
var turret:turretMc;
var yOrigin:Number;// = 0
public function GamePlayer(clip, rt2, xStart, yStart, uu){
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
s = 0;
playerleft = 0;
playerright = 0;
jump = 0;
moveplayerup = 0;
playerdown = 0;
playerup = 0;
Oldplayerup = 0;
Oldplayerdown = 0;
Oldplayerright = 0;
Oldplayerleft = 0;
xVel = 0;
yVel = 0;
xVelOld = 0;
yVelOld = 0;
santaspeed = 2;
multidirectional = 0;
dx = 0;
dy = 0;
angle = 0;
super();
rt = rt2;
Useful = uu;
missileDistFromGun = 40;
xOrigin = xStart;
yOrigin = yStart;
dx = 0;
dy = 0;
angle = 0;
shotsFired = 0;
shotsLimit = 2;
gunFired = false;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
xVelOld = 0;
numberOfMissiles = 0;
yVelOld = 0;
scrollSpeed = 10;
keypress = 0;
jump = 0;
jumpTime = 10;
mouseButton = 0;
mC = clip;
shotStrength = 6;
gunRotation = 180;
rotateGunUp = false;
rotateGunDown = false;
vectorData = new Object();
energyLevel = false;
levelDir = 1;
fireDelay = 0;
updatePosition();
}
function fireMissile(){
var ss:*;
var missileName:String;
var projectileMc:*;
var spriteData:Object;
var newXY:Object;
var speed:Number;
gunFired = true;
if (fireDelay == 0){
rt.statsMc.gunEnergy.energyLevelMc.y = (rt.statsMc.gunEnergy.energyLevelMc.y - 1);
if (rt.statsMc.gunEnergy.energyLevelMc.y < 0){
rt.statsMc.gunEnergy.energyLevelMc.y = 0;
} else {
if (rt.upgrade6 == true){
fireDelay = 1;
} else {
fireDelay = 30;
};
rt.Sounds.playSoundFx("mainGunSound");
energyLevel = false;
ss = mC.getChildAt(0);
mC.turret.play();
missileName = "playerMissile";
projectileMc = new mainGunBullet();
rt.inGameMissilesMc.addChild(projectileMc);
projectileMc.gotoAndStop(rt.baseGunType);
spriteData = new Object();
spriteData.vx = -(vectorData.vx);
spriteData.vy = -(vectorData.vy);
if (rt.baseGunType == "artillery"){
spriteData.gravity = 0.4;
speed = 22;
} else {
if (rt.baseGunType == "machineGun"){
spriteData.gravity = 0;
speed = 20;
} else {
spriteData.gravity = 0;
speed = 24;
};
};
newXY = Useful.localToGlobalXY(mC.turret.firePoint);
rt.missilesArray.push(new GameMissile(projectileMc, rt, (newXY.newX - rt.scrollxPos), newXY.newY, missileName, Useful, spriteData, speed, this, 20));
};
};
}
function updatePosition(){
var oldX:*;
var oldY:*;
oldX = mC.x;
oldY = mC.y;
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
}
public function setupEnergyLevel(){
energyLevel = true;
energyMc = new gunEnergyLevel();
mC.addChild(energyMc);
energyMc.x = -10;
energyMc.y = -50;
}
function doEnergyLevel(){
}
function mainLoop(){
if (rt.upgrade6 == true){
if (gunFired == true){
fireMissile();
};
};
if (energyLevel == true){
doEnergyLevel();
};
vectorData = Useful.getVectorFromAngle(gunRotation);
if (rotateGunUp == true){
gunRotation = (gunRotation - 1);
if (rt.upgrade7 == true){
if (gunRotation < 130){
gunRotation = 130;
};
} else {
if (gunRotation < 150){
gunRotation = 150;
};
};
} else {
if (rotateGunDown == true){
gunRotation = (gunRotation + 1);
if (gunRotation > 220){
gunRotation = 220;
};
};
};
mC.turret.rotation = gunRotation;
if (mC.currentFrame == 2){
mC.arm1.rotation = -(gunRotation);
};
if (rt.statsMc.gunEnergy.energyLevelMc.y < 60){
rt.statsMc.gunEnergy.energyLevelMc.y = (rt.statsMc.gunEnergy.energyLevelMc.y + 0.5);
if (rt.statsMc.gunEnergy.energyLevelMc.y > 60){
rt.statsMc.gunEnergy.energyLevelMc.y = 60;
};
};
fireDelay--;
if (fireDelay < 0){
fireDelay = 0;
};
}
}
}//package classesAS3
Section 19
//GameRisingMoney (classesAS3.GameRisingMoney)
package classesAS3 {
import flash.display.*;
public class GameRisingMoney extends MovieClip {
public var inGameScoreMc:Sprite;
public var txt:risingMoneyTxt;
public var scoreNumber:Number;
public var rt:Object;
public function GameRisingMoney(rt2, inGame, scoreN){
super();
addFrameScript(22, frame23);
rt = rt2;
inGameScoreMc = inGame;
scoreNumber = scoreN;
txt.moneyTxt.text = String(scoreNumber);
}
function frame23(){
this.inGameScoreMc.removeChild(this);
stop();
}
}
}//package classesAS3
Section 20
//GameRisingScore (classesAS3.GameRisingScore)
package classesAS3 {
import flash.display.*;
public class GameRisingScore extends MovieClip {
public var inGameScoreMc:Sprite;
public var txt:MovieClip;
public var scoreNumber:Number;
public var rt:Object;
public function GameRisingScore(rt2, inGame, scoreN){
super();
addFrameScript(15, frame16);
rt = rt2;
inGameScoreMc = inGame;
scoreNumber = scoreN;
txt.scoreTxt.text = ("-" + String(scoreNumber));
}
function frame16(){
this.inGameScoreMc.removeChild(this);
stop();
}
}
}//package classesAS3
Section 21
//GameRocketSmoke (classesAS3.GameRocketSmoke)
package classesAS3 {
import flash.display.*;
public class GameRocketSmoke extends MovieClip {
public var rt:Sprite;
public function GameRocketSmoke(rt2){
super();
addFrameScript(7, frame8);
rt = rt2;
}
function removeMe(){
rt.removeChild(this);
this.stop();
}
function frame8(){
this.removeMe();
stop();
}
}
}//package classesAS3
Section 22
//GameSounds (classesAS3.GameSounds)
package classesAS3 {
import flash.media.*;
import flash.utils.*;
public class GameSounds {
var rt:Object;
public function GameSounds(rt2){
super();
rt = rt2;
}
public function playSoundFx(sound:String){
var soundFxClass:Class;
var soundFx:*;
var channel:SoundChannel;
if (rt.soundsSwitch == true){
soundFxClass = Class(getDefinitionByName(sound));
soundFx = new (soundFxClass);
channel = soundFx.play();
};
}
}
}//package classesAS3
Section 23
//GameStartMsg (classesAS3.GameStartMsg)
package classesAS3 {
import flash.display.*;
import flash.events.*;
public class GameStartMsg extends MovieClip {
public var rt:Object;
public var startBtn:startGameButton;
public function GameStartMsg(rt2){
super();
addFrameScript(909, frame910);
rt = rt2;
startBtn.addEventListener(MouseEvent.MOUSE_UP, finishStuff);
}
function finishStuff(event:MouseEvent):void{
this.gotoAndStop("startGame");
}
public function removeMe(){
rt.rt.finishSetup();
rt.inGameMsgsMc.removeChild(this);
stop();
}
function frame910(){
this.removeMe();
stop();
}
}
}//package classesAS3
Section 24
//GameTitleScreen (classesAS3.GameTitleScreen)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.net.*;
import flash.system.*;
public class GameTitleScreen extends MovieClip {
public var backBtn:SimpleButton;
public var musicBtn:SimpleButton;
public var nextBtn:SimpleButton;
public var highScoresBtn2:SimpleButton;
public var instructionsBtn:SimpleButton;
var rt:Object;
public var playBtn:PlayGameBtn;
public var musicMc:MovieClip;
public var controlsBtn:SimpleButton;
public var sponsorBtn:SimpleButton;
public var moreGamesBtn2:SimpleButton;
public var fgmBtn:MovieClip;
public function GameTitleScreen(rt2){
super();
addFrameScript(0, frame1, 1, frame2, 5, frame6, 8, frame9);
rt = rt2;
}
function frame2(){
rt.doInstrBtns();
}
public function gotoSponsor(e:MouseEvent):void{
navigateToURL(new URLRequest("http://www.minijuegos.com/"), "_blank");
}
function frame1(){
sponsorBtn.addEventListener(MouseEvent.MOUSE_DOWN, gotoSponsor, false);
moreGamesBtn2.addEventListener(MouseEvent.MOUSE_DOWN, gotoSponsor, false);
fgmBtn.addEventListener(MouseEvent.MOUSE_DOWN, gotoFGM, false);
rt.doTitleScreenStuff();
stop();
}
public function gotoFGM(e:MouseEvent):void{
navigateToURL(new URLRequest("http://www.flashgamemaker.com"), "_blank");
}
function frame9(){
rt.showLeaderBoard2(this);
stop();
}
function frame6(){
rt.doContrBtns();
}
}
}//package classesAS3
Section 25
//GameUpgrade (classesAS3.GameUpgrade)
package classesAS3 {
import flash.display.*;
public class GameUpgrade extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade(rt2){
super();
addFrameScript(0, frame1);
this.stop();
rt = rt2;
buildFinished = false;
}
function frame1(){
back.gotoAndStop(1);
stop();
}
public function setupUpgrade(){
rt.setupUpgrade1();
}
}
}//package classesAS3
Section 26
//GameUpgrade10 (classesAS3.GameUpgrade10)
package classesAS3 {
import flash.display.*;
public class GameUpgrade10 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade10(rt2){
super();
this.stop();
rt = rt2;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade10();
}
}
}//package classesAS3
Section 27
//GameUpgrade2 (classesAS3.GameUpgrade2)
package classesAS3 {
import flash.display.*;
public class GameUpgrade2 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade2(rt2){
super();
addFrameScript(0, frame1);
this.stop();
rt = rt2;
buildFinished = false;
}
function frame1(){
stop();
}
public function setupUpgrade(){
rt.setupUpgrade2();
}
}
}//package classesAS3
Section 28
//GameUpgrade3 (classesAS3.GameUpgrade3)
package classesAS3 {
import flash.display.*;
public class GameUpgrade3 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade3(rt2){
super();
this.stop();
rt = rt2;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade3();
}
}
}//package classesAS3
Section 29
//GameUpgrade4 (classesAS3.GameUpgrade4)
package classesAS3 {
import flash.display.*;
public class GameUpgrade4 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade4(rt2){
super();
this.stop();
rt = rt2;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade4();
}
}
}//package classesAS3
Section 30
//GameUpgrade5 (classesAS3.GameUpgrade5)
package classesAS3 {
import flash.display.*;
public class GameUpgrade5 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade5(rt2){
super();
this.stop();
rt = rt2;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade5();
}
}
}//package classesAS3
Section 31
//GameUpgrade6 (classesAS3.GameUpgrade6)
package classesAS3 {
import flash.display.*;
public class GameUpgrade6 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade6(rt2){
super();
this.stop();
rt = rt2;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade6();
}
}
}//package classesAS3
Section 32
//GameUpgrade7 (classesAS3.GameUpgrade7)
package classesAS3 {
import flash.display.*;
public class GameUpgrade7 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade7(rt2){
super();
this.stop();
rt = rt2;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade7();
}
}
}//package classesAS3
Section 33
//GameUpgrade8 (classesAS3.GameUpgrade8)
package classesAS3 {
import flash.display.*;
public class GameUpgrade8 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade8(rt2){
super();
this.stop();
rt = rt2;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade8();
}
}
}//package classesAS3
Section 34
//GameUpgrade9 (classesAS3.GameUpgrade9)
package classesAS3 {
import flash.display.*;
public class GameUpgrade9 extends MovieClip {
var buildFinished:Boolean;
public var rt:Object;
public var upgradeBtn:SimpleButton;
public var back:MovieClip;
public function GameUpgrade9(rt2){
super();
this.stop();
rt = rt2;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade9();
}
}
}//package classesAS3
Section 35
//GameUseful (classesAS3.GameUseful)
package classesAS3 {
import flash.display.*;
public class GameUseful {
public var rt:Object;
public function GameUseful(rt2){
super();
rt = rt2;
}
function addThrust(rot, speed){
var thrustVectors:Object;
thrustVectors = new Object();
thrustVectors.xVel = (Math.cos(radian(rot)) * speed);
thrustVectors.yVel = (Math.sin(radian(rot)) * speed);
return (thrustVectors);
}
public function getDistanceQ(xx1, yy1, xx2, yy2){
var nn:Number;
nn = (xx2 - xx1);
nn = Math.abs(nn);
return (nn);
}
function radian(degree){
return (((degree * Math.PI) / 180));
}
function localToGlobalXY(mc1:MovieClip):Object{
var temp:Object;
var clip:*;
var xs:*;
var ys:*;
var r:*;
temp = new Object();
temp.newX = 0;
temp.newY = 0;
clip = mc1;
while (clip != rt.parent) {
xs = (temp.newX * (clip.scaleX / 1));
ys = (temp.newY * (clip.scaleY / 1));
r = (clip.rotation * (Math.PI / 180));
temp.newX = ((xs * Math.cos(r)) - (ys * Math.sin(r)));
temp.newY = ((xs * Math.sin(r)) + (ys * Math.cos(r)));
temp.newX = (temp.newX + clip.x);
temp.newY = (temp.newY + clip.y);
clip = clip.parent;
};
return (temp);
}
public function getDistance(xx1, yy1, xx2, yy2){
var dx2:Number;
var dy2:Number;
var dx:Number;
var dy:Number;
dx2 = xx1;
dy2 = yy1;
dx = xx2;
dy = yy2;
dx = (dx2 - dx);
dy = (dy2 - dy);
return (Math.sqrt(((dx * dx) + (dy * dy))));
}
public function RandomNumber(xn, yn):Number{
return ((Math.floor((Math.random() * ((1 + yn) - xn))) + xn));
}
function countMcs(mC):Array{
var movieClipsFound:Array;
var n:*;
movieClipsFound = new Array();
n = 0;
for (n in mC) {
if (typeof(mC[n]) == "movieclip"){
movieClipsFound.push(mC[n]);
};
};
return (movieClipsFound);
}
function checkForLOS(xx1, yy1, xx2, yy2, backgroundObject){
var dist:Number;
var distObj:Object;
var yy:Number;
var i2:*;
dist = int(getDistance(xx1, yy1, xx2, yy2));
distObj = pointTowards(xx1, yy1, xx2, yy2);
i2 = 0;
while (i2 < dist) {
yy = rt.GameMain.groundArray[int(xx1)];
if (int(yy1) > yy){
return (true);
};
xx1 = (xx1 - distObj.vx);
yy1 = (yy1 - distObj.vy);
i2++;
};
return (false);
}
function getVectorFromAngle(rotationVar):Object{
var vectorObject:Object;
var angle:Number;
vectorObject = new Object();
angle = ((rotationVar * Math.PI) / 180);
vectorObject.vx = Math.cos(angle);
vectorObject.vy = Math.sin(angle);
return (vectorObject);
}
function capVectorSpeed(vx, vy, max):Object{
var vectorSpeedsCapped:Object;
var len:*;
vectorSpeedsCapped = new Object();
len = Math.sqrt(((vx * vx) + (vy * vy)));
if (len > max){
vx = (vx * (max / len));
vy = (vy * (max / len));
};
vectorSpeedsCapped.vx = vx;
vectorSpeedsCapped.vy = vy;
return (vectorSpeedsCapped);
}
function argbtohex(a:Number, r:Number, g:Number, b:Number){
return (((((a << 24) | (r << 16)) | (g << 8)) | b));
}
public function orientateToGround(rt, mC){
var leftC:Number;
var rightC:Number;
var xm:*;
var ym:*;
var yy1:Number;
var yy2:Number;
var rotData:Object;
leftC = (mC.x - (mC.width / 2));
rightC = (mC.x + (mC.width / 2));
xm = int(leftC);
ym = (mC.y + rt.spritesMc.y);
yy1 = rt.groundArray[xm];
xm = int(rightC);
yy2 = rt.groundArray[xm];
rotData = pointTowards(leftC, yy1, rightC, yy2);
return ((rotData.spriteRotation - 180));
}
public function getArcVelocity(gravity:Number, speed:Number, xStart:Number, yStart:Number, xEnd:Number, yEnd:Number):Object{
var velocities:Object;
var xd:*;
var yd:*;
var dist:*;
var steps:*;
velocities = new Object();
xd = (xEnd - xStart);
yd = (yEnd - yStart);
dist = Math.sqrt(((xd * xd) + (yd * yd)));
steps = Math.ceil((dist / speed));
velocities.gravity = gravity;
velocities.steps = steps;
velocities.xStep = (xd / steps);
velocities.yStep = (yd / steps);
if (gravity > 0){
velocities.yStep = (velocities.yStep - ((steps * gravity) / 2));
};
return (velocities);
}
function pointTowards(xx, yy, xx2, yy2):Object{
var spriteData:Object;
var dx:*;
var dy:*;
spriteData = new Object();
dx = (xx - xx2);
dy = (yy - yy2);
spriteData.spriteAngle = Math.atan2(dy, dx);
spriteData.spriteRotation = ((spriteData.spriteAngle * 180) / Math.PI);
spriteData.vx = Math.cos(spriteData.spriteAngle);
spriteData.vy = Math.sin(spriteData.spriteAngle);
return (spriteData);
}
function rotateXY(centerX, centerY, radius, ringAngle){
var scA:Number;
var vectorData:Object;
scA = ((Math.PI * ringAngle) / 180);
vectorData = new Object();
vectorData.xPos = (centerX + (Math.cos(scA) * radius));
vectorData.yPos = (centerY + (Math.sin(scA) * radius));
return (vectorData);
}
}
}//package classesAS3
Section 36
//GameWall (classesAS3.GameWall)
package classesAS3 {
import flash.display.*;
public class GameWall extends MovieClip {
public var mySoldier:Object;
public var rt:Object;
public var energy:Number;
public function GameWall(rt2, en, myS){
super();
addFrameScript(39, frame40);
rt = rt2;
energy = en;
mySoldier = myS;
}
function frame40(){
this.mySoldier.soldierState = 5;
stop();
}
}
}//package classesAS3
Section 37
//GameWeaponsPanel (classesAS3.GameWeaponsPanel)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class GameWeaponsPanel extends MovieClip {
public var musicBtn:SimpleButton;
public var spaceGunDown:MovieClip;
public var defendBtn2:commandBtn;
public var attack:MovieClip;
public var levelTxt:TextField;
public var mineBtn2:commandBtn;
public var buildBtn2:commandBtn;
public var soundFxBtn:SimpleButton;
public var mine:MovieClip;
public var gunEnergyBtn2:gunEnergyBtn;
public var build:MovieClip;
public var msg:TextField;
public var spaceGunUp:MovieClip;
public var energy:TextField;
public var score:TextField;
public var quitBtn:SimpleButton;
public var musicMc:MovieClip;
public var rt:Object;
public var soundFxMc:MovieClip;
public var zombiesLeft:TextField;
public var attackBtn2:commandBtn;
public var defend:MovieClip;
public var pausePanelBtn:SimpleButton;
public var money:TextField;
public var gunEnergy:gunEnergyLevel;
public function GameWeaponsPanel(rt2){
super();
addFrameScript(0, frame1);
rt = rt2;
}
public function doBack(event:MouseEvent):void{
rt.selectBase();
}
function frame1(){
stop();
mineBtn2.addEventListener(MouseEvent.MOUSE_UP, rt.doMineCommandBtn);
defendBtn2.addEventListener(MouseEvent.MOUSE_UP, rt.doDefendCommandBtn);
attackBtn2.addEventListener(MouseEvent.MOUSE_UP, rt.doAttackCommandBtn);
buildBtn2.addEventListener(MouseEvent.MOUSE_UP, rt.doBuildCommandBtn);
}
}
}//package classesAS3
Section 38
//GameZombie (classesAS3.GameZombie)
package classesAS3 {
import flash.display.*;
public class GameZombie extends MovieClip {
public var myObject:Object;
public var zombie:MovieClip;
public var myParent:Object;
public var rt:Object;
public function GameZombie(myP, rt2){
super();
myParent = myP;
rt = rt2;
}
}
}//package classesAS3
Section 39
//GameZombieParts (classesAS3.GameZombieParts)
package classesAS3 {
import flash.display.*;
public class GameZombieParts extends MovieClip {
var xVel:Number;
public var myObject:Object;
var yPos:Number;
var bounces:Number;
var dead2:Boolean;// = false
var gravity:Number;
var yVel:Number;
public var myParent:Object;
public var rt:Object;
var dead:Boolean;// = false
var deadDelay:Number;
var xOrigin:Number;
var xPos:Number;
public var limb:zombieHeadSide;
var yOrigin:Number;
public function GameZombieParts(myP, rt2, velocityObj, mType, xStart, yStart, zT){
dead = false;
dead2 = false;
super();
addFrameScript(0, frame1);
myParent = myP;
rt = rt2;
xPos = 0;
yPos = 0;
bounces = 0;
dead = false;
dead2 = false;
xOrigin = xStart;
yOrigin = yStart;
this.gotoAndStop(mType);
if (this.limb != null){
this.limb.gotoAndStop(zT);
};
deadDelay = 100;
gravity = velocityObj.gravity;
xVel = velocityObj.xStep;
yVel = velocityObj.yStep;
}
function applyGravity(){
yVel = (yVel + gravity);
}
function updatePosition(){
var oldX:*;
var oldY:*;
var dx:Number;
var dy:Number;
var angle2:Number;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
oldX = this.x;
oldY = this.y;
this.x = (xOrigin + xPos);
this.y = (yOrigin + yPos);
dx = (this.x - oldX);
dy = (this.y - oldY);
angle2 = Math.atan2(dy, dx);
this.rotation = ((angle2 * 180) / Math.PI);
}
function removeMC(){
var arrayIndex:Number;
var i1:*;
arrayIndex = -1;
i1 = 0;
while (i1 < rt.zombiePartsArray.length) {
if (this == rt.zombiePartsArray[i1]){
arrayIndex = i1;
};
i1++;
};
if (arrayIndex >= 0){
if (this.parent != null){
myParent.removeChild(this);
};
};
dead2 = true;
}
function checkForOffStage(){
if (this.x < 0){
remove();
};
if (this.y < -1000){
remove();
};
if (this.x > 1700){
remove();
};
if (this.y > 700){
remove();
};
}
function collisionDetection(){
var xm:Number;
var ym:Number;
var yy:Number;
xm = int(this.x);
ym = (this.y + rt.spritesMc.y);
ym = (ym + yVel);
yy = rt.groundArray[xm];
if (ym > yy){
bounces++;
if (bounces > 4){
remove();
} else {
yVel = -(yVel);
yVel = (yVel * 0.3);
gravity++;
updatePosition();
};
};
}
function frame1(){
stop();
}
function remove(){
dead = true;
}
public function mainLoop(){
if (dead == false){
applyGravity();
collisionDetection();
updatePosition();
} else {
deadDelay--;
if (deadDelay == 0){
removeMC();
};
};
}
}
}//package classesAS3
Section 40
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import com.adobe.utils.*;
public class MD5 {
public function MD5(){
super();
}
private static function ff(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
return (transform(f, a, b, c, d, x, s, t));
}
private static function createBlocks(s:String):Array{
var blocks:Array;
var len:int;
var mask:int;
var i:int;
blocks = new Array();
len = (s.length * 8);
mask = 0xFF;
i = 0;
while (i < len) {
blocks[(i >> 5)] = (blocks[(i >> 5)] | ((s.charCodeAt((i / 8)) & mask) << (i % 32)));
i = (i + 8);
};
blocks[(len >> 5)] = (blocks[(len >> 5)] | (128 << (len % 32)));
blocks[((((len + 64) >>> 9) << 4) + 14)] = len;
return (blocks);
}
private static function ii(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
return (transform(i, a, b, c, d, x, s, t));
}
private static function f(x:int, y:int, z:int):int{
return (((x & y) | (~(x) & z)));
}
private static function g(x:int, y:int, z:int):int{
return (((x & z) | (y & ~(z))));
}
private static function h(x:int, y:int, z:int):int{
return (((x ^ y) ^ z));
}
private static function i(x:int, y:int, z:int):int{
return ((y ^ (x | ~(z))));
}
private static function transform(func:Function, a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
var tmp:int;
tmp = (((a + int(func(b, c, d))) + x) + t);
return ((IntUtil.rol(tmp, s) + b));
}
private static function hh(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
return (transform(h, a, b, c, d, x, s, t));
}
public static function hash(s:String):String{
var a:int;
var b:int;
var c:int;
var d:int;
var aa:int;
var bb:int;
var cc:int;
var dd:int;
var x:Array;
var len:int;
var i:int;
a = 1732584193;
b = -271733879;
c = -1732584194;
d = 271733878;
x = createBlocks(s);
len = x.length;
i = 0;
while (i < len) {
aa = a;
bb = b;
cc = c;
dd = d;
a = ff(a, b, c, d, x[(i + 0)], 7, -680876936);
d = ff(d, a, b, c, x[(i + 1)], 12, -389564586);
c = ff(c, d, a, b, x[(i + 2)], 17, 606105819);
b = ff(b, c, d, a, x[(i + 3)], 22, -1044525330);
a = ff(a, b, c, d, x[(i + 4)], 7, -176418897);
d = ff(d, a, b, c, x[(i + 5)], 12, 1200080426);
c = ff(c, d, a, b, x[(i + 6)], 17, -1473231341);
b = ff(b, c, d, a, x[(i + 7)], 22, -45705983);
a = ff(a, b, c, d, x[(i + 8)], 7, 1770035416);
d = ff(d, a, b, c, x[(i + 9)], 12, -1958414417);
c = ff(c, d, a, b, x[(i + 10)], 17, -42063);
b = ff(b, c, d, a, x[(i + 11)], 22, -1990404162);
a = ff(a, b, c, d, x[(i + 12)], 7, 1804603682);
d = ff(d, a, b, c, x[(i + 13)], 12, -40341101);
c = ff(c, d, a, b, x[(i + 14)], 17, -1502002290);
b = ff(b, c, d, a, x[(i + 15)], 22, 1236535329);
a = gg(a, b, c, d, x[(i + 1)], 5, -165796510);
d = gg(d, a, b, c, x[(i + 6)], 9, -1069501632);
c = gg(c, d, a, b, x[(i + 11)], 14, 643717713);
b = gg(b, c, d, a, x[(i + 0)], 20, -373897302);
a = gg(a, b, c, d, x[(i + 5)], 5, -701558691);
d = gg(d, a, b, c, x[(i + 10)], 9, 38016083);
c = gg(c, d, a, b, x[(i + 15)], 14, -660478335);
b = gg(b, c, d, a, x[(i + 4)], 20, -405537848);
a = gg(a, b, c, d, x[(i + 9)], 5, 568446438);
d = gg(d, a, b, c, x[(i + 14)], 9, -1019803690);
c = gg(c, d, a, b, x[(i + 3)], 14, -187363961);
b = gg(b, c, d, a, x[(i + 8)], 20, 1163531501);
a = gg(a, b, c, d, x[(i + 13)], 5, -1444681467);
d = gg(d, a, b, c, x[(i + 2)], 9, -51403784);
c = gg(c, d, a, b, x[(i + 7)], 14, 1735328473);
b = gg(b, c, d, a, x[(i + 12)], 20, -1926607734);
a = hh(a, b, c, d, x[(i + 5)], 4, -378558);
d = hh(d, a, b, c, x[(i + 8)], 11, -2022574463);
c = hh(c, d, a, b, x[(i + 11)], 16, 1839030562);
b = hh(b, c, d, a, x[(i + 14)], 23, -35309556);
a = hh(a, b, c, d, x[(i + 1)], 4, -1530992060);
d = hh(d, a, b, c, x[(i + 4)], 11, 1272893353);
c = hh(c, d, a, b, x[(i + 7)], 16, -155497632);
b = hh(b, c, d, a, x[(i + 10)], 23, -1094730640);
a = hh(a, b, c, d, x[(i + 13)], 4, 681279174);
d = hh(d, a, b, c, x[(i + 0)], 11, -358537222);
c = hh(c, d, a, b, x[(i + 3)], 16, -722521979);
b = hh(b, c, d, a, x[(i + 6)], 23, 76029189);
a = hh(a, b, c, d, x[(i + 9)], 4, -640364487);
d = hh(d, a, b, c, x[(i + 12)], 11, -421815835);
c = hh(c, d, a, b, x[(i + 15)], 16, 530742520);
b = hh(b, c, d, a, x[(i + 2)], 23, -995338651);
a = ii(a, b, c, d, x[(i + 0)], 6, -198630844);
d = ii(d, a, b, c, x[(i + 7)], 10, 1126891415);
c = ii(c, d, a, b, x[(i + 14)], 15, -1416354905);
b = ii(b, c, d, a, x[(i + 5)], 21, -57434055);
a = ii(a, b, c, d, x[(i + 12)], 6, 1700485571);
d = ii(d, a, b, c, x[(i + 3)], 10, -1894986606);
c = ii(c, d, a, b, x[(i + 10)], 15, -1051523);
b = ii(b, c, d, a, x[(i + 1)], 21, -2054922799);
a = ii(a, b, c, d, x[(i + 8)], 6, 1873313359);
d = ii(d, a, b, c, x[(i + 15)], 10, -30611744);
c = ii(c, d, a, b, x[(i + 6)], 15, -1560198380);
b = ii(b, c, d, a, x[(i + 13)], 21, 1309151649);
a = ii(a, b, c, d, x[(i + 4)], 6, -145523070);
d = ii(d, a, b, c, x[(i + 11)], 10, -1120210379);
c = ii(c, d, a, b, x[(i + 2)], 15, 718787259);
b = ii(b, c, d, a, x[(i + 9)], 21, -343485551);
a = (a + aa);
b = (b + bb);
c = (c + cc);
d = (d + dd);
i = (i + 16);
};
return ((((IntUtil.toHex(a) + IntUtil.toHex(b)) + IntUtil.toHex(c)) + IntUtil.toHex(d)));
}
private static function gg(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{
return (transform(g, a, b, c, d, x, s, t));
}
}
}//package com.adobe.crypto
Section 41
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public function IntUtil(){
super();
}
public static function toHex(n:int, bigEndian:Boolean=false):String{
var s:String;
var i:int;
var x:int;
s = "";
if (bigEndian){
i = 0;
while (i < 4) {
s = (s + (hexChars.charAt(((n >> (((3 - i) * 8) + 4)) & 15)) + hexChars.charAt(((n >> ((3 - i) * 8)) & 15))));
i++;
};
} else {
x = 0;
while (x < 4) {
s = (s + (hexChars.charAt(((n >> ((x * 8) + 4)) & 15)) + hexChars.charAt(((n >> (x * 8)) & 15))));
x++;
};
};
return (s);
}
public static function ror(x:int, n:int):uint{
var nn:int;
nn = (32 - n);
return (((x << nn) | (x >>> (32 - nn))));
}
public static function rol(x:int, n:int):int{
return (((x << n) | (x >>> (32 - n))));
}
}
}//package com.adobe.utils
Section 42
//AdLoader (CPMStar.AdLoader)
package CPMStar {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class AdLoader extends Sprite {
private var contentspotid:String;
private var cpmstarLoader:Loader;
public function AdLoader(contentspotid:String){
super();
this.contentspotid = contentspotid;
addEventListener(Event.ADDED, addedHandler);
}
private function addedHandler(event:Event):void{
var cpmstarViewSWFUrl:String;
var container:DisplayObjectContainer;
removeEventListener(Event.ADDED, addedHandler);
Security.allowDomain("server.cpmstar.com");
cpmstarViewSWFUrl = "http://server.cpmstar.com/adviewas3.swf";
container = parent;
cpmstarLoader = new Loader();
cpmstarLoader.contentLoaderInfo.addEventListener(Event.INIT, dispatchHandler);
cpmstarLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, dispatchHandler);
cpmstarLoader.load(new URLRequest(((cpmstarViewSWFUrl + "?contentspotid=") + contentspotid)));
addChild(cpmstarLoader);
}
private function dispatchHandler(event:Event):void{
dispatchEvent(event);
}
}
}//package CPMStar
Section 43
//MochiDigits (mochi.as3.MochiDigits)
package mochi.as3 {
public final class MochiDigits {
private var Sibling:MochiDigits;
private var Fragment:Number;
private var Encoder:Number;
public function MochiDigits(digit:Number=0, index:uint=0):void{
super();
Encoder = 0;
setValue(digit, index);
}
public function set value(v:Number):void{
setValue(v);
}
public function reencode():void{
var newEncode:uint;
newEncode = int((2147483647 * Math.random()));
Fragment = (Fragment ^ (newEncode ^ Encoder));
Encoder = newEncode;
}
public function toString():String{
var s:String;
s = String.fromCharCode((Fragment ^ Encoder));
if (Sibling != null){
s = (s + Sibling.toString());
};
return (s);
}
public function get value():Number{
return (Number(this.toString()));
}
public function setValue(digit:Number=0, index:uint=0):void{
var s:String;
s = digit.toString();
var _temp1 = index;
index = (index + 1);
Fragment = (s.charCodeAt(_temp1) ^ Encoder);
if (index < s.length){
Sibling = new MochiDigits(digit, index);
} else {
Sibling = null;
};
reencode();
}
public function addValue(inc:Number):void{
value = (value + inc);
}
}
}//package mochi.as3
Section 44
//MochiScores (mochi.as3.MochiScores)
package mochi.as3 {
import flash.display.*;
import flash.text.*;
public class MochiScores {
private static var boardID:String;
public static var onErrorHandler:Object;
public static var onCloseHandler:Object;
public function MochiScores(){
super();
}
public static function showLeaderboard(options:Object=null):void{
var n:Number;
var options = options;
if (options != null){
if (options.clip != null){
if ((options.clip is Sprite)){
MochiServices.setContainer(options.clip);
};
delete options.clip;
} else {
MochiServices.setContainer();
};
MochiServices.stayOnTop();
if (options.name != null){
if ((options.name is TextField)){
if (options.name.text.length > 0){
options.name = options.name.text;
};
};
};
if (options.score != null){
if ((options.score is TextField)){
if (options.score.text.length > 0){
options.score = options.score.text;
};
} else {
if ((options.score is MochiDigits)){
options.score = options.score.value;
};
};
n = Number(options.score);
if (isNaN(n)){
} else {
if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){
} else {
if (Math.floor(n) != n){
};
options.score = n;
};
};
};
if (options.onDisplay != null){
options.onDisplay();
} else {
if (MochiServices.clip != null){
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
};
} else {
options = {};
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.stop();
//unresolved jump
};
};
if (options.onClose != null){
onCloseHandler = options.onClose;
} else {
onCloseHandler = function ():void{
if ((MochiServices.clip is MovieClip)){
MochiServices.clip.play();
//unresolved jump
};
};
};
if (options.onError != null){
onErrorHandler = options.onError;
} else {
onErrorHandler = null;
};
if (options.boardID == null){
if (MochiScores.boardID != null){
options.boardID = MochiScores.boardID;
};
};
MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose);
}
public static function closeLeaderboard():void{
MochiServices.send("scores_closeLeaderboard");
}
public static function getPlayerInfo(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
public static function requestList(callbackObj:Object, callbackMethod:Object=null):void{
MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
public static function scoresArrayToObjects(scores:Object):Object{
var so:Object;
var i:Number;
var j:Number;
var o:Object;
var row_obj:Object;
var item:String;
var param:String;
so = {};
for (item in scores) {
if (typeof(scores[item]) == "object"){
if (((!((scores[item].cols == null))) && (!((scores[item].rows == null))))){
so[item] = [];
o = scores[item];
j = 0;
while (j < o.rows.length) {
row_obj = {};
i = 0;
while (i < o.cols.length) {
row_obj[o.cols[i]] = o.rows[j][i];
i++;
};
so[item].push(row_obj);
j++;
};
} else {
so[item] = {};
for (param in scores[item]) {
so[item][param] = scores[item][param];
};
};
} else {
so[item] = scores[item];
};
};
return (so);
}
public static function submit(score:Number, name:String, callbackObj:Object=null, callbackMethod:Object=null):void{
score = Number(score);
if (isNaN(score)){
} else {
if ((((score == Number.NEGATIVE_INFINITY)) || ((score == Number.POSITIVE_INFINITY)))){
} else {
if (Math.floor(score) != score){
};
score = Number(score);
};
};
MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
public static function onClose(args:Object=null):void{
if (args != null){
if (args.error != null){
if (args.error == true){
if (onErrorHandler != null){
if (args.errorCode == null){
args.errorCode = "IOError";
};
onErrorHandler(args.errorCode);
MochiServices.doClose();
return;
};
};
};
};
onCloseHandler();
MochiServices.doClose();
}
public static function setBoardID(boardID:String):void{
MochiScores.boardID = boardID;
MochiServices.send("scores_setBoardID", {boardID:boardID});
}
}
}//package mochi.as3
Section 45
//MochiServices (mochi.as3.MochiServices)
package mochi.as3 {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiServices {
private static var _container:Object;
private static var _connected:Boolean = false;
private static var _swfVersion:String;
public static var netupAttempted:Boolean = false;
private static var _sendChannel:LocalConnection;
private static var _clip:MovieClip;
private static var _loader:Loader;
private static var _id:String;
private static var _listenChannel:LocalConnection;
public static var widget:Boolean = false;
private static var _timer:Timer;
private static var _sendChannelName:String;
private static var _connecting:Boolean = false;
public static var onError:Object;
private static var _listenChannelName:String = "__ms_";
private static var _servicesURL:String = "http://www.mochiads.com/static/lib/services/services.swf";
public static var netup:Boolean = true;
public function MochiServices(){
super();
}
public static function isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function get connected():Boolean{
return (_connected);
}
private static function flush(error:Boolean):void{
var request:Object;
var callback:Object;
if (_clip != null){
if (_clip._queue != null){
while (_clip._queue.length > 0) {
request = _clip._queue.shift();
callback = null;
if (request != null){
if (request.callbackID != null){
callback = _clip._callbacks[request.callbackID];
};
delete _clip._callbacks[request.callbackID];
if (((error) && (!((callback == null))))){
handleError(request.args, callback.callbackObject, callback.callbackMethod);
};
};
};
};
};
}
public static function send(methodName:String, args:Object=null, callbackObject:Object=null, callbackMethod:Object=null):void{
if (_connected){
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_clip._nextcallbackID});
} else {
if ((((_clip == null)) || (!(_connecting)))){
onError("NotConnected");
handleError(args, callbackObject, callbackMethod);
flush(true);
return;
};
_clip._queue.push({methodName:methodName, args:args, callbackID:_clip._nextcallbackID});
};
if (_clip != null){
if (((!((_clip._callbacks == null))) && (!((_clip._nextcallbackID == null))))){
_clip._callbacks[_clip._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_clip._nextcallbackID++;
};
};
}
private static function init(id:String, clip:Object):void{
_id = id;
if (clip != null){
_container = clip;
loadCommunicator(id, _container);
};
}
public static function get childClip():Object{
return (_clip);
}
private static function clickMovie(url:String, cb:Function):MovieClip{
var avm1_bytecode:Array;
var b:int;
var header:Array;
var footer:Array;
var mc:MovieClip;
var lc:LocalConnection;
var lc_name:String;
var ba:ByteArray;
var cpool:ByteArray;
var actionLength:uint;
var fileLength:uint;
var loader:Loader;
avm1_bytecode = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23];
header = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3];
footer = [0, 64, 0, 0, 0];
mc = new MovieClip();
lc = new LocalConnection();
lc_name = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().getTime()));
lc = new LocalConnection();
mc.lc = lc;
mc.click = cb;
lc.client = mc;
lc.connect(lc_name);
ba = new ByteArray();
cpool = new ByteArray();
cpool.endian = Endian.LITTLE_ENDIAN;
cpool.writeShort(1);
cpool.writeUTFBytes(((url + " ") + lc_name));
cpool.writeByte(0);
actionLength = ((avm1_bytecode.length + cpool.length) + 4);
fileLength = (actionLength + 35);
ba.endian = Endian.LITTLE_ENDIAN;
ba.writeUTFBytes("FWS");
ba.writeByte(8);
ba.writeUnsignedInt(fileLength);
for each (b in header) {
ba.writeByte(b);
};
ba.writeUnsignedInt(actionLength);
ba.writeByte(136);
ba.writeShort(cpool.length);
ba.writeBytes(cpool);
for each (b in avm1_bytecode) {
ba.writeByte(b);
};
for each (b in footer) {
ba.writeByte(b);
};
loader = new Loader();
loader.loadBytes(ba);
mc.addChild(loader);
return (mc);
}
public static function stayOnTop():void{
_container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true);
if (_clip != null){
_clip.visible = true;
};
}
public static function addLinkEvent(url:String, burl:String, btn:DisplayObjectContainer, onClick:Function=null):void{
var vars:Object;
var avm1Click:DisplayObject;
var s:String;
var i:Number;
var x:String;
var req:URLRequest;
var loader:Loader;
var setURL:Function;
var err:Function;
var complete:Function;
var url = url;
var burl = burl;
var btn = btn;
var onClick = onClick;
vars = new Object();
vars["mav"] = getVersion();
vars["swfv"] = "9";
vars["swfurl"] = btn.loaderInfo.loaderURL;
vars["fv"] = Capabilities.version;
vars["os"] = Capabilities.os;
vars["lang"] = Capabilities.language;
vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY);
s = "?";
i = 0;
for (x in vars) {
if (i != 0){
s = (s + "&");
};
i = (i + 1);
s = (((s + x) + "=") + escape(vars[x]));
};
req = new URLRequest("http://x.mochiads.com/linkping.swf");
loader = new Loader();
setURL = function (url:String):void{
var rect:Rectangle;
if (avm1Click){
btn.removeChild(avm1Click);
};
avm1Click = clickMovie(url, onClick);
rect = btn.getBounds(btn);
btn.addChild(avm1Click);
avm1Click.x = rect.x;
avm1Click.y = rect.y;
avm1Click.scaleX = (0.01 * rect.width);
avm1Click.scaleY = (0.01 * rect.height);
};
err = function (ev:Object):void{
netup = false;
ev.target.removeEventListener(ev.type, arguments.callee);
setURL(burl);
};
complete = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
};
if (netup){
setURL((url + s));
} else {
setURL(burl);
};
if (!((netupAttempted) || (_connected))){
netupAttempted = true;
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete);
loader.load(req);
};
}
public static function disconnect():void{
if (((_connected) || (_connecting))){
if (_clip != null){
if (_clip.parent != null){
if ((_clip.parent is Sprite)){
Sprite(_clip.parent).removeChild(_clip);
_clip = null;
};
};
};
_connecting = (_connected = false);
flush(true);
_listenChannel.close();
//unresolved jump
var _slot1 = error;
};
if (_timer != null){
_timer.stop();
//unresolved jump
var _slot1 = error;
};
}
public static function allowDomains(server:String):String{
var hostname:String;
if (Security.sandboxType != "application"){
Security.allowDomain("*");
Security.allowInsecureDomain("*");
};
if (server.indexOf("http://") != -1){
hostname = server.split("/")[2].split(":")[0];
if (Security.sandboxType != "application"){
Security.allowDomain(hostname);
Security.allowInsecureDomain(hostname);
};
};
return (hostname);
}
public static function getVersion():String{
return ("3.0");
}
public static function doClose():void{
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
if (_clip.parent != null){
Sprite(_clip.parent).removeChild(_clip);
};
}
private static function onStatus(event:StatusEvent):void{
switch (event.level){
case "error":
_connected = false;
_listenChannel.connect(_listenChannelName);
break;
};
}
public static function get id():String{
return (_id);
}
private static function urlOptions(clip:Object):Object{
var opts:Object;
var options:String;
var pairs:Array;
var i:Number;
var kv:Array;
opts = {};
options = clip.loaderInfo.parameters.mochiad_options;
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
opts[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
return (opts);
}
public static function setContainer(container:Object=null, doAdd:Boolean=true):void{
if (container != null){
if ((container is Sprite)){
_container = container;
};
};
if (doAdd){
if ((_container is Sprite)){
Sprite(_container).addChild(_clip);
};
};
}
private static function handleError(args:Object, callbackObject:Object, callbackMethod:Object):void{
var args = args;
var callbackObject = callbackObject;
var callbackMethod = callbackMethod;
if (args != null){
if (args.onError != null){
args.onError.apply(null, ["NotConnected"]);
};
if (((!((args.options == null))) && (!((args.options.onError == null))))){
args.options.onError.apply(null, ["NotConnected"]);
};
};
if (callbackMethod != null){
args = {};
args.error = true;
args.errorCode = "NotConnected";
if (((!((callbackObject == null))) && ((callbackMethod is String)))){
var _local5 = callbackObject;
_local5[callbackMethod](args);
//unresolved jump
var _slot1 = error;
} else {
if (callbackMethod != null){
callbackMethod.apply(args);
//unresolved jump
var _slot1 = error;
};
};
};
}
private static function initComChannels():void{
if (!_connected){
_sendChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_container, version:getVersion(), parentURL:_container.loaderInfo.loaderURL});
_listenChannel.addEventListener(StatusEvent.STATUS, MochiServices.onStatus);
_clip.onReceive = function (pkg:Object):void{
var cb:String;
var cblst:Object;
var method:*;
var methodName:String;
var obj:Object;
var pkg = pkg;
cb = pkg.callbackID;
cblst = this.client._callbacks[cb];
if (!cblst){
return;
};
method = cblst.callbackMethod;
methodName = "";
obj = cblst.callbackObject;
if (((obj) && ((typeof(method) == "string")))){
methodName = method;
if (obj[method] != null){
method = obj[method];
//unresolved jump
};
};
if (method != undefined){
method.apply(obj, pkg.args);
//unresolved jump
var _slot1 = error;
} else {
if (obj != null){
obj(pkg.args);
//unresolved jump
var _slot1 = error;
};
};
delete this.client._callbacks[cb];
};
_clip.onError = function ():void{
MochiServices.onError("IOError");
};
_connecting = false;
_connected = true;
while (_clip._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _clip._queue.shift());
};
};
}
private static function listen():void{
_listenChannel = new LocalConnection();
_listenChannel.client = _clip;
_clip.handshake = function (args:Object):void{
MochiServices.comChannelName = args.newChannel;
};
_listenChannel.allowDomain("*", "localhost");
_listenChannel.allowInsecureDomain("*", "localhost");
_listenChannel.connect(_listenChannelName);
}
public static function set comChannelName(val:String):void{
if (val != null){
if (val.length > 3){
_sendChannelName = (val + "_fromgame");
initComChannels();
};
};
}
private static function loadCommunicator(id:String, clip:Object):MovieClip{
var clipname:String;
var f:Function;
var req:URLRequest;
var vars:URLVariables;
var id = id;
var clip = clip;
clipname = ("_mochiservices_com_" + id);
if (_clip != null){
return (_clip);
};
if (!MochiServices.isNetworkAvailable()){
return (null);
};
if (urlOptions(clip).servicesURL != undefined){
_servicesURL = urlOptions(clip).servicesURL;
};
MochiServices.allowDomains(_servicesURL);
_clip = createEmptyMovieClip(clip, clipname, 10336, false);
_loader = new Loader();
f = function (ev:Object):void{
_clip._mochiad_ctr_failed = true;
MochiServices.disconnect();
MochiServices.onError("IOError");
};
_listenChannelName = (_listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor((Math.random() * 99999))));
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
req = new URLRequest(_servicesURL);
vars = new URLVariables();
vars.listenLC = _listenChannelName;
vars.mochiad_options = clip.loaderInfo.parameters.mochiad_options;
if (widget){
vars.widget = true;
};
req.data = vars;
listen();
_loader.load(req);
_clip.addChild(_loader);
_clip._mochiservices_com = _loader;
_sendChannel = new LocalConnection();
_clip._queue = [];
_clip._nextcallbackID = 0;
_clip._callbacks = {};
_timer = new Timer(10000, 1);
_timer.addEventListener(TimerEvent.TIMER, connectWait);
_timer.start();
return (_clip);
}
public static function get clip():Object{
return (_container);
}
public static function bringToTop(e:Event):void{
var e = e;
if (MochiServices.clip != null){
if (MochiServices.childClip != null){
if (MochiServices.clip.numChildren > 1){
MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1));
};
//unresolved jump
var _slot1 = errorObject;
_container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop);
};
};
}
public static function connect(id:String, clip:Object, onError:Object=null):void{
var id = id;
var clip = clip;
var onError = onError;
if ((clip is DisplayObject)){
if (((!(_connected)) && ((_clip == null)))){
_connecting = true;
init(id, clip);
};
//unresolved jump
};
if (onError != null){
MochiServices.onError = onError;
} else {
if (MochiServices.onError == null){
MochiServices.onError = function (errorCode:String):void{
};
};
};
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number, doAdd:Boolean=true):MovieClip{
var mc:MovieClip;
var parent = parent;
var name = name;
var depth = depth;
var doAdd = doAdd;
mc = new MovieClip();
if (doAdd){
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
};
parent[name] = mc;
//unresolved jump
var _slot1 = e;
throw (new Error("MochiServices requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
mc["_name"] = name;
return (mc);
}
public static function connectWait(e:TimerEvent):void{
if (!_connected){
_clip._mochiad_ctr_failed = true;
MochiServices.disconnect();
MochiServices.onError("IOError");
};
}
}
}//package mochi.as3
Section 46
//assetHolder_1 (Zombie_War_Mini_vNG10_fla.assetHolder_1)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class assetHolder_1 extends MovieClip {
public function assetHolder_1(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 47
//attackButtonG_227 (Zombie_War_Mini_vNG10_fla.attackButtonG_227)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class attackButtonG_227 extends MovieClip {
public function attackButtonG_227(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 48
//background_ground_198 (Zombie_War_Mini_vNG10_fla.background_ground_198)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class background_ground_198 extends MovieClip {
public var gg:MovieClip;
public function background_ground_198(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 49
//baseMachineGun_125 (Zombie_War_Mini_vNG10_fla.baseMachineGun_125)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class baseMachineGun_125 extends MovieClip {
public var firePoint:MovieClip;
public function baseMachineGun_125(){
super();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 50
//buildButtonG_230 (Zombie_War_Mini_vNG10_fla.buildButtonG_230)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class buildButtonG_230 extends MovieClip {
public function buildButtonG_230(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 51
//clockAnim_85 (Zombie_War_Mini_vNG10_fla.clockAnim_85)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class clockAnim_85 extends MovieClip {
public function clockAnim_85(){
super();
addFrameScript(44, frame45);
}
function frame45(){
MovieClip(this.parent.parent).rt.setupGoodGuy(this);
if (MovieClip(this.parent).numberOrdered.text != 0){
gotoAndPlay(1);
} else {
MovieClip(this.parent).gotoAndStop(1);
};
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 52
//clockAnim2_87 (Zombie_War_Mini_vNG10_fla.clockAnim2_87)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class clockAnim2_87 extends MovieClip {
public function clockAnim2_87(){
super();
addFrameScript(17, frame18);
}
function frame18(){
MovieClip(this.parent.parent).rt.setupGoodGuy(this);
if (MovieClip(this.parent).numberOrdered.text != 0){
gotoAndPlay(1);
} else {
MovieClip(this.parent).gotoAndStop(1);
};
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 53
//continueAnim_341 (Zombie_War_Mini_vNG10_fla.continueAnim_341)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class continueAnim_341 extends MovieClip {
public var contBtn:SimpleButton;
public function continueAnim_341(){
super();
addFrameScript(0, frame1, 1, frame2);
}
public function gotoGame(e:MouseEvent):void{
MovieClip(this.parent).rt.contGame();
}
function frame1(){
stop();
}
function frame2(){
contBtn.addEventListener(MouseEvent.MOUSE_DOWN, gotoGame, false);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 54
//defendButtonG_228 (Zombie_War_Mini_vNG10_fla.defendButtonG_228)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class defendButtonG_228 extends MovieClip {
public function defendButtonG_228(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 55
//Endtitle_238 (Zombie_War_Mini_vNG10_fla.Endtitle_238)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class Endtitle_238 extends MovieClip {
public function Endtitle_238(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 56
//gameoverFilter_237 (Zombie_War_Mini_vNG10_fla.gameoverFilter_237)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class gameoverFilter_237 extends MovieClip {
public var submitBtn:SimpleButton;
public var endTitle:MovieClip;
public var moreGamesBtn:SimpleButton;
public var score:TextField;
public var quitBtn:SimpleButton;
public var restartBtn:SimpleButton;
public var nameTxt:TextField;
public function gameoverFilter_237(){
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function doRestart(event:MouseEvent):void{
MovieClip(this.parent.parent).rt.restartLevel();
}
public function doViewScores(event:MouseEvent):void{
}
public function doMoreGames(e:MouseEvent):void{
navigateToURL(new URLRequest("http://www.arcadebomb.com"), "_blank");
}
function frame3(){
score.text = MovieClip(this.parent.parent).rt.score;
moreGamesBtn.addEventListener(MouseEvent.MOUSE_UP, doMoreGames);
quitBtn.addEventListener(MouseEvent.MOUSE_UP, doQuit);
stop();
}
function frame1(){
MovieClip(this.parent.parent).rt.rt.showLeaderBoard(MovieClip(this.parent.parent));
stop();
}
public function doSubmit(event:MouseEvent):void{
if (nameTxt.text != ""){
MovieClip(this.parent.parent).buttonPressed(nameTxt.text, MovieClip(this.parent.parent).rt.score);
gotoAndStop(2);
};
}
function frame2(){
score.text = MovieClip(this.parent.parent).rt.score;
quitBtn.addEventListener(MouseEvent.MOUSE_UP, doQuit);
restartBtn.addEventListener(MouseEvent.MOUSE_UP, doRestart);
stop();
}
public function doQuit(event:MouseEvent):void{
MovieClip(this.parent.parent).rt.quitGame();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 57
//gameOverMsg_236 (Zombie_War_Mini_vNG10_fla.gameOverMsg_236)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class gameOverMsg_236 extends MovieClip {
public var msg:MovieClip;
public function gameOverMsg_236(){
super();
addFrameScript(0, frame1);
}
function frame1(){
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 58
//levelCompleteMsg_233 (Zombie_War_Mini_vNG10_fla.levelCompleteMsg_233)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.text.*;
public dynamic class levelCompleteMsg_233 extends MovieClip {
public var titleMc:levelCompleteMsgs;
public var timeBonus:TextField;
public var scoreBonus:TextField;
public var totalScore:TextField;
public function levelCompleteMsg_233(){
super();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 59
//manStoneHitBack_160 (Zombie_War_Mini_vNG10_fla.manStoneHitBack_160)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class manStoneHitBack_160 extends MovieClip {
public function manStoneHitBack_160(){
super();
addFrameScript(9, frame10);
}
function frame10(){
MovieClip(this.parent).gotoAndStop("walk");
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 60
//mineButtonG_229 (Zombie_War_Mini_vNG10_fla.mineButtonG_229)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class mineButtonG_229 extends MovieClip {
public function mineButtonG_229(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 61
//MINIJUEGOS_3 (Zombie_War_Mini_vNG10_fla.MINIJUEGOS_3)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class MINIJUEGOS_3 extends MovieClip {
public function MINIJUEGOS_3(){
super();
addFrameScript(99, frame100);
}
function frame100(){
MovieClip(this.parent).gotoAndStop(2);
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 62
//musicBtnMc_218 (Zombie_War_Mini_vNG10_fla.musicBtnMc_218)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class musicBtnMc_218 extends MovieClip {
public function musicBtnMc_218(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 63
//risingScoreTxt_171 (Zombie_War_Mini_vNG10_fla.risingScoreTxt_171)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.text.*;
public dynamic class risingScoreTxt_171 extends MovieClip {
public var scoreTxt:TextField;
public function risingScoreTxt_171(){
super();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 64
//shields_294 (Zombie_War_Mini_vNG10_fla.shields_294)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class shields_294 extends MovieClip {
public var w:MovieClip;
public function shields_294(){
super();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 65
//soldierBaseRifle_106 (Zombie_War_Mini_vNG10_fla.soldierBaseRifle_106)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class soldierBaseRifle_106 extends MovieClip {
public var firePoint:MovieClip;
public function soldierBaseRifle_106(){
super();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 66
//soldierDeath_149 (Zombie_War_Mini_vNG10_fla.soldierDeath_149)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class soldierDeath_149 extends MovieClip {
public function soldierDeath_149(){
super();
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 67
//soldierHit_148 (Zombie_War_Mini_vNG10_fla.soldierHit_148)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class soldierHit_148 extends MovieClip {
public function soldierHit_148(){
super();
addFrameScript(8, frame9);
}
function frame9(){
MovieClip(this.parent).gotoAndStop("gunStand");
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 68
//soundFxMc_220 (Zombie_War_Mini_vNG10_fla.soundFxMc_220)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class soundFxMc_220 extends MovieClip {
public function soundFxMc_220(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 69
//stoneFence_121 (Zombie_War_Mini_vNG10_fla.stoneFence_121)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class stoneFence_121 extends MovieClip {
public function stoneFence_121(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 70
//turret_header_129 (Zombie_War_Mini_vNG10_fla.turret_header_129)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class turret_header_129 extends MovieClip {
public function turret_header_129(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 71
//turret_holder_109 (Zombie_War_Mini_vNG10_fla.turret_holder_109)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class turret_holder_109 extends MovieClip {
public var fence:MovieClip;
public function turret_holder_109(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 72
//upgradeBack_275 (Zombie_War_Mini_vNG10_fla.upgradeBack_275)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class upgradeBack_275 extends MovieClip {
public function upgradeBack_275(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 73
//upgradeClock_277 (Zombie_War_Mini_vNG10_fla.upgradeClock_277)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class upgradeClock_277 extends MovieClip {
public function upgradeClock_277(){
super();
addFrameScript(35, frame36);
}
function frame36(){
MovieClip(this.parent.parent).setupUpgrade();
MovieClip(this.parent).gotoAndStop(3);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 74
//weapons_94 (Zombie_War_Mini_vNG10_fla.weapons_94)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class weapons_94 extends MovieClip {
public function weapons_94(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 75
//wireFence_115 (Zombie_War_Mini_vNG10_fla.wireFence_115)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class wireFence_115 extends MovieClip {
public function wireFence_115(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 76
//woodenBase_110 (Zombie_War_Mini_vNG10_fla.woodenBase_110)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class woodenBase_110 extends MovieClip {
public function woodenBase_110(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 77
//yuoarehereAnim_42 (Zombie_War_Mini_vNG10_fla.yuoarehereAnim_42)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class yuoarehereAnim_42 extends MovieClip {
public var youarehere:youarehereMc;
public function yuoarehereAnim_42(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 78
//zombieArm_20 (Zombie_War_Mini_vNG10_fla.zombieArm_20)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class zombieArm_20 extends MovieClip {
public function zombieArm_20(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 79
//zombieAttack_158 (Zombie_War_Mini_vNG10_fla.zombieAttack_158)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class zombieAttack_158 extends MovieClip {
public var leg1:MovieClip;
public var torso:MovieClip;
public var leg2:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var head:zombieHeadSide;
public function zombieAttack_158(){
super();
addFrameScript(0, frame1, 2, frame3, 4, frame5, 6, frame7, 10, frame11);
}
function frame3(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame7(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame1(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame5(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame11(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 80
//zombieDie_161 (Zombie_War_Mini_vNG10_fla.zombieDie_161)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class zombieDie_161 extends MovieClip {
public var leg1:MovieClip;
public var torso:MovieClip;
public var leg2:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var head:zombieHeadSide;
public function zombieDie_161(){
super();
addFrameScript(0, frame1, 2, frame3, 4, frame5, 6, frame7, 8, frame9);
}
function frame3(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame7(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame1(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame5(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame9(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 81
//zombieFoot_22 (Zombie_War_Mini_vNG10_fla.zombieFoot_22)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class zombieFoot_22 extends MovieClip {
public function zombieFoot_22(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 82
//zombieHit_159 (Zombie_War_Mini_vNG10_fla.zombieHit_159)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class zombieHit_159 extends MovieClip {
public var leg1:MovieClip;
public var torso:MovieClip;
public var leg2:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var head:zombieHeadSide;
public function zombieHit_159(){
super();
addFrameScript(0, frame1, 2, frame3);
}
function frame3(){
MovieClip(this.parent).gotoAndStop("walkSlow1");
}
function frame1(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 83
//zombieLeg_24 (Zombie_War_Mini_vNG10_fla.zombieLeg_24)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class zombieLeg_24 extends MovieClip {
public function zombieLeg_24(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 84
//zombieSide_157 (Zombie_War_Mini_vNG10_fla.zombieSide_157)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class zombieSide_157 extends MovieClip {
public var leg1:MovieClip;
public var torso:MovieClip;
public var leg2:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var head:zombieHeadSide;
public function zombieSide_157(){
super();
addFrameScript(0, frame1, 2, frame3, 4, frame5, 6, frame7, 8, frame9, 10, frame11, 12, frame13, 14, frame15, 16, frame17, 18, frame19);
}
function frame3(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame15(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame7(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame1(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame13(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame17(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame5(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame9(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame11(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame19(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 85
//zombieStart_152 (Zombie_War_Mini_vNG10_fla.zombieStart_152)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class zombieStart_152 extends MovieClip {
public var leg1:MovieClip;
public var torso:MovieClip;
public var leg2:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var head:zombieHeadSide;
public function zombieStart_152(){
super();
addFrameScript(0, frame1, 26, frame27);
}
function frame1(){
MovieClip(this.parent).myObject.speed = 0;
MovieClip(this.parent).myObject.speedOld = 0;
}
function frame27(){
MovieClip(this.parent).gotoAndStop(2);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 86
//zombieTorsoSide_154 (Zombie_War_Mini_vNG10_fla.zombieTorsoSide_154)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
public dynamic class zombieTorsoSide_154 extends MovieClip {
public function zombieTorsoSide_154(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 87
//zombieWalkSlow_156 (Zombie_War_Mini_vNG10_fla.zombieWalkSlow_156)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class zombieWalkSlow_156 extends MovieClip {
public var leg1:MovieClip;
public var torso:MovieClip;
public var leg2:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var head:zombieHeadSide;
public function zombieWalkSlow_156(){
super();
addFrameScript(0, frame1, 12, frame13, 17, frame18, 21, frame22, 24, frame25);
}
function frame18(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame1(){
MovieClip(this.parent).myObject.speed = 0;
MovieClip(this.parent).myObject.speedOld = 0;
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame25(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame13(){
MovieClip(this.parent).myObject.speed = 0.4;
MovieClip(this.parent).myObject.speedOld = 0.4;
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame22(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 88
//zombieWalkSlow2_163 (Zombie_War_Mini_vNG10_fla.zombieWalkSlow2_163)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class zombieWalkSlow2_163 extends MovieClip {
public var leg1:MovieClip;
public var torso:MovieClip;
public var leg2:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var head:zombieHeadSide;
public function zombieWalkSlow2_163(){
super();
addFrameScript(0, frame1, 2, frame3, 6, frame7, 10, frame11, 13, frame14, 16, frame17, 19, frame20, 22, frame23, 25, frame26, 28, frame29);
}
function frame14(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame3(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame7(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame1(){
MovieClip(this.parent).myObject.speed = 0.2;
MovieClip(this.parent).myObject.speedOld = 0.2;
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame26(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame17(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame29(){
MovieClip(this.parent).myObject.speed = 0;
MovieClip(this.parent).myObject.speedOld = 0;
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame23(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame20(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame11(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 89
//zombieWalkSlow3_164 (Zombie_War_Mini_vNG10_fla.zombieWalkSlow3_164)
package Zombie_War_Mini_vNG10_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class zombieWalkSlow3_164 extends MovieClip {
public var leg1:MovieClip;
public var torso:MovieClip;
public var leg2:MovieClip;
public var arm2:MovieClip;
public var arm1:MovieClip;
public var foot1:MovieClip;
public var foot2:MovieClip;
public var head:zombieHeadSide;
public function zombieWalkSlow3_164(){
super();
addFrameScript(0, frame1, 2, frame3, 6, frame7, 10, frame11, 13, frame14, 16, frame17, 19, frame20, 22, frame23, 25, frame26, 28, frame29);
}
function frame14(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame3(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame7(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame1(){
MovieClip(this.parent).myObject.speed = 0.2;
MovieClip(this.parent).myObject.speedOld = 0.2;
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame26(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame17(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame29(){
MovieClip(this.parent).myObject.speed = 0;
MovieClip(this.parent).myObject.speedOld = 0;
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame23(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame20(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
function frame11(){
MovieClip(this.parent).myObject.turnOffLimbs(this);
}
}
}//package Zombie_War_Mini_vNG10_fla
Section 90
//antsMc (antsMc)
package {
import flash.display.*;
public dynamic class antsMc extends BitmapData {
public function antsMc(w:Number, h:Number){
super(w, h);
}
}
}//package
Section 91
//backgroundMc (backgroundMc)
package {
import flash.display.*;
public dynamic class backgroundMc extends MovieClip {
public var ground:MovieClip;
public function backgroundMc(){
super();
}
}
}//package
Section 92
//backgroundMid (backgroundMid)
package {
import flash.display.*;
public dynamic class backgroundMid extends MovieClip {
public var back:backgroundP;
public function backgroundMid(){
super();
}
}
}//package
Section 93
//backgroundP (backgroundP)
package {
import flash.display.*;
public dynamic class backgroundP extends MovieClip {
public function backgroundP(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 94
//backgroundSkyMc (backgroundSkyMc)
package {
import flash.display.*;
public dynamic class backgroundSkyMc extends MovieClip {
public function backgroundSkyMc(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 95
//BadGuyRun (BadGuyRun)
package {
import flash.display.*;
public dynamic class BadGuyRun extends MovieClip {
public var w:MovieClip;
public function BadGuyRun(){
super();
}
}
}//package
Section 96
//badGuyStandRight (badGuyStandRight)
package {
import flash.display.*;
public dynamic class badGuyStandRight extends MovieClip {
public function badGuyStandRight(){
super();
}
}
}//package
Section 97
//badGuyThrow (badGuyThrow)
package {
import flash.display.*;
public dynamic class badGuyThrow extends MovieClip {
public function badGuyThrow(){
super();
addFrameScript(6, frame7);
}
function frame7(){
MovieClip(this.parent).gotoAndStop("stand");
}
}
}//package
Section 98
//batFx (batFx)
package {
import flash.media.*;
public dynamic class batFx extends Sound {
public function batFx(){
super();
}
}
}//package
Section 99
//bullet (bullet)
package {
import flash.display.*;
public dynamic class bullet extends MovieClip {
public function bullet(){
super();
}
}
}//package
Section 100
//bulletFx (bulletFx)
package {
import flash.media.*;
public dynamic class bulletFx extends Sound {
public function bulletFx(){
super();
}
}
}//package
Section 101
//clickBtnFx (clickBtnFx)
package {
import flash.media.*;
public dynamic class clickBtnFx extends Sound {
public function clickBtnFx(){
super();
}
}
}//package
Section 102
//commandBtn (commandBtn)
package {
import flash.display.*;
public dynamic class commandBtn extends SimpleButton {
public function commandBtn(){
super();
}
}
}//package
Section 103
//ComputerFx (ComputerFx)
package {
import flash.media.*;
public dynamic class ComputerFx extends Sound {
public function ComputerFx(){
super();
}
}
}//package
Section 104
//death1 (death1)
package {
import flash.display.*;
public dynamic class death1 extends MovieClip {
public function death1(){
super();
addFrameScript(12, frame13);
}
function frame13(){
stop();
}
}
}//package
Section 105
//doh (doh)
package {
import flash.media.*;
public dynamic class doh extends Sound {
public function doh(){
super();
}
}
}//package
Section 106
//droidBuiltFx (droidBuiltFx)
package {
import flash.media.*;
public dynamic class droidBuiltFx extends Sound {
public function droidBuiltFx(){
super();
}
}
}//package
Section 107
//enemyBomb (enemyBomb)
package {
import flash.display.*;
public dynamic class enemyBomb extends MovieClip {
public function enemyBomb(){
super();
}
}
}//package
Section 108
//enemyBullet (enemyBullet)
package {
import flash.display.*;
public dynamic class enemyBullet extends MovieClip {
public function enemyBullet(){
super();
}
}
}//package
Section 109
//enemyPhoton (enemyPhoton)
package {
import flash.display.*;
public dynamic class enemyPhoton extends MovieClip {
public function enemyPhoton(){
super();
}
}
}//package
Section 110
//enemyShell (enemyShell)
package {
import flash.display.*;
public dynamic class enemyShell extends MovieClip {
public function enemyShell(){
super();
}
}
}//package
Section 111
//energyBar (energyBar)
package {
import flash.display.*;
public dynamic class energyBar extends MovieClip {
public var bar:MovieClip;
public function energyBar(){
super();
}
}
}//package
Section 112
//explosion (explosion)
package {
import flash.display.*;
public dynamic class explosion extends MovieClip {
public function explosion(){
super();
}
}
}//package
Section 113
//explosionFx (explosionFx)
package {
import flash.media.*;
public dynamic class explosionFx extends Sound {
public function explosionFx(){
super();
}
}
}//package
Section 114
//fireMissileFx (fireMissileFx)
package {
import flash.media.*;
public dynamic class fireMissileFx extends Sound {
public function fireMissileFx(){
super();
}
}
}//package
Section 115
//gameOverFx (gameOverFx)
package {
import flash.media.*;
public dynamic class gameOverFx extends Sound {
public function gameOverFx(){
super();
}
}
}//package
Section 116
//getReadyMsg (getReadyMsg)
package {
import flash.display.*;
import flash.text.*;
public dynamic class getReadyMsg extends MovieClip {
public var levelText:TextField;
public function getReadyMsg(){
super();
}
}
}//package
Section 117
//getReadyMsgAnim (getReadyMsgAnim)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class getReadyMsgAnim extends MovieClip {
public var msg:getReadyMsg;
public function getReadyMsgAnim(){
super();
addFrameScript(10, frame11, 73, frame74);
}
function frame74(){
MovieClip(parent).rt.gameState = "play";
MovieClip(parent).removeChild(this);
stop();
}
function frame11(){
msg.levelText.text = ("Level " + MovieClip(parent).rt.levelNumber);
}
}
}//package
Section 118
//grenadeMc (grenadeMc)
package {
import flash.display.*;
public dynamic class grenadeMc extends MovieClip {
public function grenadeMc(){
super();
}
}
}//package
Section 119
//grenaderStand (grenaderStand)
package {
import flash.display.*;
public dynamic class grenaderStand extends MovieClip {
public function grenaderStand(){
super();
}
}
}//package
Section 120
//gunEnergy (gunEnergy)
package {
import flash.display.*;
public dynamic class gunEnergy extends MovieClip {
public function gunEnergy(){
super();
}
}
}//package
Section 121
//gunEnergyBtn (gunEnergyBtn)
package {
import flash.display.*;
public dynamic class gunEnergyBtn extends SimpleButton {
public function gunEnergyBtn(){
super();
}
}
}//package
Section 122
//gunEnergyLevel (gunEnergyLevel)
package {
import flash.display.*;
public dynamic class gunEnergyLevel extends MovieClip {
public var energyLevelMc:gunEnergy;
public function gunEnergyLevel(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 123
//heavyGunnerBody (heavyGunnerBody)
package {
import flash.display.*;
public dynamic class heavyGunnerBody extends MovieClip {
public function heavyGunnerBody(){
super();
}
}
}//package
Section 124
//heavyGunnerGun (heavyGunnerGun)
package {
import flash.display.*;
public dynamic class heavyGunnerGun extends MovieClip {
public function heavyGunnerGun(){
super();
}
}
}//package
Section 125
//heavyGunnerStand (heavyGunnerStand)
package {
import flash.display.*;
public dynamic class heavyGunnerStand extends MovieClip {
public var w:MovieClip;
public function heavyGunnerStand(){
super();
}
}
}//package
Section 126
//heavyGunnerWalk (heavyGunnerWalk)
package {
import flash.display.*;
public dynamic class heavyGunnerWalk extends MovieClip {
public function heavyGunnerWalk(){
super();
}
}
}//package
Section 127
//Hills (Hills)
package {
import flash.display.*;
public dynamic class Hills extends MovieClip {
public function Hills(){
super();
}
}
}//package
Section 128
//hitEnemyFx (hitEnemyFx)
package {
import flash.media.*;
public dynamic class hitEnemyFx extends Sound {
public function hitEnemyFx(){
super();
}
}
}//package
Section 129
//jetPassFx (jetPassFx)
package {
import flash.media.*;
public dynamic class jetPassFx extends Sound {
public function jetPassFx(){
super();
}
}
}//package
Section 130
//levelCompleteFx (levelCompleteFx)
package {
import flash.media.*;
public dynamic class levelCompleteFx extends Sound {
public function levelCompleteFx(){
super();
}
}
}//package
Section 131
//levelCompleteMsgs (levelCompleteMsgs)
package {
import flash.display.*;
public dynamic class levelCompleteMsgs extends MovieClip {
public function levelCompleteMsgs(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 132
//LoadingBox (LoadingBox)
package {
import flash.display.*;
import CPMStar.*;
public class LoadingBox extends MovieClip {
public var ad;
public var loaderbar:MovieClip;
public var continueGame:MovieClip;
public var rt:Object;
public var adBox:MovieClip;
public var CPMStarContentSpotID:String;
public function LoadingBox(rt2){
super();
addFrameScript(0, frame1);
rt = rt2;
}
function frame1(){
CPMStarContentSpotID = "521Q49EF9CAC";
ad = new AdLoader(CPMStarContentSpotID);
adBox.addChild(ad);
}
public function update(percent:int):void{
}
}
}//package
Section 133
//machinegunFx (machinegunFx)
package {
import flash.media.*;
public dynamic class machinegunFx extends Sound {
public function machinegunFx(){
super();
}
}
}//package
Section 134
//mainGunBullet (mainGunBullet)
package {
import flash.display.*;
public dynamic class mainGunBullet extends MovieClip {
public function mainGunBullet(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 135
//mainGunMissileHitFx (mainGunMissileHitFx)
package {
import flash.media.*;
public dynamic class mainGunMissileHitFx extends Sound {
public function mainGunMissileHitFx(){
super();
}
}
}//package
Section 136
//mainGunRotSound (mainGunRotSound)
package {
import flash.media.*;
public dynamic class mainGunRotSound extends Sound {
public function mainGunRotSound(){
super();
}
}
}//package
Section 137
//mainGunSound (mainGunSound)
package {
import flash.media.*;
public dynamic class mainGunSound extends Sound {
public function mainGunSound(){
super();
}
}
}//package
Section 138
//man (man)
package {
import flash.display.*;
public dynamic class man extends MovieClip {
public var selectionMc:manSelectionSquare;
public function man(){
super();
}
}
}//package
Section 139
//manGrenaderW (manGrenaderW)
package {
import flash.display.*;
public dynamic class manGrenaderW extends MovieClip {
public function manGrenaderW(){
super();
}
}
}//package
Section 140
//manGunStand (manGunStand)
package {
import flash.display.*;
public dynamic class manGunStand extends MovieClip {
public var w:MovieClip;
public function manGunStand(){
super();
}
}
}//package
Section 141
//manSelectionSquare (manSelectionSquare)
package {
import flash.display.*;
public dynamic class manSelectionSquare extends MovieClip {
public function manSelectionSquare(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 142
//mapShowFx (mapShowFx)
package {
import flash.media.*;
public dynamic class mapShowFx extends Sound {
public function mapShowFx(){
super();
}
}
}//package
Section 143
//marineEngineer (marineEngineer)
package {
import flash.display.*;
public dynamic class marineEngineer extends MovieClip {
public function marineEngineer(){
super();
}
}
}//package
Section 144
//mcTest (mcTest)
package {
import flash.display.*;
public dynamic class mcTest extends MovieClip {
public function mcTest(){
super();
}
}
}//package
Section 145
//mine (mine)
package {
import flash.display.*;
public dynamic class mine extends MovieClip {
public function mine(){
super();
}
}
}//package
Section 146
//moanFx (moanFx)
package {
import flash.media.*;
public dynamic class moanFx extends Sound {
public function moanFx(){
super();
}
}
}//package
Section 147
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
public class MochiAd {
public function MochiAd(){
super();
}
public static function getVersion():String{
return ("2.7");
}
public static function showClickAwayAd(options:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_timeout:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var sendHostProgress:Boolean;
var options = options;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
sendHostProgress = false;
mc.regContLC = function (lc_name:String):void{
mc._containerLCName = lc_name;
};
chk["onEnterFrame"] = function ():void{
var ad_clip:Object;
var elapsed:Number;
var finished:Boolean;
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
ad_clip = this.parent._mochiad_ctr;
elapsed = (getTimer() - this.started);
finished = false;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
finished = true;
chk.started = getTimer();
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (this.root == null){
finished = true;
};
if (finished){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(server:String):String{
var hostname:String;
hostname = server.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(hostname);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(hostname);
return (hostname);
}
public static function unload(clip:Object):Boolean{
if (((clip.clip) && (clip.clip._mochiad))){
clip = clip.clip;
};
if (clip.origFrameRate != undefined){
clip.stage.frameRate = clip.origFrameRate;
};
if (!clip._mochiad){
return (false);
};
if (clip._mochiad._containerLCName != undefined){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
};
if (clip._mochiad.onUnload){
clip._mochiad.onUnload();
};
delete clip._mochiad_loaded;
delete clip._mochiad;
return (true);
}
public static function showInterLevelAd(options:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = options;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var p:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
p = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object;
_chk = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = (msec - 250);
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
chk["onEnterFrame"] = function ():void{
var ad_clip:Object;
var elapsed:Number;
var finished:Boolean;
var total:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
ad_clip = this.parent._mochiad_ctr;
elapsed = (getTimer() - this.started);
finished = false;
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (elapsed > chk.ad_timeout){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (finished){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(options:Object, defaults:Object):Object{
var optcopy:Object;
var k:String;
var pairs:Array;
var i:Number;
var kv:Array;
optcopy = {};
for (k in defaults) {
optcopy[k] = defaults[k];
};
if (options){
for (k in options) {
optcopy[k] = options[k];
};
};
if (optcopy.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
options = optcopy.clip.loaderInfo.parameters.mochiad_options;
if (options){
pairs = options.split("&");
i = 0;
while (i < pairs.length) {
kv = pairs[i].split("=");
optcopy[unescape(kv[0])] = unescape(kv[1]);
i++;
};
};
if (optcopy.id == "test"){
};
return (optcopy);
}
public static function _cleanup(mc:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = mc;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
lc.client = null;
lc.close();
//unresolved jump
var _slot1 = e;
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function load(options:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var g:Function;
var req:URLRequest;
var v:Object;
var options = options;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip._mochiad_loaded){
return (null);
};
//unresolved jump
var _slot1 = e;
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
mc.lcName = name;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
g = function (ev:Object):void{
ev.target.removeEventListener(ev.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest(((server + ".swf?cacheBust=") + new Date().getTime()));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function runMethod(base:Object, methodName:String, argsArray:Array):Object{
var nameArray:Array;
var i:Number;
nameArray = methodName.split(".");
i = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
if (typeof(base[nameArray[i]]) == "function"){
return (base[nameArray[i]].apply(base, argsArray));
};
return (undefined);
}
public static function createEmptyMovieClip(parent:Object, name:String, depth:Number):MovieClip{
var mc:MovieClip;
mc = new MovieClip();
if (((false) && (depth))){
parent.addChildAt(mc, depth);
} else {
parent.addChild(mc);
};
parent[name] = mc;
mc["_name"] = name;
return (mc);
}
public static function _getRes(options:Object, clip:Object):Array{
var b:Object;
var w:Number;
var h:Number;
var xy:Array;
b = clip.getBounds(clip.root);
w = 0;
h = 0;
if (typeof(options.res) != "undefined"){
xy = options.res.split("x");
w = parseFloat(xy[0]);
h = parseFloat(xy[1]);
} else {
w = (b.xMax - b.xMin);
h = (b.yMax - b.yMin);
};
if ((((w == 0)) || ((h == 0)))){
w = clip.stage.stageWidth;
h = clip.stage.stageHeight;
};
return ([w, h]);
}
public static function adShowing(mc:Object):void{
mc.origFrameRate = mc.stage.frameRate;
mc.stage.frameRate = 30;
}
public static function getValue(base:Object, objectName:String):Object{
var nameArray:Array;
var i:Number;
nameArray = objectName.split(".");
i = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return (undefined);
};
base = base[nameArray[i]];
i++;
};
return (base[nameArray[i]]);
}
public static function rpc(clip:Object, callbackID:Number, arg:Object):void{
var _local4:Object;
var _local5:Object;
switch (arg.id){
case "setValue":
MochiAd.setValue(clip, arg.objectName, arg.value);
break;
case "getValue":
_local4 = MochiAd.getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local5);
break;
};
}
public static function setValue(base:Object, objectName:String, value:Object):void{
var nameArray:Array;
var i:Number;
nameArray = objectName.split(".");
i = 0;
while (i < (nameArray.length - 1)) {
if ((((base[nameArray[i]] == undefined)) || ((base[nameArray[i]] == null)))){
return;
};
base = base[nameArray[i]];
i++;
};
base[nameArray[i]] = value;
}
public static function showPreGameAd(options:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var sendHostProgress:Boolean;
var fn:Function;
var r:MovieClip;
var options = options;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (width:Number, height:Number):void{
}, ad_failed:function ():void{
}, ad_skipped:function ():void{
}, ad_progress:function (percent:Number):void{
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def"){
options.ad_started();
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
if (options.no_progress_bar){
bar.visible = false;
delete options.no_progress_bar;
} else {
bar.x = 10;
bar.y = (h - 20);
};
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var p:Number;
p = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (p > 0){
this.parent.alpha = (p * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (ev:Event):void{
ev.target.removeEventListener(ev.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adSkipped = options.ad_skipped;
mc.adjustProgress = function (msec:Number):void{
var _chk:Object;
_chk = mc._mochiad_wait;
_chk.server_control = true;
_chk.showing = true;
_chk.started = getTimer();
_chk.ad_msec = msec;
};
mc.rpc = function (callbackID:Number, arg:Object):void{
MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s:String):Object{
return (s);
};
mc.regContLC = function (lc_name:String):void{
mc._containerLCName = lc_name;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (lc_name:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _clip:Object;
var ad_clip:Object;
var elapsed:Number;
var finished:Boolean;
var clip_total:Number;
var clip_loaded:Number;
var clip_pcnt:Number;
var ad_pcnt:Number;
var _inside:Object;
var pcnt:Number;
var total:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_clip = this.parent.parent.root;
ad_clip = this.parent._mochiad_ctr;
elapsed = (getTimer() - this.started);
finished = false;
clip_total = _clip.loaderInfo.bytesTotal;
clip_loaded = _clip.loaderInfo.bytesLoaded;
if (complete){
clip_loaded = Math.max(1, clip_loaded);
clip_total = clip_loaded;
};
clip_pcnt = ((100 * clip_loaded) / clip_total);
ad_pcnt = ((100 * elapsed) / chk.ad_msec);
_inside = this._mochiad_bar._inside;
pcnt = Math.min(100, Math.min(((clip_pcnt) || (0)), ad_pcnt));
pcnt = Math.max(this.last_pcnt, pcnt);
this.last_pcnt = pcnt;
_inside.scaleX = (pcnt * 0.01);
options.ad_progress(pcnt);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:clip_pcnt});
if (clip_pcnt == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
total = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (total > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((elapsed > chk.ad_timeout)) && ((clip_pcnt == 100)))){
options.ad_failed();
finished = true;
};
};
};
if (elapsed > chk.ad_msec){
finished = true;
};
if (((complete) && (finished))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(options:Object):void{
MochiAd.showPreGameAd(options);
}
public static function showTimedAd(options:Object):void{
MochiAd.showInterLevelAd(options);
}
public static function doOnEnterFrame(mc:MovieClip):void{
var f:Function;
var mc = mc;
f = function (ev:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
ev.target.removeEventListener(ev.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 148
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public function MochiBot(){
super();
}
public static function track(parent:Sprite, tag:String):MochiBot{
var self:MochiBot;
var server:String;
var lv:URLVariables;
var url:String;
var req:URLRequest;
var loader:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
self = new (MochiBot);
parent.addChild(self);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
server = "http://core.mochibot.com/my/core.swf";
lv = new URLVariables();
lv["sb"] = Security.sandboxType;
lv["v"] = Capabilities.version;
lv["swfid"] = tag;
lv["mv"] = "8";
lv["fv"] = "9";
url = self.root.loaderInfo.loaderURL;
if (url.indexOf("http") == 0){
lv["url"] = url;
} else {
lv["url"] = "local";
};
req = new URLRequest(server);
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
self.addChild(loader);
loader.load(req);
return (self);
}
}
}//package
Section 149
//panelItems (panelItems)
package {
import flash.display.*;
public dynamic class panelItems extends MovieClip {
public function panelItems(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 150
//panelManBack (panelManBack)
package {
import flash.display.*;
import flash.text.*;
public dynamic class panelManBack extends MovieClip {
public var numberOrdered:TextField;
public var clock:MovieClip;
public function panelManBack(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 151
//pauseMc (pauseMc)
package {
import flash.display.*;
public dynamic class pauseMc extends MovieClip {
public function pauseMc(){
super();
}
}
}//package
Section 152
//Photon (Photon)
package {
import flash.display.*;
public dynamic class Photon extends MovieClip {
public function Photon(){
super();
}
}
}//package
Section 153
//pistolFx (pistolFx)
package {
import flash.media.*;
public dynamic class pistolFx extends Sound {
public function pistolFx(){
super();
}
}
}//package
Section 154
//playerSprite (playerSprite)
package {
import flash.display.*;
public dynamic class playerSprite extends MovieClip {
public var baseFront:MovieClip;
public var arm1:MovieClip;
public var selectionMc:spaceGunSelection;
public var body:MovieClip;
public var base:MovieClip;
public var turret:MovieClip;
public function playerSprite(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 155
//PlayGameBtn (PlayGameBtn)
package {
import flash.display.*;
public dynamic class PlayGameBtn extends SimpleButton {
public function PlayGameBtn(){
super();
}
}
}//package
Section 156
//playGameTxt (playGameTxt)
package {
import flash.display.*;
public dynamic class playGameTxt extends MovieClip {
public function playGameTxt(){
super();
}
}
}//package
Section 157
//projectiles (projectiles)
package {
import flash.display.*;
public dynamic class projectiles extends MovieClip {
public function projectiles(){
super();
}
}
}//package
Section 158
//risingMoneyTxt (risingMoneyTxt)
package {
import flash.display.*;
import flash.text.*;
public dynamic class risingMoneyTxt extends MovieClip {
public var moneyTxt:TextField;
public function risingMoneyTxt(){
super();
}
}
}//package
Section 159
//rocket (rocket)
package {
import flash.display.*;
public dynamic class rocket extends MovieClip {
public function rocket(){
super();
}
}
}//package
Section 160
//rocketLauncher (rocketLauncher)
package {
import flash.display.*;
public dynamic class rocketLauncher extends MovieClip {
public var selectionMc:manSelectionSquare;
public function rocketLauncher(){
super();
}
}
}//package
Section 161
//rocketLauncherShoot (rocketLauncherShoot)
package {
import flash.display.*;
public dynamic class rocketLauncherShoot extends MovieClip {
public function rocketLauncherShoot(){
super();
addFrameScript(4, frame5);
}
function frame5(){
MovieClip(this.parent).gotoAndStop("gunStand");
}
}
}//package
Section 162
//rocketStand (rocketStand)
package {
import flash.display.*;
public dynamic class rocketStand extends MovieClip {
public function rocketStand(){
super();
}
}
}//package
Section 163
//rockFx (rockFx)
package {
import flash.media.*;
public dynamic class rockFx extends Sound {
public function rockFx(){
super();
}
}
}//package
Section 164
//sniper (sniper)
package {
import flash.display.*;
public dynamic class sniper extends MovieClip {
public var selectionMc:manSelectionSquare;
public function sniper(){
super();
}
}
}//package
Section 165
//sniperHead (sniperHead)
package {
import flash.display.*;
public dynamic class sniperHead extends MovieClip {
public function sniperHead(){
super();
}
}
}//package
Section 166
//sniperStand (sniperStand)
package {
import flash.display.*;
public dynamic class sniperStand extends MovieClip {
public function sniperStand(){
super();
}
}
}//package
Section 167
//sniperWalk (sniperWalk)
package {
import flash.display.*;
public dynamic class sniperWalk extends MovieClip {
public function sniperWalk(){
super();
}
}
}//package
Section 168
//SoundMusic1 (SoundMusic1)
package {
import flash.media.*;
public dynamic class SoundMusic1 extends Sound {
public function SoundMusic1(){
super();
}
}
}//package
Section 169
//spaceGunSelection (spaceGunSelection)
package {
import flash.display.*;
public dynamic class spaceGunSelection extends MovieClip {
public function spaceGunSelection(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 170
//startGameButton (startGameButton)
package {
import flash.display.*;
public dynamic class startGameButton extends SimpleButton {
public function startGameButton(){
super();
}
}
}//package
Section 171
//startGameFx (startGameFx)
package {
import flash.media.*;
public dynamic class startGameFx extends Sound {
public function startGameFx(){
super();
}
}
}//package
Section 172
//startGameMsg (startGameMsg)
package {
import flash.display.*;
public dynamic class startGameMsg extends MovieClip {
public function startGameMsg(){
super();
}
}
}//package
Section 173
//startScreenInstr (startScreenInstr)
package {
import flash.display.*;
public dynamic class startScreenInstr extends MovieClip {
public function startScreenInstr(){
super();
}
}
}//package
Section 174
//throwFx (throwFx)
package {
import flash.media.*;
public dynamic class throwFx extends Sound {
public function throwFx(){
super();
}
}
}//package
Section 175
//turretMc (turretMc)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.utils.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class turretMc extends MovieClip {
public var firePoint:MovieClip;
public function turretMc(){
super();
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
MovieClip(this.parent).body.play();
}
}
}//package
Section 176
//upgradeFx (upgradeFx)
package {
import flash.media.*;
public dynamic class upgradeFx extends Sound {
public function upgradeFx(){
super();
}
}
}//package
Section 177
//youarehereMc (youarehereMc)
package {
import flash.display.*;
public dynamic class youarehereMc extends MovieClip {
public function youarehereMc(){
super();
}
}
}//package
Section 178
//zombieHeadSide (zombieHeadSide)
package {
import flash.display.*;
public dynamic class zombieHeadSide extends MovieClip {
public function zombieHeadSide(){
super();
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package