Frame 1
function resetDefaultKeys() {
_root.rightKey = 39;
_root.leftKey = 37;
_root.upKey = 38;
_root.downKey = 40;
_root.jumpKey = 65;
_root.shootKey = 83;
_root.grenadeKey = 68;
_root.rightKeyDesc = "RIGHT ARROW";
_root.leftKeyDesc = "LEFT ARROW";
_root.upKeyDesc = "UP ARROW";
_root.downKeyDesc = "DOWN ARROW";
_root.jumpKeyDesc = "A";
_root.shootKeyDesc = "S";
_root.grenadeKeyDesc = "D";
}
function newMedal(num) {
trace("CHECKMEDAL");
if (_root.savefile.data.medals[num] == false) {
_root.savefile.data.medals[num] = true;
newMedalPrompt();
trace("GOTMEDAL");
}
}
function newMedalPrompt() {
MEDALS.attachMovie("MEDALSIGN", "MS" + MEDALS.getNextHighestDepth(), MEDALS.getNextHighestDepth());
}
function setDefaultControls() {
_root.savefile.data.rightKey = _root.rightKey;
_root.savefile.data.leftKey = _root.leftKey;
_root.savefile.data.upKey = _root.upKey;
_root.savefile.data.downKey = _root.downKey;
_root.savefile.data.jumpKey = _root.jumpKey;
_root.savefile.data.shootKey = _root.shootKey;
_root.savefile.data.grenadeKey = _root.grenadeKey;
_root.savefile.data.rightKeyDesc = _root.rightKeyDesc;
_root.savefile.data.leftKeyDesc = _root.leftKeyDesc;
_root.savefile.data.upKeyDesc = _root.upKeyDesc;
_root.savefile.data.downKeyDesc = _root.downKeyDesc;
_root.savefile.data.jumpKeyDesc = _root.jumpKeyDesc;
_root.savefile.data.shootKeyDesc = _root.shootKeyDesc;
_root.savefile.data.grenadeKeyDesc = _root.grenadeKeyDesc;
}
version = $version;
var osType;
var majorVersion;
var majorRevision;
var minorVersion;
var minorRevision;
vers.text = version;
osArray = version.split(" ");
osType = osArray[0];
versionArray = osArray[1].split(",");
majorVersion = versionArray[0];
majorRevision = versionArray[1];
minorVersion = versionArray[2];
minorRevision = versionArray[3];
var verCount = "";
verCount = verCount + majorVersion;
verCount = verCount + majorRevision;
verCount = verCount + minorVersion;
verCount = verCount + minorRevision;
logoMask.setMask(preLoader);
Stage.showMenu = false;
resetDefaultKeys();
stop();
var savefile = SharedObject.getLocal("MERCS2SAVE_F16");
createEmptyMovieClip("MEDALS", getNextHighestDepth());
if (_root.savefile.data.setup == undefined) {
trace("newSave");
_root.savefile.data.medals = new Array(false, false, false, false, false, false, false, false, false, false, false, false, false);
_root.savefile.data.setup = true;
_root.savefile.data.detail = 2;
_root.savefile.data.qualityV = 3;
_root.savefile.data.musicV = true;
_root.savefile.data.soundV = true;
setDefaultControls();
_root.savefile.data.highScore = 0;
}
var menuPos = 0;
Frame 2
function onEnterFrame() {
controlFade(redFade);
controlFade(whiteFade);
controlPause();
}
function setFPS() {
date = new Date();
while (date.getTime() < FPSTimer) {
date = new Date();
}
FPSTimer = date.getTime() + _root.fpsSet;
}
function controlFade(target) {
if (target._alpha > 0) {
target._alpha = target._alpha - 10;
} else {
target._xscale = 0;
}
}
function setFade(target, ammount) {
target._xscale = 100;
target._alpha = ammount;
}
function controlPause() {
if (Key.isDown(80) && (pauseSwitch == false)) {
pauseSwitch = true;
if ((gamePaused == true) && (pauseHold == false)) {
gamePaused = false;
} else {
Mouse.show();
gamePaused = true;
}
} else if (!Key.isDown(80)) {
pauseSwitch = false;
}
if (gamePaused == false) {
pauseBG.gotoAndStop("INACTIVE");
pauseBG._visible = false;
pauseBG._x = -1000;
} else {
pauseBG.gotoAndStop("MAIN");
pauseBG._visible = true;
pauseBG._x = 0;
}
}
function setMusic(target) {
stopAllSounds();
if (savefile.data.musicV == true) {
MUSIC.gotoAndStop(target);
MUSIC.gotoAndStop(1);
}
lastMusic = target;
}
function playSound(target) {
if (savefile.data.soundV == true) {
SOUNDFX.gotoAndStop(target);
SOUNDFX.gotoAndStop(1);
}
}
_root.fpsSet = 2;
var FPSTimer = 0;
var date;
var lagCount = 0;
var pauseHold = false;
var gamePaused = false;
var pauseSwitch = false;
var lastMusic;
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
domain = domain.toLowerCase();
if (((domain != "") && (domain != "armorgames.com")) && (domain != "pandemicstudios.com")) {
}
Instance of Symbol 322 MovieClip in Frame 2
onClipEvent (enterFrame) {
nextFrame();
nextFrame();
}
Frame 3
stop();
_root.fpsSet = 38;
Mouse.show();
gamePaused = false;
MENUSCROLL._x = menuPos;
_root.level1Boss = false;
Frame 4
_root.gamePaused = false;
Frame 5
_root.gamePaused = false;
Frame 6
_root.gamePaused = false;
Frame 7
_root.gamePaused = false;
Frame 8
stopAllSounds();
Mouse.show();
_root.playSound("LOSE");
Frame 9
_quality = "high";
_root.gameTimer = 0;
Frame 11
stopAllSounds();
_root.gamePaused = false;
_root.playSound("WIN");
if (_root.difficulty > 1) {
_root.newMedal(5);
} else {
_root.newMedal(1);
}
Frame 12
stopAllSounds();
_root.gamePaused = false;
_root.playSound("WIN");
if (_root.difficulty > 1) {
_root.newMedal(6);
} else {
_root.newMedal(2);
}
Frame 13
stopAllSounds();
Mouse.show();
_root.playSound("LOSE");
Frame 14
stopAllSounds();
_root.playSound("WIN");
if (_root.difficulty > 1) {
_root.newMedal(7);
} else {
_root.newMedal(3);
}
Frame 15
_root.playMusic("MENU");
if (_root.difficulty > 1) {
_root.newMedal(8);
} else {
_root.newMedal(4);
}
Mouse.show();
Instance of Symbol 341 MovieClip in Frame 16
onClipEvent (load) {
stop();
}
Symbol 41 MovieClip Frame 1
_alpha = 0;
Symbol 45 MovieClip [Missile1] Frame 1
stop();
if (random(2) == 0) {
nextFrame();
}
Symbol 52 MovieClip Frame 1
stop();
Symbol 91 MovieClip [Swain_Obj_Barrel2] Frame 1
stop();
Symbol 118 MovieClip [Explosion] Frame 14
this.removeMovieClip();
Symbol 125 MovieClip Frame 1
_root.playSound("BANG");
Symbol 125 MovieClip Frame 6
stop();
Symbol 185 MovieClip Frame 13
stop();
Symbol 186 MovieClip [ENEMY_Grunt] Frame 2
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 10
stop();
Symbol 203 MovieClip [ENEMY_ColS] Frame 1
stop();
Symbol 205 MovieClip [Effect_Ring] Frame 1
function onEnterFrame() {
_xscale = (_xscale + 10);
_yscale = _xscale;
_alpha = (_alpha - 10);
if (_alpha < 0) {
this.removeMovieClip();
}
}
_alpha = 200;
Symbol 208 MovieClip [EOLFAIL] Frame 1
function onEnterFrame() {
if (_xscale > 100) {
_xscale = (_xscale - 5);
_yscale = (_yscale - 5);
_rotation = (_rotation + 5);
} else {
_alpha = (_alpha - 3);
if (_alpha < 0) {
this.removeMovieClip();
}
}
}
_xscale = 130;
_yscale = 130;
_rotation = -10;
_alpha = 200;
Symbol 210 MovieClip [EOLBAR] Frame 1
function onEnterFrame() {
if (_xscale > 100) {
_xscale = (_xscale - 5);
_yscale = (_yscale - 5);
_rotation = (_rotation + 5);
} else {
_alpha = (_alpha - 3);
if (_alpha < 0) {
this.removeMovieClip();
}
}
}
_xscale = 130;
_yscale = 130;
_rotation = -10;
_alpha = 200;
Symbol 224 MovieClip [L4Target] Frame 1
stop();
Symbol 227 MovieClip [L4Bullet] Frame 15
stop();
Symbol 254 MovieClip [Smoke] Frame 14
this.removeMovieClip();
Symbol 255 MovieClip [L4Blood] Frame 14
this.removeMovieClip();
Symbol 259 MovieClip [MEDALSIGN] Frame 1
function onEnterFrame() {
_x = (_x + 3);
_alpha = (_alpha - 4);
if (_alpha < 0) {
this.removeMovieClip();
}
}
_alpha = 500;
Symbol 278 MovieClip [MC_Bullet_KillGunFlame] Frame 1
_root.playSound("EXPBANG2");
Symbol 283 MovieClip [Item Ammo] Frame 1
stop();
Symbol 285 MovieClip [ENEMY_Col] Frame 1
_parent.addEnemyCol(this);
this.swapDepths(666);
this.removeMovieClip();
Symbol 296 MovieClip Frame 1
function onEnterFrame() {
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
_yscale = PercentLoaded;
if ((PercentLoaded == 100) && (_root.playBut._y < 0)) {
_root.playBut._y = _root.playBut._y + 1000;
_root.loadText = "PLAY";
}
}
_root.playBut._y = _root.playBut._y - 1000;
Symbol 302 Button
on (release) {
if (Number(verCount) < 901240) {
_root.gotoAndStop("UPDATEPLAYER");
} else {
nextFrame();
}
}
Symbol 314 MovieClip Frame 1
function onEnterFrame() {
nextFrame();
nextFrame();
}
Symbol 314 MovieClip Frame 70
stop();
Symbol 322 MovieClip Frame 1
_root.playSound("INTROSOUND");
Symbol 322 MovieClip Frame 407
_root.nextFrame();
Symbol 327 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 1
stop();
Symbol 349 MovieClip Frame 1
function onEnterFrame() {
if (maskee._x < 0) {
maskee._x = maskee._x + 20;
}
}
masker.setMask(maskee);
Symbol 350 Button
on (release) {
if (L1But._alpha == 100) {
_root.setFade(_root.whiteFade, 300);
_root.levelNo = 1;
_root.gotoAndStop("controlType");
}
}
on (rollOver, dragOver) {
if (L1But._alpha != 100) {
picSel.gotoAndStop(5);
} else {
picSel.gotoAndStop(1);
}
}
Symbol 351 Button
on (release) {
if (L2But._alpha == 100) {
_root.setFade(_root.whiteFade, 300);
_root.levelNo = 2;
_root.gotoAndStop("LEVEL" + _root.levelNo);
}
}
on (rollOver, dragOver) {
if (L2But._alpha != 100) {
picSel.gotoAndStop(5);
} else {
picSel.gotoAndStop(2);
}
}
Symbol 352 Button
on (release) {
if (L3But._alpha == 100) {
_root.setFade(_root.whiteFade, 300);
_root.levelNo = 3;
_root.gotoAndStop("LEVEL" + _root.levelNo);
}
}
on (rollOver, dragOver) {
if (L3But._alpha != 100) {
picSel.gotoAndStop(5);
} else {
picSel.gotoAndStop(3);
}
}
Symbol 356 Button
on (release) {
if (L4But._alpha == 100) {
_root.setFade(_root.whiteFade, 300);
_root.levelNo = 4;
_root.gotoAndStop("LEVEL" + _root.levelNo);
}
}
on (rollOver, dragOver) {
if (L4But._alpha != 100) {
picSel.gotoAndStop(5);
} else {
picSel.gotoAndStop(4);
}
}
Symbol 358 Button
on (release) {
_root.gameType = 1;
_root.menuPos = -600;
}
on (rollOver, dragOver) {
descText = "START THE GAME ALREADY! CAN YOU RECOVER THE STOLEN BRIEFCASE OF ONE OF YOUR CLIENTS? TAKE ON A PRIVATE ARMY SPANNING 4 LEVELS DEEP IN THE HEART OF VENEZUELA.";
}
Symbol 359 Button
on (release) {
MEDALS.gotoAndStop(2);
_root.menuPos = 1200;
}
on (rollOver, dragOver) {
descText = "COLLECT ACHIEVEMENTS TO EARN MEDALS. COLLECT MEDALS TO EARN MERCENARIES CONCEPT ART. COLLECT MERCENARIES CONCEPT ART TO EARN MY RESPECT.";
}
Symbol 360 Button
on (release) {
_root.menuPos = 600;
}
on (rollOver, dragOver) {
descText = "CHANGE GRAPHICS OPTIONS TO IMPROVE PERFORMANCE. CHANGE AUDIO OPTIONS TO TURN MUSIC AND SOUND EFFECTS ON OR OFF.";
}
Symbol 364 Button
on (release) {
_root.menuPos = 0;
}
Symbol 366 Button
on (release) {
_root.menuPos = -600;
}
Symbol 369 Button
on (release) {
setSound(true);
}
Symbol 370 Button
on (release) {
setSound(false);
}
Symbol 374 Button
on (release) {
setMusic(true);
_root.setMusic(_root.lastMusic);
}
Symbol 375 Button
on (release) {
stopAllSounds();
setMusic(false);
}
Symbol 378 Button
on (release) {
setDetail(3);
}
Symbol 379 Button
on (release) {
setDetail(2);
}
Symbol 383 Button
on (release) {
setDetail(1);
}
Symbol 385 Button
on (release) {
setQuality(3);
}
Symbol 386 Button
on (release) {
setQuality(2);
}
Symbol 388 Button
on (release) {
setQuality(1);
}
Symbol 390 MovieClip Frame 1
function setDetail(ammount) {
butDetail_low._alpha = 10;
butDetail_med._alpha = 10;
butDetail_high._alpha = 10;
if (ammount == 1) {
butDetail_high._alpha = 100;
} else if (ammount == 2) {
butDetail_med._alpha = 100;
} else if (ammount == 3) {
butDetail_low._alpha = 100;
}
_root.savefile.data.detail = ammount;
_root.savefile.flush();
}
function setQuality(ammount) {
butQuality_low._alpha = 10;
butQuality_med._alpha = 10;
butQuality_high._alpha = 10;
if (ammount == 1) {
butQuality_high._alpha = 100;
_root._quality = "High";
} else if (ammount == 2) {
butQuality_med._alpha = 100;
_root._quality = "Medium";
} else if (ammount == 3) {
butQuality_low._alpha = 100;
_root._quality = "Low";
}
_root.savefile.data.qualityV = ammount;
_root.savefile.flush();
}
function setSound(val) {
butSound_on._alpha = 10;
butSound_off._alpha = 10;
if (val == true) {
butSound_on._alpha = 100;
} else {
butSound_off._alpha = 100;
}
_root.savefile.data.soundV = val;
_root.savefile.flush();
}
function setMusic(val) {
butMusic_on._alpha = 10;
butMusic_off._alpha = 10;
if (val == true) {
butMusic_on._alpha = 100;
} else {
butMusic_off._alpha = 100;
}
_root.savefile.data.musicV = val;
_root.savefile.flush();
}
setDetail(_root.savefile.data.detail);
setQuality(_root.savefile.data.qualityV);
setSound(_root.savefile.data.soundV);
setMusic(_root.savefile.data.musicV);
Symbol 392 Button
on (release) {
if (_root.gameType == 1) {
_root.setFade(_root.whiteFade, 300);
_root.levelNo = 1;
_root.difficulty = 0.75;
_root.gotoAndStop("CS1");
} else {
_root.difficulty = 0.75;
_root.menuPos = -1200;
}
}
Symbol 393 Button
on (release) {
if (_root.gameType == 1) {
_root.setFade(_root.whiteFade, 300);
_root.levelNo = 1;
_root.difficulty = 2.5;
_root.gotoAndStop("CS1");
} else {
_root.difficulty = 2.5;
_root.menuPos = -1200;
}
}
Symbol 398 Button
on (release) {
_root.menuPos = 0;
MEDALS.fader = true;
}
Symbol 411 MovieClip Frame 1
stop();
Symbol 411 MovieClip Frame 2
function onEnterFrame() {
_rotation = (_rotation + 10);
}
Symbol 413 MovieClip Frame 1
MedCount = 0;
var i = 1;
while (i < 5) {
if (_root.savefile.data.medals[i] == true) {
this["MED" + i].gotoAndStop(2);
MedCount++;
}
i++;
}
if (MedCount == 4) {
U1._alpha = 100;
MEDG1._alpha = 100;
} else {
U1._alpha = 20;
MEDG1._alpha = 15;
}
MedCount = 0;
var i = 5;
while (i < 9) {
if (_root.savefile.data.medals[i] == true) {
this["MED" + i].gotoAndStop(2);
MedCount++;
}
i++;
}
if (MedCount == 4) {
U2._alpha = 100;
MEDG2._alpha = 100;
} else {
U2._alpha = 20;
MEDG2._alpha = 15;
}
MedCount = 0;
var i = 9;
while (i < 13) {
if (_root.savefile.data.medals[i] == true) {
this["MED" + i].gotoAndStop(2);
MedCount++;
}
i++;
}
if (MedCount == 4) {
U3._alpha = 100;
MEDG3._alpha = 100;
} else {
U3._alpha = 20;
MEDG3._alpha = 15;
}
Instance of Symbol 401 MovieClip "U2" in Symbol 413 MovieClip Frame 1
on (release) {
if (_alpha == 100) {
_root.setFade(_root.whiteFade, 200);
_root.gotoAndStop("UNLOCK2");
}
}
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "UNLOCK MERCENARIES CHARACTER ART BY EARNING THIS MEDAL.";
_parent.descBuffer = 5;
}
}
Instance of Symbol 403 MovieClip "MEDG1" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "LOWLY DOGTAG MEDAL.\nBEAT THE GAME ON WUSS MODE TO WIN THIS MEDAL!";
_parent.descBuffer = 5;
}
}
Instance of Symbol 405 MovieClip "MEDG2" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "WAR HERO MEDAL.\nBEAT THE GAME ON INSANE MODE TO WIN THIS MEDAL AND BE A TRUE HERO.";
_parent.descBuffer = 5;
}
}
Instance of Symbol 407 MovieClip "MEDG3" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "SHIELD MEDAL.\nCOMPLETE MYSTERY TASKS TO WIN THIS MEDAL.";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED4" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "BEAT LEVEL FOUR ON WUSS MODE";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED3" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "BEAT LEVEL THREE ON WUSS MODE";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED2" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "BEAT LEVEL TWO ON WUSS MODE";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED1" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
_parent.descBuffer = 0;
switchTimer = 0;
_parent.fader = false;
}
onClipEvent (enterFrame) {
_quality = "high";
if (act == true) {
_parent.descText = "BEAT LEVEL ONE ON WUSS MODE";
_parent.descBuffer = 5;
_parent.fader = false;
}
_parent.descBuffer--;
if (_parent.descBuffer < 0) {
_parent.descText = "Beat the 4 achievements on each row to earn the medal. Mouse over each circle to view.";
}
if (_parent.fader == true) {
switchTimer++;
if (switchTimer == 20) {
_parent.gotoAndStop(1);
}
}
}
Instance of Symbol 411 MovieClip "MED8" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "BEAT LEVEL FOUR ON INSANE MODE";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED7" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "BEAT LEVEL THREE ON INSANE MODE";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED6" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "BEAT LEVEL TWO ON INSANE MODE";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED5" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "BEAT LEVEL ONE ON INSANE MODE";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED12" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "YOUR MOTHER SHOULD HAVE TOLD YOU NOT TO STARE THERE...";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED11" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "SLICKSHOT!\nHIT FIVE ENEMIES IN A ROW WITHOUT MISSING ON LEVEL 2";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED10" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "INDESTRUCTOMERC!\nREACH THE LEVEL TWO BLIMP WITHOUT HITTING AN OBSTACLE..";
_parent.descBuffer = 5;
}
}
Instance of Symbol 411 MovieClip "MED9" in Symbol 413 MovieClip Frame 1
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "GRENADES!\nKILL AN ENEMY ON LEVEL ONE WITH A GRENADE.";
_parent.descBuffer = 5;
}
}
Instance of Symbol 401 MovieClip "U1" in Symbol 413 MovieClip Frame 1
on (release) {
if (_alpha == 100) {
_root.setFade(_root.whiteFade, 200);
_root.gotoAndStop("UNLOCK3");
}
}
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "UNLOCK MERCENARIES STYLE ART BY EARNING THIS MEDAL.";
_parent.descBuffer = 5;
}
}
Instance of Symbol 401 MovieClip "U3" in Symbol 413 MovieClip Frame 1
on (release) {
if (_alpha == 100) {
_root.setFade(_root.whiteFade, 200);
_root.gotoAndStop("UNLOCK1");
}
}
on (rollOver, dragOver) {
act = true;
}
on (rollOut, dragOut) {
act = false;
}
onClipEvent (load) {
act = false;
}
onClipEvent (enterFrame) {
if (act == true) {
_parent.descText = "UNLOCK MIKE SWAINS CONCEPT ART FOR THIS FLASH GAME.";
_parent.descBuffer = 5;
}
}
Symbol 414 Button
on (release) {
_root.gameType = 2;
_root.menuPos = -600;
}
on (rollOver, dragOver) {
_parent.descText = "CHOOSE TO PLAY EACH LEVEL INDIVIDUALLY. THIS OPTION WILL BE LOCKED UNTIL YOU HAVE BEATEN THE GAME ONCE.";
}
Symbol 428 MovieClip Frame 1
stop();
Symbol 434 Button
on (release) {
getURL ("http://www.pandemicstudios.com/mercenaries/buynow.php", "_blank");
}
on (rollOver, dragOver) {
warnText = "ESRB Rating: TEEN with LANGUAGE, USE OF ALCOHOL AND TOBACCO, VIOLENCE";
}
on (rollOut, dragOut) {
warnText = "";
}
Symbol 435 Button
on (release) {
_root.menuPos = 1850;
}
on (rollOver, dragOver) {
descText = "VIEW THE CREDITS FOR WEB IN FLAMES.";
}
Symbol 441 Button
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
on (rollOver, dragOver) {
descText = "CHECK OUT THE MERCENARIES 2 HOMEPAGE TO FIND OUT MORE ABOUT THIS GREAT NEXT GEN EXPERIENCE ON XBOX 360";
}
Symbol 445 Button
on (release) {
getURL ("http://www.pandemicstudios.com/corp/index.php", "_blank");
}
on (rollOver, dragOver) {
descText = "CHECK OUT THE MERCENARIES 2 HOMEPAGE TO FIND OUT MORE ABOUT THIS GREAT NEXT GEN EXPERIENCE ON XBOX 360";
}
Symbol 448 Button
on (release) {
getURL ("http://www.ea.com", "_blank");
}
on (rollOver, dragOver) {
descText = "CHECK OUT THE MERCENARIES 2 HOMEPAGE TO FIND OUT MORE ABOUT THIS GREAT NEXT GEN EXPERIENCE ON XBOX 360";
}
Symbol 453 MovieClip Frame 1
function onEnterFrame() {
_x = (_x + ((_root.menuPos - _x) / 6));
}
if ((_root.savefile.data.medals[1] == false) && (_root.savefile.data.medals[5] == false)) {
L1But._alpha = 100;
}
if ((_root.savefile.data.medals[2] == false) && (_root.savefile.data.medals[6] == false)) {
L2But._alpha = 20;
}
if ((_root.savefile.data.medals[3] == false) && (_root.savefile.data.medals[7] == false)) {
L3But._alpha = 20;
}
if ((_root.savefile.data.medals[4] == false) && (_root.savefile.data.medals[8] == false)) {
L4But._alpha = 20;
}
picSel.gotoAndStop(6);
_parent.setMusic("MENU");
Symbol 458 MovieClip Frame 1
stop();
Symbol 463 MovieClip Frame 1
stop();
Symbol 468 MovieClip Frame 1
stop();
Symbol 473 MovieClip Frame 1
stop();
Symbol 501 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 1
stop();
Symbol 514 MovieClip Frame 2
stop();
Symbol 526 MovieClip Frame 1
stop();
Symbol 531 MovieClip Frame 1
stop();
Symbol 536 MovieClip Frame 1
stop();
Symbol 537 MovieClip Frame 1
stop();
Instance of Symbol 501 MovieClip in Symbol 537 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_root.customControls == true) {
gotoAndStop (3);
} else if (_root.mouseControl != true) {
gotoAndStop (2);
} else {
gotoAndStop (1);
}
}
Symbol 537 MovieClip Frame 2
stop();
Symbol 538 MovieClip Frame 1
_parent._parent.newExplosive(this);
Symbol 545 MovieClip Frame 11
stop();
Symbol 571 MovieClip Frame 1
stop();
Symbol 584 MovieClip Frame 1
stop();
Symbol 605 MovieClip Frame 9
stop();
Symbol 606 MovieClip Frame 1
stop();
Symbol 616 MovieClip Frame 11
stop();
Symbol 617 MovieClip Frame 1
stop();
Symbol 620 MovieClip Frame 1
function onMouseDown() {
mousePressed = true;
}
function onMouseUp() {
mousePressed = false;
}
function pythag(x1, y1, x2, y2) {
return(Math.sqrt(Math.pow(y1 - y2, 2) + Math.pow(x1 - x2, 2)));
}
function angle(x1, y1, x2, y2) {
return(Math.round((Math.atan2(y2 - y1, x2 - x1) / 3.141593) * 180) + 90);
}
function calcSpeed(angle, speed) {
var _local2 = angle * 0.01745329;
var _local1 = new Object();
_local1.x = speed * Math.cos(_local2);
_local1.y = speed * Math.sin(_local2);
return(_local1);
}
function rotatedXY(xPos, yPos, rotate) {
var _local1 = new Object();
var _local2 = 0.0174444444444444 * rotate;
var _local4 = Math.sin(_local2);
var _local3 = Math.cos(_local2);
_local1.x = (xPos * _local3) - (yPos * _local4);
_local1.y = (xPos * _local4) + (yPos * _local3);
return(_local1);
}
function newDamage(xPos, yPos, size) {
var _local1 = G_Visual.damagedMask.attachMovie("ExplosionMask", "E" + G_Visual.damagedMask.getNextHighestDepth(), G_Visual.damagedMask.getNextHighestDepth());
_local1._x = xPos + 200;
_local1._y = yPos;
_local1._rotation = random(360);
_local1.gotoAndStop(random(4) + 1);
_local1._xscale = (_local1._yscale = size + random(40));
damageArray.push(_local1);
}
function updateDamage() {
if (damageCleaner == 0) {
damageCleaner = 48;
var _local2 = 0;
while (_local2 < damageArray.length) {
if (!damageArray[_local2].hitTest(_root.bulletHit)) {
damageArray[_local2].removeMovieClip();
damageArray.splice(_local2, 1);
_local2--;
}
_local2++;
}
} else {
damageCleaner--;
}
}
function spriteControl() {
if (grenadeTimer == 0) {
mercSwipe--;
if (mercSwipe >= 0) {
MERC.upper.gotoAndStop("BASH");
} else {
MERC.upper.gotoAndStop("STR");
}
if (!Key.isDown(_root.downKey || (_root.downKey2))) {
mercTopOffset = 0;
} else {
mercTopOffset = 45;
}
if ((MERC.touchBuffer > 2) && (Key.isDown(_root.downKey || (_root.downKey2)))) {
mercTopOffset = 0;
MERC.fireUp = -90;
if (mercSwipe < 0) {
MERC.upper.gotoAndStop("DWN");
}
} else if (Key.isDown(_root.upKey || (_root.upKey2))) {
if (Key.isDown(_root.rightKey || (_root.rightKey2)) || (Key.isDown(_root.leftKey || (_root.leftKey2)))) {
mercTopOffset = 45;
MERC.fireUp = 45;
} else {
mercTopOffset = 0;
MERC.fireUp = 90;
}
if (Key.isDown(_root.downKey || (_root.downKey2))) {
MERC.fireUp = 315;
}
if (mercSwipe < 0) {
MERC.upper.gotoAndStop("UP");
}
} else {
if (Key.isDown(_root.downKey || (_root.downKey2))) {
MERC.fireUp = 315;
} else {
MERC.fireUp = 0;
}
if (mercSwipe < 0) {
MERC.upper.gotoAndStop("STR");
}
}
} else {
MERC.upper.gotoAndStop("GRENADE");
grenadeTimer--;
}
if (MERC.touchBuffer > 5) {
MERC.lower.gotoAndStop("JUMP");
MERC._rotation = MERC._rotation / 1.5;
}
}
function newGrenade(xPos, yPos) {
grenadeTimer = 4;
trace("JIMKHIH");
var _local1 = BULLETS.attachMovie("GRENADE", "G" + BULLETS.getNextHighestDepth(), BULLETS.getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1.ySpeed = -(random(5) + 15);
_local1.xSpeed = 8 * MERC.scaleStore;
grenadeArray.push(_local1);
}
function mercFire() {
if (_root.mouseControl == true) {
aimerFire = angle(MERC._x, MERC._y - 40, _xmouse, _ymouse) - 90;
} else {
aimerFire = (((-90 + (90 * MERC.scaleStore)) - (MERC.fireUp * MERC.scaleStore)) + random(6)) - 3;
}
AIMER._x = _xmouse;
AIMER._y = _ymouse;
_root.gameTimer++;
_root.HUD.grenadeAmmo = grenadeAmmo;
if (grenadeAmmo > 0) {
if ((Key.isDown(_root.grenadeKey) || (Key.isDown(_root.grenadeKey2))) && (grenadeSwitch == false)) {
newGrenade(MERC._x, MERC._y - 35);
grenadeSwitch = true;
grenadeAmmo--;
} else if ((!Key.isDown(_root.grenadeKey)) && (!Key.isDown(_root.grenadeKey2))) {
grenadeSwitch = false;
}
}
if (killGunAmmo > 0) {
MERC.upper.altGun._visible = true;
_root.HUD.iconInf._visible = false;
_root.HUD.ammoNum = killGunAmmo;
if (killGunAlt == 0) {
killGunAlt = 2;
fireSwitch = false;
} else {
killGunAlt--;
}
} else {
MERC.upper.altGun._visible = false;
_root.HUD.itemIcon._visible = false;
_root.HUD.iconInf._visible = true;
_root.HUD.ammoNum = "";
}
if ((Key.isDown(_root.shootKey || (_root.shootKey2)) || (mousePressed == true)) && (fireSwitch == false)) {
if (hitGround(ENEMIES, MERC._x + (12 * MERC.scaleStore), MERC._y - 35) || (hitGround(BOSS, MERC._x + (12 * MERC.scaleStore), MERC._y - 35))) {
if (mercSwipe == 0) {
_root.playSound("SWIPE");
}
BOSS.dodgeTime = 5;
BOSS.health = BOSS.health + 5;
if (BOSS.health > 120) {
BOSS.health = 120;
}
mercSwipe = 5;
cycleEnemies(MERC._x + (12 * MERC.scaleStore), MERC._y - 35, 40);
MERC.xSpeed = 10 * MERC.scaleStore;
} else if (hitGround(ENEMIES, MERC._x + (6 * MERC.scaleStore), MERC._y - 45) || (hitGround(BOSS, MERC._x + (6 * MERC.scaleStore), MERC._y - 45))) {
if (mercSwipe == 0) {
_root.playSound("SWIPE");
}
BOSS.health = BOSS.health + 5;
if (BOSS.health > 120) {
BOSS.health = 120;
}
BOSS.dodgeTime = 5;
mercSwipe = 5;
cycleEnemies(MERC._x + (6 * MERC.scaleStore), MERC._y - 45, 40);
MERC.xSpeed = 10 * MERC.scaleStore;
} else {
if ((MERC.fireUp == -90) && (MERC.ySpeed > 0)) {
MERC.ySpeed = -1;
} else if ((MERC.fireUp == -45) && (MERC.ySpeed > 0)) {
MERC.ySpeed = 1;
}
fireSwitch = true;
var _local5 = rotatedXY(MERC.upper._x, MERC.upper._y / 2, MERC._rotation);
var _local2;
var _local3;
var _local4;
if (MERC.fireUp != 315) {
_local3 = (MERC._x + _local5.x) - ((MERC.fireUp / 10) * MERC.scaleStore);
_local4 = MERC._y + (_local5.y * 1.2);
} else {
_local3 = (MERC._x + _local5.x) - ((MERC.fireUp / 10) * (MERC.scaleStore * -0.35));
_local4 = MERC._y + (_local5.y * 1.2);
}
_root.levelValue1++;
if (killGunAmmo > 0) {
killGunAmmo--;
if (killGunID == 1) {
_local2 = newBullet(_local3, _local4, "KillGun", aimerFire);
_root.playSound("KILLGUN");
} else if (killGunID == 2) {
_local2 = newBullet(_local3, _local4, "KillGunFlame", aimerFire);
_root.playSound("KILLGUNFLAME");
} else if (killGunID == 3) {
if (kgr == true) {
kgr = false;
killGunAmmo++;
} else {
_local2 = newBullet(_local3, _local4, "KillGunRocket", aimerFire);
_root.playSound("KILLGUNROCKET");
kgr = true;
}
}
} else {
_local2 = newBullet(_local3, _local4, "Rifle", aimerFire);
_root.playSound("SHOT");
}
_local2._x = _local2._x + (_local2.speed.x * 2.5);
_local2._y = _local2._y + (_local2.speed.y * 2.5);
newEffect("Smoke", _local2._x, _local2._y, 150, random(360), 50);
shakeScreen(5, 2);
}
} else if ((Key.isDown(_root.shootKey || (_root.shootKey2)) == false) && (mousePressed == false)) {
fireSwitch = false;
kgr = false;
}
}
function shakeScreen(ammount, time) {
screenShake = ammount;
shakeTime = time;
}
function updateShake() {
updateDamage();
if (shakeTime > 0) {
_parent._y = _parent._y + (random(screenShake) * shakeDir);
_parent._x = _parent._x + (random(screenShake) * shakeDir);
shakeDir = shakeDir * -1;
shakeTime--;
} else {
screenShake = 0;
}
_parent._y = _parent._y / 1.1;
}
function onEnterFrame() {
if (_root.gamePaused == false) {
if (strikeTimer == 30) {
_root.playSound("ALARM");
_root.HUD.ARWARN._visible = true;
}
if (strikeTimer == 0) {
_root.HUD.ARWARN._visible = false;
strikeTimer = 250 + random(250);
newBullet((camPos + random(800)) + 1000, -800 - random(200), "HeliRocket", 135);
newBullet((camPos + random(800)) + 1000, -800 - random(200), "HeliRocket", 135);
newBullet((camPos + random(800)) + 1000, -800 - random(200), "HeliRocket", 135);
newBullet((camPos + random(800)) + 1000, -800 - random(200), "HeliRocket", 135);
newBullet((camPos + random(800)) + 1000, -800 - random(200), "HeliRocket", 135);
newBullet((camPos + random(800)) + 1000, -800 - random(200), "HeliRocket", 135);
newBullet((camPos + random(800)) + 1000, -800 - random(200), "HeliRocket", 135);
newBullet((camPos + random(800)) + 1000, -800 - random(200), "HeliRocket", 135);
} else if (camPos < 2000) {
strikeTimer--;
}
updateFragments();
heli();
if (Key.isDown(_root.jumpKey) || (Key.isDown(_root.jumpKey2))) {
MERC.jumpKeyPressed = true;
} else {
MERC.jumpKeyPressed = false;
}
charJump(MERC);
updateBullets_Grenade();
updateBullets_Rifle();
updateBullets_KillGun();
updateBullets_killGunFlame();
updateBullets_KillGunRocket();
updateBullets_HeliRocket();
updateBullets_GruntGun();
updateBullets_KillGunRocket();
updateKillGunItem();
if (Key.isDown(_root.rightKey) || (Key.isDown(_root.rightKey2))) {
CharacterTilt(MERC, 1);
MERC.xSpeed = MERC.xSpeed + 3;
} else if (Key.isDown(_root.leftKey) || (Key.isDown(_root.leftKey2))) {
CharacterTilt(MERC, -1);
MERC.xSpeed = MERC.xSpeed - 3;
} else {
MERC.tiltVar = 0;
MERC.upper._y = MERC.upperPos;
MERC.lower.gotoAndStop("STAND");
}
CharacterProcess(MERC);
updateShake();
spriteControl();
camControl();
scrollTerrain(G_Grassline, 0);
scrollTerrain(G_Treeline, -0.8);
scrollTerrain(G_Treeline2, -1.2);
scrollTerrain(G_Cityline, -1.5);
scrollTerrain(G_Sky, -1.9);
scrollTerrain(G_TreelineF, 2);
updateExplosives();
updateHealth();
updateGrunts();
updateCols();
updateSign();
MERC.upper._xscale = 100;
if (_root.mouseControl == true) {
if (AIMER._x >= MERC._x) {
MERC.scaleStore = 1;
} else {
MERC.scaleStore = -1;
}
MERC._xscale = MERC.scaler * MERC.scaleStore;
AIMER._visible = true;
MERC.upper._rotation = (aimerFire + 90) * MERC.scaleStore;
MERC.upper.gotoAndStop("UP");
if (MERC.upper._rotation > 150) {
MERC.upper._rotation = 150;
MERC.upper.gotoAndStop("STR");
MERC.upper._rotation = MERC.upper._rotation - 90;
} else if (MERC.upper._rotation < -150) {
MERC.upper._rotation = -150;
MERC.upper.gotoAndStop("STR");
MERC.upper._rotation = MERC.upper._rotation - 90;
} else if (MERC.upper._rotation > 50) {
MERC.upper.gotoAndStop("STR");
MERC.upper._rotation = MERC.upper._rotation - 90;
} else if (MERC.upper._rotation < -50) {
MERC.upper.gotoAndStop("STR");
MERC.upper._rotation = MERC.upper._rotation - 90;
}
} else {
AIMER._visible = false;
}
}
}
function charWall(Character) {
var _local1 = 0;
_local1 = _local1 + hitWall(Character, 1);
_local1 = _local1 + (hitWall(Character, -1) * 2);
return(_local1);
}
function hitWall(Character, dir) {
var _local3 = 0;
if (hitAreas(Character._x + ((Character.wid / 2) * dir), Character._y - (Character.hei / 2))) {
_local3 = 1;
while (hitAreas(Character._x + ((Character.wid / 2) * dir), Character._y - (Character.hei / 2))) {
Character._x = Character._x - dir;
}
Character._x = Character._x + dir;
Character.xSpeed = 0;
}
return(_local3);
}
function CharacterProcess(Character) {
if (Character.dead == false) {
hillVar = (MERC._rotation / 250) * (-MERC.scaleStore);
Character.xSpeed = Character.xSpeed / (1.3 + hillVar);
Character._x = Character._x + Character.xSpeed;
if (Character._x > (camPos + 300)) {
Character.xSpeed = 0;
Character._x = camPos + 300;
} else if (Character._x < (camPos - 300)) {
Character.xSpeed = 0;
Character._x = camPos - 300;
}
charWall(Character);
if (Math.round(Character.xSpeed) == 0) {
Character.xSpeed = 0;
}
Character._y = Character._y + Character.ySpeed;
if (Character.ySpeed > 0) {
Character.ySpeed = Character.ySpeed + 6;
} else if (Character.jumpKeyPressed == true) {
Character.ySpeed = Character.ySpeed + 3;
} else {
Character.ySpeed = Character.ySpeed + 6;
}
Character.ySpeed = Character.ySpeed / 1.1;
if (footR._y < (Character._y + 50)) {
footR._y = footR._y + Character.ySpeed;
}
if (footL._y < (Character._y + 50)) {
footL._y = footL._y + Character.ySpeed;
}
Character.leanVar = Character.leanVar / 1.1;
Character.touchBuffer++;
if (hitAreas(Character._x, Character._y)) {
Character.ySpeed = 0;
Character.touchBuffer = 0;
while (hitAreas(Character._x, Character._y)) {
Character._y--;
}
Character._y = Character._y + 5;
}
Character.footR = footR;
Character.footL = footL;
charLean(Character);
if (Character.touchBuffer < 6) {
Character._rotation = Math.floor(angle(footR._x, footR._y, footL._x, footL._y) + 90);
Character.upper._rotation = Math.floor(Character.tiltVar - (MERC._rotation * MERC.scaleStore)) + mercTopOffset;
} else {
Character.upper._rotation = Math.floor((Character.tiltVar + Character.leanVar) - (MERC._rotation * MERC.scaleStore)) + mercTopOffset;
}
mercFire();
} else {
if (MERC.deadTime == 0) {
stopAllSounds();
_root.playSound("LOSE");
}
Character.gotoAndStop("DEAD");
MERC.xSpeed = MERC.xSpeed / 1.1;
MERC.ySpeed = MERC.ySpeed + 2;
MERC._y = MERC._y + MERC.ySpeed;
if (MERC._y > 365) {
MERC._y = 365;
}
MERC.deadTime++;
if (MERC.deadTime == 60) {
_root.setFade(_root.whiteFade, 100);
newEffect("EOLFAIL", camPos, 200, 100, -20, 140);
} else if (MERC.deadTime == 95) {
newExplosion(MERC._x, MERC._y - 10, 250);
MERC._visible = false;
} else if (MERC.deadTime == 140) {
if (_root.gameType == 2) {
_root.setFade(_root.whiteFade, 200);
_root.menuPos = -1200;
_root.gotoAndStop("TITLE");
} else if (_root.gameType == 1) {
_root.setFade(_root.whiteFade, 400);
_root.gotoAndStop("RELOAD");
}
}
}
}
function CharacterTilt(Character, scaler) {
if (_root.mouseControl == false) {
Character._xscale = Character.scaler * scaler;
}
Character.scaleStore = scaler;
Character.lower.gotoAndStop("WALK");
if (Character.tiltVar != (3 * Character.tiltSwitch)) {
Character.tiltVar = Character.tiltVar + (1.5 * Character.tiltSwitch);
Character.upper._y = Character.upper._y - (Character.tiltVar / 2);
Character._y = Character._y - (Character.tiltVar / 5);
} else {
Character.tiltSwitch = Character.tiltSwitch * -1;
}
}
function hitAreas(xPos, yPos) {
if (hitGround(GROUND, xPos, yPos) || (hitGround(EXPLOSIVES, xPos, yPos))) {
return(true);
}
return(false);
}
function hitGround(target, xPos, yPos) {
return(target.hitTest((xPos + _parent._x) + _x, (yPos + _parent._y) + _y, true));
}
function scrollTerrain(terrain, speed) {
speed = speed / 2;
terrain._x = terrain._x - (scrollSpeed * speed);
if ((terrain._x + _parent._x) > 0) {
terrain._x = terrain._x - (terrain._width / 2);
} else if ((terrain._x + _parent._x) < (-(terrain._width / 2))) {
terrain._x = terrain._x + (terrain._width / 2);
}
}
function newEffect(type, xPos, yPos, scale, rotate, alph) {
var _local1 = EFFECTS.attachMovie(type, "E" + EFFECTS.getNextHighestDepth(), EFFECTS.getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1._rotation = rotate;
_local1._alpha = alph;
_local1._xscale = (_local1._yscale = scale);
return(_local1);
}
function destroyMovieClip(i, array) {
array[i].removeMovieClip();
array.splice(i, 1);
}
function newBullet(xPos, yPos, type, angle) {
var _local2 = BULLETS.attachMovie("MC_Bullet_" + type, "B" + BULLETS.getNextHighestDepth(), BULLETS.getNextHighestDepth());
_local2._x = xPos;
_local2._y = yPos;
_local2._rotation = angle;
_local2.speed = calcSpeed(angle, (random(10) / 10) + 20);
this["bulletArray_" + type].push(_local2);
return(_local2);
}
function updateBullets_HeliRocket() {
var _local3 = 0;
while (_local3 < bulletArray_HeliRocket.length) {
var _local2 = bulletArray_HeliRocket[_local3];
if (hitGround(MERC, _local2._x, _local2._y)) {
_root.playSound("BANG");
newExplosion(_local2._x, _local2._y, 50);
MERC.xSpeed = MERC.xSpeed + _local2.speed.x;
destroyMovieClip(_local3, bulletArray_HeliRocket);
hurtMan(10 + random(10));
} else if (hitGround(GROUND, _local2._x, _local2._y)) {
newDamage(_local2._x, _local2._y, 50);
_root.playSound("BANG");
newExplosion(_local2._x, _local2._y, 50);
destroyMovieClip(_local3, bulletArray_HeliRocket);
}
_local2._xscale = random(40) + 80;
_local2._yscale = _local2._xscale;
if (random(_root.savefile.data.detail) == 0) {
newEffect("Smoke", _local2._x, _local2._y, 150, random(360), 20 + random(40));
}
_local2._x = _local2._x + _local2.speed.x;
_local2._y = _local2._y + _local2.speed.y;
_local3++;
}
}
function updateBullets_GruntGun() {
var _local3 = 0;
while (_local3 < bulletArray_GruntGun.length) {
var _local2 = bulletArray_GruntGun[_local3];
if (hitAreas(_local2._x, _local2._y)) {
_root.playSound("BANG");
newDamage(_local2._x, _local2._y, 50);
newExplosion(_local2._x, _local2._y, 50);
destroyMovieClip(_local3, bulletArray_GruntGun);
} else if (hitGround(MERC, _local2._x, _local2._y)) {
_root.playSound("BANG");
hurtMan(10 + random(10));
newExplosion(_local2._x, _local2._y, 50);
destroyMovieClip(_local3, bulletArray_GruntGun);
} else if (!_local2.hitTest(_root.bulletHit)) {
destroyMovieClip(_local3, bulletArray_GruntGun);
}
_local2._xscale = random(40) + 80;
_local2._yscale = _local2._xscale;
_local2._x = _local2._x - (_local2.speed.x / 2);
_local2._y = _local2._y - (_local2.speed.y / 2);
_local3++;
}
}
function hurtHeli(ammount) {
HELI.health = HELI.health - ammount;
_root.levelValue2++;
if (HELI.health <= 0) {
HELI.health = 0;
HELI.dead = true;
}
}
function updateBullets_Grenade() {
var _local3 = 0;
while (_local3 < grenadeArray.length) {
var _local2 = grenadeArray[_local3];
trace(_local2.xSpeed);
_local2._rotation = _local2._rotation + _local2.xSpeed;
if (hitAreas(_local2._x, _local2._y)) {
newDamage(_local2._x, _local2._y, 100);
_root.playSound("BANG");
newExplosion(_local2._x, _local2._y, 100);
destroyMovieClip(_local3, grenadeArray);
} else if (hitGround(HELI, _local2._x, _local2._y)) {
newExplosion(_local2._x, _local2._y, 100);
_root.playSound("BANG");
destroyMovieClip(_local3, grenadeArray);
hurtHeli(4);
HELI._alpha = 50;
} else if (hitGround(ENEMIES, _local2._x, _local2._y)) {
_root.newMedal(9);
newExplosion(_local2._x, _local2._y, 100);
_root.playSound("BANG");
cycleEnemies(_local2._x, _local2._y, 100);
destroyMovieClip(_local3, grenadeArray);
} else {
_local2._xscale = random(40) + 80;
_local2._yscale = _local2._xscale;
_local2._x = _local2._x + _local2.xSpeed;
_local2._y = _local2._y + _local2.ySpeed;
_local2.ySpeed++;
}
_local3++;
}
}
function updateBullets_Rifle() {
var _local3 = 0;
while (_local3 < bulletArray_Rifle.length) {
var _local2 = bulletArray_Rifle[_local3];
if (hitAreas(_local2._x, _local2._y)) {
newDamage(_local2._x, _local2._y, 50);
_root.playSound("BANG");
newExplosion(_local2._x, _local2._y, 50);
destroyMovieClip(_local3, bulletArray_Rifle);
} else if (hitGround(HELI, _local2._x, _local2._y)) {
newExplosion(_local2._x, _local2._y, 50);
_root.playSound("BANG");
destroyMovieClip(_local3, bulletArray_Rifle);
hurtHeli(2);
HELI._alpha = 50;
} else if (hitGround(ENEMIES, _local2._x, _local2._y)) {
newExplosion(_local2._x, _local2._y, 50);
_root.playSound("BANG");
cycleEnemies(_local2._x, _local2._y, 50);
destroyMovieClip(_local3, bulletArray_Rifle);
} else if (!_local2.hitTest(_root.bulletHit)) {
destroyMovieClip(_local3, bulletArray_Rifle);
} else {
_local2._xscale = random(40) + 80;
_local2._yscale = _local2._xscale;
_local2._x = _local2._x + (_local2.speed.x / 1.5);
_local2._y = _local2._y + (_local2.speed.y / 1.5);
}
if (hitGround(BOSS, _local2._x, _local2._y)) {
if (random(10) > 0) {
BOSS.dodgeTime = 5;
}
if (random(10) == 0) {
newExplosion(_local2._x, _local2._y, 50);
_root.playSound("BANG");
}
}
_local3++;
}
}
function updateBullets_killGunFlame() {
var _local3 = 0;
while (_local3 < bulletArray_KillGunFlame.length) {
var _local2 = bulletArray_KillGunFlame[_local3];
_local2._xscale = _local2._xscale + (random(20) - 10);
_local2._yscale = _local2._yscale + (random(20) - 10);
if (_local2._alpha < 0) {
destroyMovieClip(_local3, bulletArray_KillGunFlame);
} else if (hitAreas(_local2._x, _local2._y)) {
newDamage(_local2._x, _local2._y, 50);
newExplosion(_local2._x, _local2._y, 50);
_local2._alpha = -10;
} else if (hitGround(HELI, _local2._x, _local2._y)) {
hurtHeli(0.5);
HELI._alpha = 50;
} else if (hitGround(ENEMIES, _local2._x, _local2._y)) {
cycleEnemies(_local2._x, _local2._y, 50);
} else if (!_local2.hitTest(_root.bulletHit)) {
destroyMovieClip(_local3, bulletArray_Rifle);
} else {
_local2._xscale = random(40) + 80;
_local2._yscale = _local2._xscale;
_local2._x = _local2._x + (_local2.speed.x / 1.5);
_local2._y = _local2._y + (_local2.speed.y / 1.5);
_local2.speed.y++;
}
if (_local2._alpha == 100) {
_local2._xscale = random(50) + 50;
_local2._yscale = random(50) + 50;
_local2._alpha = 399;
_local2.speed.y = _local2.speed.y - 3;
}
_local2._alpha = _local2._alpha - 21;
_local3++;
}
}
function updateBullets_KillGun() {
var _local3 = 0;
while (_local3 < bulletArray_KillGun.length) {
var _local2 = bulletArray_KillGun[_local3];
if (hitAreas(_local2._x, _local2._y)) {
newDamage(_local2._x, _local2._y, 50);
_root.playSound("BANG");
newExplosion(_local2._x, _local2._y, 50);
destroyMovieClip(_local3, bulletArray_KillGun);
} else if (hitGround(HELI, _local2._x, _local2._y)) {
newExplosion(_local2._x, _local2._y, 50);
_root.playSound("BANG");
destroyMovieClip(_local3, bulletArray_KillGun);
hurtHeli(2);
HELI._alpha = 50;
} else if (hitGround(ENEMIES, _local2._x, _local2._y)) {
newExplosion(_local2._x, _local2._y, 50);
_root.playSound("BANG");
cycleEnemies(_local2._x, _local2._y, 50);
destroyMovieClip(_local3, bulletArray_KillGun);
} else if (!_local2.hitTest(_root.bulletHit)) {
destroyMovieClip(_local3, bulletArray_KillGun);
} else {
_local2._xscale = random(40) + 80;
_local2._yscale = _local2._xscale;
_local2._x = _local2._x + _local2.speed.x;
_local2._y = _local2._y + _local2.speed.y;
}
_local3++;
}
}
function updateBullets_KillGunRocket() {
var _local3 = 0;
while (_local3 < bulletArray_KillGunRocket.length) {
var _local2 = bulletArray_KillGunRocket[_local3];
if (hitAreas(_local2._x, _local2._y)) {
newDamage(_local2._x, _local2._y, 100);
_root.playSound("BANG");
newExplosion(_local2._x, _local2._y, 100);
destroyMovieClip(_local3, bulletArray_KillGunRocket);
} else if (hitGround(HELI, _local2._x, _local2._y)) {
newExplosion(_local2._x, _local2._y, 100);
_root.playSound("BANG");
destroyMovieClip(_local3, bulletArray_KillGunRocket);
hurtHeli(5);
HELI._alpha = 50;
} else if (hitGround(ENEMIES, _local2._x, _local2._y)) {
newExplosion(_local2._x, _local2._y, 100);
_root.playSound("BANG");
cycleEnemies(_local2._x, _local2._y, 100);
destroyMovieClip(_local3, bulletArray_KillGunRocket);
} else if (!_local2.hitTest(_root.bulletHit)) {
destroyMovieClip(_local3, bulletArray_KillGunRocket);
} else {
_local2._xscale = random(40) + 80;
_local2._yscale = _local2._xscale;
_local2._x = _local2._x + (_local2.speed.x / 2);
_local2._y = _local2._y + (_local2.speed.y / 2);
}
_local3++;
}
}
function charLean(Character) {
Character.footR._x = Character._x + 15;
Character.footL._x = Character._x - 15;
footTest(Character.footR);
footTest(Character.footL);
Character.footR._y = Character.footR._y + ((Character._y - Character.footR._y) / 2);
Character.footL._y = Character.footL._y + ((Character._y - Character.footL._y) / 2);
}
function footTest(Foot) {
if (hitGround(GROUND, Foot._x, Foot._y)) {
while (hitGround(GROUND, Foot._x, Foot._y)) {
Foot._y--;
}
Foot._y = Foot._y + 2;
}
}
function newExplosion(xPos, yPos, size) {
shakeScreen(size / 10, size / 10);
newEffect("Explosion", xPos, yPos, size, random(360), 100);
cycleExplosives(xPos, yPos, size / 1.5);
}
function newExplosive(target) {
explosiveArray.push(target);
}
function cycleExplosives(xPos, yPos, size) {
updateExplosiveFlag = 5;
var _local3 = 0;
while (_local3 < explosiveArray.length) {
var _local2 = explosiveArray[_local3];
if (_local2.hitTest(_root.bulletHit)) {
if (pythag(_local2._x, _local2._y, xPos, yPos) < size) {
_local2.killTime = 3;
}
}
_local3++;
}
}
function updateExplosives() {
if (updateExplosiveFlag > 0) {
updateExplosiveFlag--;
var _local3 = 0;
while (_local3 < explosiveArray.length) {
var _local2 = explosiveArray[_local3];
_local2.killTime--;
if (_local2.killTime == 1) {
cycleEnemies(_local2._x, _local2._y, 100);
newFragments(2, _local2._x, _local2._y, 100, 6, 5);
newDamage(bullet._x, bullet._y, 100);
_root.playSound("EXPBANG");
newExplosion(_local2._x, _local2._y, 100);
_local2.swapDepths(EXPLOSIVES.getNextHighestDepth());
destroyMovieClip(_local3, explosiveArray);
}
_local3++;
}
}
}
function newFragments(num, xPos, yPos, size, typeMin, typeRange) {
var _local3 = 0;
while (_local3 < (num * (3 / _root.savefile.data.detail))) {
var _local2 = EFFECTS.attachMovie("Swain_Debris" + (random(typeRange) + typeMin), "F" + EFFECTS.getNextHighestDepth(), EFFECTS.getNextHighestDepth());
_local2._x = xPos;
_local2._y = yPos;
_local2._xscale = size;
_local2._yscale = size;
_local2.smokeSpan = size;
_local2.spin = random(40) - 10;
_local2.xSpeed = random(40) - 20;
_local2.ySpeed = -random(20);
fragmentArray.push(_local2);
_local3++;
}
}
function updateFragments() {
if (smokeCount > 0) {
smokeCount--;
}
var _local3 = 0;
while (_local3 < fragmentArray.length) {
var _local2 = fragmentArray[_local3];
_local2._rotation = _local2._rotation + _local2.spin;
_local2._x = _local2._x + _local2.xSpeed;
_local2._y = _local2._y + _local2.ySpeed;
if (((_local2.smokeSpan > 0) && (random(_root.savefile.data.detail) == 0)) && (smokeCount < (180 / _root.savefile.data.detail))) {
newEffect("Smoke", _local2._x, _local2._y, _local2.smokeSpan + random(20), random(360), 50);
smokeCount++;
}
_local2.smokeSpan = _local2.smokeSpan - 5;
_local2.ySpeed++;
if (_local2._y > 360) {
_local2._y = 360;
_local2.xSpeed = _local2.xSpeed / 1.5;
_local2.ySpeed = _local2.ySpeed * -0.5;
_local2._xscale = _local2._xscale / 2;
_local2._yscale = _local2._yscale / 2;
if (_local2._xscale < 26) {
destroyMovieClip(_local3, fragmentArray);
_local3--;
}
}
_local3++;
}
}
function charJump(Character) {
Character.jumpSwitch = false;
if ((Character.jumpKeyPressed == true) && (Character.jumpCall == false)) {
Character.jumpCall = true;
Character.jumpSwitch = true;
} else if (Character.jumpKeyPressed == false) {
Character.jumpCall = false;
}
if ((Character.touchBuffer < 5) && (Character.jumpSwitch == true)) {
Character.ySpeed = -35;
Character.touchBuffer = 5;
}
}
function heli() {
if (_root.level1Boss == true) {
_root.HUD.gotoAndStop(5);
if (BOSS.hitTest(_root.bulletHit)) {
var _local2 = BOSS;
if (BOSS.dead == false) {
var _local4 = pythag(MERC._x, 0, _local2._x, 0);
var _local6 = pythag(0, MERC._y, 0, _local2._y);
_local2.xSpeed = _local2.xSpeed / _local2.accel;
_local2._x = _local2._x + _local2.xSpeed;
_local2._y = _local2._y + _local2.ySpeed;
_local2.ySpeed = _local2.ySpeed + 2;
if (hitAreas(_local2._x, _local2._y)) {
_local2.ySpeed = 0;
while (hitAreas(_local2._x, _local2._y)) {
_local2._y--;
}
_local2._y = _local2._y + 5;
}
if (_local2.dodgeTime > 0) {
_local2.gotoAndStop("DODGE");
_local2.health = _local2.health - 1;
if (_local2.health < 0) {
_local2.dead = true;
}
_local2.dodgeTime = _local2.dodgeTime - 2;
} else {
if (_local2.ySpeed == 0) {
_local2.gotoAndStop("WALK");
} else {
_local2.gotoAndStop("JUMP");
}
if ((_local4 > (200 + (_local2.variation / 10))) || ((_local2._x > (camPos + 300)) || (_local2._x < (camPos - 300)))) {
if (_local2._x > MERC._x) {
_local2.xSpeed = _local2.xSpeed - 1.5;
_local2.scaleStore = 1;
} else {
_local2.scaleStore = -1;
_local2.xSpeed = _local2.xSpeed + 1.5;
}
_local2._xscale = _local2.scaler * _local2.scaleStore;
} else if (_local4 >= (100 + (_local2.variation / 10))) {
_local2.xSpeed = _local2.xSpeed / 1.2;
_local2.gotoAndStop("AIM");
var _local5 = angle(_local2._x, _local2._y - 68, MERC._x, MERC._y - 45) + 90;
_local2.arm._rotation = ((_local5 * _local2.scaleStore) - 90) + (90 * _local2.scaleStore);
_local2._xscale = _local2.scaler * _local2.scaleStore;
if (_local2.Fire < 0) {
_local2.Fire = _local2.FireSpeed;
var _local3 = newBullet(_local2._x, _local2._y - 50, "GruntGun", _local5);
_local3._x = _local3._x - (_local3.speed.x * 2.5);
_local3._y = _local3._y - (_local3.speed.y * 2.5);
_local2.arm.play();
newEffect("Smoke", _local3._x, _local3._y, 280, random(360), 100);
}
_local2.Fire--;
if (_local2._x > MERC._x) {
_local2.scaleStore = 1;
} else {
_local2.scaleStore = -1;
}
_local5 = angle(_local2._x, _local2._y, MERC._x, MERC._y) + 90;
_local2.aimer._rotation = ((_local5 * _local2.scaleStore) - 90) + (90 * _local2.scaleStore);
_local2._xscale = _local2.scaler * _local2.scaleStore;
} else if (_local4 > 0) {
if (_local2._x < MERC._x) {
_local2.xSpeed--;
_local2.scaleStore = 1;
} else {
_local2.scaleStore = -1;
_local2.xSpeed++;
}
_local2._xscale = _local2.scaler * _local2.scaleStore;
}
}
if (charWall(_local2) > 0) {
_local2.ySpeed = -15;
_local2.xSpeed = (-_local2._xscale) / 20;
_local2.gotoAndStop("JUMP");
}
} else {
if (_local2.deadTimer == 0) {
_root.playSound("MANDIE");
}
_local2.deadTimer++;
_local2._xscale = _local2.scaler * _local2.dead;
_local2.gotoAndStop("DEAD");
_local2._y = _local2._y + _local2.ySpeed;
_local2._x = _local2._x + _local2.xSpeed;
_local2.ySpeed = _local2.ySpeed + 3;
_local2.xSpeed = _local2.xSpeed / 1.2;
if (_local2._y > (365 + (_local2.variation / 10))) {
_local2._y = 365 + (_local2.variation / 10);
}
if (_local2.deadTimer == 20) {
stopAllSounds();
_root.playSound("WIN");
newEffect("EOLBAR", camPos, 200, 100, -20, 140);
} else if (_local2.deadTimer > 150) {
_root.setFade(_root.whiteFade, 200);
if (_root.gameType == 1) {
_root.gotoAndStop("END");
}
}
}
}
} else if (MERC._x < 2800) {
if (HELI.active != undefined) {
if (HELI.dead == false) {
if (HELI.active == false) {
if ((MERC._x > (HELI._x - 1200)) && (HELI.scaler == false)) {
HELI.scaler = true;
_root.playSund("BANG");
newBullet(HELI._x - 500, HELI._y + 30, "HeliRocket", 180);
newBullet(HELI._x - 400, HELI._y, "HeliRocket", 180);
newBullet(HELI._x - 300, HELI._y - 30, "HeliRocket", 180);
}
if (HELI.scaler == true) {
HELI.scaleStore++;
if ((HELI.scaleStore > 50) && (HELI.scaleStore < 65)) {
GROUND.heliRock._xscale = 100;
shakeScreen(30, 4);
GROUND.heliRock._y = GROUND.heliRock._y + 8;
}
if (HELI.scaleStore == 80) {
HELI.active = true;
}
}
} else {
HELI.backBlade._rotation = HELI.backBlade._rotation + 90;
if (HELI._alpha < 100) {
HELI._alpha = HELI._alpha + 5;
}
heliRotate = angle(MERC._x, MERC._y, HELI._x, HELI._y) - 90;
if (HELI.fireTime == 0) {
HELI.fireActive = true;
HELI.fireTime = 12;
} else {
HELI.fireActive = false;
HELI.fireTime--;
}
if (HELI._x > (HELI.xPos + 500)) {
HELI.xSpeed--;
heliFireAngle = heliRotate;
HELI.fireBegin = true;
}
if (HELI._x < (MERC._x + 100)) {
HELI._rotation = HELI._rotation + 2;
if (HELI._rotation > 0) {
HELI.xSpeed++;
}
heliRotateCur = HELI._rotation;
} else if (HELI._x > (MERC._x + 300)) {
HELI.xSpeed = HELI.xSpeed - 1;
HELI._rotation = HELI._rotation - 3;
heliRotateCur = HELI._rotation;
} else {
HELI.xSpeed = HELI.xSpeed / 1.04;
if (heliRotateCur > (heliRotate + 2)) {
heliRotateCur = heliRotateCur - 2;
} else if (heliRotateCur < (heliRotate - 2)) {
heliRotateCur = heliRotateCur + 2;
}
if ((heliRotateCur < (heliRotate + 10)) && (heliRotateCur > (heliRotate - 10))) {
heliFireAngle = HELI._rotation;
HELI.fireBegin = true;
}
HELI._rotation = heliRotateCur;
}
HELI._rotation = HELI._rotation / 1.2;
HELI._x = HELI._x + HELI.xSpeed;
HELI.xSpeed = HELI.xSpeed / 1.01;
if (HELI.ySwitch == true) {
if (HELI.yTimer < 40) {
HELI.yTimer++;
HELI.ySpeed = HELI.ySpeed + 1;
} else {
HELI.yTimer = 0;
HELI.ySwitch = false;
}
} else if (HELI.yTimer < 40) {
HELI.yTimer++;
HELI.ySpeed = HELI.ySpeed - 1;
} else {
HELI.yTimer = 0;
HELI.ySwitch = true;
}
HELI.curY = HELI.curY + HELI.ySpeed;
HELI._y = HELI.yPos + ((HELI.ySpeed + HELI.yDest) / 1.1);
if (HELI._x < HELI.xPos) {
HELI.xSpeed = HELI.xSpeed + 4;
}
if (HELI._x > (HELI.xPos + 900)) {
HELI._x = HELI.xPos + 900;
HELI.xSpeed = HELI.xSpeed / 1.1;
if (HELI._y > (HELI.yPos - 200)) {
HELI.yDest = HELI.yDest - 5;
}
} else if (HELI.yDest < 0) {
HELI.yDest = HELI.yDest + 5;
}
if ((HELI.fireActive == true) && (HELI.fireBegin == true)) {
HELI.fireBegin = false;
newExplosion(HELI._x, HELI._y, 30);
newBullet(HELI._x, HELI._y, "HeliRocket", (heliFireAngle + 175) + random(10));
}
}
} else {
HELI._x = HELI._x + HELI.deadSpeed;
HELI.deadSpeed = HELI.deadSpeed + 0.3;
if (HELI.deadSpeed < 30) {
if (random(3) == 0) {
_root.playSound("EXPBANG");
newExplosion((HELI._x + random(150)) - 75, (HELI._y + random(80)) - 40, 100);
}
} else if ((HELI.deadSpeed > 55) && (EOL != true)) {
EOL = true;
stopAllSounds();
_root.playSound("WIN");
_root.setFade(_root.whiteFade, 100);
newEffect("EOLBAR", camPos, 200, 100, -20, 140);
} else if (HELI.deadSpeed > 80) {
_root.setFade(_root.whiteFade, 200);
if (_root.gameType == 1) {
_root.gotoAndStop("CS2");
}
}
HELI._rotation = HELI.deadSpeed / 2;
}
}
}
}
function hurtMan(ammount) {
ammount = ammount / 1.3;
if (healthInvTime == 0) {
_root.setFade(_root.redFade, 80);
health = health - ((ammount * _root.difficulty) / 1.5);
healthBuffer = 0;
healthInvTime = healthInvMax;
if (health <= 0) {
if (MERC.dead == false) {
MERC.ySpeed = -10;
MERC.dead = true;
}
health = 0;
}
}
}
function updateHealth() {
_root.health = health;
_root.healthBuffer = healthBuffer;
if (healthInvTime > 0) {
healthInvTime--;
MERC._alpha = MERC._alpha * -1;
} else {
MERC._alpha = 100;
}
if ((healthBuffer == healthBufferMax) && (health < 100)) {
health = health + 0.5;
} else if (healthBuffer < healthBufferMax) {
healthBuffer = healthBuffer + 0.5;
}
_root.HUD.hBar._xscale = health;
if (_root.HUD.hBar._xscale < 40) {
_root.HUD.hBar._alpha = _root.HUD.hBar._alpha * -1;
} else {
_root.HUD.hBar._alpha = 100;
}
_root.HUD.hCharge._xscale = healthBuffer;
}
function updateLevel() {
if (camPos < 2200) {
_root.HUD.enemyCount = killCount;
_root.HUD.enemyCountMax = killCountMax + 1;
} else {
_root.HUD.enemyCount = Math.ceil(HELI.health);
_root.HUD.enemyCountMax = HELI.maxHealth;
}
if (killCount > killCountMax) {
if (camLock == true) {
levelExtend = levelExtend + 500;
signActive = true;
camLock = false;
}
}
}
function camControl() {
updateLevel();
if (camLock == false) {
if (MERC._x > camPos) {
camPos = MERC._x;
}
if (camPos > (levelPos + levelExtend)) {
camPos = levelPos + levelExtend;
killCount = 0;
if (camPos > 2200) {
camPos = camPos + 100;
_root.HUD.iconHeli._visible = true;
spawnCount = 1000;
} else {
spawnCount = 0;
}
if (killCountMax == 0) {
killCountMax = 9;
} else {
killCountMax = killCountMax + 2;
}
camLock = true;
signActive = false;
}
}
var _local3 = _parent._x;
camPosS = camPosS + ((camPos - camPosS) / 5);
_parent._x = _parent._x - (((_parent._x + camPosS) - 325) / 5);
scrollSpeed = _local3 - _parent._x;
}
function newGrunt() {
var _local1 = ENEMIES.attachMovie("Enemy_Grunt", "E" + ENEMIES.getNextHighestDepth(), ENEMIES.getNextHighestDepth());
var _local2 = random(2);
if (MERC._x > -1800) {
if (_local2 == 0) {
_local1._x = camPos + 400;
} else {
_local1._x = camPos - 400;
}
} else {
_local1._x = camPos + 400;
}
_local1._y = 200;
_local1.wid = _local1._width;
_local1.hei = _local1._height;
_local1.ySpeed = 0;
_local1.xSpeed = 0;
_local1.FireSpeed = random(10) + 20;
_local1.variation = random(100);
_local1.Fire = _local1.FireSpeed / 2;
_local1._xscale = 110;
_local1._yscale = _local1._xscale;
_local1.scaler = _local1._xscale;
_local1.deadTimer = 0;
_local1.accel = (random(10) / 100) + 1.2;
gruntArray.push(_local1);
}
function updateGrunts() {
if ((spawnCount <= killCountMax) && (killCountMax > 0)) {
if (activeGrunts < 8) {
if (gruntTimer == 0) {
gruntTimer = 8 + random(10);
spawnCount++;
activeGrunts++;
newGrunt();
} else {
gruntTimer--;
}
}
}
var _local4 = 0;
while (_local4 < gruntArray.length) {
var _local2 = gruntArray[_local4];
if (_local2.dead == undefined) {
var _local5 = pythag(MERC._x, 0, _local2._x, 0);
var _local7 = pythag(0, MERC._y, 0, _local2._y);
_local2.xSpeed = _local2.xSpeed / _local2.accel;
_local2._x = _local2._x + _local2.xSpeed;
_local2._y = _local2._y + _local2.ySpeed;
_local2.ySpeed = _local2.ySpeed + 2;
if (hitAreas(_local2._x, _local2._y)) {
_local2.ySpeed = 0;
while (hitAreas(_local2._x, _local2._y)) {
_local2._y--;
}
_local2._y = _local2._y + 5;
}
if (_local2.ySpeed == 0) {
_local2.gotoAndStop("RUN");
} else {
_local2.gotoAndStop("JUMP");
}
if ((_local5 > (200 + (_local2.variation / 10))) || ((_local2._x > (camPos + 300)) || (_local2._x < (camPos - 300)))) {
if (_local2._x > MERC._x) {
_local2.xSpeed = _local2.xSpeed - 1.5;
_local2.scaleStore = 1;
} else {
_local2.scaleStore = -1;
_local2.xSpeed = _local2.xSpeed + 1.5;
}
_local2._xscale = _local2.scaler * _local2.scaleStore;
} else if (_local5 >= (100 + (_local2.variation / 10))) {
_local2.xSpeed = _local2.xSpeed / 1.2;
_local2.gotoAndStop("SHOOT");
if (_local2._x > MERC._x) {
_local2.scaleStore = 1;
} else {
_local2.scaleStore = -1;
}
var _local6 = angle(_local2._x, _local2._y, MERC._x, MERC._y) + 90;
_local2.aimer._rotation = ((_local6 * _local2.scaleStore) - 90) + (90 * _local2.scaleStore);
_local2._xscale = _local2.scaler * _local2.scaleStore;
if (_local2.Fire < 0) {
_local2.Fire = _local2.FireSpeed;
var _local3 = newBullet(_local2._x, _local2._y - 40, "GruntGun", _local6);
_local3._x = _local3._x - (_local3.speed.x * 2.5);
_local3._y = _local3._y - (_local3.speed.y * 2.5);
newEffect("Smoke", _local3._x, _local3._y, 150, random(360), 50);
}
_local2.Fire--;
} else if (_local5 > 0) {
if (_local2._x < MERC._x) {
_local2.xSpeed--;
_local2.scaleStore = 1;
} else {
_local2.scaleStore = -1;
_local2.xSpeed++;
}
_local2._xscale = _local2.scaler * _local2.scaleStore;
}
if (charWall(_local2) > 0) {
_local2.ySpeed = -15;
_local2.xSpeed = (-_local2._xscale) / 20;
_local2.gotoAndStop("JUMP");
}
} else {
if (_local2.deadTimer == 0) {
killCount++;
activeGrunts--;
_root.levelValue2++;
if (random(10) == 0) {
if (killGunAmmo < 10) {
newKillGun(_local2._x, _local2._y - 35);
}
}
}
_local2.deadTimer++;
_local2._xscale = _local2.scaler * _local2.dead;
_local2.gotoAndStop("DEAD");
_local2._y = _local2._y + _local2.ySpeed;
_local2._x = _local2._x + _local2.xSpeed;
_local2.ySpeed = _local2.ySpeed + 3;
_local2.xSpeed = _local2.xSpeed / 1.2;
if (_local2._y > (365 + (_local2.variation / 10))) {
_local2._y = 365 + (_local2.variation / 10);
}
if (_local2.deadTimer > 60) {
_local2._alpha = _local2._alpha - 10;
if (_local2._alpha < 10) {
destroyMovieClip(_local4, gruntArray);
}
}
}
_local4++;
}
}
function cycleEnemies(xPos, yPos, size) {
var _local5 = 0;
while (_local5 < enemyArray.length) {
var _local3 = 0;
while (_local3 < enemyArray[_local5].length) {
var _local2 = enemyArray[_local5][_local3];
if (_local2.dead == undefined) {
if (_local2.hitTest(_root.bulletHit)) {
if (pythag(_local2._x, _local2._y - 35, xPos, yPos) < size) {
_local2.ySpeed = (-10 * size) / 40;
var _local4 = (random(400) / 100) + 5;
if (_local2._x > MERC._x) {
_local2.xSpeed = _local4;
} else {
_local2.xSpeed = -_local4;
}
if (xPos > _local2._x) {
_local2.dead = -1;
} else {
_local2.dead = 1;
}
}
}
}
_local3++;
}
_local5++;
}
}
function addEnemyCol(target) {
var _local1 = ENEMIES.attachMovie("Enemy_ColS", "E" + ENEMIES.getNextHighestDepth(), ENEMIES.getNextHighestDepth());
_local1._x = target._x;
_local1._y = target._y;
_local1._xscale = target._xscale;
_local1._yscale = target._yscale;
_local1.FireSpeed = 20 + random(10);
_local1.Fire = _local1.FireSpeed / 2;
_local1.variation = random(100);
_local1.scaleStore = 1;
_local1.deadTimer = 0;
colArray.push(_local1);
}
function updateCols() {
var _local4 = 0;
while (_local4 < colArray.length) {
var _local2 = colArray[_local4];
if (_local2.hitTest(_root.bulletHit)) {
if (_local2.dead == undefined) {
var _local6 = pythag(MERC._x, 0, _local2._x, 0);
if (MERC._x > _local2._x) {
_local2.scaleStore = -1;
} else {
_local2.scaleStore = 1;
}
_local2._xscale = 110 * _local2.scaleStore;
if (_local2._x > MERC._x) {
_local2.scaleStore = 1;
} else {
_local2.scaleStore = -1;
}
var _local5 = angle(_local2._x, _local2._y - 68, MERC._x, MERC._y - 45) + 90;
_local2.arm._rotation = ((_local5 * _local2.scaleStore) - 90) + (90 * _local2.scaleStore);
_local2._xscale = _local2.scaler * _local2.scaleStore;
if (_local2.Fire < 0) {
_local2.Fire = _local2.FireSpeed;
var _local3 = newBullet(_local2._x, _local2._y - 68, "GruntGun", _local5);
_local3._x = _local3._x - (_local3.speed.x * 2.5);
_local3._y = _local3._y - (_local3.speed.y * 2.5);
_local2.arm.play();
newEffect("Smoke", _local3._x, _local3._y, 150, random(360), 50);
}
_local2.Fire--;
} else {
if (_local2.deadTimer == 0) {
_root.levelValue2++;
_root.playSound("MANDIE");
}
_local2.deadTimer++;
_local2._xscale = _local2.scaler * _local2.dead;
_local2.gotoAndStop("DEAD");
_local2._y = _local2._y + _local2.ySpeed;
_local2._x = _local2._x + _local2.xSpeed;
_local2.ySpeed = _local2.ySpeed + 3;
_local2.xSpeed = _local2.xSpeed / 1.2;
if (_local2._y > (365 + (_local2.variation / 10))) {
_local2._y = 365 + (_local2.variation / 10);
}
if (_local2.deadTimer > 60) {
_local2._alpha = _local2._alpha - 10;
if (_local2._alpha < 80) {
destroyMovieClip(_local4, colArray);
}
}
}
}
_local4++;
}
}
function updateSign() {
if (signActive == true) {
if (signSwitch == false) {
signSway = signSway + 1;
if (signSway > 10) {
signSwitch = true;
}
} else {
signSway = signSway - 1;
if (signSway < -10) {
signSwitch = false;
}
}
signTime--;
if ((signRot < 360) && (signRot != 0)) {
signRot = signRot + 9;
signSway = 0;
} else {
signRot = 0;
}
} else {
signSway = 0;
if (signRot < 180) {
signRot = signRot + 9;
}
}
_root.HUD.SIGN._rotation = signRot + signSway;
}
function newKillGun(xPos, yPos) {
var _local1 = EFFECTS.attachMovie("Item Ammo", "IA" + EFFECTS.getNextHighestDepth(), EFFECTS.getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1.ID = random(3) + 1;
_local1.gotoAndStop(_local1.ID);
itemArray.push(_local1);
}
function updateKillGunItem() {
var _local3 = 0;
while (_local3 < itemArray.length) {
var _local2 = itemArray[_local3];
_local2._rotation = _local2._rotation + 10;
_local2._xscale = 100 + (_local2._rotation / 50);
_local2._yscale = _local2._xscale;
if (_local2.hit.hitTest(MERC)) {
newEffect("Effect_Ring", _local2._x, _local2._y, 100, 0, 200);
_root.playSound("GETAMMO");
if (_local2.ID == 4) {
grenadeAmmo = 10;
} else {
killGunAmmo = 30;
killGunID = _local2.ID;
_root.HUD.itemIcon._visible = true;
_root.HUD.itemIcon.gotoAndStop(_local2.ID);
}
destroyMovieClip(_local3, itemArray);
} else if (!_local2.hitTest(_root.bulletHit)) {
destroyMovieClip(_local3, itemArray);
}
_local3++;
}
}
_root.setMusic("GAME");
_root.levelValue1 = 0;
_root.levelValue2 = 0;
if (_root.level1Boss == true) {
MERC._x = 3000;
HELI._y = HELI._y - 1000;
}
var mousePressed = false;
createEmptyMovieClip("ENEMIES", getNextHighestDepth());
createEmptyMovieClip("EFFECTS", getNextHighestDepth());
G_Visual.damaged.setMask(G_Visual.damagedMask);
var killGunAmmo = 0;
var damageArray = new Array();
var grneadeSwitch = false;
damageCleaner = 48;
var grenadeTimer = 0;
var mercTopOffset = 0;
var grenadeArray = new Array();
var grenadeAmmo = 10;
var mercSwipe = 0;
var killGunAlt = 0;
var killGunID = 3;
var screenShake = 0;
var shakeTime = 1;
shakeDir = 1;
_root.HUD.ARWARN._visible = false;
var strikeTimer = ((strikeTimer = 200 + random(200)));
MERC.xSpeed = 0;
MERC.ySpeed = 0;
MERC.upperPos = MERC.upper._y;
MERC.tiltSwitch = 1;
MERC.tiltVar = 0;
MERC.leanVar = 0;
MERC.scaler = MERC._xscale;
MERC.wid = MERC._width;
MERC.hei = MERC._height;
MERC.scaleStore = 1;
MERC.walkCycle = 1;
MERC.deadTime = 0;
var bulletArray_Rifle = new Array();
var bulletArray_HeliRocket = new Array();
var bulletArray_GruntGun = new Array();
createEmptyMovieClip("BULLETS", getNextHighestDepth());
var bulletArray_KillGun = new Array();
var bulletArray_KillGunFlame = new Array();
var bulletArray_KillGunRocket = new Array();
var explosiveArray = new Array();
var updateExplosiveFlag = 0;
var fragmentArray = new Array();
var smokeCount = 0;
HELI.xSpeed = 0;
HELI.ySpeed = 0;
HELI.scaler = false;
HELI.scaleStore = 1;
HELI.ySwitch = 1;
HELI.yTimer = 0;
HELI.xPos = HELI._x;
HELI.yPos = HELI._y;
HELI.curY = HELI._y;
if (_root.difficulty > 1) {
HELI.maxHealth = 50;
} else {
HELI.maxHealth = 80;
}
HELI.health = HELI.maxHealth;
HELI.yDest = 0;
HELI.dead = false;
HELI.fireTime = 0;
HELI.deadSpeed = -10;
HELI._x = HELI._x + 1100;
HELI.active = false;
BOSS.ySpeed = 0;
BOSS.xSpeed = 0;
BOSS.Fire = 0;
BOSS.FireSpeed = 5;
BOSS.variation = 1;
BOSS.scaler = BOSS._xscale;
BOSS.scaleStore = 1;
BOSS.dead = false;
BOSS.deadTimer = 0;
BOSS.accel = 1.2;
BOSS.dodgeTimer = 0;
if (_root.difficulty < 1) {
BOSS.health = 100;
} else {
BOSS.health = 140;
}
GROUND.heliRock._xscale = 0;
health = 100;
healthBuffer = 0;
healthInvTime = 0;
healthInvMax = 20;
healthBufferMax = 100;
MERC.dead = false;
var levelPos = MERC._x;
var levelExtend = 500;
var killCount = 0;
var spawnCount = 0;
var killCountMax = 0;
var killCountIncrease = 1.2;
var camPos = MERC._x;
var camPosS = camPos;
var camLock = false;
var gruntArray = new Array();
var gruntTimer = 0;
var activeGrunts = 0;
var colArray = new Array();
var enemyArray = new Array(gruntArray, colArray);
var signActive = false;
var signRot = 0;
var signSwitch = false;
var signSway = 0;
var itemArray = new Array();
camPosS = camPosS + ((camPos - camPosS) / 1);
_parent._x = _parent._x - (((_parent._x + camPosS) - 325) / 1);
Symbol 638 MovieClip Frame 1
_visible = false;
Symbol 659 MovieClip Frame 1
stop();
Symbol 663 MovieClip Frame 1
gotoAndStop(_root.levelNo);
stop();
Symbol 666 Button
on (release) {
nextFrame();
}
Symbol 669 Button
on (release) {
_root.setFade(_root.whiteFade, 200);
_root.menuPos = 0;
_root.gotoAndStop("TITLE");
}
Symbol 670 Button
on (release) {
prevFrame();
}
Symbol 674 MovieClip Frame 1
stop();
Symbol 679 Button
on (release) {
gotoAndStop ("CHANGE");
}
Symbol 684 Button
on (release) {
_root.rightKey = 68;
_root.rightKey2 = 39;
_root.leftKey = 65;
_root.leftKey2 = 37;
_root.upKey = 38;
_root.upKey2 = 87;
_root.downKey = 40;
_root.downKey2 = 83;
_root.jumpKey = 90;
_root.jumpKey2 = 76;
_root.shootKey = 88;
_root.shootKey2 = 75;
_root.grenadeKey = 67;
_root.grenadeKey2 = 74;
_root.mouseControl = false;
_root.controlDesc = "OLD SCHOOL";
savefile.data.controltype = false;
_root.customControls = false;
if (_root._currentframe > 6) {
_root.setFade(_root.whiteFade, 200);
_root.gotoAndStop("LEVEL" + _root.levelNo);
} else {
_parent.gotoAndStop(1);
}
}
Symbol 685 Button
on (release) {
_root.rightKey = 68;
_root.rightKey2 = 39;
_root.leftKey = 65;
_root.leftKey2 = 37;
_root.upKey = 38;
_root.upKey2 = 87;
_root.downKey = 186;
_root.downKey2 = 186;
_root.jumpKey = _root.upKey;
_root.jumpKey2 = _root.upKey2;
_root.shootKey = 186;
_root.shootKey2 = 186;
_root.grenadeKey = 32;
_root.grenadeKey2 = 32;
_root.mouseControl = true;
_root.controlDesc = "NEXT GEN";
savefile.data.controltype = true;
_root.customControls = false;
if (_root._currentframe > 6) {
_root.setFade(_root.whiteFade, 200);
_root.gotoAndStop("LEVEL" + _root.levelNo);
} else {
_parent.gotoAndStop(1);
}
}
Symbol 691 Button
on (release) {
_root.customControls = true;
_root.mouseControl = false;
gotoAndStop ("RESET");
}
Symbol 712 Button
on (release) {
_parent.controlMC.saveConfig();
}
Symbol 714 Button
on (release) {
_parent.gotoAndStop("RESET");
}
Symbol 716 Button
on (release) {
_parent.gotoAndStop(1);
}
Symbol 720 Button
on (release) {
_root.mouseControl = true;
}
Symbol 724 MovieClip Frame 1
stop();
Instance of Symbol 501 MovieClip in Symbol 724 MovieClip Frame 1
onClipEvent (load) {
nextFrame();
}
Instance of Symbol 41 MovieClip in Symbol 724 MovieClip Frame 2
on (release) {
}
Instance of Symbol 41 MovieClip "controlMC" in Symbol 724 MovieClip Frame 2
onClipEvent (load) {
function checkChar(char) {
trace("Checking Character: " + char);
if ((char > 47) && (char < 58)) {
descReturn = numberNames[char - 48];
return(true);
}
trace("Number not found");
if (((char > 64) && (char < 91)) && (char != 80)) {
descReturn = letterNames[char - 65];
return(true);
}
trace("Letter not found");
var _local1 = 0;
while (_local1 < keyNameRef.length) {
if (char == keyNameRef[_local1]) {
descReturn = keyNames[_local1];
return(true);
}
_local1++;
}
trace("Extended not found");
return(false);
}
function saveConfig() {
_root.rightKey = (_root.savefile.data.rightKey = keyStore[0]);
_root.leftKey = (_root.savefile.data.leftKey = keyStore[1]);
if (_root.mouseControl == false) {
_root.upKey = (_root.savefile.data.upKey = keyStore[2]);
_root.downKey = (_root.savefile.data.downKey = keyStore[3]);
_root.shootKey = (_root.savefile.data.shootKey = keyStore[4]);
} else {
_root.upKey = (_root.savefile.data.upKey = 0);
_root.downKey = (_root.savefile.data.downKey = 0);
_root.shootKey = (_root.savefile.data.shootKey = 0);
}
_root.jumpKey = (_root.savefile.data.jumpKey = keyStore[5]);
_root.grenadeKey = (_root.savefile.data.grenadeKey = keyStore[6]);
_root.savefile.data.rightKeyDesc = nameStore[0];
_root.savefile.data.leftKeyDesc = nameStore[1];
_root.savefile.data.upKeyDesc = nameStore[2];
_root.savefile.data.downKeyDesc = nameStore[3];
_root.savefile.data.jumpKeyDesc = nameStore[4];
_root.savefile.data.shootKeyDesc = nameStore[5];
_root.savefile.data.grenadeKeyDesc = nameStore[6];
_root.savefile.flush();
if (_root._currentframe > 6) {
_root.gotoAndStop("Level1");
} else {
_parent._parent.gotoAndStop(1);
}
_parent.gotoAndStop(1);
}
var keyNames = new Array("Backspace", "Tab", "Enter", "Shift", "Control", "Caps Lock", "Spacebar", "Page Up", "Page Down", "End", "Home", "Left Arrow", "Up Arrow", "Right Arrow", "Down Arrow", "Insert", "Delete");
var keyNameRef = new Array(8, 9, 13, 16, 17, 20, 32, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46);
var numberNames = new Array("ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE");
var letterNames = new Array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z");
var descArray = new Array("WALK RIGHT", "WALK LEFT", "AIM UP", "AIM DOWN", "SHOOT", "JUMP", "GRENADES");
var descVar = new Array("rightKey", "leftKey", "upKey", "downKey", "shootKey", "jumpKey", "grenadeKey");
var descCount = 0;
var keyCheck = false;
confirmBoxY = _parent.confirmBox._y;
_parent.confirmBox._y = _parent.confirmBox._y - 2000;
var keyStore = new Array();
var nameStore = new Array();
var i = 0;
while (i < 7) {
_parent["text_" + descVar[i]] = _root.savefile.data["desc_" + descVar[i]];
i++;
}
var descReturn;
var lastCode = Key.getCode();
}
onClipEvent (keyDown) {
var kp = Key.getCode();
if (keyLock == false) {
keyLock = true;
if (Key.isDown(27)) {
_parent.gotoAndStop(1);
}
lastCode = kp;
if (checkChar(kp) == true) {
nameStore[descCount] = descReturn;
keyStore[descCount] = kp;
_parent["text_" + descVar[descCount]] = descReturn;
descCount++;
}
}
}
onClipEvent (enterFrame) {
if (_root.mouseControl == true) {
_parent.MOUSELOOK = "ON";
_parent.text_upKey = "MOUSE";
_parent.text_downKey = "MOUSE";
_parent.text_shootKey = "CLICK";
_parent.CBlock._visible = true;
} else {
_parent.MOUSELOOK = "OFF";
_parent.CBlock._visible = false;
}
if (!Key.isDown(lastCode)) {
keyLock = false;
}
while ((_parent["text_" + descVar[descCount]] == "MOUSE") || (_parent["text_" + descVar[descCount]] == "CLICK")) {
descCount++;
}
_parent["text_" + descVar[descCount]] = "PRESS KEY";
if (descCount >= 7) {
if (_parent.descText != "CONFIRM KEY CONFIG") {
_parent.confirmBox._y = confirmBoxY;
}
descCount = 7;
_parent.descText = "CONFIRM KEY CONFIG";
} else {
_parent.descText = "PRESS KEY TO ASSIGN IT TO " + descArray[descCount];
}
}
Symbol 724 MovieClip Frame 3
_root.mouseControl = false;
prevFrame();
Symbol 725 MovieClip Frame 1
gotoAndStop(_root.levelNo);
Symbol 726 MovieClip Frame 1
stop();
Symbol 726 MovieClip Frame 2
function onEnterFrame() {
}
Symbol 738 MovieClip Frame 1
stop();
Symbol 755 Button
on (release) {
_parent.gameStart = true;
swapDepths(666);
this.removeMovieClip();
}
Symbol 757 MovieClip Frame 1
stop();
Symbol 768 MovieClip Frame 1
function pythag(x1, y1, x2, y2) {
return(Math.sqrt(Math.pow(y1 - y2, 2) + Math.pow(x1 - x2, 2)));
}
function angle(x1, y1, x2, y2) {
return(Math.round((Math.atan2(y2 - y1, x2 - x1) / 3.141593) * 180) + 90);
}
function calcSpeed(angle, speed) {
var _local2 = angle * 0.01745329;
var _local1 = new Object();
_local1.x = speed * Math.cos(_local2);
_local1.y = speed * Math.sin(_local2);
return(_local1);
}
function rotatedXY(xPos, yPos, rotate) {
var _local1 = new Object();
var _local2 = 0.0174444444444444 * rotate;
var _local4 = Math.sin(_local2);
var _local3 = Math.cos(_local2);
_local1.x = (xPos * _local3) - (yPos * _local4);
_local1.y = (xPos * _local4) + (yPos * _local3);
return(_local1);
}
function onMouseDown() {
if (gameStart == true) {
shoot = true;
}
}
function rockControl() {
if (gameStart == true) {
_root.gameTimer++;
rockMarker._visible = false;
if (rockTimer > 0) {
rockTimer--;
rockMarker._visible = false;
} else {
rockActive = true;
}
if (ROCK._x < -100) {
rockActive = false;
ROCK._x = 2000;
ROCK.gotoAndStop(random(4) + 1);
rockTimer = random(50) + 150;
} else if (rockActive == true) {
ROCK._x = ROCK._x - 35;
rockMarker._visible = true;
rockMarker.warnText = Math.round((ROCK._x - 700) / 10);
if (ROCK._x < 700) {
rockMarker._visible = false;
}
} else {
rockMarker._visible = false;
}
}
}
function onEnterFrame() {
if (_root.gamePaused == false) {
updateEnemyBullets();
if ((gameStart == true) && (blimpDead == false)) {
if (_root.difficulty > 1) {
fuel = fuel - 2;
} else {
fuel = fuel - 1;
}
}
if (fuel < 0) {
fuel = 0;
TANK._visible = false;
deadTimerTank++;
if (deadTimerTank == 130) {
_root.setFade(_root.redFade, 200);
_root.gotoAndStop("RELOAD");
}
if (random(3) == 0) {
newExplosion((TANK._x + random(40)) - 20, (TANK._y + random(20)) - 10, 100, random(360), 100);
}
}
if (fuel < 800) {
_root.HUD.fBar._xscale = 0.355 * fuel;
}
if (gameStart == true) {
if (blimpActive == false) {
if (random(120) == 0) {
newTank();
}
if (random(80) == 0) {
newHeli();
}
if (Progress.TANK._x > 500) {
Progress._y = Progress._y + ((-25 - Progress._y) / 10);
if (Progress._y > -20) {
blimpActive = true;
BLIMP._visible = true;
BLIMP._xscale = 167;
BLIMP._yscale = 167;
Progress._visible = false;
}
} else {
Progress.TANK._x = Progress.TANK._x + 0.5;
Progress._visible = true;
}
} else {
rockTimer = 100;
if (rockMedal == true) {
_root.newMedal(10);
}
if (blimpDead == false) {
if (blimpFuelTimer == 70) {
blimpFuelTimer = 0;
newFuel(BLIMP._x - 40, BLIMP._y - 20);
} else {
blimpFuelTimer++;
}
BLIMP.gun._rotation = angle(TANK._x, TANK._y, BLIMP._x, BLIMP._y) + 90;
if (blimpHeight < 150) {
blimpHeight++;
}
if (random(100) == 0) {
blimpXPos = random(500) + 75;
}
BLIMP._x = BLIMP._x + ((blimpXPos - BLIMP._x) / 10);
if (blimpYSwitch == true) {
if (blimpYSpeed < 10) {
blimpYSpeed = blimpYSpeed + 0.5;
} else {
blimpYSwitch = false;
}
} else if (blimpYSpeed > -10) {
blimpYSpeed = blimpYSpeed - 0.5;
} else {
blimpYSwitch = true;
}
BLIMP._y = blimpHeight + blimpYSpeed;
var _local5 = angle(BLIMP._x, BLIMP._y, TANK._x, TANK._y) - 90;
if (random(20) == 0) {
_root.playSound("SHOT");
newEnemyBullet(BLIMP._x, BLIMP._y, _local5);
}
} else {
blimpTimer++;
if (blimpTimer < 100) {
if (random(3) == 0) {
newExplosion((BLIMP._x + random(180)) - 90, BLIMP._y - random(30), 100);
}
if (random(5) == 0) {
newFragments(6 - _root.savefile.data.QualityV, (BLIMP._x + random(180)) - 90, BLIMP._y - random(30));
}
} else if (blimpTimer == 180) {
_root.setFade(_root.whiteFade, 200);
_root.levelNo = 3;
_root.gotoAndStop("CS3");
}
}
}
}
updateShake();
updateFuel();
if ((Key.isDown(38) || (Key.isDown(87))) && (jumpSwitch == false)) {
jumpSwitch = true;
newExplosion(TANK._x, TANK._y + 20, 50);
ySpeed = -30;
if (gameStart == true) {
fuel = fuel - 20;
}
spin = 5;
} else if ((!Key.isDown(38)) && (!Key.isDown(87))) {
jumpSwitch = false;
}
rockControl();
if (TANK._y < -20) {
marker._visible = true;
marker._x = TANK._x;
} else {
marker._visible = false;
}
updateTank();
updateHeli();
scrollTerrain(G_Grassline, 60);
scrollTerrain(G_Treeline, 20);
scrollTerrain(G_Treeline2, 10);
scrollTerrain(G_Cityline, 5);
scrollTerrain(G_Sky, 1);
updateBullets();
updateFragments();
TANK._rotation = TANK._rotation + spin;
spin = spin / 1.05;
var _local4 = (angle(TANK._x, TANK._y, _xmouse, _ymouse) + 360) - TANK._rotation;
if (_local4 > 600) {
_local4 = _local4 - 360;
}
TANK.barrel._rotation = _local4;
if (TANK.hitTest(ROCK.hit)) {
rockMedal = false;
xSpeed = -20;
ySpeed = -20;
spin = 40;
fuel = fuel - 20;
_root.setFade(_root.redFade, 75);
newFragments(6 - _root.savefile.data.QualityV, TANK._x, TANK._y);
newExplosion((TANK._x + random(60)) - 30, (TANK._y + random(40)) - 20, 100);
}
if (TANK.barrel._rotation > 95) {
TANK.barrel._rotation = 95;
} else if (TANK.barrel._rotation < -95) {
TANK.barrel._rotation = -95;
}
if (TANK.barrel._rotation < 0) {
TANK.Top._xscale = -100;
} else {
TANK.Top._xscale = 100;
}
if (Key.isDown(39) || (Key.isDown(68))) {
xSpeed = xSpeed + 3;
TANK._rotation++;
} else if (Key.isDown(37) || (Key.isDown(65))) {
xSpeed = xSpeed - 3;
} else if (gameStart == true) {
xSpeed = xSpeed - 0.5;
}
xSpeed = xSpeed / 1.1;
TANK._x = TANK._x + xSpeed;
if (TANK._x < 0) {
xSpeed = 0;
TANK._x = 0;
} else if (TANK._x > 650) {
xSpeed = 0;
TANK._x = 650;
}
var _local2 = 0;
while (_local2 < 6) {
TANK["w" + _local2]._rotation = TANK["w" + _local2]._rotation + (20 + (xSpeed * 2));
_local2++;
}
ySpeed = ySpeed + 3;
TANK._y = TANK._y + ySpeed;
if (TANK._y > groundPos) {
TANK._rotation = TANK._rotation / 1.4;
spin = spin / 1.4;
xSpeed = xSpeed / 1.1;
ySpeed = (-ySpeed) / 1.5;
if (Math.round(ySpeed / 4) == 0) {
ySpeed = 0;
}
TANK._y = groundPos;
}
if (shoot == true) {
shoot = false;
_root.levelValue1++;
var _local3 = newBullet(TANK._x, TANK._y, (TANK.barrel._rotation + TANK._rotation) - 90);
_local3._x = _local3._x + (_local3.speed.x * 3);
_local3._y = _local3._y + (_local3.speed.y * 3);
_root.playound("BANG");
newExplosion(_local3._x, _local3._y, 40);
}
}
}
function scrollTerrain(terrain, speed) {
terrain._x = terrain._x - speed;
if (terrain._x < (-100 - (terrain._width / 2))) {
terrain._x = terrain._x + (terrain._width / 2);
}
}
function newBullet(xPos, yPos, angle) {
var _local1 = BULLETS.attachMovie("MC_Bullet_HeliRocket", "B" + BULLETS.getNextHighestDepth(), BULLETS.getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1._xscale = 60;
_local1._yscale = 60;
_local1.dead = false;
_local1._rotation = angle;
_local1.speed = calcSpeed(angle, (random(10) / 10) + 20);
bulletArray.push(_local1);
return(_local1);
}
function updateBullets() {
var _local3 = 0;
while (_local3 < bulletArray.length) {
var _local2 = bulletArray[_local3];
if (random(_root.savefile.data.detail) == 0) {
newEffect("Smoke", _local2._x, _local2._y, 150, random(360), 20 + random(40));
}
cycleEnemies(_local2._x, _local2._y, 60, _local2);
if (_local2.hitTest(BLIMP.hit)) {
BLIMP.health = BLIMP.health - 10;
if (BLIMP.health < 0) {
newExplosion((_local2._x + random(100)) - 50, _local2._y - random(50), 150 + random(20));
newFragments(5, _local2._x, _local2._y);
BLIMP._visible = false;
BLIMP._xscale = 0;
BLIMP._yscale = 0;
blimpDead = true;
}
newExplosion(_local2._x, _local2._y, 150 + random(20));
newFragments(5, _local2._x, _local2._y);
_local2.dead = true;
}
if (_local2._y > (groundPos + 20)) {
_local2.dead = true;
newExplosion(_local2._x, _local2._y, 60);
} else if (((_local2._x < -20) || (_local2._x > 670)) || (_local2._y < -20)) {
_local2.dead = true;
}
_local2._x = _local2._x + _local2.speed.x;
_local2._y = _local2._y + _local2.speed.y;
if (_local2.dead == true) {
destroyMovieClip(_local3, bulletArray);
_local3--;
}
_local3++;
}
}
function newTank() {
var _local1 = ENEMY.attachMovie("L2TANK", "T" + ENEMY.getNextHighestDepth(), ENEMY.getNextHighestDepth());
_local1._y = groundPos + 10;
if (random(2) == 0) {
_local1._x = -80;
_local1.dir = 1;
} else {
_local1._x = 730;
_local1.dir = -1;
}
_local1.dead = false;
tankArray.push(_local1);
}
function updateTank() {
var _local3 = 0;
while (_local3 < tankArray.length) {
var _local2 = tankArray[_local3];
_local2._x = _local2._x + (3 * _local2.dir);
if (_local2.hitTest(ROCK)) {
newExplosion(_local2._x, _local2._y, random(50) + 120);
_local2.dead = true;
}
_local2.barrel._rotation = angle(_local2._x, _local2._y, TANK._x, TANK._y);
if (_local2.hit.hitTest(TANK.hit)) {
_local2.dead = true;
fuel = fuel - 5;
_root.setFade(_root.redFade, 50);
newExplosion(_local2._x, _local2._y, random(50) + 120);
ySpeed = -(random(10) + 35);
xSpeed = -((_local2._x - TANK._x) / 3);
spin = random(100) - 50;
} else if ((_local2._x < -100) || (_local2._x > 750)) {
_local2.dead = true;
}
if (_local2.dead == true) {
destroyMovieClip(_local3, tankArray);
_local3--;
}
_local3++;
}
}
function newExplosion(xPos, yPos, size) {
shakeScreen(size / 15, size / 15);
newEffect("Explosion", xPos, yPos, size, random(360), random(20) + 80);
_root.playSound("EXPBANG");
}
function newEffect(type, xPos, yPos, scale, rotate, alph) {
var _local1 = EFFECTS.attachMovie(type, "E" + EFFECTS.getNextHighestDepth(), EFFECTS.getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1._rotation = rotate;
_local1._alpha = alph;
_local1._xscale = (_local1._yscale = scale);
return(_local1);
}
function destroyMovieClip(i, array) {
array[i].removeMovieClip();
array.splice(i, 1);
}
function cycleEnemies(xPos, yPos, size, target) {
var _local4 = 0;
while (_local4 < enemyArray.length) {
var _local3 = 0;
while (_local3 < enemyArray[_local4].length) {
var _local2 = enemyArray[_local4][_local3];
if (_local2.dead == false) {
if (pythag(_local2._x, _local2._y, xPos, yPos) < size) {
newExplosion(_local2._x, _local2._y, 150 + random(20));
newFragments(5, _local2._x, _local2._y);
target.dead = true;
_local2.dead = true;
_root.levelValue2++;
newFuel(_local2._x, _local2._y);
}
}
_local3++;
}
_local4++;
}
}
function newHeli() {
var _local1 = ENEMY.attachMovie("L2HELI" + random(2), "T" + ENEMY.getNextHighestDepth(), ENEMY.getNextHighestDepth());
_local1._y = (groundPos - 40) - random(200);
if (random(2) == 0) {
_local1._x = -120;
_local1.dir = 1;
} else {
_local1._x = 770;
_local1.dir = -1;
}
_local1.dead = false;
heliArray.push(_local1);
}
function updateHeli() {
var _local3 = 0;
while (_local3 < heliArray.length) {
var _local2 = heliArray[_local3];
_local2.rotor._rotation = _local2.rotor._rotation + 45;
_local2._x = _local2._x + (6 * _local2.dir);
_local2.barrel._rotation = angle(_local2._x, _local2._y, _local2._x, _local2._y);
if (_local2.hit.hitTest(TANK.hit)) {
fuel = fuel - 20;
_root.setFade(_root.redFade, 50);
_local2.dead = true;
newExplosion(_local2._x, _local2._y, random(50) + 120);
xSpeed = -((_local2._x - _local2._x) / 10);
spin = random(100) - 50;
newFragments(5, _local2._x, _local2._y);
} else if ((_local2._x < -140) || (_local2._x > 790)) {
_local2.dead = true;
}
if (_local2.dead == true) {
destroyMovieClip(_local3, heliArray);
_local3--;
}
_local3++;
}
}
function shakeScreen(ammount, time) {
if (gameStart == true) {
screenShake = ammount;
shakeTime = time;
}
}
function updateShake() {
updateDamage();
if (shakeTime > 0) {
_y = (_y + (random(screenShake) * shakeDir));
_x = (_x + (random(screenShake) * shakeDir));
shakeDir = shakeDir * -1;
shakeTime--;
} else {
screenShake = 0;
}
_y = (_y / 1.1);
_x = (_x / 1.1);
}
function newFragments(num, xPos, yPos) {
var _local3 = 0;
while (_local3 < (num * (3 / _root.savefile.data.detail))) {
var _local2 = EFFECTS.attachMovie("Swain_Debris" + (6 + random(3)), "F" + EFFECTS.getNextHighestDepth(), EFFECTS.getNextHighestDepth());
_local2._x = xPos;
_local2._y = yPos;
_local2._xscale = random(50) + 50;
_local2._yscale = random(50) + 50;
_local2.smokeSpan = size;
_local2.spin = random(40) - 10;
_local2.xSpeed = random(40) - 20;
_local2.ySpeed = -random(20);
fragmentArray.push(_local2);
_local3++;
}
}
function updateFragments() {
if (smokeCount > 0) {
smokeCount--;
}
var _local3 = 0;
while (_local3 < fragmentArray.length) {
var _local2 = fragmentArray[_local3];
_local2._rotation = _local2._rotation + _local2.spin;
_local2._x = _local2._x + _local2.xSpeed;
_local2._y = _local2._y + _local2.ySpeed;
if (((_local2.smokeSpan > 0) && (random(_root.savefile.data.detail) == 0)) && (smokeCount < (180 / _root.savefile.data.detail))) {
newEffect("Smoke", _local2._x, _local2._y, _local2.smokeSpan + random(20), random(360), 50);
smokeCount++;
}
_local2.smokeSpan = _local2.smokeSpan - 5;
_local2.ySpeed++;
if (_local2._y > 330) {
_local2._y = 360;
_local2.xSpeed = _local2.xSpeed / 1.5;
_local2.ySpeed = _local2.ySpeed * -0.5;
_local2._xscale = _local2._xscale / 2;
_local2._yscale = _local2._yscale / 2;
if (_local2._xscale < 26) {
destroyMovieClip(_local3, fragmentArray);
_local3--;
}
}
_local3++;
}
}
function newFuel(xPos, yPos) {
var _local4;
if (_root.difficulty > 1) {
_local4 = 3;
} else {
_local4 = 5;
}
var _local3 = 0;
while (_local3 < _local4) {
var _local2 = EFFECTS.attachMovie("L2Fuel", "F" + EFFECTS.getNextHighestDepth(), EFFECTS.getNextHighestDepth());
_local2._x = xPos;
_local2._y = yPos;
_local2._rotation = random(360);
_local2._xscale = random(10) + 50;
_local2._yscale = _local2._xscale;
_local2.xSpeed = (random(100) - 50) / 10;
_local2.ySpeed = (-150 + random(100)) / 10;
fuelArray.push(_local2);
_local3++;
}
}
function updateFuel() {
var _local3 = 0;
while (_local3 < fuelArray.length) {
var _local2 = fuelArray[_local3];
if (_local2.hitTest(TANK.hit)) {
if (deadTimerTank == 0) {
_root.playSound("SHOT2");
fuel = fuel + 40;
}
if (fuel > 800) {
fuel = 800;
}
newEffect("Effect_Ring", _local2._x, _local2._y, 50, 0, 200);
destroyMovieClip(_local3, fuelArray);
_local3--;
} else if (_local2._y < (groundPos + 20)) {
_local2._x = _local2._x + _local2.xSpeed;
_local2._y = _local2._y + _local2.ySpeed;
_local2.ySpeed = _local2.ySpeed + 1;
_local2.xSpeed = _local2.xSpeed / 1.15;
} else {
destroyMovieClip(_local3, fuelArray);
_local3--;
}
_local3++;
}
}
function newEnemyBullet(xPos, yPos, angle) {
var _local2 = BULLETS.attachMovie("MC_Bullet_Rifle", "B" + BULLETS.getNextHighestDepth(), BULLETS.getNextHighestDepth());
_root.playound("SHOT");
_local2._x = xPos;
_local2._y = yPos;
_local2._xscale = 140;
_local2._yscale = 140;
_local2.dead = false;
_local2._rotation = angle;
_local2.speed = calcSpeed(angle, (random(10) / 10) + 20);
_local2._x = _local2._x + _local2.speed.x;
_local2._y = _local2._y + _local2.speed.y;
bulletEnemyArray.push(_local2);
return(_local2);
}
function updateEnemyBullets() {
var _local3 = 0;
while (_local3 < bulletEnemyArray.length) {
var _local2 = bulletEnemyArray[_local3];
if (random(_root.savefile.data.detail) == 0) {
newEffect("Smoke", _local2._x, _local2._y, 150, random(360), 20 + random(40));
}
if (_local2.hitTest(TANK.hit)) {
newExplosion(_local2._x, _local2._y, 150 + random(20));
newFragments(5, TANK._x, TANK._y);
_local2.dead = true;
fuel = fuel - 40;
_root.setFade(_root.redFade, 40);
}
if (_local2._y > (groundPos + 20)) {
_local2.dead = true;
newExplosion(_local2._x, _local2._y, 60);
} else if (((_local2._x < -20) || (_local2._x > 670)) || (_local2._y < -20)) {
_local2.dead = true;
}
_local2._x = _local2._x + (_local2.speed.x / 2);
_local2._y = _local2._y + (_local2.speed.y / 2);
if (_local2.dead == true) {
destroyMovieClip(_local3, bulletEnemyArray);
_local3--;
}
_local3++;
}
}
_root.setMusic("GAME");
createEmptyMovieClip("ENEMY", getNextHighestDepth());
createEmptyMovieClip("EFFECTS", getNextHighestDepth());
createEmptyMovieClip("BULLETS", getNextHighestDepth());
rockMarker.swapDepths(getNextHighestDepth());
ROCK.swapDepths(getNextHighestDepth());
var barrelRot = 0;
var xSpeed = 0;
var ySpeed = 0;
var groundPos = TANK._y;
var spin = o;
rockMarker._visible = false;
var rockTimer = (random(50) + 200);
var rockActive = false;
var gameStart = false;
ROCK._x = 2000;
var rockMedal = true;
var fuel = 850;
var jumpSwitch = false;
var blimpActive = false;
var blimpHeight = 0;
var blimpYSwitch = false;
var blimpYSpeed = 0;
var blimpFuelTimer = 0;
var blimpXPos = 300;
var blimpDead = false;
var blimpTimer = 0;
BLIMP._xscale = 0;
BLIMP._yscale = 0;
var deadTimerTank = 0;
BLIMP._visible = false;
var bulletArray = new Array();
BLIMP.health = 250;
var tankArray = new Array();
var heliArray = new Array();
var enemyArray = new Array(tankArray, heliArray);
shakeDir = 1;
var fragmentArray = new Array();
var smokeCount = 0;
Progress.TANK.barrel._rotation = 90;
Progress._visible = false;
var fuelArray = new Array();
var bulletEnemyArray = new Array();
Symbol 770 MovieClip Frame 1
var cursorArray = new Array();
var cursorTrailLength = 10;
while (cursorArray.length < cursorTrailLength) {
cursorArray.push(0);
}
var i = 0;
Symbol 781 MovieClip Frame 1
stop();
Symbol 788 MovieClip Frame 1
stop();
Symbol 788 MovieClip Frame 10
stop();
Symbol 789 MovieClip Frame 1
stop();
Symbol 793 MovieClip Frame 1
stop();
Symbol 793 MovieClip Frame 10
stop();
Symbol 794 MovieClip Frame 1
stop();
Symbol 801 Button
on (release) {
_parent._parent.gameStart = true;
_parent._parent.turbulance = 30;
swapDepths(666);
this.removeMovieClip();
}
Symbol 802 MovieClip Frame 1
stop();
Symbol 810 MovieClip Frame 1
function onEnterFrame() {
if (_root.gamePaused == false) {
heliView();
backgroundManagement();
FRAME.distText = distVar + " Metres";
if (gameStart == true) {
_root.gameTimer++;
if (distVar > 0) {
distVar--;
}
if (lifeAmmoTimer > 0) {
if (distVar == 0) {
_root.setFade(_root.whiteFade, 100);
_root.levelNo = 4;
_root.gotoAndStop("CS5");
}
}
challengeMode();
updateBulletPods();
updateBullets();
updateMissiles();
updateExplosions();
updateRadar();
deathManagement();
updateMessages();
enemySpawnControl();
}
FRAME.radar.mouse._x = cursor._x / 5;
EFFECTS.clear();
cursor._rotation = cursor._rotation + 10;
if (_ymouse < 330) {
cursorPosY = _ymouse;
} else {
cursorPosY = 330;
}
cursorPosX = _xmouse;
cursor._x = cursor._x - ((cursor._x - cursorPosX) / 2);
cursor._y = cursor._y - ((cursor._y - cursorPosY) / 2);
cursorTrail(cursor, EFFECTS);
}
}
function cursorTrail(curs, layer) {
with (curs) {
cursorArray.push(_x);
cursorArray.push(_y);
cursorArray.shift();
cursorArray.shift();
i = 0;
while (i < (cursorArray.length - 2)) {
layer.lineStyle(i / (cursorTrailLength / 10), 16711680, i * 10);
layer.moveTo(cursorArray[i], cursorArray[i + 1]);
i = i + 2;
layer.lineTo(cursorArray[i], cursorArray[i + 1]);
}
}
}
function onMouseDown() {
if (gameStart == true) {
if (missileAmmo > 0) {
FRAME.HEALTHBOX["bulletPod" + missileAmmo].gotoAndPlay(2);
missileAmmo--;
if (selectBullet() == true) {
_root.playSound("EXPBANG");
_root.levelValue1++;
newBullet(cursor._x, cursor._y, 4, 100, 300);
}
}
}
}
function newBullet(xPos, yPos, targetLayer, scale, flashScale) {
if (targetLayer > 0) {
var _local2 = this["BULLET_" + targetLayer].attachMovie("BULLET", "B" + bulletCount, bulletCount++);
_local2._x = xPos;
_local2._y = yPos;
_local2._xscale = scale;
_local2._yscale = scale;
_local2.layer = targetLayer;
_local2.scaleVar = scale;
_local2.scaler = scale;
_local2.Flash._xscale = flashScale;
_local2.Flash._yscale = flashScale;
_local2.speed = 3;
_local2.flare.gotoAndStop(1);
bulletArray.push(_local2);
newRadarBullet(xPos, targetLayer, 1);
} else {
combo = 0;
}
}
function updateBullets() {
var _local1 = 0;
while (_local1 < bulletArray.length) {
if (bulletArray[_local1].destroy == true) {
removeBullet(_local1);
_local1--;
} else {
bulletArray[_local1].flare._alpha = random(20) + 80;
bulletArray[_local1].Flash._xscale = bulletArray[_local1].Flash._xscale / 1.5;
bulletArray[_local1].Flash._yscale = bulletArray[_local1].Flash._xscale;
bulletArray[_local1]._x--;
bulletArray[_local1].scaler = bulletArray[_local1].scaler - bulletArray[_local1].speed;
bulletArray[_local1]._xscale = bulletArray[_local1].scaler;
if (random(3) == 0) {
newL3Smoke(bulletArray[_local1]._x, bulletArray[_local1]._y, bulletArray[_local1].layer, bulletArray[_local1]._xscale / 2);
}
bulletArray[_local1]._yscale = bulletArray[_local1]._xscale;
if (bulletArray[_local1].scaler < (bulletArray[_local1].scaleVar - 20)) {
checkCol(bulletArray[_local1]._x, bulletArray[_local1]._y, bulletArray[_local1].layer, _local1);
if ((bulletArray[_local1].destroy != true) && ((bulletArray[_local1]._y < 185) || (bulletArray[_local1].layer > 3))) {
newBullet(bulletArray[_local1]._x, bulletArray[_local1]._y, bulletArray[_local1].layer - 1, bulletArray[_local1].scaler, 0);
} else if ((bulletArray[_local1]._y > 185) && (bulletArray[_local1].layer <= 3)) {
combo = 0;
newExplosion(bulletArray[_local1]._x, bulletArray[_local1]._y, bulletArray[_local1].layer, bulletArray[_local1].layer / 2);
}
bulletArray[_local1].destroy = true;
}
}
_local1++;
}
}
function newMissile(type, yPos, targetLayer) {
var _local2 = this["MISSILE_" + targetLayer].attachMovie("MISSILE" + type, "M" + missileCount, missileCount++);
_local2._x = -_local2._width;
_local2._y = yPos;
_local2._xscale = 20 * targetLayer;
_local2._yscale = _local2._xscale;
_local2.layer = targetLayer;
_local2.box._visible = false;
_local2.drop = 0;
_local2.radar = type;
_local2.speed = 40;
_local2.health = 2;
missileArray.push(_local2);
}
function updateMissiles() {
var _local1 = 0;
while (_local1 < missileArray.length) {
if (missileArray[_local1].health > 1) {
newRadarBullet(missileArray[_local1]._x, missileArray[_local1].layer, missileArray[_local1].radar + 1);
}
if (dead == true) {
missileArray[_local1]._y = missileArray[_local1]._y - (missileArray[_local1]._yscale / 50);
}
missileArray[_local1]._x = missileArray[_local1]._x + (missileArray[_local1]._xscale / 20);
missileArray[_local1]._rotation = missileArray[_local1]._rotation / 1.04;
if (missileArray[_local1].health <= 1) {
missileArray[_local1]._y = missileArray[_local1]._y + missileArray[_local1].drop;
missileArray[_local1].drop = missileArray[_local1].drop + (missileArray[_local1]._xscale / 200);
missileArray[_local1]._rotation = missileArray[_local1]._rotation + 2;
newL3Smoke(missileArray[_local1]._x, missileArray[_local1]._y, missileArray[_local1].layer, missileArray[_local1]._xscale);
if (missileArray[_local1]._y > (150 + (missileArray[_local1].layer * 22))) {
newExplosion(missileArray[_local1]._x, missileArray[_local1]._y, missileArray[_local1].layer, missileArray[_local1].layer);
changeMoney(50 * missileArray[_local1].radar);
removeMissile(_local1);
_local1--;
}
} else if ((missileArray[_local1]._x > (400 + (missileArray[_local1]._width / 2))) && (missileArray[_local1].health > 1)) {
removeMissile(_local1);
_local1--;
}
_local1++;
}
}
function checkCol(xPos, yPos, targetLayer, caller) {
hitBlock._x = xPos;
hitBlock._y = yPos;
hitBlock._width = bulletArray[caller]._width;
hitBlock._height = hitBlock._width;
var _local2 = 0;
while (_local2 < missileArray.length) {
if (missileArray[_local2].hitTest(hitBlock) && (missileArray[_local2].layer == targetLayer)) {
newExplosion(bulletArray[caller]._x, bulletArray[caller]._y, targetLayer, targetLayer / 2);
newL3Smoke(bulletArray[caller]._x, bulletArray[caller]._y, bulletArray[caller].layer, bulletArray[caller]._xscale * 2);
FRAME.boomFade._alpha = missileArray[_local2]._xscale;
if (missileArray[_local2].box.hitTest(hitBlock)) {
missileArray[_local2].health = missileArray[_local2].health - (1 + random(2));
combo++;
_root.levelValue2++;
if (combo >= 5) {
_root.newMedal(11);
}
if (missileArray[_local2].health <= 0) {
newExplosion(missileArray[_local2]._x + (targetLayer * 2), missileArray[_local2]._y, targetLayer, targetLayer);
newMessage("BONUS!", missileArray[_local2]._x, missileArray[_local2]._y, 70, 200);
var _local5 = ((20 + missileArray[_local2].radar) * combo) + (100 * missileArray[_local2].radar);
changeMoney(_local5);
newMessage((combo + " HIT COMBO + $") + _local5, 290, 240, 100, 200);
removeMissile(_local2);
_local2--;
} else {
var _local5 = (20 + missileArray[_local2].radar) * combo;
changeMoney(_local5);
newExplosion(missileArray[_local2]._x, missileArray[_local2]._y, targetLayer, targetLayer);
missileArray[_local2]._rotation = -20;
if (combo > 1) {
newMessage((combo + " HIT COMBO + $") + _local5, 290, 240, 100, 200);
} else {
newMessage(" HIT + $" + _local5, 310, 240, 100, 200);
}
}
}
bulletArray[caller].destroy = true;
}
_local2++;
}
}
function removeMissile(ID) {
if (missileArray[ID].radar != 22) {
destroyCount++;
if (missileArray[ID].health <= 1) {
killCount++;
} else {
hurtShip();
if (_root.health == 0) {
dead = true;
}
}
}
missileArray[ID].removeMovieClip();
missileArray.splice(ID, 1);
}
function removeBullet(ID) {
bulletArray[ID].removeMovieClip();
bulletArray.splice(ID, 1);
}
function backgroundManagement() {
var _local2 = 0;
while (_local2 < 6) {
this["BG_" + _local2]._x = this["BG_" + _local2]._x - (10 / (_local2 + 1));
if (this["BG_" + _local2]._x < (-(this["BG_" + _local2]._width / 3))) {
this["BG_" + _local2]._x = this["BG_" + _local2]._x + (this["BG_" + _local2]._width / 3);
}
_local2++;
}
BG_sky._x = BG_sky._x - 2;
if (BG_sky._x < (30 - (BG_sky._width / 2))) {
BG_sky._x = BG_sky._x + (BG_sky._width / 2);
}
}
function heliView() {
_y = liftStore;
_x = (_x - ((_x - heliX) / 10));
_y = (_y - ((_y - heliY) / 10));
heliX = heliX / 1.1;
heliY = heliY / 1.1;
_x = (_x / 1.1);
_y = (_y / 1.1);
FRAME._x = ((-_x) / 1.5) - 60;
FRAME._y = ((-_y) / 1.5) - 70;
if (Math.round(_rotation) == rotateTarget) {
rotateTarget = random(10) - 5;
} else if (_rotation < rotateTarget) {
rotate = rotate + 0.1;
} else if (_rotation > rotateTarget) {
rotate = rotate - 0.1;
}
_rotation = ((rotate * turbulance) / 100);
FRAME._rotation = -_rotation;
liftStore = _y;
_y = (_y + ((lift * turbulance) / 100));
FRAME._y = FRAME._y - ((lift * turbulance) / 100);
if (lift < liftTarget) {
lift = lift + 1;
} else if (lift > liftTarget) {
lift = lift - 1;
} else {
liftTarget = random(liftMax);
}
if (random(1000 / turbulance) == 0) {
heliX = random(turbulance) - (turbulance / 2);
}
if (random(1000 / turbulance) == 0) {
heliY = random(turbulance) - (turbulance / 2);
}
}
function newRadarBullet(xPos, yPos, type) {
var _local1 = FRAME.radar.attachMovie("Radar_Bullet", "RP" + radarPointCount, radarPointCount++);
_local1._x = xPos / 5;
_local1._y = (yPos * 10) + 10;
_local1._xscale = 100;
_local1._yscale = 100;
_local1.gotoAndStop(type);
radarTrackArray.push(_local1);
}
function updateRadar() {
var _local1 = 0;
while (_local1 < radarTrackArray.length) {
if (radarTrackArray[_local1]._xscale > 0) {
radarTrackArray[_local1]._xscale = radarTrackArray[_local1]._xscale - 5;
radarTrackArray[_local1]._alpha = radarTrackArray[_local1]._alpha - 10;
radarTrackArray[_local1]._yscale = radarTrackArray[_local1]._xscale;
} else {
radarTrackArray[_local1].removeMovieClip();
radarTrackArray.splice(_local1, 1);
_local1--;
}
_local1++;
}
}
function newExplosion(xPos, yPos, layer, scale) {
_root.playSound("BANG");
var _local3 = this["EXPLOSIONS_" + layer].attachMovie("Explosion", "EXP" + explosionCount, explosionCount++);
_local3._x = xPos;
_local3._y = yPos;
_local3._xscale = 20 * scale;
_local3._yscale = 20 * scale;
_local3._rotation = random(360);
explosionArray.push(_local3);
if (_local3._x < 150) {
_x = (_x + (scale * 2));
} else if (_local3._x > 250) {
_x = (_x - (scale * 2));
}
_y = (_y - (scale * 2));
}
function updateExplosions() {
var _local1 = 0;
while (_local1 < explosionArray.length) {
if (explosionArray[_local1]._x > 0) {
explosionArray[_local1]._x = explosionArray[_local1]._x - (explosionArray[_local1]._xscale / 40);
} else {
explosionArray[_local1].removeMovieClip();
explosionArray.splice(_local1, 1);
_local1--;
}
_local1++;
}
}
function selectBullet() {
if ((ammo > 0) && (_root._ymouse < 330)) {
ammo--;
return(true);
}
}
function updateBulletPods() {
if ((missileAmmoTimer < 30) && (missileAmmo < 8)) {
if (_root.difficulty > 1) {
missileAmmoTimer = missileAmmoTimer + 0.75;
} else {
missileAmmoTimer = missileAmmoTimer + 1.5;
}
} else if (missileAmmo < 8) {
missileAmmo++;
missileAmmoTimer = 0;
} else {
missileAmmoTimer = 0;
}
var _local2 = 1;
while (_local2 < 9) {
if (missileAmmo < _local2) {
} else {
FRAME.HEALTHBOX["bulletPod" + _local2].gotoAndStop(1);
}
FRAME.rBar._width = 4.66666666666667 * missileAmmoTimer;
_local2++;
}
_local2 = 1;
while (_local2 < 9) {
if (lifeAmmo < _local2) {
} else {
FRAME.LIFEBOX["bulletPod" + _local2].gotoAndStop(1);
}
_local2++;
}
}
function newL3Smoke(xPos, yPos, layer, scale) {
if (smokeArray.length < 200) {
var _local2 = this["SMOKE_" + layer].attachMovie("Smoke", "SMK" + smokeCount, smokeCount++);
_local2._x = xPos;
_local2._y = yPos;
_local2._xscale = (scale * 2) + random(5);
_local2._yscale = (scale * 2) + random(5);
_local2._alpha = random(5) + 15;
_local2._rotation = random(360);
}
}
function enemySpawnControl() {
if (spawnInc < 20) {
spawnInc = spawnInc + 0.02;
}
trace(spawnInc);
FRAME.waveText = (("" + killCount) + "/") + levelArray[4];
spawnTimer++;
if (dead != true) {
if (spawnTimer > 50) {
spawnTimer = 0 + spawnInc;
waveTimer++;
newMissile(random(levelArray[1]) + 1, random(120) + 40, 4 - random(3));
} else if ((waveTimer == levelArray[4]) && (destroyCount == levelArray[4])) {
if (endCount == 0) {
newMessage("LEVEL COMPLETE!", 190, 100, 200, 400);
if (killCount == destroyCount) {
newMessage("PERFECT SCORE!", 190, 130, 100, 300);
if (_root.mission == 3) {
if (_root.difficulty == 2) {
} else if (_root.difficulty == 3) {
} else if (_root.difficulty == 4) {
}
}
}
if (combo >= destroyCount) {
newMessage("PERFECT COMBO!", 190, 150, 100, 300);
}
stopAllSounds();
_parent.newSound("LEVEL_COMPLETE.WAV", 400, false, 0);
}
endCount++;
if (endCount == 150) {
_parent.transistion("UPGRADE");
}
}
}
}
function setGraphics(val) {
skyColor.gotoAndStop(val);
var _local3 = 0;
while (_local3 < 3) {
var _local2 = 1;
while (_local2 < 4) {
this["BG_" + _local3]["tile" + _local2].gotoAndStop(val);
_local2++;
}
_local3++;
}
}
function introManagement() {
if (introTimer > 0) {
BARRY._x = BARRY._x - ((BARRY._x - 200) / 30);
if (introTimer < 80) {
BARRY._rotation = BARRY._rotation - 0.45;
}
if (introTimer < 50) {
BARRY._xscale = BARRY._xscale * (1 + barryScaler);
barryScaler = barryScaler + 0.01;
BARRY._yscale = BARRY._xscale;
}
introTimer--;
}
}
function changeMoney(ammount) {
_root.money = _root.money + (ammount * _root.difficulty);
}
function newMessage(mess, xPos, yPos, size, timer) {
var _local1 = MESSAGE.attachMovie("message", "MSG" + messageCount, messageCount++);
_local1.txtBox = mess;
_local1._x = xPos - _x;
_local1._y = yPos - _y;
_local1._rotation = -_rotation;
_local1._xscale = size;
_local1._yscale = size;
_local1._alpha = timer;
}
function deathManagement() {
if (dead == true) {
deathTimer--;
if (deathTimer == 0) {
_parent.transistion("GAMEOVER");
}
if (random(4) == 0) {
if (random(2) == 0) {
newMessage("DAMAGE CRITICAL!", 190, 80, 100, 100);
newMessage("BAIL OUT!", 200, 100, 100, 100);
}
newExplosion(random(400), random(100) + 200, random(4), (random(100) + 50) / 20);
FRAME.boomFade._alpha = 100;
}
}
}
function smartBomb() {
if (_root.smartBomb > 0) {
_root.smartBomb--;
FRAME.boomFade._alpha = 200;
_parent.newSound("EMP", 200, false, 0);
var _local3 = 0;
while (_local3 < missileArray.length) {
missileArray[_local3].health = 0;
_local3++;
}
}
}
function hurtShip() {
_parent.newSound("BANG", 600, false, 0);
FRAME.hurtFade._alpha = 100;
_root.setFade(_root.redFade, 50);
FRAME.LIFEBOX["bulletPod" + lifeAmmo].gotoAndPlay(2);
lifeAmmo--;
}
function challengeMode() {
if (lifeAmmo <= 0) {
trace("DANG");
lifeAmmoTimer--;
if (random(10) == 0) {
_root.playSound("BANG");
_root.setFade(_root.redFade, 50);
}
if (lifeAmmoTimer == 0) {
_root.setFade(_root.redFade, 100);
_root.gotoAndStop("RELOAD");
}
}
if (_root.difficulty == 5) {
challengeDistance++;
if (challengeDistance == 7500) {
_parent.newMedal(9);
}
if (combo == 30) {
_parent.newMedal(10);
}
challengeTimerGraphics--;
if (challengeTimerGraphics == 0) {
challengeTimerGraphics = 500;
setGraphics(random(9) + 1);
FRAME.boomFade._alpha = 100;
}
challengeTimerType--;
if ((challengeTimerType == 0) && (levelArray[1] < 4)) {
challengeTimerType = 1000;
levelArray[1]++;
}
challengeTimerDepth--;
if ((challengeTimerDepth == 0) && (levelArray[2] < 4)) {
challengeTimerDepth = 800;
levelArray[2]++;
}
challengeTimerSpawn--;
if ((challengeTimerSpawn == 0) && (levelArray[3] > 5)) {
challengeTimerSpawn = 600;
levelArray[3] = levelArray[3] - 2.5;
}
}
}
_root.setMusic("GAME");
var levelArray_0 = new Array(1, 1, 3, 60, 10, "LEVEL 1 - CITY AREA 1 - TIME 6 A.M.", 20);
var levelArray_1 = new Array(4, 2, 3, 60, 15, "LEVEL 2 - OIL FIELDS 1 - TIME 9 A.M.", 40);
var levelArray_2 = new Array(7, 2, 4, 50, 20, "LEVEL 3 - ROCKY MOUNTAINS 1 - TIME 12 A.M.", 40);
var levelArray_3 = new Array(2, 3, 4, 40, 25, "LEVEL 4 - CITY AREA 2 - TIME 4 P.M.", 120);
var levelArray_4 = new Array(5, 3, 4, 40, 30, "LEVEL 5 - OIL FIELDS 2 - TIME 7 P.M.", 20);
var levelArray_5 = new Array(7, 3, 4, 30, 35, "LEVEL 6 -ROCKY MOUNTAINS 2 - TIME 9 P.M.", 80);
var levelArray_6 = new Array(3, 3, 4, 20, 40, "LEVEL 7 - CITY AREA 3 - TIME 11 P.M.", 80);
var levelArray_7 = new Array(8, 4, 4, 20, 45, "LEVEL 8 - THE WARFIELD - TIME 1 A.M.", 120);
var levelArray_8 = new Array(9, 4, 4, 15, 50, "LEVEL 9 - THE NEW GROUND - TIME 2 A.M.", 120);
var levelArray_98 = new Array(2, 1, 1, 60, 99999, "CHALLENGE MODE - GOOD LUCK!", 60);
var levelArray_99 = new Array(2, 0, 0, 999999, 5, "TUTORIAL PRESS SPACE TO QUIT", 0);
var levelArray = this.levelArray_9;
var moneyPot = Math.round(_root.money);
var missileArray = new Array();
var bulletArray = new Array();
var radarTrackArray = new Array();
var explosionArray = new Array();
var smokeArray = new Array();
var messageArray = new Array();
var i;
var layerCount = 0;
var gameFroze = false;
i = 0;
while (i < 19) {
createEmptyMovieClip("MISSILE_" + layerCount, i);
layerCount++;
i = i + 4;
}
layerCount = 0;
i = 1;
while (i < 20) {
createEmptyMovieClip("BULLET_" + layerCount, i);
layerCount++;
i = i + 4;
}
layerCount = 0;
i = 2;
while (i < 21) {
createEmptyMovieClip("EXPLOSIONS_" + layerCount, i);
layerCount++;
i = i + 4;
}
layerCount = 0;
i = 3;
while (i < 22) {
createEmptyMovieClip("SMOKE_" + layerCount, i);
layerCount++;
i = i + 4;
}
hitBlock._visible = false;
createEmptyMovieClip("EFFECTS", 20);
FRAME.swapDepths(23);
cursor.swapDepths(21);
createEmptyMovieClip("MESSAGE", 24);
_parent.newSound("CITY_THEME.WAV", 400, true, 999);
_root.levelValue1 = 0;
_root.levelValue2 = 0;
var bulletCount = 0;
railCounter = 0;
var missileCount = 0;
var distVar = 1500;
var turbulance = 10;
var lift = 0;
var liftMax = 35;
var liftTarget = 0;
var liftStore = 0;
var rotate = 0;
var rotateTarget = 0;
var levelGraphics = levelArray[0];
var combo = 0;
var destroyCount = 0;
var killCount = 0;
var endCount = 0;
var radarPointCount = 0;
var explosionCount = 0;
var reloadTimer = 0;
var ammo = 100;
var moneySave = 0;
missileAmmo = 8;
missileAmmoTimer = 0;
var smokeCount = 0;
var waveTimer = 0;
var spawnTimer = 0;
var spawnInc = 0;
var bonusSpawnTimer = (random(1000) + 100);
var introTimer = 160;
var barryScaler = -0.1;
cursor._visible = true;
var messageCount = 0;
var deathTimer = 200;
FRAME.hurtFade._alpha = 0;
var lifeAmmo = 4;
var lifeAmmoTimer = 80;
var challengeTimerType = 1000;
var challengeTimerSpawn = 600;
var challengeTimerDepth = 800;
var challengeTimerGraphics = 500;
var challengeDistance = 0;
Symbol 815 MovieClip Frame 1
function onEnterFrame() {
_xscale = (scaler + (random(100) / 100));
_yscale = _xscale;
}
stop();
var scaler = _xscale;
stop();
Symbol 816 MovieClip Frame 1
sun.gotoAndStop(2);
Symbol 827 MovieClip Frame 1
stop();
Symbol 827 MovieClip Frame 15
stop();
Symbol 830 MovieClip Frame 1
_parent._parent.newTarget(_x, _y, faceDir, pauseTime, distLeft, distRight, sensitivity, sensitivityY);
this.swapDepths(666);
this.removeMovieClip();
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = 1;
distLeft = 10;
distRight = 10;
pauseTime = 100000000000;
sensitivity = 1000;
sensitivityY = 2000;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = -1;
distLeft = 300;
distRight = 0;
pauseTime = 100;
sensitivity = 50;
sensitivityY = 30;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = -1;
distLeft = 0;
distRight = 300;
pauseTime = 100;
sensitivity = 50;
sensitivityY = 30;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = -1;
distLeft = 80;
distRight = 80;
pauseTime = 10;
sensitivity = 30;
sensitivityY = 150;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = 1;
distLeft = 0;
distRight = 40;
pauseTime = 60;
sensitivity = 50;
sensitivityY = 0;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = -1;
distLeft = 40;
distRight = 0;
pauseTime = 60;
sensitivity = 50;
sensitivityY = 150;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = -1;
distLeft = 20;
distRight = 20;
pauseTime = 10;
sensitivity = 20;
sensitivityY = 20;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = -1;
distLeft = 20;
distRight = 20;
pauseTime = 10;
sensitivity = 20;
sensitivityY = 20;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = 1;
distLeft = 10;
distRight = 10;
pauseTime = 100000000 /* 0x5F5E100 */;
sensitivity = 200;
sensitivityY = 200;
}
Instance of Symbol 830 MovieClip in Symbol 833 MovieClip Frame 1
onClipEvent (load) {
faceDir = -1;
distLeft = 80;
distRight = 80;
pauseTime = 50;
sensitivity = 50;
sensitivityY = 30;
}
Symbol 837 MovieClip Frame 1
stop();
Symbol 847 MovieClip Frame 1
levelMap.setMask(masker);
Symbol 873 MovieClip Frame 1
stop();
Symbol 873 MovieClip Frame 158
gotoAndStop (1);
Symbol 874 MovieClip Frame 1
function pythag(x1, y1, x2, y2) {
return(Math.sqrt(Math.pow(y1 - y2, 2) + Math.pow(x1 - x2, 2)));
}
function angle(x1, y1, x2, y2) {
return(Math.round((Math.atan2(y2 - y1, x2 - x1) / 3.141593) * 180) + 90);
}
function calcSpeed(angle, speed) {
var _local2 = angle * 0.01745329;
var _local1 = new Object();
_local1.x = speed * Math.cos(_local2);
_local1.y = speed * Math.sin(_local2);
return(_local1);
}
function rotatedXY(xPos, yPos, rotate) {
var _local1 = new Object();
var _local2 = 0.0174444444444444 * rotate;
var _local4 = Math.sin(_local2);
var _local3 = Math.cos(_local2);
_local1.x = (xPos * _local3) - (yPos * _local4);
_local1.y = (xPos * _local4) + (yPos * _local3);
return(_local1);
}
function swapBlur(targ1, targ2) {
targ1.swapDepths(sceneDepth2);
targ2.swapDepths(sceneDepth1);
targ1.swapDepths(sceneDepth3);
}
function newTarget(xPos, yPos, faceDir, pauseTime, distLeft, distRight, sensitivity, sensitivityY) {
targetCount++;
var _local1 = IFBG.TARGETS.attachMovie("L4Target", "B" + IFBG.TARGETS.getNextHighestDepth(), IFBG.TARGETS.getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1.faceDir = faceDir;
_local1._xscale = _local1._xscale * faceDir;
_local1.pauseTime = pauseTime;
_local1.pauseCount = 0;
_local1.distLeft = distLeft;
_local1.distRight = distRight;
_local1.sensitivity = sensitivity;
_local1.scaler = _local1._xscale;
_local1.sensitivitY = sensitivitY;
_local1.awareness = false;
_local1.dead = false;
targetArray.push(_local1);
}
function updateTargets() {
var _local3 = 0;
while (_local3 < targetArray.length) {
var _local2 = targetArray[_local3];
if (_local2.dead == false) {
if (_local2.pauseCount < _local2.pauseTime) {
_local2.pauseCount++;
if (_root.HUD.hBar._xscale <= 190) {
_local2.gotoAndStop("STAND");
}
} else {
if (_root.HUD.hBar._xscale <= 190) {
_local2.gotoAndStop("WALK");
}
if (_local2.faceDir == 1) {
_local2._xscale = -100;
if (_local2.distRight > 0) {
_local2._x++;
_local2.distRight--;
_local2.distLeft++;
} else {
_local2.pauseCount = 0;
_local2.faceDir = -1;
}
} else {
_local2._xscale = 100;
if (_local2.distLeft > 0) {
_local2._x--;
_local2.distRight++;
_local2.distLeft--;
} else {
_local2.faceDir = 1;
_local2.pauseCount = 0;
}
}
}
if (alarmVar == true) {
_local2.awareness = true;
}
if (_local2.awareness == true) {
_local2.scla._visible = true;
if (_root.difficulty > 1) {
totalAwareness = totalAwareness + 1;
} else {
totalAwareness = totalAwareness + 0.7;
}
if (_root.HUD.hBar._xscale > 190) {
_local2.gotoAndStop("KILL");
}
if (_root.HUD.hBar._xscale > 198) {
if (random(20) == 0) {
getHit();
}
}
warnX = _local2._x;
warnY = _local2._y;
warnBuffer = 5;
} else {
_local2.scla._visible = false;
}
if (_local2.hit == true) {
targetCount--;
if (targetCount == 0) {
warnBuffer = 10000;
warnX = IFBG.ALARM._x;
warnY = IFBG.ALARM._y + 20;
}
_local2.gotoAndStop("dead");
totalAwareness = totalAwareness - 40;
_local2.dead = true;
setAwareness(_local2._x, _local2._y, 1);
}
}
_local3++;
}
}
function endGame() {
_root.HUD.targetText = targetCount;
if (alarmVar == true) {
if (targetCount == 0) {
alarmCount++;
if (alarmCount == 80) {
warnBuffer = 10000;
warnX = IFBG.ALARM._x;
warnY = IFBG.ALARM._y;
IFBG.DOORS.play();
}
}
}
}
function cycleTargets(xPos, yPos, target) {
var _local5 = 0;
while (_local5 < targetArray.length) {
var _local3 = targetArray[_local5];
if (_local3.hit != true) {
if (pythag(xPos, yPos, _local3._x, _local3._y) < 30) {
var _local2 = 1;
while (_local2 < 5) {
if (target.hitTest(_local3["hit" + _local2])) {
newEffect("L4Blood", target._x, target._y, 40 + random(20), random(360), 100);
_root.levelValue2++;
_local3.hit = true;
}
_local2++;
}
}
}
_local5++;
}
}
function updateAwareness() {
endGame();
if (totalAwareness > 1) {
totalAwareness = totalAwareness - 0.5;
} else if (totalAwareness > 200) {
totalAwareness = 200;
}
}
function setAwareness(xPos, yPos, div) {
var _local3 = 0;
while (_local3 < targetArray.length) {
var _local2 = targetArray[_local3];
if (_local2.dead == false) {
if (pythag(xPos, yPos, _local2._x, _local2._x) < (_local2.sensitivity / div)) {
_local2.awareness = true;
if (_local2.pauseCount < 20) {
_local2.pauseCount = 20;
}
if (_root.difficulty > 1) {
totalAwareness = totalAwareness + (40 + random(10));
} else {
totalAwareness = totalAwareness + 5;
}
}
}
_local3++;
}
}
function cycleBlocks(target) {
var _local5 = _parent._rotation;
_parent._rotation = 0;
var _local3 = 0;
var _local2 = 17;
while (_local2 < 19) {
if (target.hitTest(IFBG["b" + _local2])) {
_local3 = 1;
}
_local2++;
}
_local2 = 1;
while (_local2 < 17) {
if (target.hitTest(IFBG["b" + _local2])) {
_local3 = 2;
}
_local2++;
}
_parent._rotation = _local5;
return(_local3);
}
function shoot() {
_root.levelValue1++;
newBullet(scope._x, scope._y);
_root.playSound("SHOT");
_parent.FLASH._alpha = 80;
knockOffsetY = -25;
rotateTarget = -10;
scope._xscale = 150;
scope._yscale = 150;
scope.scope.LH._alpha = 60;
scope.scope.LH._rotation = 30;
}
function getHit() {
if (hitBuffer < 0) {
deadCount = deadCount + 8;
if (deadCount < 20) {
hitBuffer = 24;
_root.playSound("BANG");
_root.setFade(_root.redFade, 80);
knockOffsetX = random(400) - 200;
knockOffsetY = random(400) - 200;
rotateTarget = random(80) - 40;
var _local2 = random(50) + 10;
scope._xscale = scope._xscale - _local2;
scope._yscale = scope._yscale - _local2;
scope._xscale = scope._xscale + ((100 - scope._xscale) / 3);
scope._yscale = scope._yscale + ((100 - scope._yscale) / 3);
scope.scope.LH._alpha = 120;
scope.scope.LH._rotation = 30;
scope.scope._y = scope.scope._y + 400;
traumaTime = 100;
MOUSE.x = MOUSE.x + (random(500) - 250);
MOUSE.y = MOUSE.y + (80 + random(80));
} else {
stopAllSounds();
_root.playSound("LOSE");
}
}
}
function newBullet(xPos, yPos) {
var _local2 = new Object();
_local2.x = xPos;
_local2.y = yPos;
this.localToGlobal(_local2);
IFBG.BULLETS.globalToLocal(_local2);
var _local3 = IFBG.BULLETS.attachMovie("L4Bullet", "B" + IFBG.BULLETS.getNextHighestDepth(), IFBG.BULLETS.getNextHighestDepth());
var _local6;
_local3._x = _local2.x;
_local3._y = _local2.y;
_local3.active = true;
bulletArray.push(_local3);
}
function updateBullet() {
hitBuffer--;
var _local3 = 0;
while (_local3 < bulletArray.length) {
var _local2 = bulletArray[_local3];
_local2._xscale = _local2._xscale / 1.3;
_local2._yscale = _local2._xscale;
if (_local2._xscale < 1) {
_local2._xscale = 0.1;
_local2._yscale = 0.1;
if (_local2.hitTest(IFBG.GEN)) {
if (alarmCount > 80) {
_root.levelValue2++;
stopAllSounds();
_root.playSound("WIN");
_root.setFade(_root.whiteFade, 200);
_root.levelNo = 1;
_root.gotoAndStop("CS4");
}
}
if (_local2.hitTest(IFBG.ALARM)) {
if (alarmVar != true) {
_root.levelValue2++;
_root.playSound("ALARM");
}
alarmVar = true;
}
var _local4 = cycleBlocks(_local2);
if (_local4 < 2) {
cycleTargets(_local2._x, _local2._y, _local2);
}
if (_local4 > 0) {
newEffect("Smoke", _local2._x, _local2._y, 20, random(360), 100);
}
setAwareness(_local2._x, _local2._y, 2);
_local2.removeMovieClip();
bulletArray.splice(_local3, 1);
_local3--;
}
_local3++;
}
}
function newEffect(type, xPos, yPos, scale, rotate, alph) {
var _local1 = IFBG.attachMovie(type, "E" + IFBG.getNextHighestDepth(), IFBG.getNextHighestDepth());
_local1._x = xPos;
_local1._y = yPos;
_local1._rotation = rotate;
_local1._alpha = alph;
_local1._xscale = (_local1._yscale = scale);
return(_local1);
}
function onMouseDown() {
if (look == false) {
shoot();
}
}
function warnArrow() {
if (warnBuffer > 0) {
_root.HUD.WARN._visible = true;
warnBuffer--;
var _local2 = new Object();
_local2.x = scope._x;
_local2.y = scope._y;
localToGlobal(_local2);
IFBG.globalToLocal(_local2);
_root.HUD.WARN._rotation = angle(_local2.x, _local2.y, warnX, warnY - 20) - 90;
var _local3 = pythag(_local2.x, _local2.y, warnX, warnY - 20);
_root.HUD.WARN.sprite._rotation = -_root.HUD.WARN._rotation;
if (_local3 < 100) {
_root.HUD.WARN._xscale = _local3;
_root.HUD.WARN._yscale = _local3;
} else {
_root.HUD.WARN._yscale = 100;
_root.HUD.WARN._xscale = 100;
}
} else {
_root.HUD.WARN._visible = false;
}
}
function onEnterFrame() {
if (_root.gamePaused == false) {
_root.gameTimer++;
if (deadCount < 20) {
_root.HUD.hBar._xscale = totalAwareness;
warnArrow();
if (Key.isDown(40) || (Key.isDown(83))) {
instSwitch = true;
_root.HUD.inst.gotoAndStop(2);
} else {
_root.HUD.inst.gotoAndStop(1);
}
updateAwareness();
updateTargets();
if (Key.isDown(32) && (lookSwitch == false)) {
lookSwitch = true;
if (look == true) {
look = false;
_root.playSound("GETAMMO");
} else {
look = true;
}
} else if (!Key.isDown(32)) {
lookSwitch = false;
}
updateBullet();
if (pythag(scope._x, scope._y, -600, -100) < 100) {
if (look == false) {
if (sunBurn < 99) {
sunBurn = sunBurn + 10;
if (sunBurn > 96) {
_root.newMedal(12);
sunBurn == 96;
}
}
}
} else if (sunBurn > 0) {
sunBurn = sunBurn - 2;
}
if (sunBurn > 0) {
_root.setFade(_root.whiteFade, sunBurn);
}
scope.scope.radar.pointerX._x = -((80 / (xSize * 2)) * _x);
scope.scope.radar.pointerY._y = (-((40 / (ySize + (ySize / 4))) * _y)) - 11;
mouseOffSetX = mouseOffSetX / 1.05;
mouseOffSetY = mouseOffSetY / 1.05;
if (scope.scope.STATIC._alpha > 0) {
scope.scope.STATIC._rotation = scope.scope.STATIC._rotation + 90;
scope.scope.STATIC._alpha = scope.scope.STATIC._alpha - 2;
}
if (scope.scope.LH._alpha > 0) {
scope.scope.LH._alpha = scope.scope.LH._alpha - 4;
scope.scope.LH._rotation = scope.scope.LH._rotation + 5;
}
if (look == true) {
if (knoll._alpha < 100) {
knoll._alpha = knoll._alpha + 10;
}
if (scopeOffSet == 0) {
_root.newSound("SNDreload");
}
if (scopeOffSet < 600) {
scopeOffSet = scopeOffSet + 100;
} else {
if (FBG._alpha > 0) {
FBG._alpha = FBG._alpha - 25;
}
IFBG._x = 0;
IFBG._y = 200;
if (maskSet == false) {
maskSet = true;
swapBlur(FBG, IFBG);
IFBG.setMask(null);
IFBG._xscale = 200;
IFBG._yscale = 200;
}
}
} else {
if (knoll._alpha > 0) {
knoll._alpha = knoll._alpha - 10;
}
if (scopeOffSet == 600) {
_root.newSound("SNDreload");
}
if (scopeOffSet > 0) {
scopeOffSet = scopeOffSet - 100;
}
if (FBG._alpha < 100) {
FBG._alpha = FBG._alpha + 25;
} else {
IFBG._x = IFBG_PosX;
IFBG._y = IFBG_PosY;
IFBG._xscale = 600;
IFBG._yscale = 600;
swapBlur(IFBG, FBG);
IFBG.setMask(scope.scope.scopeMask);
}
if (maskSet == true) {
maskSet = false;
}
}
scope.scope._y = scope.scope._y + (((scopePosY + scopeOffSet) - scope.scope._y) / 5);
scope.scope2._y = scope.scope2._y + ((((scopePosY - scopeOffSet) - scope.scope2._y) + 1250) / 10);
_parent._rotation = _parent._rotation + ((rotateTarget - _parent._rotation) / 5);
rotateTarget = rotateTarget / 1.03;
_parent.FLASH._alpha = _parent.FLASH._alpha / 1.1;
_parent.HURT._alpha = _parent.HURT._alpha / 1.01;
_parent.DEAD._alpha = _parent.DEAD._alpha / 1.001;
knockOffsetX = knockOffsetX / 1.05;
knockOffsetY = knockOffsetY / 1.05;
if (scope._xscale < 100) {
scope._xscale = scope._xscale + 2;
scope._yscale = scope._yscale + 2;
} else if (scope._xscale > 106) {
scope._xscale = scope._xscale - 20;
scope._yscale = scope._yscale - 20;
}
MOUSE.x = MOUSE.x + (((_xmouse - MOUSE.x) + mouseOffSetX) / traumaTime);
MOUSE.y = MOUSE.y + (((_ymouse - MOUSE.y) + mouseOffSetY) / traumaTime);
if (traumaTime > 1) {
if (scopeOffSet == 600) {
FBG_FOCUS._alpha = Math.round(traumaTime / 10);
}
traumaTime--;
scope.scope.STATIC._alpha = 50;
if (scope.scope.TBAR._alpha < 100) {
scope.scope.TBAR._alpha = scope.scope.TBAR._alpha + 5;
}
scope.scope.TBAR.tbar._xscale = 0.833333333333333 * traumaTime;
} else if (scope.scope.TBAR._alpha > 0) {
scope.scope.TBAR._alpha = scope.scope.TBAR._alpha - 10;
}
if (MOUSE.x > xSize) {
MOUSE.x = xSize - 2;
} else if (MOUSE.x < (-xSize)) {
MOUSE.x = (-xSize) + 2;
}
if (MOUSE.y > ySize) {
MOUSE.y = ySize - 2;
} else if (MOUSE.y < (-(ySize / 4))) {
knockOffsetY = 0;
MOUSE.y = (-(ySize / 4)) + 2;
}
var _local3 = (MOUSE.x - scope._x) / 5;
var _local4 = (MOUSE.y - scope._y) / 5;
scope.scope.CH.SRing_O._rotation = scope.scope.CH.SRing_O._rotation + (_local3 * 2);
scope.scope.CH.SRing_I._rotation = scope.scope.CH.SRing_I._rotation - (_local4 * 2);
scope._x = scope._x + _local3;
scope._y = scope._y + _local4;
IFBG_PosX = IFBG_PosX - (_local3 * 2);
IFBG_PosY = IFBG_PosY - (_local4 * 2);
knoll._y = knoll._y + (_local4 * 0.2);
knoll._x = knoll._x + (_local3 * 0.3);
_x = (_x - (((_x + scope._x) + knockOffsetX) / 2));
_y = (_y - (((_y + scope._y) + knockOffsetY) / 2));
MD._x = _xmouse;
MD._y = _ymouse;
if (pythag(_xmouse, _ymouse, scope._x, scope._y + scope.scope._y) < 175) {
Mouse.hide();
MD._visible = true;
} else {
Mouse.show();
MD._visible = false;
}
} else {
deadCount++;
_root.setFade(_root.redFade, 50);
if (deadCount == 200) {
_root.setFade(_root.whiteFade, 150);
_root.gotoAndStop("RELOAD");
}
}
}
}
_root.setMusic("GAME");
xSize = 600;
ySize = 375;
var MOUSE = new Object();
MOUSE.x = _xmouse;
MOUSE.y = _ymouse;
traumaTime = 1;
knockOffsetX = 0;
knockOffsetY = 0;
var lookSwitch = false;
var look = true;
FBG_FOCUS._visible = false;
scope.scope.LH._alpha = 0;
var maskSet = true;
IFBG_PosX = IFBG._x;
IFBG_PosY = IFBG._y;
IFBG.createEmptyMovieClip("BULLETS", IFBG.getNextHighestDepth());
var sceneDepth1 = 0;
var sceneDepth2 = (sceneDepth1 + 1);
var sceneDepth3 = (sceneDepth2 + 1);
FBG.swapDepths(sceneDepth1);
IFBG.swapDepths(sceneDepth3);
knoll.swapDepths(getNextHighestDepth());
scope.swapDepths(getNextHighestDepth());
MD.swapDepths(getNextHighestDepth());
var targetCount = 0;
var targetArray = new Array();
var alarmVar = false;
var alarmCount = 0;
var totalAwareness = 1;
_root.levelValue1 = 0;
_root.levelValue2 = 0;
var hitBuffer = 0;
var bulletArray = new Array();
scopePosY = scope.scope._y;
var scopeOffSet = 0;
mouseOffSetX = 0;
mouseOffSetY = 0;
var sunBurn = 0;
var warnX = 0;
var warnY = 0;
var warnBuffer = 0;
var deadCount = 0;
Instance of Symbol 816 MovieClip "FBG" in Symbol 874 MovieClip Frame 1
/* no clip actions */
Symbol 879 Button
on (release) {
_root.setFade(_root.whiteFade, 300);
_root.gotoAndStop("Level" + _root.levelNo);
}
Symbol 881 Button
on (release) {
_root.setFade(_root.whiteFade, 100);
_root.gotoAndStop("TITLE");
}
Symbol 905 MovieClip Frame 81
stopAllSounds();
_root.playSound("LOSE");
Symbol 905 MovieClip Frame 145
_root.setFade(_root.whiteFade, 50);
_root.gotoAndStop("CS1a");
Symbol 936 MovieClip Frame 141
Symbol 936 MovieClip Frame 142
_root.setFade(_root.whiteFade, 100);
Symbol 936 MovieClip Frame 282
_root.setFade(_root.whiteFade, 100);
_root.gotoAndStop("controltype");
Symbol 943 Button
on (release) {
_root.setFade(_root.whiteFade, 100);
_root.levelNo = 2;
if (_root.gameType == 2) {
_root.gotoAndStop("TITLE");
} else {
_root.gotoAndStop("Level2");
}
}
Symbol 956 MovieClip Frame 1
function onEnterFrame() {
if (timer < (timerCount * timerMax)) {
timer++;
} else if ((textCols + 1) != timerCount) {
this["desc" + timerCount] = this["tag" + timerCount];
this["res" + timerCount] = this["result" + timerCount];
timerCount++;
_root.playSound("BANG");
}
}
desc1 = "";
desc2 = "";
desc3 = "";
desc4 = "";
res1 = "";
res2 = "";
res3 = "";
res4 = "";
timer = timerMax;
timerCount = 1;
Symbol 957 MovieClip Frame 39
stop();
Instance of Symbol 956 MovieClip in Symbol 957 MovieClip Frame 39
onClipEvent (load) {
textCols = 4;
tag1 = "SHOTS FIRED";
tag2 = "SHOTS HIT";
tag3 = "PERCENTAGE";
tag4 = "LEVEL SCORE";
var percent = Math.round((100 / _root.levelValue1) * _root.levelValue2);
result1 = _root.levelValue1;
result2 = _root.levelValue2;
result3 = percent + " PERCENT";
result4 = percent * 50;
timerMax = 15;
_root.level1Score = result4;
}
Symbol 962 Button
on (release) {
_root.setFade(_root.whiteFade, 100);
_root.levelNo = 3;
if (_root.gameType == 2) {
_root.gotoAndStop("TITLE");
} else {
_root.gotoAndStop("Level3");
}
}
Symbol 966 MovieClip Frame 39
stop();
Instance of Symbol 956 MovieClip in Symbol 966 MovieClip Frame 39
onClipEvent (load) {
textCols = 4;
tag1 = "SHOTS FIRED";
tag2 = "SHOTS HIT";
tag3 = "PERCENTAGE";
tag4 = "LEVEL SCORE";
var percent = Math.round((100 / _root.levelValue1) * _root.levelValue2);
result1 = _root.levelValue1;
result2 = _root.levelValue2;
result3 = percent + " PERCENT";
result4 = percent * 50;
timerMax = 15;
_root.level2Score = result4;
}
Symbol 988 MovieClip Frame 71
stop();
Symbol 1000 Button
on (release) {
_root.setFade(_root.whiteFade, 100);
_root.levelNo = 1;
if (_root.gameType == 2) {
_root.gotoAndStop("TITLE");
} else {
_root.level1Boss = true;
_root.gotoAndStop("Level1");
}
}
Symbol 1002 MovieClip Frame 105
stop();
Instance of Symbol 956 MovieClip in Symbol 1002 MovieClip Frame 105
onClipEvent (load) {
textCols = 4;
tag1 = "SHOTS FIRED";
tag2 = "SHOTS HIT";
tag3 = "PERCENTAGE";
tag4 = "LEVEL SCORE";
var percent = Math.round((100 / _root.levelValue1) * _root.levelValue2);
result1 = _root.levelValue1;
result2 = _root.levelValue2;
result3 = percent + " PERCENT";
result4 = percent * 50;
timerMax = 15;
_root.level4Score = result4;
}
Symbol 1005 Button
on (release) {
_root.setFade(_root.whiteFade, 100);
_root.levelNo = 4;
_root.gotoAndStop("Level4");
}
Symbol 1009 MovieClip Frame 39
stop();
Instance of Symbol 956 MovieClip in Symbol 1009 MovieClip Frame 39
onClipEvent (load) {
textCols = 4;
tag1 = "SHOTS FIRED";
tag2 = "SHOTS HIT";
tag3 = "PERCENTAGE";
tag4 = "LEVEL SCORE";
var percent = Math.round((100 / _root.levelValue1) * _root.levelValue2);
result1 = _root.levelValue1;
result2 = _root.levelValue2;
result3 = percent + " PERCENT";
result4 = percent * 50;
timerMax = 15;
_root.level3Score = result4;
}
Symbol 1015 Button
on (release) {
_root.setFade(_root.whiteFade, 100);
_root.menuPos = 0;
_root.gotoAndStop("TITLE");
}
Symbol 1017 MovieClip Frame 2
stopAllSounds();
_root.playSound("INTROSOUND");
Symbol 1017 MovieClip Frame 100
_root.playSound("SHOT");
Symbol 1017 MovieClip Frame 103
_root.playSound("SHOT");
Symbol 1017 MovieClip Frame 106
_root.playSound("SHOT");
Symbol 1017 MovieClip Frame 109
_root.playSound("SHOT");
Symbol 1017 MovieClip Frame 119
_root.playSound("EXPBANG");
_root.playSound("EXPBANG");
_root.playSound("EXPBANG");
Symbol 1017 MovieClip Frame 157
_root.setFade(_root.whiteFade, 200);
Symbol 1017 MovieClip Frame 158
stop();
stopAllSounds();
_root.playMusic("MENU");
Instance of Symbol 956 MovieClip in Symbol 1017 MovieClip Frame 158
onClipEvent (load) {
textCols = 4;
tag1 = "GAME TIME SCORE";
tag2 = "LEVEL SCORES";
tag3 = "DIFFICULTY BONUS";
tag4 = "TOTAL GAME SCORE";
result1 = Math.round(1000000 / (_root.gameTimer / 2));
result2 = ((_root.level1Score + _root.level2Score) + _root.level3Score) + _root.level4Score;
if (_root.difficulty > 1) {
result3 = 6000;
} else {
result3 = 0;
}
result4 = (result1 + result2) + result3;
timerMax = 15;
if (_root.savefile.data.highScore < result4) {
_root.savefile.data.highScore = result4;
_root.savefile.flush();
}
}
Symbol 1018 Button
on (release) {
_root.setFade(_root.whiteFade, 100);
_root.menuPos = 1200;
_root.gotoAndStop("TITLE");
}
Symbol 1028 MovieClip Frame 1
stop();
Symbol 1035 MovieClip Frame 1
function onEnterFrame() {
if (cycleImage == true) {
Image1._x = Image1._x + offsetSpeed;
Image2._x = Image2._x - offsetSpeed;
if (Image1._xscale > 50) {
Image1._xscale = Image1._xscale - 2.5;
Image1._yscale = Image1._yscale - 2.5;
Image2._xscale = Image2._xscale + 2.5;
Image2._yscale = Image2._yscale + 2.5;
}
if (Image1._x == Image1Orig) {
Image1._x = Image1Orig;
Image2._x = Image2Orig;
Image1.swapDepths(Image2);
Image1.gotoAndStop(Image2._currentframe);
Image1._xscale = 100;
Image1._yscale = 100;
Image2._xscale = 50;
Image2._yscale = 50;
cycleImage = false;
}
offsetSpeed = offsetSpeed - (2 * moveDir);
if (offsetSpeed == 3) {
Image1.swapDepths(Image2);
}
}
if (Key.isDown(39)) {
keyPressSwitch = true;
if (cycleImage == false) {
moveDir = 1;
cycleImage = true;
offsetSpeed = 23 * moveDir;
ImageSelect();
}
} else if (Key.isDown(37)) {
keyPressSwitch = true;
if (cycleImage == false) {
moveDir = -1;
cycleImage = true;
offsetSpeed = 23 * moveDir;
ImageSelect();
}
} else if ((Key.isDown(39) == false) && (Key.isDown(37) == false)) {
keyPressSwitch = false;
}
descText = (("Image " + currentImage) + " of ") + imageNum;
}
function ImageSelect() {
currentImage = currentImage + (1 * moveDir);
if (currentImage == 0) {
currentImage = imageNum;
} else if (currentImage > imageNum) {
currentImage = 1;
}
Image2.gotoAndStop(currentImage);
}
_quality = "best";
var imageNum = Image1._totalframes;
var currentImage = 1;
var cycleImage = false;
var offsetSpeed = 0;
var Image1Orig = Image1._x;
var Image2Orig = Image2._x;
var moveDir = -1;
var cycleBuffer = 0;
var keyPressSwitch = false;
Image1.gotoAndStop(currentImage);
Image2.gotoAndStop(currentImage + 1);
Symbol 1050 MovieClip Frame 1
function onEnterFrame() {
if (cycleImage == true) {
Image1._x = Image1._x + offsetSpeed;
Image2._x = Image2._x - offsetSpeed;
if (Image1._xscale > 50) {
Image1._xscale = Image1._xscale - 2.5;
Image1._yscale = Image1._yscale - 2.5;
Image2._xscale = Image2._xscale + 2.5;
Image2._yscale = Image2._yscale + 2.5;
}
if (Image1._x == Image1Orig) {
Image1._x = Image1Orig;
Image2._x = Image2Orig;
Image1.swapDepths(Image2);
Image1.gotoAndStop(Image2._currentframe);
Image1._xscale = 100;
Image1._yscale = 100;
Image2._xscale = 50;
Image2._yscale = 50;
cycleImage = false;
}
offsetSpeed = offsetSpeed - (2 * moveDir);
if (offsetSpeed == 3) {
Image1.swapDepths(Image2);
}
}
if (Key.isDown(39)) {
keyPressSwitch = true;
if (cycleImage == false) {
moveDir = 1;
cycleImage = true;
offsetSpeed = 23 * moveDir;
ImageSelect();
}
} else if (Key.isDown(37)) {
keyPressSwitch = true;
if (cycleImage == false) {
moveDir = -1;
cycleImage = true;
offsetSpeed = 23 * moveDir;
ImageSelect();
}
} else if ((Key.isDown(39) == false) && (Key.isDown(37) == false)) {
keyPressSwitch = false;
}
descText = (("Image " + currentImage) + " of ") + imageNum;
}
function ImageSelect() {
currentImage = currentImage + (1 * moveDir);
if (currentImage == 0) {
currentImage = imageNum;
} else if (currentImage > imageNum) {
currentImage = 1;
}
Image2.gotoAndStop(currentImage);
}
_quality = "best";
var imageNum = Image1._totalframes;
var currentImage = 1;
var cycleImage = false;
var offsetSpeed = 0;
var Image1Orig = Image1._x;
var Image2Orig = Image2._x;
var moveDir = -1;
var cycleBuffer = 0;
var keyPressSwitch = false;
Image1.gotoAndStop(currentImage);
Image2.gotoAndStop(currentImage + 1);
Symbol 1062 MovieClip Frame 1
function onEnterFrame() {
if (cycleImage == true) {
Image1._x = Image1._x + offsetSpeed;
Image2._x = Image2._x - offsetSpeed;
if (Image1._xscale > 50) {
Image1._xscale = Image1._xscale - 2.5;
Image1._yscale = Image1._yscale - 2.5;
Image2._xscale = Image2._xscale + 2.5;
Image2._yscale = Image2._yscale + 2.5;
}
if (Image1._x == Image1Orig) {
Image1._x = Image1Orig;
Image2._x = Image2Orig;
Image1.swapDepths(Image2);
Image1.gotoAndStop(Image2._currentframe);
Image1._xscale = 100;
Image1._yscale = 100;
Image2._xscale = 50;
Image2._yscale = 50;
cycleImage = false;
}
offsetSpeed = offsetSpeed - (2 * moveDir);
if (offsetSpeed == 3) {
Image1.swapDepths(Image2);
}
}
if (Key.isDown(39)) {
keyPressSwitch = true;
if (cycleImage == false) {
moveDir = 1;
cycleImage = true;
offsetSpeed = 23 * moveDir;
ImageSelect();
}
} else if (Key.isDown(37)) {
keyPressSwitch = true;
if (cycleImage == false) {
moveDir = -1;
cycleImage = true;
offsetSpeed = 23 * moveDir;
ImageSelect();
}
} else if ((Key.isDown(39) == false) && (Key.isDown(37) == false)) {
keyPressSwitch = false;
}
descText = (("Image " + currentImage) + " of ") + imageNum;
}
function ImageSelect() {
currentImage = currentImage + (1 * moveDir);
if (currentImage == 0) {
currentImage = imageNum;
} else if (currentImage > imageNum) {
currentImage = 1;
}
Image2.gotoAndStop(currentImage);
}
_quality = "best";
var imageNum = Image1._totalframes;
var currentImage = 1;
var cycleImage = false;
var offsetSpeed = 0;
var Image1Orig = Image1._x;
var Image2Orig = Image2._x;
var moveDir = -1;
var cycleBuffer = 0;
var keyPressSwitch = false;
Image1.gotoAndStop(currentImage);
Image2.gotoAndStop(currentImage + 1);
Symbol 1064 Button
on (release) {
getURL ("http://www.pandemicstudios.com/mercenaries/index.php", "_blank");
}
Symbol 1067 Button
on (release) {
getURL ("http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash", "_blank");
}
Symbol 1071 Button
on (release) {
_root.gotoAndStop("INTRO");
}