Section 1
//GameBadGuy (classesAS3.GameBadGuy)
package classesAS3 {
import flash.display.*;
import classesAS3.*;
import flash.filters.*;
class GameBadGuy {
var explosionRot:Number;
var xVel:Number;// = 0
var distanceArray:Array;
var energy:Number;// = 0
var hitVel;
var spriteData:Object;
var freeze:Number;
var deadExplosion:Boolean;
var yPos:Number;// = 0
var myValue:Number;
var targetObj:Object;
var inToGround:Number;
var energyBarOn:Number;
var delayToStart:Number;
var numberOfMissiles;// = 0
var Useful:GameUseful;
var energyStart:Number;// = 0
var xPos:Number;// = 0
var range:Number;
var rt:Object;
var energyMc:MovieClip;
var myScore:Number;
var speed:Number;// = 0
var myDamage:Number;
var xOrigin:Number;// = 0
var missileName:String;
var delayToFireMissile:Number;// = 1
var myName:String;
var gravity:Number;
var projectileMc:Object;
var speedOld:Number;
var energyBarMc:GameEnergyBar;
var yVel:Number;// = 0
var glowFilter:GlowFilter;
var dead:Boolean;
var myRange:Number;
var xDir:Number;
var mC:Object;
var yOrigin:Number;// = 0
function GameBadGuy(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12){
var _local13:Number;
var _local14:*;
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
speed = 0;
energyStart = 0;
energy = 0;
delayToFireMissile = 1;
numberOfMissiles = 0;
super();
rt = _arg2;
Useful = _arg6;
myDamage = _arg10;
missileName = _arg11;
myName = _arg9;
_local13 = Useful.RandomNumber(1, 10);
_local13 = (_local13 - 10);
myRange = (_arg8 + _local13);
myValue = _arg12;
gravity = 1;
xOrigin = 0;
yOrigin = _arg4;
xPos = _arg3;
yPos = 0;
xVel = 0;
yVel = 0;
hitVel = 0;
glowFilter = new GlowFilter(11184895, 1, 5, 5, 3, 1);
energyBarOn = 0;
if (rt.waveDelay < 160){
_local14 = (200 - rt.waveDelay);
_arg5 = (_arg5 + (_local14 / 100));
};
speed = _arg5;
speedOld = _arg5;
xDir = -1;
dead = false;
deadExplosion = false;
freeze = 0;
inToGround = 0;
delayToStart = _arg7;
mC = _arg1;
numberOfMissiles = 0;
if (myName == "manStone"){
energyStart = 80;
} else {
energyStart = 100;
};
energy = energyStart;
distanceArray = new Array();
updatePosition();
}
function applyGravity(){
yVel = (yVel + gravity);
}
function findEnemyGun(){
var _local1:Object;
distanceArray = new Array();
_local1 = new Object();
_local1.distSprite = rt.Player;
_local1.dist = Useful.getDistanceQ(mC.x, mC.y, rt.Player.mC.x, rt.Player.mC.y);
if (_local1.dist < (myRange + 120)){
distanceArray.push(_local1);
};
}
function updatePosition(){
xPos = (xPos + hitVel);
hitVel = 0;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
}
function remove(){
var _local1:Number;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < rt.badGuysArray.length) {
if (this == rt.badGuysArray[_local2]){
_local1 = _local2;
};
_local2++;
};
rt.inGameEnemyMc.removeChild(mC);
rt.badGuysArray.splice(_local1, 1);
}
function mainLoop(){
var _local1:*;
if (delayToStart == 0){
if (dead == false){
if (freeze != 0){
freeze--;
if (freeze == 0){
mC.filters = [];
};
} else {
if (rt.goodGuysArray.length > 0){
findEnemyTarget();
if (distanceArray.length > 0){
if (myName == "manStone"){
speed = 0;
checkForFire();
if (mC.currentFrame != 2){
mC.gotoAndStop("stand");
};
} else {
if (myName == "badGuyRollingBomb"){
if (distanceArray[0].dist < 20){
distanceArray[0].distSprite.decreaseEnergy(mC.x, myDamage);
dead = true;
inToGround = 0;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 76, true, false, false, 10));
rt.increaseMoney(myValue);
rt.increaseScore(myValue);
_local1 = new GameRisingMoney(rt, rt.inGameScoreMc, myValue);
rt.inGameScoreMc.addChild(_local1);
_local1.x = mC.x;
_local1.y = (mC.y - 10);
};
} else {
if (myName == "badGuySword"){
speed = 0;
swordAttack();
} else {
if (myName == "badGuyHoverTank"){
speed = 0;
checkForFire();
} else {
if (myName == "badGuyWalker"){
speed = 0;
checkForFire();
if (mC.currentFrame != 2){
mC.gotoAndStop("stand");
};
} else {
if (myName == "badGuyRoundTank"){
speed = 0;
checkForFire();
if (mC.currentFrame != 2){
mC.gotoAndStop("stand");
};
} else {
if (myName == "badGuyFlying"){
gravity = 0;
xVel = (xDir * speed);
checkForFire();
if (xPos < 10){
remove();
};
};
};
};
};
};
};
};
} else {
speed = speedOld;
if (mC.currentFrame == 3){
mC.gotoAndStop("walk");
} else {
if (mC.currentFrame == 4){
mC.gotoAndStop("walk");
} else {
if (mC.currentFrame == 6){
mC.gotoAndStop("walk");
};
};
};
if (myName == "badGuyFlying"){
gravity = 0;
xVel = (xDir * speed);
};
};
} else {
findEnemyGun();
if (distanceArray.length > 0){
if (myName == "manStone"){
speed = 0;
checkForFire();
} else {
if (myName == "badGuyHoverTank"){
speed = 0;
checkForFire();
} else {
if (myName == "badGuyWalker"){
speed = 0;
checkForFire();
if (mC.currentFrame != 2){
mC.gotoAndStop("stand");
};
} else {
if (myName == "badGuyRoundTank"){
speed = 0;
checkForFire();
if (mC.currentFrame != 2){
mC.gotoAndStop("stand");
};
} else {
if (myName == "badGuyRollingBomb"){
rt.decreaseEnergy(myDamage);
dead = true;
inToGround = 0;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 76, true, false, false, 10));
} else {
if (myName == "badGuyFlying"){
gravity = 0;
xVel = (xDir * speed);
checkForFire();
if (xPos < 10){
remove();
};
} else {
if (myName == "badGuySword"){
speed = 0;
swordAttack();
};
};
};
};
};
};
};
} else {
if (myName == "badGuyHoverTank"){
} else {
if (myName == "badGuyFlying"){
gravity = 0;
xVel = (xDir * speed);
};
speed = speedOld;
if (mC.currentFrame != 1){
mC.gotoAndStop("walk");
};
};
};
};
if (myName != "badGuyFlying"){
applyGravity();
checkForGround2();
} else {
if (myName == "badGuyWalker"){
applyGravity();
checkForGround4();
};
};
updatePosition();
};
} else {
if (deadExplosion == true){
applyGravity();
checkForGround3();
mC.rotation = (mC.rotation + explosionRot);
updatePosition();
} else {
if (myName == "badGuyFlying"){
inToGround++;
if (inToGround > 40){
remove();
} else {
yVel = 0.1;
xVel = 0;
updatePosition();
};
} else {
inToGround++;
if (inToGround > 100){
remove();
} else {
yVel = 0.1;
xVel = 0;
updatePosition();
};
};
};
};
} else {
delayToStart--;
};
}
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;
setupMissile();
};
};
}
function checkForGround():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:*;
var _local6:*;
trace("XPOS");
trace(rt.backMc.x);
_local1 = yVel;
_local2 = yVel;
if (_local2 < 0){
_local2 = ((_local2 - _local2) - _local2);
};
_local3 = (mC.x + rt.spritesMc.x);
_local4 = (mC.y + rt.spritesMc.y);
_local5 = 0;
while (_local5 < int(_local2)) {
if (rt.backMc.hitTestPoint(_local3, (_local4 + _local5), true)){
yVel = (yVel - int(_local1));
yVel = (_local5 + yVel);
break;
};
_local5++;
};
xVel = (xDir * speed);
updatePosition();
_local3 = (mC.x + rt.spritesMc.x);
_local4 = (mC.y + rt.spritesMc.y);
if (rt.backMc.hitTestPoint(_local3, (_local4 + _local5), true)){
_local6 = 0;
_local5 = 0;
while (_local5 < 10) {
yPos--;
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
if (rt.backMc.hitTestPoint((mC.x + rt.spritesMc.x), mC.y, true) == false){
trace("free");
_local6 = 1;
break;
};
_local5++;
};
};
if (_local6 == 0){
changeDirection();
};
if (xPos > 1700){
xDir = -1;
} else {
if (xPos < 10){
xDir = 1;
};
};
if (xVel > 0){
mC.scaleX = -1;
} else {
mC.scaleX = 1;
};
}
function checkForGround4():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
trace("XPOS");
trace(rt.backMc.x);
_local1 = yVel;
_local2 = yVel;
if (_local2 < 0){
_local2 = ((_local2 - _local2) - _local2);
};
_local3 = int(mC.x);
_local4 = (mC.y + rt.spritesMc.y);
_local5 = rt.groundArray[_local3];
if (_local4 > _local5){
remove();
};
}
function changeDirection(){
if (xDir < 0){
xDir = 1;
} else {
xDir = -1;
};
}
function checkForGround2():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Object;
if (myName == "badGuyHoverTank"){
_local4 = (mC.x - (mC.width / 2));
_local5 = (mC.x + (mC.width / 2));
_local1 = int(_local4);
_local2 = (mC.y + rt.spritesMc.y);
_local6 = rt.groundArray[_local1];
_local1 = int(_local5);
_local7 = rt.groundArray[_local1];
_local8 = Useful.pointTowards(_local4, _local6, _local5, _local7);
mC.rotation = (_local8.spriteRotation - 180);
};
_local1 = int(mC.x);
_local2 = (mC.y + rt.spritesMc.y);
_local3 = rt.groundArray[_local1];
if (_local2 > _local3){
_local2 = (_local2 - _local3);
yVel = (yVel - _local2);
};
xVel = (xDir * speed);
updatePosition();
_local1 = int(mC.x);
_local2 = (mC.y + rt.spritesMc.y);
if (_local2 > _local3){
_local2 = (_local2 - _local3);
yPos = (yPos - _local2);
yVel = 0;
};
if (xPos > 1700){
xDir = -1;
} else {
if (xPos < 10){
xDir = 1;
};
};
if (xVel > 0){
mC.scaleX = -1;
} else {
mC.scaleX = 1;
};
}
function checkForGround3():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
trace("XPOS");
trace(rt.backMc.x);
_local1 = yVel;
_local2 = yVel;
if (_local2 < 0){
_local2 = ((_local2 - _local2) - _local2);
};
_local3 = int(mC.x);
_local4 = (mC.y + rt.spritesMc.y);
_local5 = rt.groundArray[_local3];
if (_local4 > _local5){
remove();
};
}
function swordAttack(){
var _local1:Object;
delayToFireMissile--;
if (delayToFireMissile == 0){
if (distanceArray[0].distSprite == rt.Player){
rt.decreaseEnergy(int((myDamage / 2)));
delayToFireMissile = 10;
if (mC.currentFrame != 2){
mC.gotoAndStop("shoot");
};
} else {
delayToFireMissile = 10;
if (mC.currentFrame != 2){
mC.gotoAndStop("shoot");
};
_local1 = distanceArray[0].distSprite;
_local1.decreaseEnergy(mC.x, myDamage);
};
};
}
function doEnergyCrystal(){
rt.pickupsArray.push(new energyCrystals());
rt.inGamePickupsMc.addChild(rt.pickupsArray[(rt.pickupsArray.length - 1)]);
rt.pickupsArray[(rt.pickupsArray.length - 1)].x = mC.x;
rt.pickupsArray[(rt.pickupsArray.length - 1)].y = mC.y;
}
function findEnemyTarget(){
var _local1:int;
var _local2:Object;
var _local3:*;
distanceArray = new Array();
_local1 = 0;
while (_local1 < rt.goodGuysArray.length) {
if (rt.goodGuysArray[_local1].dead == false){
_local2 = new Object();
_local2.distSprite = rt.goodGuysArray[_local1];
_local2.dist = Useful.getDistanceQ(mC.x, mC.y, (rt.goodGuysArray[_local1].mC.x - 7), rt.goodGuysArray[_local1].mC.y);
if (myName == "badGuySword"){
_local3 = (mC.x - rt.Player.mC.x);
if (_local3 < 0){
_local3 = ((_local3 - _local3) - _local3);
};
if (_local3 < (myRange + 120)){
_local2.distSprite = rt.Player;
_local2.dist = _local3;
distanceArray.push(_local2);
} else {
if (_local2.dist < myRange){
distanceArray.push(_local2);
};
};
} else {
if (_local2.dist < myRange){
distanceArray.push(_local2);
};
};
};
_local1++;
};
distanceArray.sortOn("dist", Array.NUMERIC);
}
function decreaseEnergy(_arg1, _arg2, _arg3){
var _local4:Number;
var _local5:Number;
var _local6:Object;
var _local7:*;
_arg1 = _arg1.myParent.mC.x;
rt.Sounds.playSoundFx("hitEnemyFx");
if (myName == "badGuyHoverTank"){
_arg3 = int((_arg3 / 2));
};
energy = (energy - _arg3);
if (energyBarOn == 0){
energyBarOn = 1;
energyBarMc = new GameEnergyBar(this);
mC.addChild(energyBarMc);
};
energyBarMc.x = 0;
energyBarMc.y = -35;
_local4 = (energy / 10);
energyBarMc.bar.bar.y = int((10 - _local4));
if (energy <= 0){
rt.Sounds.playSoundFx("explosionFx");
if (_arg2 == true){
_local5 = Useful.RandomNumber(1, 100);
explosionRot = 8;
if (_arg1 > mC.x){
_local5 = (_local5 - 100);
explosionRot = -8;
};
_local6 = Useful.getArcVelocity(6, 16, mC.x, mC.y, (mC.x + _local5), (mC.y - 100));
gravity = _local6.gravity;
xVel = _local6.xStep;
yVel = _local6.yStep;
deadExplosion = true;
dead = true;
} else {
inToGround = 0;
dead = true;
mC.gotoAndStop("deathBack");
if (myName == "badGuyRoundTank"){
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 3, Useful, 20, 2, 356, true, false, false, 13));
};
if (myName == "badGuyFlying"){
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 3, Useful, 20, 2, 356, true, false, false, 13));
};
};
rt.increaseMoney(myValue);
rt.increaseScore(myValue);
_local7 = new GameRisingMoney(rt, rt.inGameScoreMc, myValue);
rt.inGameScoreMc.addChild(_local7);
_local7.x = mC.x;
_local7.y = (mC.y - 10);
} else {
_local7 = new GameRisingScore(rt, rt.inGameScoreMc, _arg3);
rt.inGameScoreMc.addChild(_local7);
_local7.x = mC.x;
_local7.y = (mC.y - 10);
if (freeze == 0){
if (myName != "badGuyHoverTank"){
if (myName != "badGuyFlying"){
if (myName != "badGuyWalker"){
if (xDir < 0){
if (_arg1 > mC.x){
mC.gotoAndStop("hit2");
hitVel = 20;
} else {
mC.gotoAndStop("hit");
hitVel = 20;
};
} else {
if (_arg1 > mC.x){
mC.gotoAndStop("hit");
hitVel = -20;
} else {
hitVel = 20;
mC.gotoAndStop("hit2");
};
};
};
};
};
};
};
updatePosition();
}
function setupMissile(){
var _local1:Number;
_local1 = 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 - _local1), (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 - _local1), targetObj.mC.y);
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, spriteData, 16, this, myDamage));
};
};
};
};
}
}
}//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(_arg1){
addFrameScript(22, frame23);
enemy = _arg1;
}
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(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12){
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
super();
rt = _arg1;
Useful = _arg5;
fullRange = _arg11;
numberOfParticles = _arg6;
numberOfLoops = _arg7;
explodeDistance = _arg8;
gravity = _arg9;
artillary = _arg10;
speed = _arg12;
xOrigin = _arg2;
yOrigin = _arg3;
xPos = 0;
yPos = 0;
Count = 0;
mType = _arg4;
}
function remove(){
var _local1:Number;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < rt.explosionsArray.length) {
if (this == rt.explosionsArray[_local2]){
_local1 = _local2;
};
_local2++;
};
rt.explosionsArray.splice(_local1, 1);
delete ??getglobalscope
[this];
}
function mainLoop(){
var _local1:int;
var _local2:Number;
var _local3:Object;
var _local4:GameParticle;
_local1 = 0;
while (_local1 < numberOfParticles) {
if (fullRange == false){
_local2 = Useful.RandomNumber(1, 180);
_local2 = (_local2 + 180);
if (_local2 > 359){
_local2 = (_local2 - 359);
};
} else {
_local2 = Useful.RandomNumber(1, 360);
};
_local3 = Useful.getVectorFromAngle(_local2);
_local4 = new GameParticle(rt, Useful, xOrigin, yOrigin, mType, _local3.vx, _local3.vy, ((_local3.vx * explodeDistance) + xOrigin), ((_local3.vy * explodeDistance) + yOrigin), artillary, gravity, explodeDistance, speed);
rt.inGameExplosionsMc.addChild(_local4);
rt.particlesArray.push(_local4);
_local4.rotation = _local2;
_local1++;
};
Count++;
if (Count > numberOfLoops){
remove();
};
}
}
}//package classesAS3
Section 4
//GameGame (classesAS3.GameGame)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.geom.*;
import flash.utils.*;
public class GameGame extends MovieClip {
var left:Number;
var StartTimer:Number;
var badGuysArray:Array;
var selectionArray: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 spritesMc:Sprite;
var moneyMax:Number;
var filterAlienDelay:Number;
var inGameMissilesMc:Sprite;
var levelWidth:Number;
var oldScore:Number;
var clickloc:Point;
var moneyDelay:Number;
var money:Number;
var levelWidthBlocks:Number;
var gameOverMsgMc:GameOverMsgAnim;
var pauseSwitch:Boolean;
var backMc:backgroundMc;
var oldUpgrade3:Boolean;
var minutes:Number;
var oldUpgrade5:Boolean;
var oldUpgrade1:Boolean;
var oldUpgrade4:Boolean;
var filterDelay:Number;
var oldUpgrade2:Boolean;
var lives:Number;
var inGameScoreMc:Sprite;
var groundArray:Array;
var explosionsArray:Array;
var energyAlien:Number;
var itemsToBuyMc:Sprite;
var cmf:ColorMatrixFilter;
var upgradeCost1:Number;
var upgradeCost2:Number;
var upgradeCost3:Number;
var upgradeCost5:Number;
var levelData:Array;
var timeBonus:Number;
var top:Number;
var oldMouseY:Number;
var currentPickup:String;
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 scrollScreen:String;
var upgrade3:Boolean;
var upgrade4:Boolean;
var upgrade5:Boolean;
var upgradeMc3:GameUpgrade3;
var upgradeMc4:GameUpgrade4;
var upgradeMc2:GameUpgrade2;
var upgradeMc5:GameUpgrade5;
var upgradeMc1:GameUpgrade;
var musicSwitch:Boolean;// = true
var marchingAntsMc:Sprite;
var tilesArray:Array;
var releaseloc:Point;
var levelHeight:Number;
var fulltime:Number;
var panelItemsData:Array;
var alienBaseMc:alienBase;
var backSkyMc:backgroundSkyMc;
var startGameMsgMc:GameStartMsg;
var badGuysLevels:Array;
var waveDelay:Number;
var spring:Number;
var minDisplay:String;
var clockDelay:Number;
var right:Number;
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 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 marquee_mc:MovieClip;
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 inGameBackgroundMc:Sprite;
var inGameBackgroundMc2:Sprite;
var currentTimeBonus:Number;
var pickupType:String;
var inGameStatsMc:Sprite;
var inGameMsgsMc:Sprite;
var pickupAdded:Boolean;
var blockSizeY:Number;
public var levelNumber:Number;
public var maxLevels:Number;
public static const SOLDIER_STATE_DEFEND:int = 1;
public static const SOLDIER_STATE_ATTACK:int = 0;
public static const SOLDIER_STATE_CRYSTAL:int = 2;
public static const SOLDIER_STATE_RETREAT:int = 3;
public function GameGame(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
var _local9:Array;
var _local10:Array;
var _local11:Array;
var _local12:Array;
var _local13:Array;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:Array;
var _local18:Array;
var _local19:Array;
soundsSwitch = true;
musicSwitch = true;
super();
rt = _arg1;
Useful = _arg7;
upgrade1 = false;
upgrade2 = false;
upgrade3 = false;
upgrade4 = false;
upgrade5 = false;
movieWidth = _arg2;
movieHeight = _arg3;
backMcWidth = 1700;
maxLevels = _arg8;
blockSize = 100;
blockSizeY = 30;
Sounds = new GameSounds(this);
levelWidthBlocks = _arg4;
levelHeightBlocks = _arg5;
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();
inGameActionMc.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();
_local9 = ["manStone"];
upgradeCost1 = 70;
upgradeCost2 = 120;
upgradeCost3 = 150;
upgradeCost4 = 170;
upgradeCost5 = 200;
panelItemsData = new Array("basicMan", 10, "Basic droid $10", "Grenader", 30, "Grenade droid not accurate $30", "sniper", 70, "Sniper, long range fire $70", "rocketLauncher", 50, "Rocket launcher, $50", "heavyGunner", 170, "Battle droid, $170");
itemsCost = new Array(10, 10, 10, 10, 10);
_local10 = new Array("manStone", 1, 210, (backMcWidth - 1), 100, 5, 10, "rock", 5, "manStone", 1, 210, (backMcWidth - 1), 100, 6, 10, "rock", 5, "manStone", 1, 210, (backMcWidth - 1), 100, 6, 10, "rock", 5, "noBadGuy", 0, 0, 0, 0, 0, 0, "", 0, "noBadGuy", 0, 0, 0, 0, 0, 0, "", 0, "badGuyFlying", 3, 200, (backMcWidth - 1), 100, 30, 5, "enemyBomb", 25, "noBadGuy", 0, 0, 0, 0, 0, 0, "", 0);
_local11 = new Array("badGuyRoundTank", 1, 200, (backMcWidth - 1), 100, 10, 14, "enemyBullet", 15, "manStone", 1, 210, (backMcWidth - 1), 100, 5, 10, "rock", 5, "manStone", 1, 210, (backMcWidth - 1), 100, 5, 10, "rock", 5, "manStone", 1, 210, (backMcWidth - 1), 100, 5, 10, "rock", 5, "manStone", 1, 210, (backMcWidth - 1), 100, 5, 10, "rock", 5, "noBadGuy", 0, 0, 0, 0, 0, 0, "", 0);
_local12 = new Array("badGuySword", 2, 25, (backMcWidth - 1), 100, 14, 7, "", 6, "manStone", 3, 200, (backMcWidth - 1), 100, 6, 5, "rock", 5);
_local13 = new Array("badGuyRoundTank", 3, 200, (backMcWidth - 1), 100, 8, 9, "enemyBullet", 15, "badGuyFlying", 2, 200, (backMcWidth - 1), 100, 40, 5, "enemyBomb", 25, "manStone", 2, 210, (backMcWidth - 1), 100, 7, 10, "rock", 5);
_local14 = new Array("badGuyHoverTank", 1, 200, (backMcWidth - 1), 100, 5, 20, "enemyShell", 20, "noBadGuy", 0, 0, 0, 0, 0, 0, "", 0, "noBadGuy", 0, 0, 0, 0, 0, 0, "", 0, "badGuySword", 2, 25, (backMcWidth - 1), 100, 14, 7, "", 6);
_local15 = new Array("manStone", 1, 200, (backMcWidth - 1), 100, 6, 7, "rock", 5);
_local16 = new Array("manStone", 4, 210, (backMcWidth - 1), 100, 6, 10, "rock", 5, "badGuyFlying", 1, 200, (backMcWidth - 1), 100, 40, 5, "enemyBomb", 25, "manStone", 4, 210, (backMcWidth - 1), 100, 6, 10, "rock", 5, "manStone", 4, 210, (backMcWidth - 1), 100, 6, 10, "rock", 5, "manStone", 4, 210, (backMcWidth - 1), 100, 6, 10, "rock", 5, "manStone", 4, 210, (backMcWidth - 1), 100, 6, 10, "rock", 5);
_local17 = new Array("badGuyRollingBomb", 7, 100, (backMcWidth - 1), 100, 15, 20, "", 2, "badGuyRoundTank", 1, 200, (backMcWidth - 1), 100, 10, 9, "enemyBullet", 15);
_local18 = new Array("badGuyHoverTank", 1, 200, (backMcWidth - 1), 100, 7, 20, "enemyShell", 20, "badGuyHoverTank", 1, 200, (backMcWidth - 1), 100, 7, 20, "enemyShell", 20, "badGuyHoverTank", 1, 200, (backMcWidth - 1), 100, 7, 20, "enemyShell", 20, "manStone", 6, 210, (backMcWidth - 1), 100, 6, 10, "rock", 5, "badGuyRoundTank", 2, 200, (backMcWidth - 1), 100, 8, 9, "enemyBullet", 15, "badGuyFlying", 3, 200, (backMcWidth - 1), 100, 40, 5, "enemyBomb", 25);
_local19 = new Array("badGuyWalker", 1, 200, (backMcWidth - 1), 100, 10, 6, "enemyPhoton", 25, "badGuySword", 2, 25, (backMcWidth - 1), 100, 14, 7, "", 6, "noBadGuy", 0, 0, 0, 0, 0, 0, "", 0, "badGuyWalker", 1, 200, (backMcWidth - 1), 100, 10, 6, "enemyPhoton", 25, "badGuyFlying", 4, 200, (backMcWidth - 1), 100, 40, 5, "enemyBomb", 25, "badGuyHoverTank", 1, 200, (backMcWidth - 1), 100, 7, 20, "enemyShell", 20, "badGuyHoverTank", 1, 200, (backMcWidth - 1), 100, 7, 20, "enemyShell", 20, "badGuyHoverTank", 1, 200, (backMcWidth - 1), 100, 7, 20, "enemyShell", 20);
badGuysLevels = new Array(_local15, _local11, _local10, _local12, _local17, _local13, _local16, _local14, _local18, _local19);
scrollvx = 0;
glowFilter = new GlowFilter(0xFFFFFF, 1, 8, 8, 3, 1);
score = 0;
bestScore = 0;
lives = _arg6;
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 = 10;
wave = 0;
delayToWave = 100;
maxScrollSpeed = 24;
scrollxPos = 0;
secDisplay = "00";
minDisplay = "00";
StartTimer = 1;
clockDelay = 10;
minutes = StartTimer;
sec = 0;
fulltime = 0;
numberOfStartItems = 5;
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 = "";
}
function endLevelStuff(){
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;
levelTime = 0;
waveDelayD = 1;
energy = 100;
wave = 0;
waveDelay = 200;
money = 0;
moneyDelay = currentMoneyDelay;
moneyMax = (100 + ((levelNumber - 1) * 50));
newArrays();
setupPanel();
setupBackground();
if (levelNumber == levelStart){
setupPlayer();
setupAlienBase();
};
Player.mC.selectionMc.gotoAndStop(2);
Player.mC.y = (groundArray[50] - 70);
selectionArray.push(Player);
alienBaseMc.x = 1530;
alienBaseMc.y = (groundArray[1530] - 120);
setupBadGuys();
setupAnts();
soundFxBtn2();
musicBtn2();
setLevel();
if (levelNumber == 1){
setupStartGameMsg();
} else {
rt.finishSetup();
};
}
function runWave(){
var _local1:Array;
delayToWave--;
if (delayToWave == 0){
setupWave(wave);
wave++;
_local1 = badGuysLevels[(levelNumber - 1)];
if ((wave * 9) >= _local1.length){
wave = 0;
};
waveDelayD--;
if (waveDelayD == 0){
waveDelayD = 1;
waveDelay = (waveDelay - 1);
if (waveDelay < 30){
waveDelay = 30;
};
};
delayToWave = waveDelay;
};
}
function setupAlienBase(){
alienBaseMc = new alienBase();
alienBaseMc.gotoAndStop(1);
inGameEnemyMc.addChild(alienBaseMc);
}
function calcGroundPoints(){
var _local1:*;
var _local2:Number;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
groundArray = new Array();
_local1 = 0;
while (_local1 < 1700) {
_local2 = 0;
_local3 = 0;
_local4 = false;
_local5 = 150;
while (_local4 == false) {
if (backMc.ground.hitTestPoint((_local2 + _local1), (_local3 + _local5), true)){
groundArray[_local1] = (_local3 + _local5);
_local4 = true;
};
++_local5;
if (_local5 > (backMc.height + 200)){
trace("error");
groundArray[_local1] = -1;
_local4 = true;
};
};
_local1++;
};
}
function setLevel(){
statsMc.levelTxt.text = String(levelNumber);
}
function soundFxBtn(){
if (statsMc.soundFxMc.currentFrame == 1){
statsMc.soundFxMc.gotoAndStop("off");
soundsSwitch = false;
} else {
statsMc.soundFxMc.gotoAndStop("on");
soundsSwitch = true;
};
}
function checkForAfford(){
var _local1:*;
_local1 = 0;
while (_local1 < numberOfStartItems) {
if (panelItemsData[((_local1 * 3) + 1)] > money){
if (itemsArray[_local1].currentFrame != 2){
itemsArray[_local1].gotoAndStop("notBuy");
};
} else {
if (itemsArray[_local1].currentFrame != 1){
itemsArray[_local1].gotoAndStop(1);
};
};
_local1++;
};
if (upgrade1 == false){
if (upgradeCost1 > money){
upgradeMc1.gotoAndStop("notAfford");
} else {
upgradeMc1.gotoAndStop(1);
};
};
if (upgrade2 == false){
if (upgradeCost2 > money){
upgradeMc2.gotoAndStop("notAfford");
} else {
upgradeMc2.gotoAndStop(1);
};
};
if (upgrade3 == false){
if (upgradeCost3 > money){
upgradeMc3.gotoAndStop("notAfford");
} else {
upgradeMc3.gotoAndStop(1);
};
};
if (upgrade4 == false){
if (upgradeCost4 > money){
upgradeMc4.gotoAndStop("notAfford");
} else {
upgradeMc4.gotoAndStop(1);
};
};
if (upgrade5 == false){
if (upgradeCost5 > money){
upgradeMc5.gotoAndStop("notAfford");
} else {
upgradeMc5.gotoAndStop(1);
};
};
}
function doMoneyIncrease(){
moneyDelay--;
if (moneyDelay == 0){
moneyDelay = currentMoneyDelay;
money++;
if (money > moneyMax){
money = moneyMax;
};
};
checkForAfford();
}
function doMarching(){
var _local1:*;
if (!clickloc){
return;
};
_local1 = (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, _local1.x, _local1.y);
drawSquare(marquee_mc, (clickloc.x + 1), (clickloc.y + 1), (_local1.x - 1), (_local1.y - 1));
marquee_mc.graphics.endFill();
}
function decreaseScore(_arg1){
score = int((score - _arg1));
if (score >= 0){
setScore();
} else {
score = 0;
setScore();
};
}
public function buildDroid(_arg1:Number){
var _local2:*;
var _local3:Number;
_local2 = _arg1;
_local3 = (money - itemsCost[_local2]);
if (_local3 >= 0){
if (goodGuysArray.length < 60){
decreaseMoney(itemsCost[_local2]);
filterDelay = 1;
itemsArray[_local2].back.numberOrdered.text++;
if (upgrade1 == true){
itemsArray[_local2].back.gotoAndStop(3);
} else {
itemsArray[_local2].back.gotoAndStop(2);
};
Sounds.playSoundFx("clickBtnFx");
checkForAfford();
};
};
}
function turnMusicOff(){
var _local1:MovieClip;
_local1 = inGameStatsMc["ingamestatsmc"];
_local1 = _local1["wg"];
_local1 = _local1["stats"];
_local1["music"].gotoAndStop(2);
}
function decreaseEnergy(_arg1:Number){
var _local2:*;
energy = (energy - _arg1);
if (energy < 0){
energy = 0;
};
_local2 = new GameRisingScore(rt, inGameScoreMc, _arg1);
inGameScoreMc.addChild(_local2);
_local2.x = Player.mC.x;
_local2.y = Player.mC.y;
if (filterDelay == 1){
Player.mC.filters = [glowFilter];
filterDelay = 10;
};
setEnergy();
}
function decreaseAlienEnergy(_arg1:Number){
var _local2:*;
energyAlien = (energyAlien - _arg1);
if (energyAlien < 0){
energyAlien = 0;
};
_local2 = new GameRisingScore(rt, inGameScoreMc, _arg1);
inGameScoreMc.addChild(_local2);
_local2.x = alienBaseMc.x;
_local2.y = alienBaseMc.y;
if (filterAlienDelay == 1){
alienBaseMc.filters = [glowFilter];
filterAlienDelay = 10;
};
setAlienEnergy();
}
public function doRetreatCommand(_arg1:MouseEvent):void{
var _local2:*;
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(1);
_local2 = 0;
while (_local2 < selectionArray.length) {
selectionArray[_local2].soldierState = SOLDIER_STATE_RETREAT;
_local2++;
};
}
function setupBadGuys():void{
setupWave(wave);
wave++;
delayToWave = 200;
}
public function doDefendCommandBtn(_arg1:MouseEvent):void{
doDefend();
}
function musicBtn2(){
if (musicSwitch == false){
statsMc.musicMc.gotoAndStop("off");
} else {
statsMc.musicMc.gotoAndStop("on");
};
}
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 setBest(){
var _local1:MovieClip;
_local1 = inGameStatsMc["ingamestatsmc"];
_local1 = _local1["wg"];
_local1 = _local1["stats"];
if (bestScore < 10){
_local1.bestScore.text = ("0000" + bestScore);
} else {
if (bestScore < 100){
_local1.bestScore.text = ("000" + bestScore);
} else {
if (bestScore < 1000){
_local1.bestScore.text = ("00" + bestScore);
} else {
if (bestScore < 10000){
_local1.bestScore.text = ("0" + bestScore);
} else {
_local1.bestScore.text = bestScore;
};
};
};
};
}
function killAllGoodGuys(){
var _local1:*;
_local1 = (goodGuysArray.length - 1);
while (_local1 >= 0) {
goodGuysArray[_local1].remove();
_local1--;
};
}
function increaseScore(_arg1){
score = int((score + _arg1));
if (score > 0){
setScore();
};
}
function setMoney(){
statsMc.money.text = ((String(money) + "/") + moneyMax);
}
function setEnergy(){
statsMc.energy.text = String(energy);
if (filterDelay > 1){
filterDelay--;
if (filterDelay == 1){
Player.mC.filters = [];
};
};
}
public function setupPanel():void{
statsMc = new GameWeaponsPanel(this);
inGameStatsMc.addChild(statsMc);
statsMc.gunEnergy.gotoAndStop(1);
statsMc.y = (movieHeight - 77);
statsMc.msg.text = "Welcome Commander";
setupPanelItems();
}
function checkForGameOver(){
if (energy == 0){
gameOver("game_over");
};
if (energyAlien == 0){
gameOver("level_complete");
};
}
function leftClick(){
var _local1:Boolean;
var _local2:*;
_local1 = false;
if (Player.mC.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (selectionArray[0] != Player){
clearSelection();
selectPlayer();
};
_local1 = true;
};
if (_local1 == false){
_local2 = 0;
while (_local2 < goodGuysArray.length) {
if (goodGuysArray[_local2].mC.hitTestPoint(stage.mouseX, stage.mouseY, true)){
clearSelection();
selectGoodGuy(goodGuysArray[_local2]);
_local1 = true;
};
_local2++;
};
if (_local1 == 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 setLives(){
var _local1:MovieClip;
_local1 = inGameStatsMc["ingamestatsmc"];
_local1 = _local1["wg"];
_local1 = _local1["stats"];
_local1.lives.text = lives;
}
function clearSelection(){
var _local1:*;
_local1 = 0;
while (_local1 < selectionArray.length) {
if (selectionArray[_local1] == Player){
selectionArray[_local1].mC.selectionMc.gotoAndStop(1);
} else {
selectionArray[_local1].mC.selectionMc.gotoAndStop(1);
};
_local1++;
};
selectionArray = new Array();
}
function killAllExplosions(){
var _local1:*;
_local1 = (explosionsArray.length - 1);
while (_local1 >= 0) {
explosionsArray[_local1].remove();
_local1--;
};
_local1 = (particlesArray.length - 1);
while (_local1 >= 0) {
particlesArray[_local1].remove();
_local1--;
};
}
function checkPanel(){
var _local1:*;
_local1 = 0;
while (_local1 < itemsArray.length) {
if (itemsArray[_local1].hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = panelItemsData[((_local1 * 3) + 2)];
};
_local1++;
};
if (statsMc.currentFrame == 1){
if (upgradeMc1.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Build droids quicker, $70";
} else {
if (upgradeMc2.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Droids personal shield, $120";
} else {
if (upgradeMc3.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Increase gun fire rate, $150";
} else {
if (upgradeMc4.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Increase gun fire power, $170";
} else {
if (upgradeMc5.hitTestPoint(stage.mouseX, stage.mouseY, true)){
statsMc.msg.text = "Freeze enemy bullets, $200";
};
};
};
};
};
};
}
function setupSoldierCommands(){
if (statsMc.currentFrame == 1){
statsMc.removeChild(itemsToBuyMc);
statsMc.removeChild(upgradeMc1);
statsMc.removeChild(upgradeMc2);
statsMc.removeChild(upgradeMc3);
statsMc.removeChild(upgradeMc4);
statsMc.removeChild(upgradeMc5);
statsMc.gotoAndStop(2);
statsMc.attackBtn2.addEventListener(MouseEvent.MOUSE_UP, doAttackCommandBtn);
statsMc.defendBtn2.addEventListener(MouseEvent.MOUSE_UP, doDefendCommandBtn);
if (selectionArray.length == 1){
if (selectionArray[0].soldierState == SOLDIER_STATE_ATTACK){
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(2);
} else {
if (selectionArray[0].soldierState == SOLDIER_STATE_DEFEND){
statsMc.attack.gotoAndStop(1);
statsMc.defend.gotoAndStop(2);
};
};
};
} else {
if (selectionArray.length == 1){
if (selectionArray[0].soldierState == SOLDIER_STATE_ATTACK){
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(2);
} else {
if (selectionArray[0].soldierState == SOLDIER_STATE_DEFEND){
statsMc.attack.gotoAndStop(1);
statsMc.defend.gotoAndStop(2);
};
};
};
};
}
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(_arg1):void{
var _local2:*;
var _local3:Number;
Sounds.playSoundFx("droidBuiltFx");
_local3 = 100;
trace(_arg1.parent.parent.itemsMc.currentFrame);
if (_arg1.parent.parent.itemsMc.currentFrame == 1){
goodGuysArray.push(new GameGoodGuy(this, (Player.mC.x + 50), (Player.mC.y - 20), 0.5, "man", 0, Useful, 250, "bullet"));
} else {
if (_arg1.parent.parent.itemsMc.currentFrame == 5){
goodGuysArray.push(new GameGoodGuy(this, (Player.mC.x + 50), (Player.mC.y - 20), 0.3, "rocket", 0, Useful, 300, "rocket"));
} else {
if (_arg1.parent.parent.itemsMc.currentFrame == 2){
goodGuysArray.push(new GameGoodGuy(this, (Player.mC.x + 50), (Player.mC.y - 20), 0.3, "grenader", 0, Useful, 250, "grenade"));
} else {
if (_arg1.parent.parent.itemsMc.currentFrame == 3){
goodGuysArray.push(new GameGoodGuy(this, (Player.mC.x + 50), (Player.mC.y - 20), 0.3, "sniper", 0, Useful, 400, "bullet"));
} else {
if (_arg1.parent.parent.itemsMc.currentFrame == 4){
goodGuysArray.push(new GameGoodGuy(this, (Player.mC.x + 50), (Player.mC.y - 20), 0.3, "heavyGunner", 0, Useful, 200, "Photon"));
};
};
};
};
};
_arg1.parent.numberOrdered.text--;
}
public function doAttackCommandBtn(_arg1:MouseEvent):void{
doAttack();
}
function doClock(){
clockDelay--;
if (clockDelay == 0){
clockDelay = 20;
countDown();
};
}
public function dropSomething():void{
var _local1:tower1;
var _local2:Number;
var _local3:man;
var _local4:Number;
_local1 = new tower1();
_local1.gotoAndStop(1);
inGameGoodGuysMc.addChild(_local1);
_local2 = (stage.mouseX - spritesMc.x);
_local3 = new man();
_local3.gotoAndStop(1);
inGameGoodGuysMc.addChild(_local3);
_local4 = (_local1.y - _local1.height);
}
function countDown(){
sec--;
if (sec < 0){
minutes--;
sec = 59;
if (minutes < 0){
minutes = 0;
sec = 0;
gameOver("out_of_time");
};
};
}
function setAlienEnergy(){
statsMc.energyAlien.text = String(energyAlien);
if (filterAlienDelay > 1){
filterAlienDelay--;
if (filterAlienDelay == 1){
alienBaseMc.filters = [];
};
};
}
function pauseOn(){
pauseSwitch = true;
}
function setWave(){
}
function setupStartGameMsg(){
startGameMsgMc = new GameStartMsg(this);
inGameMsgsMc.addChild(startGameMsgMc);
startGameMsgMc.x = 140;
startGameMsgMc.y = 50;
}
function setupPanelItems(){
var _local1:*;
var _local2:*;
itemsToBuyMc = new Sprite();
statsMc.addChild(itemsToBuyMc);
itemsToBuyMc.x = 68;
itemsToBuyMc.y = 15;
itemsArray = new Array();
_local1 = 0;
while (_local1 < numberOfStartItems) {
_local2 = new GamePanelBuyMc(this);
itemsToBuyMc.addChild(_local2);
if (panelItemsData[((_local1 * 3) + 1)] > money){
_local2.gotoAndStop("notBuy");
};
itemsCost[_local1] = panelItemsData[((_local1 * 3) + 1)];
_local2.itemsMc.gotoAndStop(panelItemsData[(_local1 * 3)]);
_local2.x = (_local1 * 40);
itemsArray.push(_local2);
_local1++;
};
upgradeMc1 = new GameUpgrade(this);
statsMc.addChild(upgradeMc1);
upgradeMc1.x = 290;
upgradeMc1.y = 39;
if (upgrade1 == true){
upgradeMc1.gotoAndStop(3);
upgradeMc1.back.gotoAndStop(3);
};
upgradeMc2 = new GameUpgrade2(this);
statsMc.addChild(upgradeMc2);
upgradeMc2.x = 315;
upgradeMc2.y = 39;
if (upgrade2 == true){
upgradeMc2.gotoAndStop(3);
upgradeMc2.back.gotoAndStop(3);
};
upgradeMc3 = new GameUpgrade3(this);
statsMc.addChild(upgradeMc3);
upgradeMc3.x = 340;
upgradeMc3.y = 39;
if (upgrade3 == true){
upgradeMc3.gotoAndStop(3);
upgradeMc3.back.gotoAndStop(3);
};
upgradeMc4 = new GameUpgrade4(this);
statsMc.addChild(upgradeMc4);
upgradeMc4.x = 290;
upgradeMc4.y = 60;
if (upgrade4 == true){
upgradeMc4.gotoAndStop(3);
upgradeMc4.back.gotoAndStop(3);
};
upgradeMc5 = new GameUpgrade5(this);
statsMc.addChild(upgradeMc5);
upgradeMc5.x = 315;
upgradeMc5.y = 60;
if (upgrade5 == true){
upgradeMc5.gotoAndStop(3);
upgradeMc5.back.gotoAndStop(3);
};
checkForAfford();
}
function killAllMissiles(){
var _local1:*;
_local1 = (missilesArray.length - 1);
while (_local1 >= 0) {
missilesArray[_local1].remove();
_local1--;
};
}
function newLevelStuff(){
energyAlien = (100 + ((levelNumber - 1) * 50));
if (energyAlien > 500){
energyAlien = 500;
};
wave = 0;
}
public function scrollBackgroundLeft():void{
backMc.ground.x = (backMc.ground.x - 10);
}
function selectGoodGuy(_arg1){
var _local2:*;
_local2 = new manSelectionSquare();
_arg1.mC.selectionMc.gotoAndStop(2);
selectionArray.push(_arg1);
setupSoldierCommands();
}
function doAttack(){
var _local1:*;
statsMc.defend.gotoAndStop(1);
statsMc.attack.gotoAndStop(2);
_local1 = 0;
while (_local1 < selectionArray.length) {
selectionArray[_local1].soldierState = SOLDIER_STATE_ATTACK;
_local1++;
};
}
public function restartLevel(){
if (gameOverMsgMc != null){
inGameMsgsMc.removeChild(gameOverMsgMc);
};
gameOverMsgMc = null;
upgrade1 = oldUpgrade1;
upgrade2 = oldUpgrade2;
upgrade3 = oldUpgrade3;
money = oldMoney;
energy = oldEnergy;
score = oldScore;
rt.gameState = 6;
killAllBadGuys();
killAllGoodGuys();
killAllMissiles();
killAllExplosions();
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 _local1:MovieClip;
if (sec < 10){
secDisplay = ("0" + sec);
} else {
secDisplay = String(sec);
};
if (minutes < 10){
minDisplay = ("0" + minutes);
} else {
minDisplay = String(minutes);
};
_local1 = inGameStatsMc["ingamestatsmc"];
_local1 = _local1["wg"];
_local1 = _local1["stats"];
_local1.time.text = (((minDisplay + ":") + secDisplay) + "s");
}
function decreaseMoney(_arg1:Number){
money = (money - _arg1);
if (money < 0){
money = 0;
};
setMoney();
}
public function quitGame(){
Sounds.playSoundFx("gameOverFx");
killAllBadGuys();
killAllGoodGuys();
killAllMissiles();
rt.gameState = 1;
killAllExplosions();
levelNumber = 1;
if (gameOverMsgMc != null){
inGameMsgsMc.removeChild(gameOverMsgMc);
};
gameOverMsgMc = null;
upgrade1 = false;
upgrade2 = false;
upgrade3 = false;
upgrade4 = false;
upgrade5 = false;
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 selectPlayer(){
var _local1:*;
_local1 = 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();
groundArray = new Array();
itemsArray = new Array();
selectionArray = new Array();
}
function setupWave(_arg1){
var _local2:Array;
var _local3:*;
var _local4:Class;
var _local5:*;
var _local6:Number;
_local2 = badGuysLevels[(levelNumber - 1)];
_local3 = 0;
while (_local3 < _local2[((_arg1 * 9) + 1)]) {
_local4 = Class(getDefinitionByName(_local2[(_arg1 * 9)]));
_local5 = new (_local4);
_local5.gotoAndStop(1);
inGameEnemyMc.addChild(_local5);
if (_local2[(_arg1 * 9)] == "badGuyFlying"){
_local6 = Useful.RandomNumber(1, 50);
_local6 = (_local6 - 25);
_local6 = (_local6 + _local2[((_arg1 * 9) + 4)]);
badGuysArray.push(new GameBadGuy(_local5, this, _local2[((_arg1 * 9) + 3)], _local6, (_local2[((_arg1 * 9) + 5)] / 10), Useful, (_local3 * 10), _local2[((_arg1 * 9) + 2)], _local2[(_arg1 * 9)], _local2[((_arg1 * 9) + 6)], _local2[((_arg1 * 9) + 7)], _local2[((_arg1 * 9) + 8)]));
} else {
badGuysArray.push(new GameBadGuy(_local5, this, _local2[((_arg1 * 9) + 3)], (alienBaseMc.y + 20), (_local2[((_arg1 * 9) + 5)] / 10), Useful, (_local3 * 10), _local2[((_arg1 * 9) + 2)], _local2[(_arg1 * 9)], _local2[((_arg1 * 9) + 6)], _local2[((_arg1 * 9) + 7)], _local2[((_arg1 * 9) + 8)]));
};
_local3++;
};
}
function doDefend(){
var _local1:*;
statsMc.attack.gotoAndStop(1);
statsMc.defend.gotoAndStop(2);
_local1 = 0;
while (_local1 < selectionArray.length) {
selectionArray[_local1].soldierState = SOLDIER_STATE_DEFEND;
selectionArray[_local1].speed = 0;
selectionArray[_local1].mC.gotoAndStop("stand");
_local1++;
};
}
function setupUpgrade4(){
upgradeMc4.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
}
function setupUpgrade5(){
upgradeMc5.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
}
function setupUpgrade2(){
upgradeMc2.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
}
function setupUpgrade3(){
upgradeMc3.gotoAndStop(3);
Sounds.playSoundFx("upgradeFx");
}
function soundFxBtn2(){
if (soundsSwitch == false){
statsMc.soundFxMc.gotoAndStop("off");
} else {
statsMc.soundFxMc.gotoAndStop("on");
};
}
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 setupUpgrade1(){
upgradeMc1.gotoAndStop(3);
currentMoneyDelay = 30;
Sounds.playSoundFx("upgradeFx");
}
function killAllBadGuys(){
var _local1:*;
_local1 = (badGuysArray.length - 1);
while (_local1 >= 0) {
badGuysArray[_local1].remove();
_local1--;
};
}
function setEnemies(){
statsMc.enemies.text = String(badGuysArray.length);
}
function increaseEnergy(_arg1:Number){
energy = (energy + _arg1);
if (energy > 10000){
energy = 10000;
};
setEnergy();
}
function findSelected(){
var _local1:Array;
var _local2:*;
_local1 = new Array();
if (clickloc != null){
if (clickloc.x < stage.mouseX){
_local2 = 0;
while (_local2 < goodGuysArray.length) {
if ((goodGuysArray[_local2].mC.x + spritesMc.x) > clickloc.x){
if ((goodGuysArray[_local2].mC.x + spritesMc.x) < stage.mouseX){
if (goodGuysArray[_local2].mC.y > clickloc.y){
if (goodGuysArray[_local2].mC.y < stage.mouseY){
_local1.push(goodGuysArray[_local2]);
};
};
};
};
_local2++;
};
} else {
_local2 = 0;
while (_local2 < goodGuysArray.length) {
if ((goodGuysArray[_local2].mC.x + spritesMc.x) > stage.mouseX){
if ((goodGuysArray[_local2].mC.x + spritesMc.x) < clickloc.x){
if (goodGuysArray[_local2].mC.y > clickloc.y){
if (goodGuysArray[_local2].mC.y < stage.mouseY){
_local1.push(goodGuysArray[_local2]);
};
};
};
};
_local2++;
};
};
if (_local1.length > 0){
clearSelection();
_local2 = 0;
while (_local2 < _local1.length) {
selectGoodGuy(_local1[_local2]);
_local2++;
};
};
};
}
function checkForPanelClick(){
var _local1:*;
var _local2:Number;
if (statsMc.currentFrame == 1){
_local1 = 0;
while (_local1 < itemsArray.length) {
if (itemsArray[_local1].hitTestPoint(stage.mouseX, stage.mouseY, true)){
_local2 = (money - itemsCost[_local1]);
if (_local2 >= 0){
if (goodGuysArray.length < 60){
decreaseMoney(itemsCost[_local1]);
filterDelay = 1;
itemsArray[_local1].back.numberOrdered.text++;
if (upgrade1 == true){
itemsArray[_local1].back.gotoAndStop(3);
} else {
itemsArray[_local1].back.gotoAndStop(2);
};
Sounds.playSoundFx("clickBtnFx");
checkForAfford();
};
};
};
_local1++;
};
if (upgradeMc1.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade1 == false){
_local2 = (money - upgradeCost1);
if (_local2 >= 0){
decreaseMoney(upgradeCost1);
upgradeMc1.back.gotoAndStop(2);
upgrade1 = true;
};
};
} else {
if (upgradeMc2.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade2 == false){
_local2 = (money - upgradeCost2);
if (_local2 >= 0){
decreaseMoney(upgradeCost2);
upgradeMc2.back.gotoAndStop(2);
upgrade2 = true;
};
};
} else {
if (upgradeMc3.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade3 == false){
_local2 = (money - upgradeCost3);
if (_local2 >= 0){
decreaseMoney(upgradeCost3);
upgradeMc3.back.gotoAndStop(2);
upgrade3 = true;
};
};
} else {
if (upgradeMc4.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade4 == false){
_local2 = (money - upgradeCost4);
if (_local2 >= 0){
decreaseMoney(upgradeCost4);
upgradeMc4.back.gotoAndStop(2);
upgrade4 = true;
};
};
} else {
if (upgradeMc5.back.hitTestPoint(stage.mouseX, stage.mouseY, true)){
if (upgrade5 == false){
_local2 = (money - upgradeCost5);
if (_local2 >= 0){
decreaseMoney(upgradeCost5);
upgradeMc5.back.gotoAndStop(2);
upgrade5 = true;
};
};
};
};
};
};
};
};
if (statsMc.spaceGunUp.hitTestPoint(stage.mouseX, stage.mouseY, true)){
Player.rotateGunUp = true;
Sounds.playSoundFx("mainGunRotSound");
} else {
if (statsMc.spaceGunDown.hitTestPoint(stage.mouseX, stage.mouseY, true)){
Player.rotateGunDown = true;
Sounds.playSoundFx("mainGunRotSound");
} else {
if (statsMc.gunEnergy.hitTestPoint(stage.mouseX, stage.mouseY, true)){
Player.fireMissile();
};
};
};
}
function drawSquare(_arg1, _arg2, _arg3, _arg4, _arg5){
_arg1.graphics.moveTo(_arg2, _arg3);
_arg1.graphics.lineTo(_arg4, _arg3);
_arg1.graphics.lineTo(_arg4, _arg5);
_arg1.graphics.lineTo(_arg2, _arg5);
_arg1.graphics.lineTo(_arg2, _arg3);
}
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(){
backMc = new backgroundMc();
backgroundLevelMc.addChild(backMc);
inGameBackgroundMc.filters = [bf2];
backMc.ground.gotoAndStop(levelNumber);
backMc.gotoAndStop(levelNumber);
backSkyMc = new backgroundSkyMc();
backSkyMc.cacheAsBitmap = true;
backSkyMc.gotoAndStop(levelNumber);
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 _local1:MovieClip;
_local1 = inGameStatsMc["ingamestatsmc"];
_local1 = _local1["wg"];
_local1 = _local1["stats"];
_local1["music"].gotoAndStop(1);
}
public function gameOverLoop(){
var _local1:*;
var _local2:*;
gameExplosions.mainLoop();
_local1 = 0;
while (_local1 < explosionsArray.length) {
explosionsArray[_local1].mainLoop();
_local1++;
};
_local2 = 0;
while (_local2 < particlesArray.length) {
particlesArray[_local2].mainLoop();
_local2++;
};
alienBaseMc.y = (alienBaseMc.y + 2);
if ((alienBaseMc.y - 30) > groundArray[int(alienBaseMc.x)]){
if (levelCompleteMsg != null){
levelCompleteMsg.play();
};
};
}
function increaseMoney(_arg1:Number){
money = (money + _arg1);
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 _local1:MovieClip;
_local1 = new playerSprite();
playerMc.addChild(_local1);
Player = new GamePlayer(_local1, this, 50, (groundArray[50] - 70), Useful);
}
function setSelectedAmount(){
if (statsMc.currentFrame == 2){
if (statsMc.selectedTxt != null){
statsMc.selectedTxt.text = String(selectionArray.length);
};
};
}
public function mainLoop(){
var _local1:int;
var _local2:*;
var _local3:Number;
trace("mouse");
trace(stage.mouseX);
trace(root.mouseX);
levelTime++;
doMoneyIncrease();
doMarching();
Player.mainLoop();
checkPanel();
_local1 = 0;
while (_local1 < badGuysArray.length) {
badGuysArray[_local1].mainLoop();
_local1++;
};
_local1 = 0;
while (_local1 < goodGuysArray.length) {
goodGuysArray[_local1].mainLoop();
_local1++;
};
_local1 = 0;
while (_local1 < missilesArray.length) {
missilesArray[_local1].mainLoop();
_local1++;
};
_local1 = (missilesArray.length - 1);
while (_local1 >= 0) {
if (missilesArray[_local1].dead == true){
missilesArray.splice(_local1, 1);
};
_local1--;
};
_local1 = 0;
while (_local1 < explosionsArray.length) {
explosionsArray[_local1].mainLoop();
_local1++;
};
_local2 = 0;
while (_local2 < particlesArray.length) {
particlesArray[_local2].mainLoop();
_local2++;
};
runWave();
setEnergy();
setMoney();
setAlienEnergy();
setEnemies();
setScore();
setSelectedAmount();
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);
_local3 = -(maxScrollSpeed);
if (scrollvx < _local3){
scrollvx = _local3;
};
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(_arg1){
inGameStatsMc.removeChild(statsMc);
if (_arg1 == "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);
gameExplosions = new GameMultipleExplosion(this, Useful, 8, Player.mC.x, (Player.mC.y - 60), 80, 1, 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);
gameExplosions = new GameMultipleExplosion(this, Useful, 8, alienBaseMc.x, (alienBaseMc.y - 60), 80, 1, 2);
alienBaseMc.filters = [];
killAllBadGuys();
killAllGoodGuys();
killAllMissiles();
};
}
}
}//package classesAS3
Section 5
//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 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_ATTACK:int = 0;
public static const SOLDIER_STATE_CRYSTAL:int = 2;
public static const SOLDIER_STATE_RETREAT:int = 3;
public function GameGoodGuy(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9){
var _local10: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 = _arg1;
if (_arg5 == "man"){
mC = new man();
mC.gotoAndStop("walk");
rt.inGameGoodGuysMc.addChild(mC);
myDamage = 5;
myFireDelay = 90;
} else {
if (_arg5 == "rocket"){
mC = new rocketLauncher();
mC.gotoAndStop("walk");
rt.inGameGoodGuysMc.addChild(mC);
myDamage = 20;
myFireDelay = 60;
} else {
if (_arg5 == "grenader"){
mC = new GameManGrenader(this);
mC.gotoAndStop("walk");
myDamage = 20;
myFireDelay = 60;
rt.inGameGoodGuysMc.addChild(mC);
} else {
if (_arg5 == "sniper"){
mC = new sniper();
mC.gotoAndStop("walk");
rt.inGameGoodGuysMc.addChild(mC);
myDamage = 20;
myFireDelay = 60;
} else {
if (_arg5 == "heavyGunner"){
mC = new heavyGunner();
mC.gotoAndStop("walk");
rt.inGameGoodGuysMc.addChild(mC);
myDamage = 2;
myFireDelay = 60;
};
};
};
};
};
Useful = _arg7;
_local10 = Useful.RandomNumber(1, 10);
_local10 = (_local10 - 10);
myRange = (_arg8 + _local10);
missileName = _arg9;
dead = false;
inToGround = 0;
xOrigin = _arg2;
yOrigin = _arg3;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
myParent = _arg6;
hitVel = 0;
energyBarOn = 0;
gravity = 1;
_local10 = Useful.RandomNumber(1, 10);
_local10 = (_local10 / 100);
_arg4 = (_arg4 + _local10);
speed = _arg4;
speedOld = _arg4;
xDir = 1;
mC.scaleX = -1;
distanceArray = new Array();
glowFilter = new GlowFilter(0xFFFFFF, 1, 3, 3, 3, 1);
numberOfMissiles = 0;
energyStart = 100;
energy = energyStart;
myName = _arg5;
soldierState = SOLDIER_STATE_ATTACK;
filterDelay = 1;
updatePosition();
}
function applyGravity(){
yVel = (yVel + gravity);
}
function remove(){
var _local1:Number;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < rt.goodGuysArray.length) {
if (this == rt.goodGuysArray[_local2]){
_local1 = _local2;
};
_local2++;
};
rt.inGameGoodGuysMc.removeChild(mC);
rt.goodGuysArray.splice(_local1, 1);
}
function updatePosition(){
xPos = (xPos + hitVel);
hitVel = 0;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
}
function mainLoop(){
if (dead == false){
if (filterDelay > 1){
filterDelay--;
if (filterDelay == 1){
mC.filters = [];
};
};
if (soldierState == SOLDIER_STATE_ATTACK){
if (rt.badGuysArray.length > 0){
findEnemyTarget();
if (distanceArray.length > 0){
speed = 0;
if (distanceArray[0].distSprite == rt.alienBaseMc){
checkForFireBase();
} else {
checkForFire();
if (mC.currentFrame != 3){
if (myName == "grenader"){
mC.gotoAndStop("stand");
} else {
mC.gotoAndStop("gunStand");
};
};
};
} else {
findEnemyBase();
if (distanceArray.length > 0){
speed = 0;
checkForFireBase();
} else {
speed = speedOld;
if (mC.currentFrame != 1){
mC.gotoAndStop("walk");
mC.scaleX = -1;
xDir = 1;
};
};
};
} else {
findEnemyBase();
if (distanceArray.length > 0){
speed = 0;
checkForFireBase();
} 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();
};
if (distanceArray.length > 0){
speed = 0;
checkForFire();
};
applyGravity();
checkForGround();
} else {
if (soldierState == SOLDIER_STATE_RETREAT){
if (60 > mC.x){
xDir = 1;
mC.scaleX = -1;
} else {
xDir = -1;
mC.scaleX = 1;
};
applyGravity();
checkForGround();
};
};
};
updatePosition();
} else {
inToGround++;
if (inToGround > 100){
remove();
} else {
yVel = 0.1;
xVel = 0;
updatePosition();
};
};
}
public function throwGrenade(){
var _local1:Object;
var _local2:Object;
_local2 = distanceArray[0].distSprite;
projectileMc = new grenadeMc();
rt.inGameMissilesMc.addChild(projectileMc);
if (distanceArray[0].distSprite == rt.alienBaseMc){
_local1 = Useful.getArcVelocity(2, 16, mC.x, mC.y, _local2.x, _local2.y);
} else {
_local1 = Useful.getArcVelocity(2, 16, mC.x, mC.y, _local2.mC.x, _local2.mC.y);
};
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, _local1, 16, this, myDamage));
}
function checkForFire(){
var _local1:Object;
var _local2:Object;
if (missileName == "Photon"){
delayToFireMissile--;
if (delayToFireMissile > 0){
mC.gotoAndStop("shoot");
_local1 = distanceArray[0].distSprite;
projectileMc = new Photon();
rt.inGameMissilesMc.addChild(projectileMc);
if (_local1.myName == "badGuyRollingBomb"){
_local2 = Useful.pointTowards(_local1.mC.x, (_local1.mC.y - 10), mC.x, (mC.y - 50));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 50), missileName, Useful, _local2, 20, this, myDamage));
} else {
_local2 = Useful.pointTowards(_local1.mC.x, (_local1.mC.y - 20), mC.x, (mC.y - 50));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 50), missileName, Useful, _local2, 20, this, myDamage));
};
} else {
if (delayToFireMissile < -(myFireDelay)){
delayToFireMissile = myFireDelay;
};
};
} else {
delayToFireMissile--;
if (delayToFireMissile == 0){
delayToFireMissile = myFireDelay;
mC.gotoAndStop("shoot");
_local1 = distanceArray[0].distSprite;
if (_local1.mC.x > mC.x){
xDir = 1;
mC.scaleX = -1;
} else {
xDir = -1;
mC.scaleX = 1;
};
if (missileName == "bullet"){
rt.Sounds.playSoundFx("bulletFx");
projectileMc = new bullet();
rt.inGameMissilesMc.addChild(projectileMc);
if (_local1.myName == "badGuyRollingBomb"){
_local2 = Useful.pointTowards(_local1.mC.x, (_local1.mC.y - 10), mC.x, (mC.y - 15));
} else {
_local2 = Useful.pointTowards(_local1.mC.x, (_local1.mC.y - 20), mC.x, (mC.y - 15));
};
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 20), missileName, Useful, _local2, 16, this, myDamage));
} else {
if (missileName == "rocket"){
rt.Sounds.playSoundFx("fireMissileFx");
projectileMc = new rocket();
rt.inGameMissilesMc.addChild(projectileMc);
_local2 = Useful.pointTowards(_local1.mC.x, _local1.mC.y, mC.x, (mC.y - 5));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 30), missileName, Useful, _local2, 16, this, myDamage));
} else {
if (missileName == "grenade"){
rt.Sounds.playSoundFx("throwFx");
projectileMc = new projectiles();
rt.inGameMissilesMc.addChild(projectileMc);
_local2 = Useful.getArcVelocity(3, 16, mC.x, (mC.y - 10), _local1.mC.x, (_local1.mC.y - 10));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, _local2, 16, this, myDamage));
} else {
projectileMc = new projectiles();
rt.inGameMissilesMc.addChild(projectileMc);
_local2 = Useful.getArcVelocity(6, 26, mC.x, mC.y, _local1.mC.x, _local1.mC.y);
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, _local2, 16, this, myDamage));
};
};
};
};
};
}
function decreaseEnergy(_arg1, _arg2){
var _local3:*;
var _local4:Number;
if (myName == "man"){
_arg2 = (_arg2 + 10);
};
if (rt.upgrade2 == true){
_arg2 = int((_arg2 / 2));
filterDelay = 10;
mC.filters = [glowFilter];
};
energy = (energy - _arg2);
if (energyBarOn == 0){
energyBarOn = 1;
energyBarMc = new GameEnergyBar(this);
mC.addChild(energyBarMc);
};
_local3 = new GameRisingScore(rt, rt.inGameScoreMc, _arg2);
rt.inGameScoreMc.addChild(_local3);
_local3.x = mC.x;
_local3.y = (mC.y - 10);
energyBarMc.x = 0;
energyBarMc.y = -35;
_local4 = (energy / 10);
energyBarMc.bar.bar.y = int((10 - _local4));
if (energy <= 0){
inToGround = 0;
dead = true;
rt.Sounds.playSoundFx("explosionFx");
if (xDir < 0){
if (_arg1 > mC.x){
mC.gotoAndStop("deathBack");
hitVel = 14;
} else {
mC.gotoAndStop("deathBack");
hitVel = -14;
};
} else {
if (_arg1 > mC.x){
mC.gotoAndStop("deathBack");
hitVel = -14;
} else {
hitVel = 14;
mC.gotoAndStop("deathBack");
};
};
} else {
if (xDir < 0){
if (_arg1 > mC.x){
mC.gotoAndStop("hit2");
hitVel = -4;
} else {
mC.gotoAndStop("hit");
hitVel = 4;
};
} else {
if (_arg1 > mC.x){
mC.gotoAndStop("hit");
hitVel = -4;
} else {
hitVel = 4;
mC.gotoAndStop("hit2");
};
};
if (missileName == "Photon"){
hitVel = int((hitVel / 2));
};
};
updatePosition();
}
function checkForGround():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = int(mC.x);
_local2 = (mC.y + rt.spritesMc.y);
_local3 = rt.groundArray[_local1];
if (_local2 > _local3){
_local2 = (_local2 - _local3);
yVel = (yVel - _local2);
};
xVel = (xDir * speed);
updatePosition();
_local1 = int(mC.x);
_local2 = (mC.y + rt.spritesMc.y);
if (_local2 > _local3){
_local2 = (_local2 - _local3);
yPos = (yPos - _local2);
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 findCrystalTarget(){
var _local1:int;
var _local2:Object;
distanceArray = new Array();
_local1 = 0;
while (_local1 < rt.badGuysArray.length) {
if (rt.pickupsArray[_local1].dead == false){
_local2 = new Object();
_local2.distSprite = rt.pickupsArray[_local1];
_local2.dist = Useful.getDistanceQ(mC.x, mC.y, rt.pickupsArray[_local1].x, rt.pickupsArray[_local1].y);
if (_local2.dist < myRange){
distanceArray.push(_local2);
};
};
_local1++;
};
distanceArray.sortOn("dist", Array.NUMERIC);
}
function getCrystal(){
var _local1:Object;
_local1 = distanceArray[0].distSprite;
if (_local1.x > mC.x){
xDir = 1;
mC.scaleX = -1;
} else {
xDir = -1;
mC.scaleX = 1;
};
}
public function checkForTower():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:*;
_local1 = yVel;
_local2 = yVel;
if (_local2 < 0){
_local2 = ((_local2 - _local2) - _local2);
};
_local3 = (mC.x + rt.spritesMc.x);
_local4 = (mC.y + rt.spritesMc.y);
_local4 = (_local4 - 2);
_local5 = 0;
while (_local5 < int(_local2)) {
if (myParent.mC.hitTestPoint(_local3, (_local4 + _local5), true)){
yVel = (yVel - int(_local1));
yVel = (_local5 + yVel);
gravity = 0;
mC.gotoAndStop("stand");
break;
};
_local5++;
};
}
function checkForFireBase(){
var _local1:*;
var _local2:Object;
if (missileName == "Photon"){
delayToFireMissile--;
if (delayToFireMissile > 0){
mC.gotoAndStop("shoot");
_local1 = distanceArray[0].distSprite;
projectileMc = new Photon();
rt.inGameMissilesMc.addChild(projectileMc);
_local2 = Useful.pointTowards(_local1.mC.x, (_local1.mC.y - 20), mC.x, (mC.y - 50));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 50), missileName, Useful, _local2, 20, this, myDamage));
} else {
if (delayToFireMissile < -(myFireDelay)){
delayToFireMissile = myFireDelay;
};
};
} else {
delayToFireMissile--;
if (delayToFireMissile == 0){
delayToFireMissile = myFireDelay;
mC.gotoAndStop("shoot");
_local1 = distanceArray[0].distSprite;
if (_local1.x > mC.x){
xDir = 1;
mC.scaleX = -1;
} else {
xDir = -1;
mC.scaleX = 1;
};
if (missileName == "bullet"){
rt.Sounds.playSoundFx("bulletFx");
projectileMc = new bullet();
rt.inGameMissilesMc.addChild(projectileMc);
_local2 = Useful.pointTowards(_local1.x, (_local1.y + 60), mC.x, (mC.y - 5));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, _local2, 16, this, myDamage));
} else {
if (missileName == "rocket"){
rt.Sounds.playSoundFx("fireMissileFx");
projectileMc = new rocket();
rt.inGameMissilesMc.addChild(projectileMc);
_local2 = Useful.pointTowards(_local1.x, (_local1.y + 60), mC.x, (mC.y - 25));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 25), missileName, Useful, _local2, 16, this, myDamage));
} else {
if (missileName == "grenade"){
rt.Sounds.playSoundFx("throwFx");
projectileMc = new projectiles();
rt.inGameMissilesMc.addChild(projectileMc);
_local2 = Useful.getArcVelocity(2, 16, mC.x, (mC.y - 10), _local1.x, (_local1.y - 10));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, _local2, 16, this, myDamage));
} else {
projectileMc = new projectiles();
rt.inGameMissilesMc.addChild(projectileMc);
_local2 = Useful.getArcVelocity(6, 26, mC.x, mC.y, _local1.x, (_local1.y + 60));
rt.missilesArray.push(new GameMissile(projectileMc, rt, mC.x, (mC.y - 10), missileName, Useful, _local2, 16, this, myDamage));
};
};
};
};
};
}
function findEnemyBase(){
var _local1:Object;
distanceArray = new Array();
_local1 = new Object();
_local1.distSprite = rt.alienBaseMc;
_local1.dist = Useful.getDistanceQ(mC.x, mC.y, _local1.distSprite.x, _local1.distSprite.y);
if (_local1.dist < myRange){
if (myName == "grenader"){
distanceArray.push(_local1);
} else {
if (Useful.checkForLOS(mC.x, mC.y, _local1.distSprite.x, _local1.distSprite.y, _local1.distSprite) == false){
distanceArray.push(_local1);
};
};
};
}
function checkForCrystals(){
var _local1:*;
_local1 = 0;
while (_local1 < rt.pickupsArray.length) {
if (mC.hitTestObject(rt.pickupsArray[_local1])){
rt.increaseEnergy(5);
rt.pickupsArray[_local1].parent.removeChild(rt.pickupsArray[_local1]);
rt.pickupsArray.splice(_local1, 1);
};
_local1++;
};
}
function findEnemyTarget(){
var _local1:int;
var _local2:Boolean;
var _local3:Object;
distanceArray = new Array();
_local1 = 0;
while (_local1 < rt.badGuysArray.length) {
if (rt.badGuysArray[_local1].dead == false){
_local2 = false;
if (myName == "grenader"){
if (rt.badGuysArray[_local1].myName == "badGuyFlying"){
_local2 = true;
};
};
if (_local2 == false){
_local3 = new Object();
_local3.distSprite = rt.badGuysArray[_local1];
_local3.dist = Useful.getDistanceQ(mC.x, mC.y, rt.badGuysArray[_local1].mC.x, rt.badGuysArray[_local1].mC.y);
if (_local3.dist < myRange){
if (myName == "grenader"){
distanceArray.push(_local3);
} else {
if (Useful.checkForLOS(mC.x, (mC.y - 5), _local3.distSprite.mC.x, (_local3.distSprite.mC.y - 25), _local3.distSprite.mC) == false){
distanceArray.push(_local3);
};
};
};
};
};
distanceArray.sortOn("dist", Array.NUMERIC);
_local1++;
};
}
}
}//package classesAS3
Section 6
//GameIntroAnim (classesAS3.GameIntroAnim)
package classesAS3 {
import flash.display.*;
import flash.events.*;
public class GameIntroAnim extends MovieClip {
var rt:Object;
public function GameIntroAnim(_arg1){
addFrameScript(121, frame122);
rt = _arg1;
this.play();
}
function frame122(){
this.rt.introFinished();
stop();
}
}
}//package classesAS3
Section 7
//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(_arg1){
addFrameScript(0, frame1, 14, frame15, 30, frame31, 98, frame99);
rt = _arg1;
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);
if (this.rt.levelNumber == this.rt.levelMax){
msg.titleMc.gotoAndStop(2);
};
}
function frame1(){
play();
}
function frame31(){
stop();
}
function frame99(){
trace(this.rt.levelNumber);
if (this.rt.levelNumber == this.rt.levelMax){
this.rt.quitGame();
} else {
this.rt.endLevelStuff();
};
stop();
}
}
}//package classesAS3
Section 8
//GameLoop (classesAS3.GameLoop)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import flash.media.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
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 mochiId:String;// = "2bbba8dad72356d6"
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 titleStarted:Boolean;// = false
public var mochiScoreId:String;// = "dc04996c7964cc2d"
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 = "2bbba8dad72356d6";
mochiScoreId = "dc04996c7964cc2d";
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;
super();
addFrameScript(0, frame1, 2, frame3);
checkDomain();
if (Kongregate_Site == true){
} else {
trace(this);
};
MochiBot.track(this, "e88cc78d");
mouseNumberDown = 0;
mainBtnsSetup = false;
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;
titleScreen.instructionsBtn.addEventListener(MouseEvent.MOUSE_UP, doInstScreen);
titleScreen.controlsBtn.addEventListener(MouseEvent.MOUSE_UP, doControlsScreen);
titleScreen.musicBtn.addEventListener(MouseEvent.MOUSE_UP, doSoundBtn);
}
public function setupTitleScreen(){
titleScreen = new GameTitleScreen(this);
titleScreen.x = 0;
addChild(titleScreen);
titleScreen.play();
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;
};
};
}
public function doControlsScreen(_arg1:MouseEvent):void{
titleScreen.gotoAndStop("controls");
}
public function doScoresBtns(){
titleScreen.backBtn.addEventListener(MouseEvent.MOUSE_UP, doLastScoreScreen);
}
public function showLeaderboard(_arg1){
}
public function mouseMoveHandler(_arg1:Event):void{
}
public function doPlay():void{
GameMain.mainLoop();
}
public function keyListener(_arg1:KeyboardEvent):void{
keyPressDown = false;
GameMain.scrollScreen = "";
GameMain.Player.rotateGunUp = false;
GameMain.Player.rotateGunDown = false;
if (_arg1.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 (_arg1.keyCode == 90){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.buildDroid(0);
};
} else {
if (_arg1.keyCode == 88){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.buildDroid(1);
};
} else {
if (_arg1.keyCode == 67){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.buildDroid(2);
};
} else {
if (_arg1.keyCode == 86){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.buildDroid(3);
};
} else {
if (_arg1.keyCode == 66){
if (gameState == STATE_SYSTEM_PLAY){
GameMain.buildDroid(4);
};
};
};
};
};
};
}
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(_arg1:MouseEvent):void{
titleScreen.gotoAndStop("mainScreen");
}
public function doSoundBtn(_arg1: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);
trace("loadingComplete");
removeChild(loadingBox);
loadingBox = null;
this.loaderInfo.removeEventListener(Event.INIT, loadingComplete);
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS, loadingProgress);
finishPreload();
}
public function mouseLeftClick(_arg1:Event):void{
if (gameState == STATE_SYSTEM_PLAY){
if (stage.mouseY < (500 - 80)){
GameMain.leftClick();
} else {
GameMain.checkForPanelClick();
};
};
}
public function doMapScreen(_arg1:MouseEvent):void{
removeChild(titleScreen);
setupMapScreen();
}
public function mapLeftUpClick(_arg1:MouseEvent):void{
}
public function showHUD():void{
FPS.text = "FPS";
Memory.text = "mem";
Memory.x = 200;
stage.addChild(FPS);
stage.addChild(Memory);
}
public function doSetup(_arg1:MouseEvent):void{
removeChild(mapScreen2);
GameMain.setupGame();
}
public function openURL(_arg1:String){
var _local2:String;
var _local3:URLRequest;
_local2 = _arg1;
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
}
function doLastContScreen(_arg1: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);
}
public function introFinished(){
removeChild(introAnim);
gameState = STATE_SYSTEM_TITLE;
}
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(_arg1:MouseEvent):void{
if (titleScreen.currentFrame < 4){
titleScreen.nextFrame();
} else {
titleScreen.gotoAndStop("mainScreen");
};
}
function doNextContScreen(_arg1:MouseEvent):void{
if (titleScreen.currentFrame < 7){
titleScreen.nextFrame();
} else {
titleScreen.gotoAndStop("mainScreen");
};
}
function doLastInstScreen(_arg1:MouseEvent):void{
if (titleScreen.currentFrame > 2){
titleScreen.gotoAndStop((titleScreen.currentFrame - 1));
} else {
titleScreen.gotoAndStop("mainScreen");
};
}
public function runGame(_arg1: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(_arg1:MouseEvent):void{
titleScreen.gotoAndStop("instructions");
}
function doLastScoreScreen(_arg1:MouseEvent):void{
titleScreen.gotoAndStop("mainScreen");
}
public function doMapScreenStuff(){
mapScreen2.playBtn.addEventListener(MouseEvent.MOUSE_UP, doSetup);
mapScreen2.youarehereMc.infoMc.gotoAndStop(GameMain.levelNumber);
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 _local1:Number;
_local1 = (1 / ((getTimer() - currentTime) / 1000));
currentTime = getTimer();
FPS.text = ("FPS: " + Math.round(_local1).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(_arg1:KeyboardEvent):void{
if (gameState == STATE_SYSTEM_PLAY){
if (_arg1.keyCode == Keyboard.SPACE){
GameMain.Player.fireMissile();
} else {
if (_arg1.keyCode == 87){
GameMain.Player.rotateGunUp = true;
GameMain.Sounds.playSoundFx("mainGunRotSound");
} else {
if (_arg1.keyCode == 83){
GameMain.Player.rotateGunDown = true;
GameMain.Sounds.playSoundFx("mainGunRotSound");
} else {
if (_arg1.keyCode == Keyboard.UP){
GameMain.Player.rotateGunUp = true;
GameMain.Sounds.playSoundFx("mainGunRotSound");
} else {
if (_arg1.keyCode == Keyboard.DOWN){
GameMain.Player.rotateGunDown = true;
GameMain.Sounds.playSoundFx("mainGunRotSound");
} else {
if (_arg1.keyCode == 65){
keyPressDown = true;
GameMain.scrollScreen = "right";
} else {
if (_arg1.keyCode == 68){
keyPressDown = true;
GameMain.scrollScreen = "left";
} else {
if (_arg1.keyCode == Keyboard.RIGHT){
keyPressDown = true;
GameMain.scrollScreen = "left";
} else {
if (_arg1.keyCode == Keyboard.LEFT){
keyPressDown = true;
GameMain.scrollScreen = "right";
};
};
};
};
};
};
};
};
};
};
}
public function loadingProgress(_arg1: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);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
public function adFinished(){
mochiOn = false;
gameState = STATE_SYSTEM_LOADER;
}
public function mouseLeftUpClick(_arg1:Event):void{
if (gameState == STATE_SYSTEM_PLAY){
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(_arg1:MouseEvent):void{
removeChild(mapScreen2);
addChild(titleScreen);
titleScreen.gotoAndStop("mainScreen");
titleScreen.playBtn.addEventListener(MouseEvent.MOUSE_UP, doMapScreen);
}
public function doLoadScreen():void{
trace(((this.loaderInfo.bytesLoaded / this.loaderInfo.bytesTotal) * 100));
if (!loaderStarted){
if (this.loaderInfo.bytesLoaded == this.loaderInfo.bytesTotal){
finishPreload();
} else {
loadingBox = new LoadingBox();
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(_arg1: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();
};
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;
}
}
var _local1:* = Security.allowDomain("*");
return (_local1);
}//package classesAS3
Section 9
//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(_arg1){
myParent = _arg1;
}
}
}//package classesAS3
Section 10
//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(_arg1){
addFrameScript(20, frame21);
rt = _arg1;
}
function frame21(){
rt.doMapScreenStuff();
stop();
}
}
}//package classesAS3
Section 11
//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(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10){
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
super();
rt = _arg2;
Useful = _arg6;
myParent = _arg9;
myDamage = _arg10;
xOrigin = _arg3;
yOrigin = _arg4;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
speed = _arg8;
dead = false;
mC = _arg1;
mType = _arg5;
trailDelay = 2;
updatePosition();
velocities = new Object();
velocities.gravity = _arg7.gravity;
if (_arg5 == "playerMissile"){
xVel = (_arg7.vx * speed);
yVel = (_arg7.vy * speed);
} else {
if (_arg5 == "bullet"){
xVel = (_arg7.vx * speed);
yVel = (_arg7.vy * speed);
} else {
if (_arg5 == "Photon"){
xVel = (_arg7.vx * speed);
yVel = (_arg7.vy * speed);
} else {
if (_arg5 == "enemyShell"){
xVel = (_arg7.vx * speed);
yVel = (_arg7.vy * speed);
} else {
if (_arg5 == "enemyPhoton"){
xVel = (_arg7.vx * speed);
yVel = (_arg7.vy * speed);
} else {
if (_arg5 == "enemyBullet"){
xVel = (_arg7.vx * speed);
yVel = (_arg7.vy * speed);
} else {
if (_arg5 == "rocket"){
xVel = (_arg7.vx * speed);
yVel = (_arg7.vy * speed);
} else {
if (_arg5 == "grenade"){
velocities.gravity = _arg7.gravity;
velocities.steps = _arg7.steps;
velocities.xStep = _arg7.xStep;
velocities.yStep = _arg7.yStep;
xVel = velocities.xStep;
yVel = velocities.yStep;
} else {
velocities.gravity = _arg7.gravity;
velocities.steps = _arg7.steps;
velocities.xStep = _arg7.xStep;
velocities.yStep = _arg7.yStep;
xVel = velocities.xStep;
yVel = velocities.yStep;
};
};
};
};
};
};
};
};
}
function applyGravity(){
yVel = (yVel + velocities.gravity);
}
function mainLoop(){
if (dead == true){
remove();
} else {
if (mType == "playerMissile"){
applyGravity();
checkForOffStage();
collisionDetection();
} else {
if (mType == "enemyPhoton"){
checkForOffStage();
collisionDetection();
} else {
if (mType == "enemyShell"){
checkForOffStage();
collisionDetection();
} else {
if (mType == "enemyBullet"){
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 _local1:*;
var _local2:*;
var _local3:Number;
var _local4:Number;
var _local5:Number;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
_local1 = mC.x;
_local2 = mC.y;
mC.x = (xOrigin + xPos);
mC.y = (yOrigin + yPos);
_local3 = (mC.x - _local1);
_local4 = (mC.y - _local2);
_local5 = Math.atan2(_local4, _local3);
mC.rotation = ((_local5 * 180) / Math.PI);
trace("missile y");
trace(mC._y);
}
function remove(){
var _local1:Number;
var _local2:*;
if (dead == false){
_local1 = -1;
_local2 = 0;
while (_local2 < rt.missilesArray.length) {
if (this == rt.missilesArray[_local2]){
_local1 = _local2;
};
_local2++;
};
if (_local1 >= 0){
if (mC != null){
if (mC.parent != null){
rt.inGameMissilesMc.removeChild(mC);
};
};
};
dead = true;
};
}
function mCDeath(){
}
function collisionDetection(){
var _local1:*;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (mType == "bullet"){
_local1 = 0;
while (_local1 < rt.badGuysArray.length) {
if (rt.badGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.badGuysArray[_local1].mC)){
rt.badGuysArray[_local1].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));
};
};
_local1++;
};
if (dead == false){
if (mC.hitTestObject(rt.alienBaseMc)){
rt.decreaseAlienEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
};
} else {
if (mType == "Photon"){
_local1 = 0;
while (_local1 < rt.badGuysArray.length) {
if (rt.badGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.badGuysArray[_local1].mC)){
rt.badGuysArray[_local1].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));
};
};
_local1++;
};
if (dead == false){
if (mC.hitTestObject(rt.alienBaseMc)){
rt.decreaseAlienEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 3, 1, 8, true, false, false, 8));
};
};
} else {
if (mType == "rocket"){
_local1 = 0;
while (_local1 < rt.badGuysArray.length) {
if (rt.badGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.badGuysArray[_local1].mC)){
rt.badGuysArray[_local1].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));
};
};
_local1++;
};
if (dead == false){
if (mC.hitTestObject(rt.alienBaseMc)){
rt.decreaseAlienEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
};
} else {
if (mType == "grenade"){
_local1 = 0;
while (_local1 < rt.badGuysArray.length) {
if (rt.badGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.badGuysArray[_local1].mC)){
rt.badGuysArray[_local1].decreaseEnergy(this, true, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 7, 1, 10, true, false, false, 8));
};
};
_local1++;
};
if (dead == false){
if (mC.hitTestObject(rt.alienBaseMc)){
rt.decreaseAlienEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
};
} else {
if (mType == "enemyBomb"){
if (mC.hitTestObject(rt.Player.mC)){
rt.decreaseEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
if (dead == false){
_local1 = 0;
while (_local1 < rt.goodGuysArray.length) {
if (rt.goodGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.goodGuysArray[_local1].mC)){
rt.goodGuysArray[_local1].decreaseEnergy(mC.x, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
};
_local1++;
};
};
} else {
if (mType == "enemyPhoton"){
if (mC.hitTestObject(rt.Player.mC)){
rt.decreaseEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 3, 1, 16, true, false, false, 8));
};
if (dead == false){
_local1 = 0;
while (_local1 < rt.goodGuysArray.length) {
if (rt.goodGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.goodGuysArray[_local1].mC)){
rt.goodGuysArray[_local1].decreaseEnergy(mC.x, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 3, 1, 16, true, false, false, 8));
};
};
_local1++;
};
};
} else {
if (mType == "enemyShell"){
if (mC.hitTestObject(rt.Player.mC)){
rt.decreaseEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
if (dead == false){
_local1 = 0;
while (_local1 < rt.goodGuysArray.length) {
if (rt.goodGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.goodGuysArray[_local1].mC)){
rt.goodGuysArray[_local1].decreaseEnergy(mC.x, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
};
_local1++;
};
};
} else {
if (mType == "enemyBullet"){
if (mC.hitTestObject(rt.Player.mC)){
rt.decreaseEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
if (dead == false){
_local1 = 0;
while (_local1 < rt.goodGuysArray.length) {
if (rt.goodGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.goodGuysArray[_local1].mC)){
rt.goodGuysArray[_local1].decreaseEnergy(mC.x, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 7, 1, 10, true, false, false, 8));
};
};
_local1++;
};
};
} else {
if (mType == "rock"){
if (mC.hitTestObject(rt.Player.mC)){
rt.decreaseEnergy(myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 3, 1, 10, true, false, false, 8));
};
if (dead == false){
_local1 = 0;
while (_local1 < rt.goodGuysArray.length) {
if (rt.goodGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.goodGuysArray[_local1].mC)){
rt.goodGuysArray[_local1].decreaseEnergy(mC.x, myDamage);
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 4, 1, 10, true, false, false, 8));
};
};
_local1++;
};
};
} else {
_local1 = 0;
while (_local1 < rt.badGuysArray.length) {
if (rt.badGuysArray[_local1].dead == false){
if (mC.hitTestObject(rt.badGuysArray[_local1].mC)){
if (rt.upgrade5 == true){
if (rt.upgrade3 == true){
rt.badGuysArray[_local1].decreaseEnergy(this, true, 10);
} else {
rt.badGuysArray[_local1].decreaseEnergy(this, true, 5);
};
if (rt.badGuysArray[_local1].dead == 0){
rt.badGuysArray[_local1].freeze = 100;
rt.badGuysArray[_local1].mC.filters = [rt.badGuysArray[_local1].glowFilter];
rt.badGuysArray[_local1].mC.gotoAndStop("stand");
};
} else {
if (rt.upgrade3 == true){
rt.badGuysArray[_local1].decreaseEnergy(this, true, (myDamage * 2));
} else {
rt.badGuysArray[_local1].decreaseEnergy(this, true, myDamage);
};
};
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
remove();
dead = true;
};
};
_local1++;
};
if (dead == false){
if (mC.hitTestObject(rt.alienBaseMc)){
if (rt.upgrade3 == true){
rt.decreaseAlienEnergy(int((myDamage / 4)));
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 2, Useful, 5, 6, 60, true, false, false, 8));
} else {
rt.decreaseAlienEnergy(int((myDamage / 4)));
remove();
dead = true;
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 10, 3, 16, true, false, false, 8));
};
};
};
};
};
};
};
};
};
};
};
};
if (dead == false){
_local2 = int(mC.x);
_local3 = (mC.y + rt.spritesMc.y);
_local3 = (_local3 + yVel);
_local4 = rt.groundArray[_local2];
if (_local3 > _local4){
rt.Sounds.playSoundFx("mainGunMissileHitFx");
_local3 = (_local3 - _local4);
yVel = (yVel - _local3);
updatePosition();
rt.explosionsArray.push(new GameExplosion(rt, mC.x, mC.y, 1, Useful, 4, 1, 30, true, false, false, 8));
remove();
};
};
}
function doTrail(){
var _local1:*;
trailDelay--;
if (trailDelay == 0){
trailDelay = 2;
_local1 = new GameRocketSmoke(rt.inGameExplosionsMc);
rt.inGameExplosionsMc.addChild(_local1);
_local1.x = mC.x;
_local1.y = mC.y;
};
}
}
}//package classesAS3
Section 12
//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(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8){
rt = _arg1;
mType = _arg8;
numberOfExplosions = _arg3;
xPos = _arg4;
yPos = _arg5;
areaWidth = _arg6;
Useful = _arg2;
delayToExplosion = _arg7;
}
function mainLoop(){
var _local1:Number;
var _local2:Number;
delayToExplosion--;
if (delayToExplosion == 0){
delayToExplosion = Useful.RandomNumber(1, 8);
_local1 = (xPos + Useful.RandomNumber(1, areaWidth));
_local2 = (rt.alienBaseMc.y + Useful.RandomNumber(1, areaWidth));
rt.explosionsArray.push(new GameExplosion(rt, _local1, _local2, mType, Useful, 8, 5, 76, false, false, true, 8));
};
}
}
}//package classesAS3
Section 13
//GameOverMsgAnim (classesAS3.GameOverMsgAnim)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import com.adobe.crypto.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
public class GameOverMsgAnim extends MovieClip {
public var m:MovieClip;
public var rt:Object;
public function GameOverMsgAnim(_arg1){
addFrameScript(9, frame10, 22, frame23);
rt = _arg1;
this.play();
}
function frame10(){
stop();
}
function frame23(){
stop();
}
public function buttonPressed(_arg1, _arg2){
var _local3:URLVariables;
var _local4:URLRequest;
var _local5:URLLoader;
if (rt.rt.policyLoaded == false){
rt.rt.policyLoaded = true;
Security.loadPolicyFile("http://hiscore.arcadebomb.com/crossdomain.xml");
};
_local3 = new URLVariables();
_local3.n = _arg1;
_local3.s = _arg2;
_local3.t = new Date().getTime();
_local3.k = Math.floor((Math.random() * 100));
_local3.m = MD5.hash(("" + ((_arg2 + _local3.k) * 6061)));
_local4 = new URLRequest("http://hiscore.arcadebomb.com/wardroids_submit.php");
_local4.method = "POST";
_local4.data = _local3;
_local5 = new URLLoader();
_local5.load(_local4);
_local5.addEventListener(Event.COMPLETE, goodjob);
}
function goodjob(_arg1:Event):void{
trace(URLLoader(_arg1.target).data);
}
}
}//package classesAS3
Section 14
//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(_arg1){
addFrameScript(0, frame1);
rt = _arg1;
buildFinished = false;
}
function frame1(){
stop();
}
}
}//package classesAS3
Section 15
//GameParticle (classesAS3.GameParticle)
package classesAS3 {
import flash.display.*;
public class GameParticle extends MovieClip {
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 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(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13){
xOrigin = 0;
yOrigin = 0;
xPos = 0;
yPos = 0;
xVel = 0;
yVel = 0;
super();
rt = _arg1;
Useful = _arg2;
artillary = _arg10;
gravity = _arg11;
explodeDistance = _arg12;
xOrigin = _arg3;
yOrigin = _arg4;
gravityValue = 0;
endX = _arg8;
endY = _arg9;
xPos = 0;
yPos = 0;
xVel = (_arg6 * _arg13);
yVel = (_arg7 * _arg13);
mC = this;
mType = _arg5;
mC.gotoAndStop(mType);
updatePosition();
}
function updatePosition(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
xPos = (xPos + xVel);
yPos = (yPos + yVel);
_local1 = x;
_local2 = y;
x = (xOrigin + xPos);
y = (yOrigin + yPos);
_local3 = (x - _local1);
_local4 = (y - _local2);
_local5 = Math.atan2(_local4, _local3);
rotation = ((_local5 * 180) / Math.PI);
}
function mainLoop(){
var _local1:Number;
_local1 = Useful.getDistance(x, y, endX, endY);
if (artillary == true){
if (_local1 > (explodeDistance / 2)){
scaleX = (scaleX + 40);
scaleY = scaleX;
} else {
scaleX = (scaleX - 35);
scaleY = scaleX;
};
};
if (gravity == true){
gravityValue = (gravityValue + 0.2);
yVel = (yVel + gravityValue);
};
if (_local1 > (explodeDistance + 10)){
if (this.parent != null){
remove();
};
};
updatePosition();
}
function checkForOffStage(){
if (mC.x < 0){
remove();
};
if (mC.y < 0){
remove();
};
if (mC.x > 1700){
remove();
};
}
function collisionDetection(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:*;
_local1 = yVel;
_local2 = yVel;
if (_local2 < 0){
_local2 = ((_local2 - _local2) - _local2);
};
_local3 = (mC.x + rt.spritesMc.x);
_local4 = (mC.y + rt.spritesMc.y);
_local4 = (_local4 - 6);
_local5 = 0;
while (_local5 < int(_local2)) {
if (rt.backMc.hitTestPoint(_local3, (_local4 + _local5), true)){
remove();
break;
};
_local5++;
};
_local5 = 0;
while (_local5 < rt.badGuysArray.length) {
if (rt.badGuysArray[_local5].dead == false){
if (mC.hitTestObject(rt.badGuysArray[_local5].mC)){
rt.badGuysArray[_local5].decreaseEnergy(mC.x);
remove();
};
};
_local5++;
};
}
function mCDeath(){
}
function remove(){
var _local1:Number;
var _local2:*;
_local1 = 0;
_local2 = 0;
while (_local2 < rt.particlesArray.length) {
if (this == rt.particlesArray[_local2]){
_local1 = _local2;
};
_local2++;
};
this.parent.removeChild(this);
rt.particlesArray.splice(_local1, 1);
delete ??getglobalscope
[this];
}
}
}//package classesAS3
Section 16
//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 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(_arg1, _arg2, _arg3, _arg4, _arg5){
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 = _arg2;
Useful = _arg5;
missileDistFromGun = 40;
xOrigin = _arg3;
yOrigin = _arg4;
dx = 0;
dy = 0;
angle = 0;
shotsFired = 0;
shotsLimit = 2;
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 = _arg1;
shotStrength = 6;
gunRotation = 180;
rotateGunUp = false;
rotateGunDown = false;
vectorData = new Object();
energyLevel = false;
levelDir = 1;
fireDelay = 0;
updatePosition();
}
function fireMissile(){
var _local1:*;
var _local2:String;
var _local3:*;
var _local4:Object;
var _local5:Number;
var _local6:Object;
if (fireDelay == 0){
rt.statsMc.gunEnergy.energyLevelMc.y = (rt.statsMc.gunEnergy.energyLevelMc.y - 15);
if (rt.statsMc.gunEnergy.energyLevelMc.y < 0){
rt.statsMc.gunEnergy.energyLevelMc.y = 0;
} else {
if (rt.upgrade3 == true){
fireDelay = 10;
} else {
fireDelay = 30;
};
rt.Sounds.playSoundFx("mainGunSound");
energyLevel = false;
_local1 = mC.getChildAt(0);
mC.turret.play();
_local2 = "playerMissile";
_local3 = new mainGunBullet();
rt.inGameMissilesMc.addChild(_local3);
if (rt.upgrade5 == true){
_local3.gotoAndStop(2);
} else {
_local3.gotoAndStop(1);
};
_local4 = new Object();
_local4.vx = -(vectorData.vx);
_local4.vy = -(vectorData.vy);
_local4.gravity = 0.4;
_local5 = 22;
trace(mC.turret.x);
trace(mC.turret.y);
trace(mC.turret.firePoint.x);
trace(mC.turret.firePoint.y);
_local6 = Useful.localToGlobalXY(mC.turret.firePoint);
rt.missilesArray.push(new GameMissile(_local3, rt, (_local6.newX - rt.scrollxPos), _local6.newY, _local2, Useful, _local4, _local5, this, 20));
};
};
}
function updatePosition(){
var _local1:*;
var _local2:*;
_local1 = mC.x;
_local2 = 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 (energyLevel == true){
doEnergyLevel();
};
vectorData = Useful.getVectorFromAngle(gunRotation);
if (rotateGunUp == true){
gunRotation = (gunRotation - 1);
if (gunRotation < 100){
gunRotation = 100;
};
} else {
if (rotateGunDown == true){
gunRotation = (gunRotation + 1);
if (gunRotation > 200){
gunRotation = 200;
};
};
};
mC.turret.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 17
//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(_arg1, _arg2, _arg3){
addFrameScript(22, frame23);
rt = _arg1;
inGameScoreMc = _arg2;
scoreNumber = _arg3;
txt.moneyTxt.text = String(scoreNumber);
}
function frame23(){
this.inGameScoreMc.removeChild(this);
stop();
}
}
}//package classesAS3
Section 18
//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(_arg1, _arg2, _arg3){
addFrameScript(15, frame16);
rt = _arg1;
inGameScoreMc = _arg2;
scoreNumber = _arg3;
txt.scoreTxt.text = ("-" + String(scoreNumber));
}
function frame16(){
this.inGameScoreMc.removeChild(this);
stop();
}
}
}//package classesAS3
Section 19
//GameRocketSmoke (classesAS3.GameRocketSmoke)
package classesAS3 {
import flash.display.*;
public class GameRocketSmoke extends MovieClip {
public var rt:Sprite;
public function GameRocketSmoke(_arg1){
addFrameScript(7, frame8);
rt = _arg1;
}
function removeMe(){
rt.removeChild(this);
this.stop();
}
function frame8(){
this.removeMe();
stop();
}
}
}//package classesAS3
Section 20
//GameSounds (classesAS3.GameSounds)
package classesAS3 {
import flash.media.*;
import flash.utils.*;
public class GameSounds {
var rt:Object;
public function GameSounds(_arg1){
rt = _arg1;
}
public function playSoundFx(_arg1:String){
var _local2:Class;
var _local3:*;
var _local4:SoundChannel;
if (rt.soundsSwitch == true){
_local2 = Class(getDefinitionByName(_arg1));
_local3 = new (_local2);
_local4 = _local3.play();
};
}
}
}//package classesAS3
Section 21
//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(_arg1){
addFrameScript(909, frame910);
rt = _arg1;
startBtn.addEventListener(MouseEvent.MOUSE_UP, finishStuff);
}
function finishStuff(_arg1:MouseEvent):void{
this.gotoAndStop("startGame");
}
public function removeMe(){
rt.rt.finishSetup();
rt.inGameMsgsMc.removeChild(this);
stop();
}
function frame910(){
this.removeMe();
stop();
}
}
}//package classesAS3
Section 22
//GameTitleScreen (classesAS3.GameTitleScreen)
package classesAS3 {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.system.*;
import flash.net.*;
public class GameTitleScreen extends MovieClip {
public var score10:TextField;
var rt:Object;
public var moreGamesBtn:SimpleButton;
public var nextBtn:SimpleButton;
public var instructionsBtn:SimpleButton;
public var playBtn:PlayGameBtn;
public var link_btn:SimpleButton;
public var musicMc:MovieClip;
public var fgmBtn:MovieClip;
public var highScoresBtn:SimpleButton;
public var name1:TextField;
public var name3:TextField;
public var name4:TextField;
public var name6:TextField;
public var name8:TextField;
public var name2:TextField;
public var name7:TextField;
public var name9:TextField;
public var name5:TextField;
public var controlsBtn:SimpleButton;
public var score1:TextField;
public var score3:TextField;
public var score4:TextField;
public var score5:TextField;
public var score6:TextField;
public var score7:TextField;
public var score8:TextField;
public var gunEnergy:gunEnergyLevel;
public var backBtn:SimpleButton;
public var musicBtn:SimpleButton;
public var score2:TextField;
public var name10:TextField;
public var score9:TextField;
public function GameTitleScreen(_arg1){
addFrameScript(0, frame1, 1, frame2, 5, frame6, 8, frame9);
rt = _arg1;
}
function frame2(){
rt.doInstrBtns();
}
function frame1(){
link_btn.addEventListener(MouseEvent.MOUSE_DOWN, gotoArc, false);
moreGamesBtn.addEventListener(MouseEvent.MOUSE_DOWN, gotoArc, false);
highScoresBtn.addEventListener(MouseEvent.MOUSE_DOWN, doHighScores, false);
fgmBtn.addEventListener(MouseEvent.MOUSE_DOWN, gotoFGM, false);
rt.doTitleScreenStuff();
stop();
}
function frame6(){
rt.doContrBtns();
}
function frame9(){
this.getScores();
backBtn.addEventListener(MouseEvent.MOUSE_DOWN, doBackBtn, false);
}
public function doBackBtn(_arg1:MouseEvent):void{
gotoAndStop(1);
}
public function getScores(){
var request:URLRequest;
var loader:URLLoader;
var handleComplete:Function;
var onIOError:Function;
handleComplete = function (_arg1:Event):void{
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
name1.text = _local2.data.name1;
score1.text = _local2.data.score1;
name2.text = _local2.data.name2;
score2.text = _local2.data.score2;
name3.text = _local2.data.name3;
score3.text = _local2.data.score3;
name4.text = _local2.data.name4;
score4.text = _local2.data.score4;
name5.text = _local2.data.name5;
score5.text = _local2.data.score5;
name6.text = _local2.data.name6;
score6.text = _local2.data.score6;
name7.text = _local2.data.name7;
score7.text = _local2.data.score7;
name8.text = _local2.data.name8;
score8.text = _local2.data.score8;
name9.text = _local2.data.name9;
score9.text = _local2.data.score9;
name10.text = _local2.data.name10;
score10.text = _local2.data.score10;
};
onIOError = function (_arg1:IOErrorEvent):void{
trace("Error loading URL.");
};
if (rt.policyLoaded == false){
rt.policyLoaded = true;
Security.loadPolicyFile("http://hiscore.arcadebomb.com/crossdomain.xml");
};
request = new URLRequest("http://hiscore.arcadebomb.com/wardroids_get.php");
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
request.method = URLRequestMethod.POST;
loader.addEventListener(Event.COMPLETE, handleComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.load(request);
}
public function doHighScores(_arg1:MouseEvent):void{
gotoAndStop("highscores");
}
public function gotoFGM(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.flashgamemaker.com"), "_blank");
}
public function gotoArc(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.arcadebomb.com"), "_blank");
}
}
}//package classesAS3
Section 23
//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(_arg1){
addFrameScript(0, frame1);
this.stop();
rt = _arg1;
buildFinished = false;
}
function frame1(){
back.gotoAndStop(1);
stop();
}
public function setupUpgrade(){
rt.setupUpgrade1();
}
}
}//package classesAS3
Section 24
//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(_arg1){
addFrameScript(0, frame1);
this.stop();
rt = _arg1;
buildFinished = false;
}
function frame1(){
stop();
}
public function setupUpgrade(){
rt.setupUpgrade2();
}
}
}//package classesAS3
Section 25
//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(_arg1){
this.stop();
rt = _arg1;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade3();
}
}
}//package classesAS3
Section 26
//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(_arg1){
this.stop();
rt = _arg1;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade4();
}
}
}//package classesAS3
Section 27
//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(_arg1){
this.stop();
rt = _arg1;
buildFinished = false;
}
public function setupUpgrade(){
rt.setupUpgrade5();
}
}
}//package classesAS3
Section 28
//GameUseful (classesAS3.GameUseful)
package classesAS3 {
import flash.display.*;
public class GameUseful {
public var rt:Object;
public function GameUseful(_arg1){
rt = _arg1;
}
function addThrust(_arg1, _arg2){
var _local3:Object;
_local3 = new Object();
_local3.xVel = (Math.cos(radian(_arg1)) * _arg2);
_local3.yVel = (Math.sin(radian(_arg1)) * _arg2);
return (_local3);
}
public function getDistanceQ(_arg1, _arg2, _arg3, _arg4){
var _local5:Number;
_local5 = (_arg3 - _arg1);
_local5 = Math.abs(_local5);
return (_local5);
}
function radian(_arg1){
return (((_arg1 * Math.PI) / 180));
}
function localToGlobalXY(_arg1:MovieClip):Object{
var _local2:Object;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local2 = new Object();
_local2.newX = 0;
_local2.newY = 0;
_local3 = _arg1;
while (_local3 != rt.parent) {
_local4 = (_local2.newX * (_local3.scaleX / 1));
_local5 = (_local2.newY * (_local3.scaleY / 1));
_local6 = (_local3.rotation * (Math.PI / 180));
_local2.newX = ((_local4 * Math.cos(_local6)) - (_local5 * Math.sin(_local6)));
_local2.newY = ((_local4 * Math.sin(_local6)) + (_local5 * Math.cos(_local6)));
_local2.newX = (_local2.newX + _local3.x);
_local2.newY = (_local2.newY + _local3.y);
_local3 = _local3.parent;
};
return (_local2);
}
public function getDistance(_arg1, _arg2, _arg3, _arg4){
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local5 = _arg1;
_local6 = _arg2;
_local7 = _arg3;
_local8 = _arg4;
_local7 = (_local5 - _local7);
_local8 = (_local6 - _local8);
return (Math.sqrt(((_local7 * _local7) + (_local8 * _local8))));
}
public function RandomNumber(_arg1, _arg2):Number{
return ((Math.floor((Math.random() * ((1 + _arg2) - _arg1))) + _arg1));
}
function countMcs(_arg1):Array{
var _local2:Array;
var _local3:*;
_local2 = new Array();
_local3 = 0;
for (_local3 in _arg1) {
if (typeof(_arg1[_local3]) == "movieclip"){
_local2.push(_arg1[_local3]);
};
};
return (_local2);
}
function checkForLOS(_arg1, _arg2, _arg3, _arg4, _arg5){
var _local6:Number;
var _local7:Object;
var _local8:Number;
var _local9:*;
_local6 = int(getDistance(_arg1, _arg2, _arg3, _arg4));
_local7 = pointTowards(_arg1, _arg2, _arg3, _arg4);
_local9 = 0;
while (_local9 < _local6) {
_local8 = rt.GameMain.groundArray[int(_arg1)];
if (int(_arg2) > _local8){
return (true);
};
_arg1 = (_arg1 - _local7.vx);
_arg2 = (_arg2 - _local7.vy);
_local9++;
};
return (false);
}
function getVectorFromAngle(_arg1):Object{
var _local2:Object;
var _local3:Number;
_local2 = new Object();
_local3 = ((_arg1 * Math.PI) / 180);
_local2.vx = Math.cos(_local3);
_local2.vy = Math.sin(_local3);
return (_local2);
}
function capVectorSpeed(_arg1, _arg2, _arg3):Object{
var _local4:Object;
var _local5:*;
_local4 = new Object();
_local5 = Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2)));
if (_local5 > _arg3){
_arg1 = (_arg1 * (_arg3 / _local5));
_arg2 = (_arg2 * (_arg3 / _local5));
};
_local4.vx = _arg1;
_local4.vy = _arg2;
return (_local4);
}
function argbtohex(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
return (((((_arg1 << 24) | (_arg2 << 16)) | (_arg3 << 8)) | _arg4));
}
public function getArcVelocity(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Object{
var _local7:Object;
var _local8:*;
var _local9:*;
var _local10:*;
var _local11:*;
_local7 = new Object();
_local8 = (_arg5 - _arg3);
_local9 = (_arg6 - _arg4);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local11 = Math.ceil((_local10 / _arg2));
_local7.gravity = _arg1;
_local7.steps = _local11;
_local7.xStep = (_local8 / _local11);
_local7.yStep = (_local9 / _local11);
if (_arg1 > 0){
_local7.yStep = (_local7.yStep - ((_local11 * _arg1) / 2));
};
return (_local7);
}
function pointTowards(_arg1, _arg2, _arg3, _arg4):Object{
var _local5:Object;
var _local6:*;
var _local7:*;
_local5 = new Object();
_local6 = (_arg1 - _arg3);
_local7 = (_arg2 - _arg4);
_local5.spriteAngle = Math.atan2(_local7, _local6);
_local5.spriteRotation = ((_local5.spriteAngle * 180) / Math.PI);
_local5.vx = Math.cos(_local5.spriteAngle);
_local5.vy = Math.sin(_local5.spriteAngle);
return (_local5);
}
function rotateXY(_arg1, _arg2, _arg3, _arg4){
var _local5:Number;
var _local6:Object;
_local5 = ((Math.PI * _arg4) / 180);
_local6 = new Object();
_local6.xPos = (_arg1 + (Math.cos(_local5) * _arg3));
_local6.yPos = (_arg2 + (Math.sin(_local5) * _arg3));
return (_local6);
}
}
}//package classesAS3
Section 29
//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 enemies:TextField;
public var energyAlien:TextField;
public var attack:MovieClip;
public var levelTxt:TextField;
public var soundFxBtn:SimpleButton;
public var gunEnergyBtn2:gunEnergyBtn;
public var getCrystalBtn2:commandBtn;
public var msg:TextField;
public var spaceGunUp:MovieClip;
public var energy:TextField;
public var score:TextField;
public var backToBaseBtn:SimpleButton;
public var quitBtn:SimpleButton;
public var musicMc:MovieClip;
public var rt:Object;
public var soundFxMc:MovieClip;
public var retreatBtn2:commandBtn;
public var attackBtn2:commandBtn;
public var defend:MovieClip;
public var money:TextField;
public var pausePanelBtn:SimpleButton;
public var gunEnergy:gunEnergyLevel;
public var selectedTxt:TextField;
public function GameWeaponsPanel(_arg1){
addFrameScript(0, frame1, 1, frame2);
rt = _arg1;
}
public function doBack(_arg1:MouseEvent):void{
gotoAndStop(1);
rt.selectBase();
}
function frame1(){
stop();
}
function frame2(){
backToBaseBtn.addEventListener(MouseEvent.MOUSE_UP, doBack);
}
}
}//package classesAS3
Section 30
//MD5 (com.adobe.crypto.MD5)
package com.adobe.crypto {
import com.adobe.utils.*;
public class MD5 {
private static function ff(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(f, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function createBlocks(_arg1:String):Array{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = new Array();
_local3 = (_arg1.length * 8);
_local4 = 0xFF;
_local5 = 0;
while (_local5 < _local3) {
_local2[(_local5 >> 5)] = (_local2[(_local5 >> 5)] | ((_arg1.charCodeAt((_local5 / 8)) & _local4) << (_local5 % 32)));
_local5 = (_local5 + 8);
};
_local2[(_local3 >> 5)] = (_local2[(_local3 >> 5)] | (128 << (_local3 % 32)));
_local2[((((_local3 + 64) >>> 9) << 4) + 14)] = _local3;
return (_local2);
}
private static function ii(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(i, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
private static function f(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg2) | (~(_arg1) & _arg3)));
}
private static function g(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 & _arg3) | (_arg2 & ~(_arg3))));
}
private static function h(_arg1:int, _arg2:int, _arg3:int):int{
return (((_arg1 ^ _arg2) ^ _arg3));
}
private static function i(_arg1:int, _arg2:int, _arg3:int):int{
return ((_arg2 ^ (_arg1 | ~(_arg3))));
}
private static function transform(_arg1:Function, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):int{
var _local9:int;
_local9 = (((_arg2 + int(_arg1(_arg3, _arg4, _arg5))) + _arg6) + _arg8);
return ((IntUtil.rol(_local9, _arg7) + _arg3));
}
private static function hh(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(h, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
public static function hash(_arg1:String):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:int;
_local2 = 1732584193;
_local3 = -271733879;
_local4 = -1732584194;
_local5 = 271733878;
_local10 = createBlocks(_arg1);
_local11 = _local10.length;
_local12 = 0;
while (_local12 < _local11) {
_local6 = _local2;
_local7 = _local3;
_local8 = _local4;
_local9 = _local5;
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 7, -680876936);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 1)], 12, -389564586);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 17, 606105819);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 3)], 22, -1044525330);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 7, -176418897);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 5)], 12, 1200080426);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 17, -1473231341);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 7)], 22, -45705983);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 7, 1770035416);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 9)], 12, -1958414417);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 17, -42063);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 11)], 22, -1990404162);
_local2 = ff(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 7, 1804603682);
_local5 = ff(_local5, _local2, _local3, _local4, _local10[(_local12 + 13)], 12, -40341101);
_local4 = ff(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 17, -1502002290);
_local3 = ff(_local3, _local4, _local5, _local2, _local10[(_local12 + 15)], 22, 1236535329);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 5, -165796510);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 6)], 9, -1069501632);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 14, 643717713);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 0)], 20, -373897302);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 5, -701558691);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 10)], 9, 38016083);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 14, -660478335);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 4)], 20, -405537848);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 5, 568446438);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 14)], 9, -1019803690);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 14, -187363961);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 8)], 20, 1163531501);
_local2 = gg(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 5, -1444681467);
_local5 = gg(_local5, _local2, _local3, _local4, _local10[(_local12 + 2)], 9, -51403784);
_local4 = gg(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 14, 1735328473);
_local3 = gg(_local3, _local4, _local5, _local2, _local10[(_local12 + 12)], 20, -1926607734);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 5)], 4, -378558);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 8)], 11, -2022574463);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 11)], 16, 1839030562);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 14)], 23, -35309556);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 1)], 4, -1530992060);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 4)], 11, 1272893353);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 7)], 16, -155497632);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 10)], 23, -1094730640);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 13)], 4, 681279174);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 0)], 11, -358537222);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 3)], 16, -722521979);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 6)], 23, 76029189);
_local2 = hh(_local2, _local3, _local4, _local5, _local10[(_local12 + 9)], 4, -640364487);
_local5 = hh(_local5, _local2, _local3, _local4, _local10[(_local12 + 12)], 11, -421815835);
_local4 = hh(_local4, _local5, _local2, _local3, _local10[(_local12 + 15)], 16, 530742520);
_local3 = hh(_local3, _local4, _local5, _local2, _local10[(_local12 + 2)], 23, -995338651);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 0)], 6, -198630844);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 7)], 10, 1126891415);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 14)], 15, -1416354905);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 5)], 21, -57434055);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 12)], 6, 1700485571);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 3)], 10, -1894986606);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 10)], 15, -1051523);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 1)], 21, -2054922799);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 8)], 6, 1873313359);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 15)], 10, -30611744);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 6)], 15, -1560198380);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 13)], 21, 1309151649);
_local2 = ii(_local2, _local3, _local4, _local5, _local10[(_local12 + 4)], 6, -145523070);
_local5 = ii(_local5, _local2, _local3, _local4, _local10[(_local12 + 11)], 10, -1120210379);
_local4 = ii(_local4, _local5, _local2, _local3, _local10[(_local12 + 2)], 15, 718787259);
_local3 = ii(_local3, _local4, _local5, _local2, _local10[(_local12 + 9)], 21, -343485551);
_local2 = (_local2 + _local6);
_local3 = (_local3 + _local7);
_local4 = (_local4 + _local8);
_local5 = (_local5 + _local9);
_local12 = (_local12 + 16);
};
return ((((IntUtil.toHex(_local2) + IntUtil.toHex(_local3)) + IntUtil.toHex(_local4)) + IntUtil.toHex(_local5)));
}
private static function gg(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int):int{
return (transform(g, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
}
}
}//package com.adobe.crypto
Section 31
//IntUtil (com.adobe.utils.IntUtil)
package com.adobe.utils {
public class IntUtil {
private static var hexChars:String = "0123456789abcdef";
public static function toHex(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
_local3 = "";
if (_arg2){
_local4 = 0;
while (_local4 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> (((3 - _local4) * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> ((3 - _local4) * 8)) & 15))));
_local4++;
};
} else {
_local5 = 0;
while (_local5 < 4) {
_local3 = (_local3 + (hexChars.charAt(((_arg1 >> ((_local5 * 8) + 4)) & 15)) + hexChars.charAt(((_arg1 >> (_local5 * 8)) & 15))));
_local5++;
};
};
return (_local3);
}
public static function ror(_arg1:int, _arg2:int):uint{
var _local3:int;
_local3 = (32 - _arg2);
return (((_arg1 << _local3) | (_arg1 >>> (32 - _local3))));
}
public static function rol(_arg1:int, _arg2:int):int{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
}
}//package com.adobe.utils
Section 32
//alt_intro_holder_197 (WarDroids_v39Network_fla.alt_intro_holder_197)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class alt_intro_holder_197 extends MovieClip {
public function alt_intro_holder_197(){
addFrameScript(114, frame115);
}
function frame115(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 33
//assetHolder_1 (WarDroids_v39Network_fla.assetHolder_1)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class assetHolder_1 extends MovieClip {
public function assetHolder_1(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 34
//attackButtonG_59 (WarDroids_v39Network_fla.attackButtonG_59)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class attackButtonG_59 extends MovieClip {
public function attackButtonG_59(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 35
//background_ground_65 (WarDroids_v39Network_fla.background_ground_65)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class background_ground_65 extends MovieClip {
public var gg:MovieClip;
public function background_ground_65(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 36
//badGuySwordAttack_112 (WarDroids_v39Network_fla.badGuySwordAttack_112)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class badGuySwordAttack_112 extends MovieClip {
public function badGuySwordAttack_112(){
addFrameScript(4, frame5);
}
function frame5(){
MovieClip(this.parent).gotoAndStop("stand");
}
}
}//package WarDroids_v39Network_fla
Section 37
//baseExplodeBitAnim_148 (WarDroids_v39Network_fla.baseExplodeBitAnim_148)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class baseExplodeBitAnim_148 extends MovieClip {
public function baseExplodeBitAnim_148(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 38
//bg_menu_preloader_3 (WarDroids_v39Network_fla.bg_menu_preloader_3)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class bg_menu_preloader_3 extends MovieClip {
public var manFrames:BadGuyRun;
}
}//package WarDroids_v39Network_fla
Section 39
//clockAnim_162 (WarDroids_v39Network_fla.clockAnim_162)
package WarDroids_v39Network_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
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_162 extends MovieClip {
public function clockAnim_162(){
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 WarDroids_v39Network_fla
Section 40
//clockAnim2_164 (WarDroids_v39Network_fla.clockAnim2_164)
package WarDroids_v39Network_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
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_164 extends MovieClip {
public function clockAnim2_164(){
addFrameScript(17, frame18);
}
function frame18(){
trace(Object(this.parent.parent.parent));
MovieClip(this.parent.parent).rt.setupGoodGuy(this);
if (MovieClip(this.parent).numberOrdered.text != 0){
gotoAndPlay(1);
} else {
MovieClip(this.parent).gotoAndStop(1);
};
}
}
}//package WarDroids_v39Network_fla
Section 41
//defendButtonG_60 (WarDroids_v39Network_fla.defendButtonG_60)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class defendButtonG_60 extends MovieClip {
public function defendButtonG_60(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 42
//Endtitle_38 (WarDroids_v39Network_fla.Endtitle_38)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class Endtitle_38 extends MovieClip {
public function Endtitle_38(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 43
//gameoverFilter_37 (WarDroids_v39Network_fla.gameoverFilter_37)
package WarDroids_v39Network_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
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_37 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_37(){
addFrameScript(0, frame1, 1, frame2);
}
public function doRestart(_arg1:MouseEvent):void{
MovieClip(this.parent.parent).rt.restartLevel();
}
public function doViewScores(_arg1:MouseEvent):void{
}
public function doMoreGames(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.arcadebomb.com"), "_blank");
}
function frame1(){
score.text = MovieClip(this.parent.parent).rt.score;
submitBtn.addEventListener(MouseEvent.MOUSE_UP, doSubmit);
moreGamesBtn.addEventListener(MouseEvent.MOUSE_UP, doMoreGames);
quitBtn.addEventListener(MouseEvent.MOUSE_UP, doQuit);
restartBtn.addEventListener(MouseEvent.MOUSE_UP, doRestart);
stop();
}
public function doSubmit(_arg1: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;
moreGamesBtn.addEventListener(MouseEvent.MOUSE_UP, doMoreGames);
quitBtn.addEventListener(MouseEvent.MOUSE_UP, doQuit);
stop();
}
public function doQuit(_arg1:MouseEvent):void{
MovieClip(this.parent.parent).rt.quitGame();
}
}
}//package WarDroids_v39Network_fla
Section 44
//gameOverMsg_36 (WarDroids_v39Network_fla.gameOverMsg_36)
package WarDroids_v39Network_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class gameOverMsg_36 extends MovieClip {
public var msg:MovieClip;
public function gameOverMsg_36(){
addFrameScript(0, frame1);
}
function frame1(){
if (MovieClip(this.parent).rt.levelNumber >= MovieClip(this.parent).rt.maxLevels){
msg.endTitle.gotoAndStop(2);
};
if (MovieClip(this.parent).rt.rt.mindJolt == true){
msg.gotoAndStop(3);
};
}
}
}//package WarDroids_v39Network_fla
Section 45
//inner2_body_157 (WarDroids_v39Network_fla.inner2_body_157)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class inner2_body_157 extends MovieClip {
public function inner2_body_157(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 46
//levelCompleteMsg_48 (WarDroids_v39Network_fla.levelCompleteMsg_48)
package WarDroids_v39Network_fla {
import flash.display.*;
import flash.text.*;
public dynamic class levelCompleteMsg_48 extends MovieClip {
public var titleMc:levelCompleteMsgs;
public var timeBonus:TextField;
public var scoreBonus:TextField;
public var totalScore:TextField;
}
}//package WarDroids_v39Network_fla
Section 47
//manStoneHitBack_94 (WarDroids_v39Network_fla.manStoneHitBack_94)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class manStoneHitBack_94 extends MovieClip {
public function manStoneHitBack_94(){
addFrameScript(9, frame10);
}
function frame10(){
MovieClip(this.parent).gotoAndStop("walk");
}
}
}//package WarDroids_v39Network_fla
Section 48
//musicBtnMc_21 (WarDroids_v39Network_fla.musicBtnMc_21)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class musicBtnMc_21 extends MovieClip {
public function musicBtnMc_21(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 49
//risingScoreTxt_132 (WarDroids_v39Network_fla.risingScoreTxt_132)
package WarDroids_v39Network_fla {
import flash.display.*;
import flash.text.*;
public dynamic class risingScoreTxt_132 extends MovieClip {
public var scoreTxt:TextField;
}
}//package WarDroids_v39Network_fla
Section 50
//shields_207 (WarDroids_v39Network_fla.shields_207)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class shields_207 extends MovieClip {
public var w:MovieClip;
}
}//package WarDroids_v39Network_fla
Section 51
//soundFxMc_54 (WarDroids_v39Network_fla.soundFxMc_54)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class soundFxMc_54 extends MovieClip {
public function soundFxMc_54(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 52
//turret_header_156 (WarDroids_v39Network_fla.turret_header_156)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class turret_header_156 extends MovieClip {
public var body:MovieClip;
}
}//package WarDroids_v39Network_fla
Section 53
//upgradeBack_200 (WarDroids_v39Network_fla.upgradeBack_200)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class upgradeBack_200 extends MovieClip {
public function upgradeBack_200(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 54
//upgradeClock_201 (WarDroids_v39Network_fla.upgradeClock_201)
package WarDroids_v39Network_fla {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
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_201 extends MovieClip {
public function upgradeClock_201(){
addFrameScript(35, frame36);
}
function frame36(){
MovieClip(this.parent.parent).setupUpgrade();
MovieClip(this.parent).gotoAndStop(3);
}
}
}//package WarDroids_v39Network_fla
Section 55
//walkerDeath_119 (WarDroids_v39Network_fla.walkerDeath_119)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class walkerDeath_119 extends MovieClip {
public function walkerDeath_119(){
addFrameScript(6, frame7);
}
function frame7(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 56
//weapons_8 (WarDroids_v39Network_fla.weapons_8)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class weapons_8 extends MovieClip {
public function weapons_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 57
//yuoarehereAnim_186 (WarDroids_v39Network_fla.yuoarehereAnim_186)
package WarDroids_v39Network_fla {
import flash.display.*;
public dynamic class yuoarehereAnim_186 extends MovieClip {
public var infoMc:MovieClip;
public var youarehere:youarehereMc;
public function yuoarehereAnim_186(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
}
function frame10(){
stop();
}
function frame3(){
stop();
}
function frame6(){
stop();
}
function frame7(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
stop();
}
function frame9(){
stop();
}
function frame8(){
stop();
}
function frame2(){
stop();
}
}
}//package WarDroids_v39Network_fla
Section 58
//alienBase (alienBase)
package {
import flash.display.*;
public dynamic class alienBase extends MovieClip {
}
}//package
Section 59
//antsMc (antsMc)
package {
import flash.display.*;
public dynamic class antsMc extends BitmapData {
public function antsMc(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 60
//backgroundMc (backgroundMc)
package {
import flash.display.*;
public dynamic class backgroundMc extends MovieClip {
public var ground:MovieClip;
}
}//package
Section 61
//backgroundP (backgroundP)
package {
import flash.display.*;
public dynamic class backgroundP extends MovieClip {
public function backgroundP(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 62
//backgroundSkyMc (backgroundSkyMc)
package {
import flash.display.*;
public dynamic class backgroundSkyMc extends MovieClip {
public function backgroundSkyMc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 63
//badGuyFlying (badGuyFlying)
package {
import flash.display.*;
public dynamic class badGuyFlying extends MovieClip {
}
}//package
Section 64
//badGuyFlyingWalk (badGuyFlyingWalk)
package {
import flash.display.*;
public dynamic class badGuyFlyingWalk extends MovieClip {
}
}//package
Section 65
//badGuyHoverTank (badGuyHoverTank)
package {
import flash.display.*;
public dynamic class badGuyHoverTank extends MovieClip {
}
}//package
Section 66
//badGuyRollingBomb (badGuyRollingBomb)
package {
import flash.display.*;
public dynamic class badGuyRollingBomb extends MovieClip {
}
}//package
Section 67
//badGuyRoundTank (badGuyRoundTank)
package {
import flash.display.*;
public dynamic class badGuyRoundTank extends MovieClip {
public var tankMc:badGuyRoundTank2;
}
}//package
Section 68
//badGuyRoundTank2 (badGuyRoundTank2)
package {
import flash.display.*;
public dynamic class badGuyRoundTank2 extends MovieClip {
}
}//package
Section 69
//BadGuyRun (BadGuyRun)
package {
import flash.display.*;
public dynamic class BadGuyRun extends MovieClip {
public var w:MovieClip;
}
}//package
Section 70
//badGuyRunStone (badGuyRunStone)
package {
import flash.display.*;
public dynamic class badGuyRunStone extends MovieClip {
}
}//package
Section 71
//badGuyStandRight (badGuyStandRight)
package {
import flash.display.*;
public dynamic class badGuyStandRight extends MovieClip {
public var w:MovieClip;
}
}//package
Section 72
//badGuySword (badGuySword)
package {
import flash.display.*;
public dynamic class badGuySword extends MovieClip {
}
}//package
Section 73
//badGuySwordWalk (badGuySwordWalk)
package {
import flash.display.*;
public dynamic class badGuySwordWalk extends MovieClip {
}
}//package
Section 74
//badGuyTankShoot (badGuyTankShoot)
package {
import flash.display.*;
public dynamic class badGuyTankShoot extends MovieClip {
public function badGuyTankShoot(){
addFrameScript(3, frame4);
}
function frame4(){
MovieClip(this.parent).gotoAndStop("walk");
}
}
}//package
Section 75
//badGuyThrow (badGuyThrow)
package {
import flash.display.*;
public dynamic class badGuyThrow extends MovieClip {
public function badGuyThrow(){
addFrameScript(8, frame9);
}
function frame9(){
MovieClip(this.parent).gotoAndStop("stand");
}
}
}//package
Section 76
//badGuyWalker (badGuyWalker)
package {
import flash.display.*;
public dynamic class badGuyWalker extends MovieClip {
}
}//package
Section 77
//bagGuyHoverTankWalk (bagGuyHoverTankWalk)
package {
import flash.display.*;
public dynamic class bagGuyHoverTankWalk extends MovieClip {
}
}//package
Section 78
//bullet (bullet)
package {
import flash.display.*;
public dynamic class bullet extends MovieClip {
}
}//package
Section 79
//bulletFx (bulletFx)
package {
import flash.media.*;
public dynamic class bulletFx extends Sound {
}
}//package
Section 80
//clickBtnFx (clickBtnFx)
package {
import flash.media.*;
public dynamic class clickBtnFx extends Sound {
}
}//package
Section 81
//commandBtn (commandBtn)
package {
import flash.display.*;
public dynamic class commandBtn extends SimpleButton {
}
}//package
Section 82
//ComputerFx (ComputerFx)
package {
import flash.media.*;
public dynamic class ComputerFx extends Sound {
}
}//package
Section 83
//death1 (death1)
package {
import flash.display.*;
public dynamic class death1 extends MovieClip {
public function death1(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package
Section 84
//droidBuiltFx (droidBuiltFx)
package {
import flash.media.*;
public dynamic class droidBuiltFx extends Sound {
}
}//package
Section 85
//enemyBomb (enemyBomb)
package {
import flash.display.*;
public dynamic class enemyBomb extends MovieClip {
}
}//package
Section 86
//enemyBullet (enemyBullet)
package {
import flash.display.*;
public dynamic class enemyBullet extends MovieClip {
}
}//package
Section 87
//enemyPhoton (enemyPhoton)
package {
import flash.display.*;
public dynamic class enemyPhoton extends MovieClip {
}
}//package
Section 88
//enemyPhotonFx (enemyPhotonFx)
package {
import flash.media.*;
public dynamic class enemyPhotonFx extends Sound {
}
}//package
Section 89
//enemyShell (enemyShell)
package {
import flash.display.*;
public dynamic class enemyShell extends MovieClip {
}
}//package
Section 90
//energyBar (energyBar)
package {
import flash.display.*;
public dynamic class energyBar extends MovieClip {
public var bar:MovieClip;
}
}//package
Section 91
//energyCrystals (energyCrystals)
package {
import flash.display.*;
public dynamic class energyCrystals extends MovieClip {
}
}//package
Section 92
//explosionFx (explosionFx)
package {
import flash.media.*;
public dynamic class explosionFx extends Sound {
}
}//package
Section 93
//fireMissileFx (fireMissileFx)
package {
import flash.media.*;
public dynamic class fireMissileFx extends Sound {
}
}//package
Section 94
//gameOverFx (gameOverFx)
package {
import flash.media.*;
public dynamic class gameOverFx extends Sound {
}
}//package
Section 95
//getReadyMsg (getReadyMsg)
package {
import flash.display.*;
import flash.text.*;
public dynamic class getReadyMsg extends MovieClip {
public var levelText:TextField;
}
}//package
Section 96
//getReadyMsgAnim (getReadyMsgAnim)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
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(){
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 97
//grenade (grenade)
package {
import flash.display.*;
public dynamic class grenade extends MovieClip {
}
}//package
Section 98
//grenadeMc (grenadeMc)
package {
import flash.display.*;
public dynamic class grenadeMc extends MovieClip {
}
}//package
Section 99
//grenaderStand (grenaderStand)
package {
import flash.display.*;
public dynamic class grenaderStand extends MovieClip {
}
}//package
Section 100
//gunEnergy (gunEnergy)
package {
import flash.display.*;
public dynamic class gunEnergy extends MovieClip {
}
}//package
Section 101
//gunEnergyBtn (gunEnergyBtn)
package {
import flash.display.*;
public dynamic class gunEnergyBtn extends SimpleButton {
}
}//package
Section 102
//gunEnergyLevel (gunEnergyLevel)
package {
import flash.display.*;
public dynamic class gunEnergyLevel extends MovieClip {
public var energyLevelMc:gunEnergy;
public function gunEnergyLevel(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 103
//heavyGunner (heavyGunner)
package {
import flash.display.*;
public dynamic class heavyGunner extends MovieClip {
public var selectionMc:manSelectionSquare;
}
}//package
Section 104
//heavyGunnerBody (heavyGunnerBody)
package {
import flash.display.*;
public dynamic class heavyGunnerBody extends MovieClip {
}
}//package
Section 105
//heavyGunnerGun (heavyGunnerGun)
package {
import flash.display.*;
public dynamic class heavyGunnerGun extends MovieClip {
}
}//package
Section 106
//heavyGunnerStand (heavyGunnerStand)
package {
import flash.display.*;
public dynamic class heavyGunnerStand extends MovieClip {
public var w:MovieClip;
}
}//package
Section 107
//heavyGunnerWalk (heavyGunnerWalk)
package {
import flash.display.*;
public dynamic class heavyGunnerWalk extends MovieClip {
}
}//package
Section 108
//heavyGunnerWalk2 (heavyGunnerWalk2)
package {
import flash.display.*;
public dynamic class heavyGunnerWalk2 extends MovieClip {
public var w:MovieClip;
}
}//package
Section 109
//Hills (Hills)
package {
import flash.display.*;
public dynamic class Hills extends MovieClip {
}
}//package
Section 110
//hitEnemyFx (hitEnemyFx)
package {
import flash.media.*;
public dynamic class hitEnemyFx extends Sound {
}
}//package
Section 111
//levelCompleteFx (levelCompleteFx)
package {
import flash.media.*;
public dynamic class levelCompleteFx extends Sound {
}
}//package
Section 112
//levelCompleteMsgs (levelCompleteMsgs)
package {
import flash.display.*;
public dynamic class levelCompleteMsgs extends MovieClip {
public function levelCompleteMsgs(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 113
//LoadingBox (LoadingBox)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class LoadingBox extends MovieClip {
public var loaderbar:MovieClip;
public var link_btn:SimpleButton;
public function LoadingBox(){
addFrameScript(0, frame1);
trace("loading box");
}
function frame1(){
this.stop();
loaderbar.stop();
link_btn.addEventListener(MouseEvent.MOUSE_DOWN, gotoArc, false);
}
public function update(_arg1:int):void{
}
public function gotoArc(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.arcadebomb.com"), "_blank");
}
}
}//package
Section 114
//mainGunBullet (mainGunBullet)
package {
import flash.display.*;
public dynamic class mainGunBullet extends MovieClip {
public function mainGunBullet(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 115
//mainGunMissileHitFx (mainGunMissileHitFx)
package {
import flash.media.*;
public dynamic class mainGunMissileHitFx extends Sound {
}
}//package
Section 116
//mainGunRotSound (mainGunRotSound)
package {
import flash.media.*;
public dynamic class mainGunRotSound extends Sound {
}
}//package
Section 117
//mainGunSound (mainGunSound)
package {
import flash.media.*;
public dynamic class mainGunSound extends Sound {
}
}//package
Section 118
//man (man)
package {
import flash.display.*;
public dynamic class man extends MovieClip {
public var selectionMc:manSelectionSquare;
public var manFrames:BadGuyRun;
public var manThrow:badGuyThrow;
public var manStand:badGuyStandRight;
}
}//package
Section 119
//manGrenaderW (manGrenaderW)
package {
import flash.display.*;
public dynamic class manGrenaderW extends MovieClip {
}
}//package
Section 120
//manGunStand (manGunStand)
package {
import flash.display.*;
public dynamic class manGunStand extends MovieClip {
public var w:MovieClip;
}
}//package
Section 121
//manHit (manHit)
package {
import flash.display.*;
public dynamic class manHit extends MovieClip {
public function manHit(){
addFrameScript(9, frame10);
}
function frame10(){
MovieClip(this.parent).gotoAndStop("walk");
}
}
}//package
Section 122
//manHitBack (manHitBack)
package {
import flash.display.*;
public dynamic class manHitBack extends MovieClip {
public function manHitBack(){
addFrameScript(9, frame10);
}
function frame10(){
MovieClip(this.parent).gotoAndStop("walk");
}
}
}//package
Section 123
//manMachineGun (manMachineGun)
package {
import flash.display.*;
public dynamic class manMachineGun extends MovieClip {
public var w:MovieClip;
}
}//package
Section 124
//manMachineGunAnim (manMachineGunAnim)
package {
import flash.display.*;
public dynamic class manMachineGunAnim extends MovieClip {
public function manMachineGunAnim(){
addFrameScript(16, frame17);
}
function frame17(){
MovieClip(this.parent).gotoAndStop("gunStand");
}
}
}//package
Section 125
//manSelectionSquare (manSelectionSquare)
package {
import flash.display.*;
public dynamic class manSelectionSquare extends MovieClip {
public function manSelectionSquare(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 126
//manStone (manStone)
package {
import flash.display.*;
public dynamic class manStone extends MovieClip {
}
}//package
Section 127
//manStoneDeath (manStoneDeath)
package {
import flash.display.*;
public dynamic class manStoneDeath extends MovieClip {
public function manStoneDeath(){
addFrameScript(7, frame8);
}
function frame8(){
stop();
}
}
}//package
Section 128
//manStoneHit (manStoneHit)
package {
import flash.display.*;
public dynamic class manStoneHit extends MovieClip {
public function manStoneHit(){
addFrameScript(9, frame10);
}
function frame10(){
MovieClip(this.parent).gotoAndStop("walk");
}
}
}//package
Section 129
//manStoneThrow (manStoneThrow)
package {
import flash.display.*;
public dynamic class manStoneThrow extends MovieClip {
public function manStoneThrow(){
addFrameScript(6, frame7);
}
function frame7(){
MovieClip(this.parent).gotoAndStop("stand");
}
}
}//package
Section 130
//mapShowFx (mapShowFx)
package {
import flash.media.*;
public dynamic class mapShowFx extends Sound {
}
}//package
Section 131
//marineEngineer (marineEngineer)
package {
import flash.display.*;
public dynamic class marineEngineer extends MovieClip {
}
}//package
Section 132
//mcTest (mcTest)
package {
import flash.display.*;
public dynamic class mcTest extends MovieClip {
}
}//package
Section 133
//MochiAd (MochiAd)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.system.*;
import flash.net.*;
public class MochiAd {
public static function getVersion():String{
return ("2.7");
}
public static function showClickAwayAd(_arg1: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 = _arg1;
DEFAULTS = {ad_timeout:2000, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function ():void{
}, ad_finished:function ():void{
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, 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 (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
sendHostProgress = false;
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
_local3 = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.root == null){
_local3 = true;
};
if (_local3){
delete this.onEnterFrame;
};
};
doOnEnterFrame(chk);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (_arg1.origFrameRate != undefined){
_arg1.stage.frameRate = _arg1.origFrameRate;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad._containerLCName != undefined){
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "notify", {id:"unload"});
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1: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 = _arg1;
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 (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, 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 _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 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 (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local4 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.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."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
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(_arg1: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 = _arg1;
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);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
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 (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.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(_arg1:Object, _arg2:String, _arg3:Array):Object{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
if (typeof(_arg1[_local4[_local5]]) == "function"){
return (_arg1[_local4[_local5]].apply(_arg1, _arg3));
};
return (undefined);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function adShowing(_arg1:Object):void{
_arg1.origFrameRate = _arg1.stage.frameRate;
_arg1.stage.frameRate = 30;
}
public static function getValue(_arg1:Object, _arg2:String):Object{
var _local3:Array;
var _local4:Number;
_local3 = _arg2.split(".");
_local4 = 0;
while (_local4 < (_local3.length - 1)) {
if ((((_arg1[_local3[_local4]] == undefined)) || ((_arg1[_local3[_local4]] == null)))){
return (undefined);
};
_arg1 = _arg1[_local3[_local4]];
_local4++;
};
return (_arg1[_local3[_local4]]);
}
public static function rpc(_arg1:Object, _arg2:Number, _arg3:Object):void{
var _local4:Object;
var _local5:Object;
switch (_arg3.id){
case "setValue":
MochiAd.setValue(_arg1, _arg3.objectName, _arg3.value);
break;
case "getValue":
_local4 = MochiAd.getValue(_arg1, _arg3.objectName);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local4);
break;
case "runMethod":
_local5 = MochiAd.runMethod(_arg1, _arg3.method, _arg3.args);
_arg1._mochiad.lc.send(_arg1._mochiad._containerLCName, "rpcResult", _arg2, _local5);
break;
default:
trace(("[mochiads rpc] unknown rpc id: " + _arg3.id));
};
}
public static function setValue(_arg1:Object, _arg2:String, _arg3:Object):void{
var _local4:Array;
var _local5:Number;
_local4 = _arg2.split(".");
_local5 = 0;
while (_local5 < (_local4.length - 1)) {
if ((((_arg1[_local4[_local5]] == undefined)) || ((_arg1[_local4[_local5]] == null)))){
return;
};
_arg1 = _arg1[_local4[_local5]];
_local5++;
};
_arg1[_local4[_local5]] = _arg3;
}
public static function showPreGameAd(_arg1: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 = _arg1;
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 (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function ():void{
}, ad_progress:function (_arg1: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 _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.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 (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
mc.rpc = function (_arg1:Number, _arg2:Object):void{
MochiAd.rpc(clip, _arg1, _arg2);
};
mc.rpcTestFn = function (_arg1:String):Object{
trace(("[MOCHIAD rpcTestFn] " + _arg1));
return (_arg1);
};
mc.regContLC = function (_arg1:String):void{
mc._containerLCName = _arg1;
};
sendHostProgress = false;
mc.sendHostLoadProgress = function (_arg1:String):void{
sendHostProgress = true;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
options.ad_progress(_local10);
if (sendHostProgress){
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local7});
if (_local7 == 100){
sendHostProgress = false;
};
};
if (!chk.showing){
_local11 = this.parent._mochiad_ctr.contentLoaderInfo.bytesTotal;
if (_local11 > 0){
chk.showing = true;
chk.started = getTimer();
MochiAd.adShowing(clip);
} else {
if ((((_local3 > chk.ad_timeout)) && ((_local7 == 100)))){
options.ad_failed();
_local4 = true;
};
};
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 134
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.system.*;
import flash.net.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 135
//panelItems (panelItems)
package {
import flash.display.*;
public dynamic class panelItems extends MovieClip {
public function panelItems(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 136
//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(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 137
//pauseMc (pauseMc)
package {
import flash.display.*;
public dynamic class pauseMc extends MovieClip {
}
}//package
Section 138
//Photon (Photon)
package {
import flash.display.*;
public dynamic class Photon extends MovieClip {
}
}//package
Section 139
//playerSprite (playerSprite)
package {
import flash.display.*;
public dynamic class playerSprite extends MovieClip {
public var selectionMc:spaceGunSelection;
public var turret:turretMc;
}
}//package
Section 140
//PlayGameBtn (PlayGameBtn)
package {
import flash.display.*;
public dynamic class PlayGameBtn extends SimpleButton {
}
}//package
Section 141
//playGameTxt (playGameTxt)
package {
import flash.display.*;
public dynamic class playGameTxt extends MovieClip {
}
}//package
Section 142
//projectiles (projectiles)
package {
import flash.display.*;
public dynamic class projectiles extends MovieClip {
}
}//package
Section 143
//risingMoneyTxt (risingMoneyTxt)
package {
import flash.display.*;
import flash.text.*;
public dynamic class risingMoneyTxt extends MovieClip {
public var moneyTxt:TextField;
}
}//package
Section 144
//rocket (rocket)
package {
import flash.display.*;
public dynamic class rocket extends MovieClip {
}
}//package
Section 145
//rocketLauncher (rocketLauncher)
package {
import flash.display.*;
public dynamic class rocketLauncher extends MovieClip {
public var selectionMc:manSelectionSquare;
}
}//package
Section 146
//rocketLauncherShoot (rocketLauncherShoot)
package {
import flash.display.*;
public dynamic class rocketLauncherShoot extends MovieClip {
public function rocketLauncherShoot(){
addFrameScript(4, frame5);
}
function frame5(){
MovieClip(this.parent).gotoAndStop("gunStand");
}
}
}//package
Section 147
//rocketStand (rocketStand)
package {
import flash.display.*;
public dynamic class rocketStand extends MovieClip {
}
}//package
Section 148
//rockFx (rockFx)
package {
import flash.media.*;
public dynamic class rockFx extends Sound {
}
}//package
Section 149
//sniper (sniper)
package {
import flash.display.*;
public dynamic class sniper extends MovieClip {
public var selectionMc:manSelectionSquare;
}
}//package
Section 150
//sniperHead (sniperHead)
package {
import flash.display.*;
public dynamic class sniperHead extends MovieClip {
}
}//package
Section 151
//sniperStand (sniperStand)
package {
import flash.display.*;
public dynamic class sniperStand extends MovieClip {
}
}//package
Section 152
//sniperWalk (sniperWalk)
package {
import flash.display.*;
public dynamic class sniperWalk extends MovieClip {
}
}//package
Section 153
//SoundMusic1 (SoundMusic1)
package {
import flash.media.*;
public dynamic class SoundMusic1 extends Sound {
}
}//package
Section 154
//spaceGunSelection (spaceGunSelection)
package {
import flash.display.*;
public dynamic class spaceGunSelection extends MovieClip {
public function spaceGunSelection(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 155
//startGameButton (startGameButton)
package {
import flash.display.*;
public dynamic class startGameButton extends SimpleButton {
}
}//package
Section 156
//startGameFx (startGameFx)
package {
import flash.media.*;
public dynamic class startGameFx extends Sound {
}
}//package
Section 157
//startGameMsg (startGameMsg)
package {
import flash.display.*;
public dynamic class startGameMsg extends MovieClip {
}
}//package
Section 158
//startScreenInstr (startScreenInstr)
package {
import flash.display.*;
public dynamic class startScreenInstr extends MovieClip {
}
}//package
Section 159
//tankRoundBitAnim (tankRoundBitAnim)
package {
import flash.display.*;
public dynamic class tankRoundBitAnim extends MovieClip {
public var roundMc:MovieClip;
}
}//package
Section 160
//throwFx (throwFx)
package {
import flash.media.*;
public dynamic class throwFx extends Sound {
}
}//package
Section 161
//tower1 (tower1)
package {
import flash.display.*;
public dynamic class tower1 extends MovieClip {
}
}//package
Section 162
//turretMc (turretMc)
package {
import flash.display.*;
public dynamic class turretMc extends MovieClip {
public var firePoint:MovieClip;
public var body:MovieClip;
public function turretMc(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 163
//upgradeFx (upgradeFx)
package {
import flash.media.*;
public dynamic class upgradeFx extends Sound {
}
}//package
Section 164
//youarehereMc (youarehereMc)
package {
import flash.display.*;
public dynamic class youarehereMc extends MovieClip {
}
}//package