Frame 1
fscommand ("allowScale", "false");
_quality = "HIGH";
Stage.showMenu = false;
onLoad = function () {
this.progressbar.bar_mc._width = 1;
var _local2 = false;
};
onEnterFrame = function () {
myLoaded = Math.round(_root.getBytesLoaded());
myTotal = Math.round(_root.getBytesTotal());
myPercent = (myLoaded / myTotal) * 100;
this.progressbar.bar_mc._width = myPercent * 2;
percenttext.percentText.text = Math.round(myPercent) + "%";
if ((myLoaded == myTotal) && (_root.animationCompleted == true)) {
gotoAndPlay (3);
_root.animationCompleted = false;
}
};
animation.onPress = function () {
getURL ("http://www.flasharcade.com/", "_blank");
};
stop();
Frame 4
stop();
fscommand ("allowScale", "false");
_quality = "HIGH";
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 500000);
_root.gameBGSound.setVolume(80);
Frame 6
stop();
Frame 8
_quality = "LOW";
stop();
Frame 10
function clearAll() {
j = 1;
while (j < 10) {
var _local2 = _root["targetEnemyClip" + j];
_local2.removeMovieClip();
j++;
}
}
_quality = "HIGH";
stopAllSounds();
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 500000);
_root.gameBGSound.setVolume(80);
clearAll();
stop();
Frame 12
_quality = "HIGH";
stop();
Symbol 40 MovieClip Frame 95
stop();
Symbol 56 MovieClip Frame 201
stop();
_root.animationCompleted = true;
Instance of Symbol 61 MovieClip "bar_mc" in Symbol 62 MovieClip Frame 1
onClipEvent (enterFrame) {
_xscale = (_root.percentDone * 4);
}
Symbol 134 MovieClip Frame 30
stop();
Symbol 135 MovieClip Frame 30
stop();
_parent.removeMovieClip();
Symbol 136 MovieClip [bombClip] Frame 1
stop();
Symbol 136 MovieClip [bombClip] Frame 2
stop();
Symbol 142 MovieClip [bullet1] Frame 4
stop();
Symbol 142 MovieClip [bullet1] Frame 5
Symbol 142 MovieClip [bullet1] Frame 7
this.removeMovieClip();
stop();
Symbol 148 MovieClip [bullet2] Frame 4
stop();
Symbol 148 MovieClip [bullet2] Frame 5
Symbol 148 MovieClip [bullet2] Frame 7
this.removeMovieClip();
stop();
Symbol 150 MovieClip [bullet3] Frame 4
stop();
Symbol 150 MovieClip [bullet3] Frame 5
Symbol 150 MovieClip [bullet3] Frame 7
this.removeMovieClip();
stop();
Symbol 160 MovieClip [ebullet] Frame 1
stop();
Symbol 160 MovieClip [ebullet] Frame 2
Symbol 160 MovieClip [ebullet] Frame 16
this.removeMovieClip();
stop();
Symbol 171 MovieClip Frame 30
stop();
_parent.gotoAndStop(1);
Symbol 172 MovieClip Frame 30
stop();
_parent.removeMovieClip();
Symbol 173 MovieClip [eJeep] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 173 MovieClip [eJeep] Frame 2
stop();
Symbol 173 MovieClip [eJeep] Frame 3
stop();
Symbol 180 MovieClip Frame 30
stop();
_parent.gotoAndStop(1);
Symbol 181 MovieClip Frame 30
stop();
_parent.removeMovieClip();
Symbol 182 MovieClip [eJeep2] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 182 MovieClip [eJeep2] Frame 2
stop();
Symbol 182 MovieClip [eJeep2] Frame 3
stop();
Symbol 191 MovieClip Frame 10
_parent.gotoAndStop("gun1_still");
Symbol 197 MovieClip Frame 30
stop();
_parent.removeMovieClip();
Symbol 198 MovieClip [eJeep3] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 198 MovieClip [eJeep3] Frame 2
stop();
Symbol 198 MovieClip [eJeep3] Frame 3
stop();
Symbol 209 MovieClip Frame 1
_root.stage_mc._y = random(20);
Symbol 209 MovieClip Frame 3
_root.stage_mc._y = random(10);
Symbol 209 MovieClip Frame 5
_root.stage_mc._y = random(30);
Symbol 209 MovieClip Frame 7
_root.stage_mc._y = random(10);
Symbol 209 MovieClip Frame 9
_root.stage_mc._y = random(20);
Symbol 209 MovieClip Frame 11
_root.stage_mc._y = random(2);
Symbol 209 MovieClip Frame 13
_root.stage_mc._y = 4;
Symbol 209 MovieClip Frame 31
_root.enemyKilled = _root.enemyKilled + 1;
_parent.removeMovieClip();
Symbol 210 MovieClip [ePlane] Frame 1
stop();
Symbol 210 MovieClip [ePlane] Frame 2
stop();
Symbol 222 MovieClip Frame 30
stop();
_parent.gotoAndStop(1);
Symbol 223 MovieClip Frame 30
stop();
_parent.removeMovieClip();
Symbol 224 MovieClip [eTruck] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 224 MovieClip [eTruck] Frame 2
stop();
Symbol 224 MovieClip [eTruck] Frame 3
stop();
Symbol 229 MovieClip Frame 30
stop();
_parent.gotoAndStop(1);
Symbol 230 MovieClip Frame 5
if (!_root.gameEnd) {
_root.heroHealth = _root.heroHealth + 30;
if (_root.heroHealth > 100) {
_root.heroHealth = 100;
}
}
Symbol 230 MovieClip Frame 30
stop();
_root.powerupStatus = false;
_parent.removeMovieClip();
Symbol 231 MovieClip [eTruck1] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 231 MovieClip [eTruck1] Frame 2
stop();
Symbol 231 MovieClip [eTruck1] Frame 3
stop();
Symbol 237 MovieClip Frame 30
stop();
_parent.gotoAndStop(1);
Symbol 238 MovieClip Frame 30
stop();
_root.powerupStatus = false;
_root.bullet2Total = _root.bullet2Total + 10;
_root.bullet2Remaining = _root.bullet2Remaining + 10;
_parent.removeMovieClip();
Symbol 239 MovieClip [eTruck2] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 239 MovieClip [eTruck2] Frame 2
stop();
Symbol 239 MovieClip [eTruck2] Frame 3
stop();
Symbol 242 MovieClip Frame 30
stop();
_parent.gotoAndStop(1);
Symbol 243 MovieClip Frame 30
stop();
_root.powerupStatus = false;
_root.bullet3Total = _root.bullet3Total + 5;
_root.bullet3Remaining = _root.bullet3Remaining + 5;
_parent.removeMovieClip();
Symbol 244 MovieClip [eTruck3] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 244 MovieClip [eTruck3] Frame 2
stop();
Symbol 244 MovieClip [eTruck3] Frame 3
stop();
Symbol 251 MovieClip Frame 30
stop();
_parent.gotoAndStop(1);
Symbol 252 MovieClip Frame 30
stop();
_parent.removeMovieClip();
Symbol 253 MovieClip [eTruck4] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 253 MovieClip [eTruck4] Frame 2
stop();
Symbol 253 MovieClip [eTruck4] Frame 3
stop();
Symbol 274 MovieClip Frame 1
_root.stage_mc._y = random(10);
Symbol 274 MovieClip Frame 4
_root.stage_mc._y = random(30);
Symbol 274 MovieClip Frame 7
_root.stage_mc._y = random(10);
Symbol 274 MovieClip Frame 10
_root.stage_mc._y = random(20);
Symbol 274 MovieClip Frame 13
_root.stage_mc._y = random(5);
Symbol 274 MovieClip Frame 16
stop();
_root.stage_mc._y = 4;
Symbol 275 MovieClip Frame 30
stop();
_root.enemyKilled++;
_parent.removeMovieClip();
Symbol 276 MovieClip [heli2] Frame 1
stop();
Instance of Symbol 203 MovieClip "body_hit" in Symbol 276 MovieClip [heli2] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 276 MovieClip [heli2] Frame 2
stop();
Symbol 276 MovieClip [heli2] Frame 3
stop();
Symbol 276 MovieClip [heli2] Frame 4
stop();
Symbol 277 MovieClip [heliBullet] Frame 1
stop();
Symbol 277 MovieClip [heliBullet] Frame 2
Symbol 277 MovieClip [heliBullet] Frame 35
this.removeMovieClip();
stop();
Symbol 294 MovieClip Frame 1
stop();
Symbol 297 MovieClip Frame 10
stop();
Symbol 300 MovieClip Frame 9
stop();
Symbol 301 MovieClip Frame 1
gotoAndPlay (7);
Symbol 301 MovieClip Frame 33
stop();
_parent.removeMovieClip();
Symbol 302 MovieClip [soldier01] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 302 MovieClip [soldier01] Frame 2
stop();
Symbol 302 MovieClip [soldier01] Frame 3
stop();
Symbol 315 MovieClip Frame 10
stop();
Symbol 316 MovieClip Frame 1
gotoAndPlay (7);
Symbol 316 MovieClip Frame 43
stop();
_parent.removeMovieClip();
Symbol 317 MovieClip [soldier02] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 317 MovieClip [soldier02] Frame 2
stop();
Symbol 317 MovieClip [soldier02] Frame 3
stop();
Symbol 329 MovieClip Frame 10
stop();
Symbol 330 MovieClip Frame 1
gotoAndPlay (7);
Symbol 330 MovieClip Frame 43
stop();
_parent.removeMovieClip();
Symbol 331 MovieClip [soldier03] Frame 1
stop();
this.objectRef.hitFlag = false;
Symbol 331 MovieClip [soldier03] Frame 2
stop();
Symbol 331 MovieClip [soldier03] Frame 3
stop();
Symbol 351 MovieClip Frame 20
stop();
Symbol 352 Button
on (release) {
_root.gotoAndPlay("game");
}
Symbol 356 Button
on (release) {
_root.gotoAndPlay("inst");
}
Symbol 360 Button
on (release) {
_root.gotoAndPlay("highScore");
}
Symbol 382 MovieClip Frame 20
stop();
Symbol 387 Button
on (release) {
getURL ("http://www.flasharcade.com", "_blank");
}
Symbol 391 Button
on (release) {
getURL ("http://www.flasharcade.com/flash-games/", "_blank");
}
Symbol 399 Button
on (press) {
_root.gotoAndPlay("intro");
}
Symbol 402 MovieClip Frame 41
stop();
Symbol 414 MovieClip Frame 10
stop();
_root.stage_mc.gunInStillAnimation();
Symbol 416 MovieClip Frame 10
_parent.gotoAndStop("gun1_still");
Symbol 417 MovieClip Frame 11
stop();
_root.stage_mc.gunInAnimation();
Symbol 421 MovieClip Frame 10
stop();
_root.stage_mc.gunInStillAnimation();
Symbol 423 MovieClip Frame 10
_parent.gotoAndStop("gun2_still");
Symbol 424 MovieClip Frame 10
stop();
_root.stage_mc.gunInAnimation();
Symbol 428 MovieClip Frame 10
stop();
_root.stage_mc.gunInStillAnimation();
Symbol 432 MovieClip Frame 8
_parent.gotoAndStop("gun3_still");
Symbol 433 MovieClip Frame 10
stop();
_root.stage_mc.gunInAnimation();
Symbol 434 MovieClip Frame 1
Symbol 434 MovieClip Frame 2
stop();
_root.swapStatus = false;
Symbol 434 MovieClip Frame 3
stop();
Symbol 434 MovieClip Frame 4
stop();
Symbol 434 MovieClip Frame 5
stop();
Symbol 434 MovieClip Frame 6
stop();
_root.swapStatus = false;
Symbol 434 MovieClip Frame 7
stop();
Symbol 434 MovieClip Frame 8
stop();
Symbol 434 MovieClip Frame 9
stop();
Symbol 434 MovieClip Frame 10
stop();
_root.swapStatus = false;
Symbol 434 MovieClip Frame 11
stop();
Symbol 434 MovieClip Frame 12
stop();
Symbol 434 MovieClip Frame 13
stop();
Symbol 446 MovieClip Frame 30
_parent.gotoAndStop(1);
Symbol 446 MovieClip Frame 62
_parent._x = 450;
Symbol 446 MovieClip Frame 72
_parent.gotoAndStop(1);
Symbol 447 MovieClip Frame 30
_root.gotoAndPlay("end");
Symbol 449 MovieClip Frame 1
_root.stage_mc._y = random(20);
Symbol 449 MovieClip Frame 3
_root.stage_mc._y = random(10);
Symbol 449 MovieClip Frame 5
_root.stage_mc._y = random(20);
Symbol 449 MovieClip Frame 7
_root.stage_mc._y = 4;
Symbol 449 MovieClip Frame 9
stop();
_parent.gotoAndStop("still");
_root.stage_mc._y = 4;
Symbol 450 MovieClip Frame 1
stop();
dieStatus = false;
this.gunClip._visible = true;
Symbol 450 MovieClip Frame 2
stop();
this.gunClip._visible = true;
Symbol 450 MovieClip Frame 3
stop();
this.gunClip._visible = false;
Symbol 450 MovieClip Frame 4
stop();
this.gunClip._visible = true;
Symbol 450 MovieClip Frame 5
stop();
this.gunClip._visible = true;
Symbol 464 MovieClip Frame 1
function createECar() {
var _local4 = random(10);
if (_local4 <= 2) {
_root.cName = "eJeep";
_global.tempName = "eJeep1";
this.attachMovie(_root.cName, "eJeep1", _root.levelNum, {clipRef:_global.tempName, spotNumParam:1, wSpeed:_root.targetEJeep_Speed, lifeParam:_root.targetEJeep_Life});
this.eJeep1._xscale = -100;
} else if ((_local4 > 2) && (_local4 <= 5)) {
_root.cName = "eTruck";
_global.tempName = "eJeep1";
this.attachMovie(_root.cName, "eJeep1", _root.levelNum, {clipRef:_global.tempName, spotNumParam:1, wSpeed:_root.targetEJeep_Speed, lifeParam:_root.targetEJeep_Life});
this.eJeep1._xscale = -100;
} else if ((_local4 > 5) && (_local4 <= 7)) {
_root.cName = "eJeep2";
_global.tempName = "eJeep1";
this.attachMovie(_root.cName, "eJeep1", _root.levelNum, {clipRef:_global.tempName, spotNumParam:1, wSpeed:_root.targetEJeep_Speed, lifeParam:_root.targetEJeep_Life});
this.eJeep1._xscale = -100;
} else {
_root.cName = "eTruck4";
_global.tempName = "eJeep1";
this.attachMovie(_root.cName, "eJeep1", _root.levelNum, {clipRef:_global.tempName, spotNumParam:1, wSpeed:_root.targetEJeep_Speed, lifeParam:_root.targetEJeep_Life});
this.eJeep1._xscale = -100;
}
this.eJeep1._x = -50;
this.eJeep1._y = 400;
_root.targetEnemyClip = this.eJeep1;
_root.levelNum++;
clearInterval(_root.eJeepInterval);
}
function createECar4() {
if (_root.level > 3) {
var _local4 = random(20);
} else {
var _local4 = random(10);
}
_global.tempName = "eJeep4";
if (_local4 <= 3) {
_root.cName = "eJeep";
this.attachMovie(_root.cName, "eJeep4", _root.levelNum, {spotNumParam:8, wSpeed:_root.targetEJeep3_Speed, lifeParam:_root.targetEJeep_Life});
this.eJeep4._xscale = -100;
} else if ((_local4 > 3) && (_local4 <= 7)) {
_root.cName = "eTruck";
this.attachMovie(_root.cName, "eJeep4", _root.levelNum, {spotNumParam:8, wSpeed:_root.targetEJeep3_Speed, lifeParam:_root.targetEJeep_Life});
this.eJeep4._xscale = -100;
} else if ((_local4 > 10) && (_local4 <= 16)) {
_root.cName = "eTruck4";
this.attachMovie(_root.cName, "eJeep4", _root.levelNum, {spotNumParam:8, wSpeed:_root.targetEJeep3_Speed, lifeParam:_root.targetEJeep_Life});
this.eJeep4._xscale = -100;
} else if ((_local4 > 16) && (_local4 <= 19)) {
_root.cName = "eJeep3";
this.attachMovie(_root.cName, "eJeep4", _root.levelNum, {clipRef:_global.tempName, spotNumParam:8, wSpeed:_root.targetEJeep3_Speed, lifeParam:_root.targetEJeep_Life});
} else {
_root.cName = "eTruck4";
this.attachMovie(_root.cName, "eJeep4", _root.levelNum, {spotNumParam:8, wSpeed:_root.targetEJeep3_Speed, lifeParam:_root.targetEJeep_Life});
this.eJeep4._xscale = -100;
}
this.eJeep4._x = -50;
this.eJeep4._y = 400;
_root.targetEnemyClip8 = this.eJeep4;
_root.levelNum++;
clearInterval(_root.eJeepInterval4);
}
function createECar5() {
var _local4 = random(10);
if (_local4 <= 3) {
_root.cName3 = "soldier01";
} else if ((_local4 > 3) && (_local4 <= 7)) {
_root.cName3 = "soldier02";
} else {
_root.cName3 = "soldier03";
}
_global.tempName = "esoldier1";
this.attachMovie(_root.cName3, "esoldier1", _root.levelNum, {clipRef:_global.tempName, spotNumParam:9, wSpeed:25, lifeParam:_root.targetEJeep_Life});
this.esoldier1._x = 610;
this.esoldier1._y = 400;
_root.targetEnemyClip9 = this.esoldier1;
_root.levelNum++;
clearInterval(_root.eJeepInterval5);
}
function createECar2() {
var _local4 = random(10);
if (_local4 <= 3) {
_root.cName2 = "eJeep";
this.attachMovie(_root.cName2, "eJeep2", _root.levelNum, {spotNumParam:2, wSpeed:_root.targetEJeep2_Speed, lifeParam:_root.targetEJeep2_Life});
this.eJeep2._xscale = -100;
} else if ((_local4 > 3) && (_local4 <= 7)) {
_root.cName = "eJeep2";
_global.tempName = "eJeep2";
this.attachMovie(_root.cName, "eJeep2", _root.levelNum, {clipRef:_global.tempName, spotNumParam:2, wSpeed:_root.targetEJeep2_Speed, lifeParam:_root.targetEJeep2_Life});
this.eJeep2._xscale = -100;
} else {
_root.cName2 = "eTruck";
this.attachMovie(_root.cName2, "eJeep2", _root.levelNum, {spotNumParam:2, wSpeed:_root.targetEJeep2_Speed, lifeParam:_root.targetEJeep2_Life});
this.eJeep2._xscale = -100;
}
this.eJeep2._x = 650;
this.eJeep2._y = 400;
_root.targetEnemyClip2 = this.eJeep2;
_root.levelNum++;
clearInterval(_root.eJeepInterval2);
}
function createEnemyPlane() {
this.attachMovie("ePlane", "ePlane1", _root.levelNum, {spotNumParam:3, wSpeed:_root.targetEPlane_Speed, lifeParam:35, cNum:_root.targetBombNum});
this.ePlane1._x = 650;
this.ePlane1._y = 120;
_root.targetEnemyClip3 = this.ePlane1;
_root.levelNum++;
}
function createPowerup() {
_root.powerupStatus = true;
var _local3 = random(10);
if ((_root.heroHealth < 40) && (_local3 < 8)) {
_root.pName = "eTruck1";
} else {
_local3 = random(10);
if (_local3 < 6) {
_root.pName = "eTruck2";
} else {
_root.pName = "eTruck3";
}
}
this.attachMovie(_root.pName, "pTruck2", _root.levelNum, {spotNumParam:6, wSpeed:4, lifeParam:15});
this.pTruck2._x = -50;
this.pTruck2._y = 400;
this.pTruck2._xscale = -100;
_root.targetEnemyClip6 = this.pTruck2;
_root.levelNum++;
}
function createHelicopter() {
_global.tempName = "heli2";
var _local4 = random(2);
if (_local4 == 1) {
_root.yHeli = 20 + random(80);
this.attachMovie("heli2", "heli2", _root.levelNum, {clipRef:_global.tempName, spotNumParam:7, wSpeed:_root.targetEHeli_Speed, lifeParam:_root.targetEHeli_Life, initx:620, inity:_root.yHeli, direction:-1, bulletFrequencyParam:40});
this.heli2._x = 620;
this.heli2._xscale = 100;
} else {
_root.yHeli = 20 + random(80);
_root.Heli_Speed = _root.targetEHeli_Speed * -1;
this.attachMovie("heli2", "heli2", _root.levelNum, {clipRef:_global.tempName, spotNumParam:7, wSpeed:_root.Heli_Speed, lifeParam:_root.targetEHeli_Life, initx:-10, inity:_root.yHeli, direction:-1, bulletFrequencyParam:40});
this.heli2._x = -10;
this.heli2._xscale = -100;
}
_root.targetEnemyClip7 = this.heli2;
_root.levelNum++;
clearInterval(_root.heliInterval);
}
function checkScore() {
if (_root.score > _root.civilianScore_Array[_root.level]) {
_root.level++;
_root.mc_level.gotoAndPlay(2);
updateParam();
}
}
function updateParam() {
clearAllIntervals();
trace("update");
_root.targetEJeep_Interval = _root.eJeep_Interval_Array[_root.level];
_root.targetEJeep2_Interval = _root.eJeep2_Interval_Array[_root.level];
_root.targetEJeep3_Interval = _root.eJeep3_Interval_Array[_root.level];
_root.targetMine_Interval = _root.mine_Interval_Array[_root.level];
_root.targetEHeli_Interval = _root.eHeli_Interval_Array[_root.level];
_root.targetEPlane_Interval = _root.enemyPlane_Interval_Array[_root.level];
_root.targetCPlane_Interval = _root.civilianPlane_Interval_Array[_root.level];
_root.targetCivilianNum = _root.civilianDrop_Array[_root.level];
_root.targetBombNum = _root.bombDrop_Array[_root.level];
_root.targetBombDropSpeed = _root.bombDrop_Speed[_root.level];
_root.bombTrackNum = _root.bombTrack_Array[_root.level];
_root.targetEJeep_Speed = _root.eJeepSpeed_Array[_root.level];
_root.targetEJeep2_Speed = _root.eJeep2Speed_Array[_root.level];
_root.targetEJeep3_Speed = _root.eJeep3Speed_Array[_root.level];
_root.targetEHeli_Speed = _root.eHeliSpeed_Array[_root.level];
_root.targetMine_Speed = _root.mineSpeed_Array[_root.level];
_root.targetEJeep_Life = _root.eJeepLife_Array[_root.level];
_root.targetEJeep2_Life = _root.eJeep2Life_Array[_root.level];
_root.targetEHeli_Life = _root.eHeliLife_Array[_root.level];
_root.targetEPlane_Speed = _root.ePlaneSpeed_Array[_root.level];
_root.targetCPlane_Speed = _root.cPlaneSpeed_Array[_root.level];
setAllIntervals();
}
function clearAllIntervals() {
clearInterval(_root.ePlaneInterval);
clearInterval(_root.powerupDrop_Interval);
}
function setAllIntervals() {
if ((_root.level == 1) || (_root.level > 2)) {
_root.ePlaneInterval = setInterval(this, "createEnemyPlane", _root.targetEPlane_Interval);
_root.createEnemy3Flag = true;
_root.dieEnemy3Flag = false;
}
_root.powerupDrop_Interval = setInterval(this, "createPowerup", 19000);
}
function moveBG() {
this=main_bg;//parameter overwritten
this.bg1._x = this.bg1._x + 25;
this.bg3._x = this.bg3._x + 1;
if (this.bg1._x >= 600) {
this.bg1._x = 0;
}
if (this.bg3._x >= 600) {
this.bg3._x = 0;
}
}
fscommand ("allowScale", "false");
fscommand ("fullScreen", "false");
_root.civilianScore_Array = [3000, 10000, 20000, 35000, 50000, 70000, 90000, 120000, 150000, 180000, 20000000];
_root.level = 1;
_root.heroLife = 1;
_root.score = 0;
_root.heroHealth = 100;
t_btn.useHandCursor = false;
clearInterval(_root.eJeepInterval);
clearInterval(_root.eJeepInterval2);
clearInterval(_root.eJeepInterval4);
clearInterval(_root.eJeepInterval5);
clearInterval(_root.heliInterval);
clearInterval(_root.powerupDrop_Interval);
_root.powerupStatus = false;
_root.targetHeroClip = this.heroJeep;
_root.levelNum = 10000;
_root.createEnemy1Flag = false;
_root.createEnemy2Flag = false;
_root.createEnemy3Flag = false;
_root.createEnemy4Flag = false;
_root.createEnemy5Flag = false;
_root.createEnemy6Flag = false;
_root.createEnemy7Flag = false;
_root.createEnemy8Flag = false;
_root.createEnemy9Flag = false;
_root.dieEnemy1Flag = false;
_root.dieEnemy2Flag = false;
_root.dieEnemy3Flag = false;
_root.dieEnemy4Flag = false;
_root.dieEnemy5Flag = false;
_root.dieEnemy6Flag = false;
_root.dieEnemy7Flag = false;
_root.dieEnemy8Flag = false;
_root.dieEnemy9Flag = false;
_root.gameEnd = false;
_root.eJeep_Interval_Array = [1800, 1800, 1800, 1800, 1500, 1500, 1500, 1500, 1500, 1500, 1500];
_root.eJeep3_Interval_Array = [2000, 2000, 2000, 2000, 1800, 1800, 1800, 1800, 1800, 1800, 1800];
_root.eJeep2_Interval_Array = [2200, 2200, 2200, 2200, 2000, 2000, 2000, 2000, 2000, 2000, 2000];
_root.eHeli_Interval_Array = [2000, 5000, 13000, 10000, 10000, 8000, 8000, 8000, 8000, 8000, 8000];
_root.eJeepSpeed_Array = [2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3];
_root.eJeep2Speed_Array = [-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2];
_root.eJeep3Speed_Array = [3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4];
_root.eHeliSpeed_Array = [3, 3, 4, 4, 5, 5, 5, 5, 5, 5, 5];
_root.eJeepLife_Array = [10, 10, 15, 15, 15, 15, 15, 20, 20, 20, 20];
_root.eJeep2Life_Array = [12, 12, 15, 15, 15, 15, 15, 15, 15, 15, 15];
_root.eHeliLife_Array = [15, 15, 15, 20, 20, 25, 25, 30, 30, 35, 35];
_root.enemyPlane_Interval_Array = [8000, 10000, 10000, 15000, 15000, 15000, 15000, 15000, 15000, 15000, 15000];
_root.ePlaneSpeed_Array = [5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7];
_root.bombDrop_Array = [2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4];
_root.bombTrack_Array = [30, 25, 20, 15, 15, 15, 15, 15, 15, 15, 15];
_root.bombDrop_Speed = [7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
_root.enemyKilled = 0;
_root.stage_mc._y = 4;
updateParam();
this.onEnterFrame = function () {
moveBG();
checkScore();
if (((!_root.createEnemy1Flag) && (!_root.powerupStatus)) && (_root.level <= 3)) {
clearInterval(_root.eJeepInterval);
_root.eJeepInterval = setInterval(this, "createECar", _root.targetEJeep_Interval);
_root.createEnemy1Flag = true;
_root.dieEnemy1Flag = false;
}
if (!_root.createEnemy2Flag) {
clearInterval(_root.eJeepInterval2);
_root.eJeepInterval2 = setInterval(this, "createECar2", _root.targetEJeep2_Interval);
_root.createEnemy2Flag = true;
_root.dieEnemy2Flag = false;
}
if (!_root.createEnemy9Flag) {
clearInterval(_root.eJeepInterval5);
var _local3 = (3 + random(5)) * 1000;
_root.eJeepInterval5 = setInterval(this, "createECar5", _local3);
_root.createEnemy9Flag = true;
_root.dieEnemy9Flag = false;
}
if ((!_root.createEnemy7Flag) && ((_root.level == 2) || (_root.level > 3))) {
clearInterval(_root.heliInterval);
_root.heliInterval = setInterval(this, "createHelicopter", _root.targetEHeli_Interval);
_root.createEnemy7Flag = true;
_root.dieEnemy7Flag = false;
}
if (((!_root.createEnemy8Flag) && (!_root.powerupStatus)) && (_root.level > 3)) {
clearInterval(_root.eJeepInterval4);
_root.eJeepInterval4 = setInterval(this, "createECar4", _root.targetEJeep3_Interval);
_root.createEnemy8Flag = true;
_root.dieEnemy8Flag = false;
}
if ((_root.dieEnemy1Flag && (!_root.powerupStatus)) && (_root.level <= 3)) {
clearInterval(_root.eJeepInterval);
_root.eJeepInterval = setInterval(this, "createECar", _root.targetEJeep_Interval);
_root.dieEnemy1Flag = false;
_root.createEnemy1Flag = true;
}
if ((_root.dieEnemy8Flag && (!_root.powerupStatus)) && (_root.level > 3)) {
clearInterval(_root.eJeepInterval4);
_root.eJeepInterval4 = setInterval(this, "createECar4", _root.targetEJeep3_Interval);
_root.dieEnemy8Flag = false;
_root.createEnemy8Flag = true;
}
if (_root.dieEnemy2Flag) {
clearInterval(_root.eJeepInterval2);
_root.eJeepInterval2 = setInterval(this, "createECar2", _root.targetEJeep2_Interval);
_root.dieEnemy2Flag = false;
_root.createEnemy2Flag = true;
}
if (_root.dieEnemy9Flag) {
clearInterval(_root.eJeepInterval5);
var _local3 = (3 + random(5)) * 1000;
_root.eJeepInterval5 = setInterval(this, "createECar5", _local3);
_root.createEnemy9Flag = true;
_root.dieEnemy9Flag = false;
}
if (_root.dieEnemy7Flag && ((_root.level == 2) || (_root.level > 3))) {
clearInterval(_root.heliInterval);
_root.heliInterval = setInterval(this, "createHelicopter", _root.targetEHeli_Interval);
_root.createEnemy7Flag = true;
_root.dieEnemy7Flag = false;
}
};
function heroBulletClass() {
this.objectRef = this;
this.init();
}
function heroBulletClass2() {
this.objectRef = this;
_root.bullet2Used++;
_root.bullet2Remaining = _root.bullet2Total - _root.bullet2Used;
super.init();
}
function heroBulletClass3() {
this.objectRef = this;
_root.bullet3Used++;
_root.bullet3Remaining = _root.bullet3Total - _root.bullet3Used;
super.init();
}
heroBulletClass.prototype = new MovieClip();
heroBulletClass.prototype.init = function () {
this.clip = eval (this.clipRef);
this.clip._x = this.initx;
this.clip._y = this.inity;
this.endx = this.initx + 300;
this.endy = this.inity - 300;
this.targetEnemy1 = _root.targetEnemyClip;
this.targetEnemy2 = _root.targetEnemyClip2;
this.targetEnemy3 = _root.targetEnemyClip3;
this.targetEnemy4 = _root.targetEnemyClip4;
this.targetEnemy5 = _root.targetEnemyClip5;
this.targetEnemy6 = _root.targetEnemyClip6;
this.targetEnemy7 = _root.targetEnemyClip7;
this.targetEnemy8 = _root.targetEnemyClip8;
this.targetEnemy9 = _root.targetEnemyClip9;
this.targetBombClip1 = _root.targetBombClip1;
this.targetBombClip2 = _root.targetBombClip2;
this.targetBombClip3 = _root.targetBombClip3;
this.targetBombClip4 = _root.targetBombClip4;
this.targetBombClip5 = _root.targetBombClip5;
this.targetBombClip6 = _root.targetBombClip6;
this.targetBombClip7 = _root.targetBombClip7;
this.bonus_mc = _root.targetBonusClip;
this.clipAngle = this.initAngle;
this.clip._rotation = this.clipAngle;
this.moveSpeed = 30;
this.counter = 0;
this.ammunationHitFlag = false;
this.bulletHitFlag = false;
this.ang = (this.clipAngle / 180) * Math.PI;
this.xspeed = Math.cos(this.ang) * this.moveSpeed;
this.yspeed = Math.sin(this.ang) * this.moveSpeed;
this.bSound = new Sound(this);
this.bSound.attachSound("gunSound");
this.bSound.start();
this.bSound.setVolume(20);
};
heroBulletClass.prototype.movement = function () {
this.clip._x = this.clip._x + this.xspeed;
this.clip._y = this.clip._y + this.yspeed;
this.counter++;
if (this.counter > 50) {
this.removeMovieClip();
}
j = 1;
while (j < 10) {
var _local2 = this["targetEnemy" + j];
if (this.clip.hitTest(_local2.body_hit)) {
this.bSound.stop();
this.bulletHitFlag = true;
this.objectRef.hitBullet(_local2);
this.clip.removeMovieClip();
delete this.objectRef;
return(undefined);
}
j++;
}
k = 1;
while (k < 7) {
var _local3 = this["targetBombClip" + k];
if (this.clip.hitTest(_local3.body_hit)) {
this.bSound.stop();
this.bulletHitFlag = true;
this.objectRef.hitBullet(_local3);
this.clip.removeMovieClip();
delete this.objectRef;
return(undefined);
}
k++;
}
};
heroBulletClass.prototype.hitBullet = function (eName) {
if (this.bulletHitFlag) {
eName.bulletHitFlag = true;
eName.hitBullet();
this.bulletHitFlag = false;
}
};
heroBulletClass.prototype.onEnterFrame = function () {
this.objectRef.movement();
};
heroBulletClass2.prototype = new heroBulletClass();
heroBulletClass2.prototype.hitBullet = function (eName) {
if (this.bulletHitFlag) {
eName.bulletHit2Flag = true;
eName.hitBullet2();
this.bulletHitFlag = false;
}
};
heroBulletClass3.prototype = new heroBulletClass();
heroBulletClass3.prototype.hitBullet = function (eName) {
if (this.bulletHitFlag) {
eName.bulletHit3Flag = true;
eName.hitBullet3();
this.bulletHitFlag = false;
}
};
Object.registerClass("bullet1", heroBulletClass);
Object.registerClass("bullet2", heroBulletClass2);
Object.registerClass("bullet3", heroBulletClass3);
heliObject = function () {
this.objectRef = this;
this.init();
};
heliObject.prototype = new MovieClip();
heliObject.prototype.init = function () {
this.clip = eval (this.clipRef);
this.clip._x = this.initx;
this.clip._y = this.inity;
this.bulletFlag = false;
this.bulletLocation = _root.stage_mc;
this.targetEnemy = _root.targetHeroClip;
this.xvel = this.wSpeed;
this.spotNum = this.spotNumParam;
this.life = this.lifeParam;
this.bulletFrequency = this.bulletFrequencyParam;
this.gravity = 0.1;
this.thrust = 2;
this.distance = 0;
this.dieFlag = false;
this.rotationAngle = 1;
this.bulletCounter = 0;
this.blastFlag = false;
this.bulletHitFlag = false;
this.yvel = -this.thrust;
this.trackFlag = false;
_root.hSound = new Sound(this);
_root.hSound.attachSound("heliSound");
_root.hSound.start(0, 1000);
_root.hSound.setVolume(100);
};
heliObject.prototype.yMovement = function () {
this.clip._y = this.clip._y + this.yvel;
this.yvel = this.yvel + this.gravity;
if (this.yvel >= this.thrust) {
this.gravity = 0.1;
this.thrust = 2;
this.yvel = -this.thrust;
}
};
heliObject.prototype.xMovement = function () {
trace(this.clip);
if (!this.trackFlag) {
this.clip._x = this.clip._x - this.xvel;
} else if (this.clip._x < this.targetEnemy._x) {
this.clip._x = this.clip._x + this.xvel;
diffx = this.getXDistance();
if (diffx < 20) {
this.xvel = 0;
} else if (diffx > 150) {
this.xvel = this.wSpeed;
}
} else if (this.clip._x > this.targetEnemy._x) {
this.clip._x = this.clip._x - this.xvel;
diffx = this.getXDistance();
if (diffx < 20) {
this.xvel = 0;
} else if (diffx > 150) {
this.xvel = this.wSpeed;
}
}
if (this.clip._x < 0) {
this.clip._x = 0;
this.reBounce();
} else if (this.clip._x > 640) {
this.clip._x = 640;
this.reBounce();
}
};
heliObject.prototype.getXDistance = function () {
return(Math.abs(this.targetEnemy._x - this.clip._x));
};
heliObject.prototype.rotateObject = function () {
this.clip._rotation = this.clip._rotation + this.rotationAngle;
if (this.clip._rotation > 5) {
this.rotationAngle = this.rotationAngle * -1;
} else if (this.clip._rotation < -5) {
this.rotationAngle = this.rotationAngle * -1;
}
};
heliObject.prototype.heliMove = function () {
this.xMovement();
};
heliObject.prototype.reBounce = function () {
this.xvel = this.xvel * -1;
this.clip._y = this.inity;
};
heliObject.prototype.onEnterFrame = function () {
this.objectRef.heliMove();
};
heliObject2 = function () {
super();
};
heliObject2.prototype = new heliObject();
heliObject2.prototype.heliMove = function () {
super.heliMove();
this.attack();
};
heliObject2.prototype.attack = function () {
var _local8 = (_root.stage_mc._x + this.targetEnemy._x) + random(100);
var _local7 = _root.stage_mc._y + this.targetEnemy._y;
var _local9 = ((_root.stage_mc._x + this.clip._x) + this.clip.body._x) + this.clip.body.gun._x;
var _local10 = ((_root.stage_mc._y + this.clip._y) + this.clip.body._y) + this.clip.body.gun._y;
var _local5 = _local8 - _local9;
var _local4 = _local7 - _local10;
var _local6 = Math.atan2(_local4, _local5);
var _local3 = Math.ceil((_local6 / Math.PI) * 180);
this.clip.body.gun._rotation = _local3 - 90;
_root.bulletAngle = _local3 - 90;
};
heliObject2.prototype.createBullet = function () {
if ((this.bulletFlag && (this.blastFlag == false)) && (String(_root.bulletAngle) != "NaN")) {
_global.temp = "heliBullet" + _root.heroBulletlevelNum;
_global.tempxpos = (this.clip._x + this.clip.body._x) + this.clip.body.gun._x;
_global.tempypos = this.clip._y + 35;
_global.tempAngle = _root.bulletAngle;
this.bulletLocation.attachMovie("heliBullet", _global.temp, _root.heroBulletlevelNum, {clipRef:_global.temp, initbulletx:_global.tempxpos, initbullety:_global.tempypos, initAngle:_global.tempAngle, mSpeed:8, bPowerParam:4});
_root.targetBombClip6 = _root.stage_mc["heliBullet" + _root.heroBulletlevelNum];
_root.heroBulletlevelNum++;
this.bulletFlag = false;
}
};
heliObject2.prototype.hitBullet = function () {
if (this.bulletHitFlag) {
this.life = this.life - 2;
if (this.life <= 0) {
this.blastFlag = true;
}
this.bulletHitFlag = false;
}
};
heliObject2.prototype.hitBullet2 = function () {
if (this.bulletHit2Flag) {
this.life = this.life - 5;
if (this.life <= 0) {
this.blastFlag = true;
}
this.bulletHit2Flag = false;
}
};
heliObject2.prototype.hitBullet3 = function () {
if (this.bulletHit3Flag) {
this.life = this.life - 150;
if (this.life <= 0) {
this.blastFlag = true;
}
this.bulletHit3Flag = false;
}
};
heliObject2.prototype.blast = function () {
if ((this.blastFlag && (this.dieFlag == false)) && (_root.gameEnd == false)) {
this.clip.gotoAndStop(3);
this.yvel = this.yvel + 2;
this.xvel = 0;
this.clip._y = this.clip._y + this.yvel;
this.clip._rotation = this.clip._rotation + 5;
if (this.clip._y > 250) {
_root.score = _root.score + 1000;
_root.ammunationX = this.clip._x;
this.clip.gotoAndStop(4);
this.dieFlag = true;
_root.hSound.stop();
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.blastFlag = false;
return(undefined);
}
}
};
heliObject2.prototype.onEnterFrame = function () {
if (!this.dieFlag) {
this.objectRef.heliMove();
this.objectRef.blast();
this.objectRef.bulletCounter++;
if ((this.objectRef.bulletCounter > this.objectRef.bulletFrequency) && (!this.objectRef.bulletFlag)) {
this.objectRef.bulletFlag = true;
this.objectRef.createBullet();
this.objectRef.bulletCounter = 0;
}
}
};
Object.registerClass("heli2", heliObject2);
function heliBulletClass() {
this.objectRef = this;
this.init();
}
heliBulletClass.prototype = new MovieClip();
heliBulletClass.prototype.init = function () {
this.clip = eval (this.clipRef);
this.clip._x = this.initbulletx;
this.clip._y = this.initbullety;
this.targetEnemy = _root.targetHeroClip;
this.clipAngle = this.initAngle + 90;
this.bulletHitFlag = false;
this.dieFlag = false;
this.power = this.bPowerParam;
this.life = 5;
this.clip._rotation = this.clipAngle - 90;
this.moveSpeed = this.mSpeed;
this.civilianAnimateFlag = false;
this.civilianHitFlag = false;
this.ang = (this.clipAngle / 180) * Math.PI;
this.xspeed = Math.cos(this.ang) * this.moveSpeed;
this.yspeed = Math.sin(this.ang) * this.moveSpeed;
this.bSound = new Sound(this);
this.bSound.attachSound("gunSound2");
this.bSound.start();
this.bSound.setVolume(50);
};
heliBulletClass.prototype.movement = function () {
this.clip._x = this.clip._x + this.xspeed;
this.clip._y = this.clip._y + this.yspeed;
if (this.clip._y > 600) {
trace(this.clip._name);
this.removeMovieClip();
}
if (this.clip.hitTest(this.targetEnemy.body_hit2)) {
this.enemyHitFlag = true;
this.hitEnemy();
}
j = 1;
while (j < 2) {
var _local3 = _root.stage_mc["mc_bulletArea" + j];
if (this.clip.hitTest(_local3)) {
this.clip.gotoAndPlay(2);
this.dieFlag = true;
}
j++;
}
};
heliBulletClass.prototype.hitEnemy = function () {
if (this.enemyHitFlag) {
_root.heroHealth = _root.heroHealth - this.power;
this.clip.gotoAndPlay(2);
this.dieFlag = true;
this.enemyHitFlag = false;
}
};
heliBulletClass.prototype.hitAmmunation = function () {
if (this.civilianHitFlag) {
this.civilianAnimateFlag = true;
this.animate();
this.civilianHitFlag = false;
}
};
heliBulletClass.prototype.animate = function () {
if (this.civilianAnimateFlag) {
this.clip.gotoAndPlay(2);
this.civilianAnimateFlag = false;
this.clip.onEnterFrame = null;
}
};
heliBulletClass.prototype.hitBullet = function () {
if (this.bulletHitFlag) {
this.life = this.life - 5;
if (this.life < 0) {
this.civilianHitFlag = true;
this.hitAmmunation();
}
this.bulletHitFlag = false;
}
};
heliBulletClass.prototype.hitBullet2 = function () {
if (this.bulletHit2Flag) {
this.life = this.life - 20;
if (this.life < 0) {
this.civilianHitFlag = true;
this.hitAmmunation();
}
this.bulletHit2Flag = false;
}
};
heliBulletClass.prototype.hitBullet3 = function () {
if (this.bulletHit3Flag) {
this.life = this.life - 50;
if (this.life < 0) {
this.civilianHitFlag = true;
this.hitAmmunation();
}
this.bulletHit3Flag = false;
}
};
heliBulletClass.prototype.onEnterFrame = function () {
if (!this.objectRef.dieFlag) {
this.objectRef.movement();
}
};
Object.registerClass("heliBullet", heliBulletClass);
Object.registerClass("ebullet", heliBulletClass);
function activity() {
}
function moveJeep() {
if (Key.isDown(65)) {
_root.jeepCoord = this.heroJeep.getBounds(this);
if (_root.jeepCoord.xMin >= 0) {
this.heroJeep._x = this.heroJeep._x - _root.jeepSpeed;
}
}
if (Key.isDown(68)) {
_root.jeepCoord = this.heroJeep.getBounds(this);
if (_root.jeepCoord.xMax <= 600) {
this.heroJeep._x = this.heroJeep._x + _root.jeepSpeed;
}
}
if (Key.isDown(87) && (!_root.jumpFlag)) {
_root.jumpFlag = true;
this.heroJeep.gotoAndStop("up");
this.heroJeep.jumpH = -14;
activity = jumpActivity;
}
}
function jumpActivity() {
if (_root.jumpFlag) {
this.heroJeep._y = this.heroJeep._y + this.heroJeep.jumpH;
_root.jeepCoord = this.heroJeep.getBounds(this);
if (_root.jeepCoord.xMin >= 0) {
this.heroJeep._x = this.heroJeep._x - 0.5;
}
this.heroJeep.jumpH = this.heroJeep.jumpH + 1;
trace(this.heroJeep.jumpH);
if (this.heroJeep.jumpH >= 0) {
this.heroJeep.jumpH = 0;
_root.fallFlag = true;
activity = fallActivity;
}
}
}
function fallActivity() {
if (_root.fallFlag) {
trace(this.heroJeep.jumpH);
if (this.heroJeep.jumpH < 14) {
this.heroJeep.jumpH = this.heroJeep.jumpH + 1.5;
}
trace(_root.fallFlag);
this.heroJeep._y = this.heroJeep._y + this.heroJeep.jumpH;
_root.jeepCoord = this.heroJeep.getBounds(this);
if (_root.jeepCoord.xMin >= 0) {
this.heroJeep._x = this.heroJeep._x - 0.5;
}
if (this.heroJeep._y > this.heroJeep.inity) {
this.heroJeep._y = this.heroJeep.inity;
this.heroJeep.gotoAndStop("down");
_root.jumpFlag = false;
_root.fallFlag = false;
activity = null;
}
}
}
function checkAngle() {
x1 = _root._xmouse;
y1 = _root._ymouse;
diffx = x1 - (this.heroJeep._x + this.heroJeep.gunClip._x);
diffy = y1 - (this.heroJeep._y + this.heroJeep.gunClip._y);
dist = Math.sqrt((diffx * diffx) + (diffy * diffy));
rad = Math.atan2(diffy, diffx);
ang = Math.ceil((rad / Math.PI) * 180);
trace("diffy =" + diffy);
if (diffy <= 0) {
if (diffx < 0) {
this.heroJeep.gunClip._yscale = -100;
this.heroJeep.gunClip._xscale = 80;
this.heroJeep.gunClip._rotation = ang;
_root.gunAngle = ang;
} else {
this.heroJeep.gunClip._yscale = 100;
this.heroJeep.gunClip._xscale = 80;
this.heroJeep.gunClip._rotation = ang;
_root.gunAngle = ang;
}
} else if (diffx < 0) {
this.heroJeep.gunClip._yscale = -100;
this.heroJeep.gunClip._xscale = 80;
this.heroJeep.gunClip._rotation = 180;
_root.gunAngle = 180;
} else {
this.heroJeep.gunClip._yscale = 100;
this.heroJeep.gunClip._xscale = 80;
this.heroJeep.gunClip._rotation = 0;
_root.gunAngle = 0;
}
}
function changeGun() {
if (_root.swapStatus != true) {
_root.previousGun = _root.currentGun;
_root.currentGun = _root.currentGun + 1;
if (_root.currentGun > 3) {
_root.currentGun = 1;
}
var _local2 = _root[("gun" + _root.currentGun) + "Available"];
var _local3 = _root[("gun" + _root.currentGun) + "Load"];
i = 0;
while (i < 5) {
if ((!_local2) || (!_local3)) {
_root.currentGun = _root.currentGun + 1;
if (_root.currentGun > 3) {
_root.currentGun = 1;
}
_local2 = _root[("gun" + _root.currentGun) + "Available"];
_local3 = _root[("gun" + _root.currentGun) + "Load"];
} else {
break;
}
i++;
}
gunOutAnimation();
_root.swapStatus = true;
}
}
function swapGun() {
if (Key.isDown(32) && (!Key.isDown(38))) {
changeGun();
}
}
function checkGunLoad() {
if (!_root.gun1Load) {
_root.gun1Counter++;
if (_root.gun1Counter > 5) {
_root.gun1Load = true;
_root.gun1Counter = 0;
}
}
if (!_root.gun2Load) {
_root.gun2Counter++;
if (_root.gun2Counter > 10) {
_root.gun2Load = true;
_root.gun2Counter = 0;
}
}
if (!_root.gun3Load) {
_root.gun3Counter++;
if (_root.gun3Counter > 20) {
_root.gun3Load = true;
_root.gun3Counter = 0;
}
}
}
function shoot() {
if (_root.heroAttackFlag) {
var _local3 = _root[("gun" + _root.currentGun) + "Available"];
var _local5 = _root[("gun" + _root.currentGun) + "Load"];
if (_local3 && (_local5)) {
if (_root.swapStatus != true) {
var _local4 = ("gun" + _root.currentGun) + "_fire";
this.heroJeep.gunClip.gotoAndStop(_local4);
createBullet();
_root[("gun" + _root.currentGun) + "Load"] = false;
}
} else if (!_local3) {
_root.swapStatus = false;
changeGun();
}
}
}
function gunOutAnimation() {
this.heroJeep.gunClip.gotoAndStop(("gun" + _root.previousGun) + "_out");
}
function gunInAnimation() {
this.heroJeep.gunClip.gotoAndStop(("gun" + _root.currentGun) + "_in");
}
function gunInStillAnimation() {
this.heroJeep.gunClip.gotoAndStop(("gun" + _root.currentGun) + "_still");
_root.swapStatus = false;
}
function createBullet() {
var _local4 = _root[("gun" + _root.currentGun) + "Available"];
var _local7 = "bullet" + _root.currentGun;
var _local3 = (("bullet" + _root.currentGun) + "_") + _root.heroBulletlevelNum;
var _local6 = this.heroJeep._x + this.heroJeep.gunClip._x;
var _local5 = this.heroJeep._y + this.heroJeep.gunClip._y;
trace(tempHeroBulletXPos);
if (_local4) {
_root.stage_mc.attachMovie(_local7, _local3, _root.heroBulletlevelNum, {clipRef:_local3, initx:_local6, inity:_local5, initAngle:_root.gunAngle});
_root.heroBulletlevelNum++;
}
}
function checkGunAvailable() {
if (_root.bullet1Used >= _root.bullet1Total) {
_root.gun1Available = false;
} else {
_root.gun1Available = true;
}
if (_root.bullet2Used >= _root.bullet2Total) {
_root.gun2Available = false;
} else {
_root.gun2Available = true;
}
if (_root.bullet3Used >= _root.bullet3Total) {
_root.gun3Available = false;
} else {
_root.gun3Available = true;
}
}
function checkGameEnd() {
if (_root.heroHealth <= 0) {
_root.heroHealth = 0;
this.heroJeep.gotoAndStop("die2");
_root.gameEnd = true;
moveJeep = function () {
};
this.heroJeep.dieStatus = true;
trace(_root.heroHealth);
}
}
_root.jeepCoord = {};
_root.jeepSpeed = 8;
_root.heroJump = false;
_root.currentGun = 1;
_root.previousGun = 1;
_root.heroBulletlevelNum = 20000;
_root.gun1Available = true;
_root.gun2Available = true;
_root.gun3Available = true;
_root.gun1Load = true;
_root.gun2Load = true;
_root.gun3Load = true;
_root.gun1Counter = 0;
_root.gun2Counter = 0;
_root.gun3Counter = 0;
_root.bullet1Used = 0;
_root.bullet2Used = 0;
_root.bullet3Used = 0;
_root.bullet1Total = 5000000 /* 0x4C4B40 */;
_root.bullet2Total = 20;
_root.bullet3Total = 10;
_root.bullet2Remaining = 20;
_root.bullet3Remaining = 10;
_root.swapStatus = false;
_root.jumpFlag = false;
_root.fallFlag = false;
this.heroJeep.dieStatus = false;
attackListener = new Object();
attackListener.onMouseDown = function () {
if (!_root.heroAttackFlag) {
_root.heroAttackFlag = true;
}
};
attackListener.onMouseUp = function () {
if (_root.heroAttackFlag) {
_root.heroAttackFlag = false;
}
};
Mouse.addListener(attackListener);
this.heroJeep.onEnterFrame = function () {
if (this.heroJeep.dieStatus != true) {
moveJeep();
swapGun();
checkGunLoad();
checkGunAvailable();
shoot();
checkAngle();
activity();
checkGameEnd();
}
};
stop();
function enemyJeep2() {
super();
}
function mineClass() {
super();
}
function powerUpClass() {
super();
}
enemyJeep = function () {
this.objectRef = this;
};
enemyJeep.prototype = new MovieClip();
enemyJeep.prototype.onLoad = function () {
this.objectRef.clipRef = this;
this.initEnemy();
};
enemyJeep.prototype.initEnemy = function () {
this.objectRef = this;
this.initxpos = this._x;
this.initypos = this._y;
this.targetHero = _root.targetHeroClip;
this.spotNum = this.spotNumParam;
this.walkSpeed = this.wSpeed;
this.life = this.lifeParam;
this.targetHeropos = this.targetHero._x;
this.dieFlag = false;
this.hitFlag = false;
this.crash = false;
this.bulletHitFlag = false;
this.bulletHit2Flag = false;
this.bulletHit3Flag = false;
if (this.wSpeed > 0) {
this.objectRef.walkSpeed = this.wSpeed + random(4);
} else {
this.objectRef.walkSpeed = (Math.abs(this.wSpeed) + random(4)) * -1;
}
};
enemyJeep.prototype.movement = function () {
this._x = this._x + this.objectRef.walkSpeed;
if (this.clipRef.hitTest(_root.targetHeroClip.body_hit2)) {
_root.heroHealth = _root.heroHealth - 4;
_root.targetHeroClip.gotoAndStop("die");
this.endAction();
}
if (this._x > 650) {
this.dieFlag = true;
clearInterval(this.setMoveInterval);
clearInterval(this.setWaitInterval);
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.removeMovieClip();
} else if (this._x < -60) {
this.dieFlag = true;
clearInterval(this.setMoveInterval);
clearInterval(this.setWaitInterval);
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.removeMovieClip();
}
};
enemyJeep.prototype.activeMovement = function () {
this.movement();
};
enemyJeep.prototype.hitBullet = function () {
if (this.bulletHitFlag) {
this.life = this.life - 4;
if (this.life < 0) {
_root.score = _root.score + 300;
this.endAction();
}
this.bulletHitFlag = false;
}
};
enemyJeep.prototype.hitBullet2 = function () {
if (this.bulletHit2Flag) {
this.life = this.life - 6;
if (this.life < 0) {
_root.score = _root.score + 300;
this.endAction();
}
this.bulletHit2Flag = false;
}
};
enemyJeep.prototype.hitBullet3 = function () {
if (this.bulletHit3Flag) {
this.life = this.life - 100;
if (this.life < 0) {
_root.score = _root.score + 500;
this.endAction();
}
this.bulletHit3Flag = false;
}
};
enemyJeep.prototype.endAction = function () {
_global.deathCounter++;
_root.enemyOnStageStatus = false;
clearInterval(this.setMoveInterval);
clearInterval(this.setWaitInterval);
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.clipRef.gotoAndStop("die2");
this.dieFlag = true;
};
enemyJeep.prototype.onEnterFrame = function () {
if (_root.gameEnd != true) {
if ((this.objectRef.dieFlag == false) && (_root.heroJeep.dieStatus != true)) {
this.activeMovement();
}
}
};
enemyJeep2.prototype = new enemyJeep();
enemyJeep2.prototype.initEnemy = function () {
this.objectRef = this;
this.initxpos = this._x;
this.initypos = this._y;
this.targetHero = _root.targetHeroClip;
this.spotNum = this.spotNumParam;
this.walkSpeed = this.wSpeed;
this.life = 8;
this.targetHeropos = this.targetHero._x;
this.dieFlag = false;
this.hitFlag = false;
this.bulletHitFlag = false;
this.bulletHit2Flag = false;
this.bulletHit3Flag = false;
if (this.wSpeed > 0) {
this.objectRef.walkSpeed = 1 + random(4);
} else {
this.objectRef.walkSpeed = (1 + random(4)) * -1;
}
this.setMoveInterval = setInterval(this, "moveInterval", 4000);
};
enemyJeep2.prototype.movement = function () {
this._x = this._x + this.objectRef.walkSpeed;
if (this.clipRef.hitTest(_root.targetHeroClip.body_hit2)) {
_root.heroHealth = _root.heroHealth - 4;
_root.targetHeroClip.gotoAndStop("die");
this.endAction();
}
if (this._x < -50) {
this._x = -50;
this.objectRef.walkSpeed = this.objectRef.walkSpeed * -1;
}
if (this._x > 650) {
this._x = 650;
this.objectRef.walkSpeed = this.objectRef.walkSpeed * -1;
}
};
enemyJeep2.prototype.moveInterval = function () {
clearInterval(this.setMoveInterval);
var _local2 = this.getDirection();
var _local3 = (2 + random(5)) * 1000;
this.walkSpeed = this.wSpeed * _local2;
this.setWaitInterval = setInterval(this, "waitInterval", _local3);
};
enemyJeep2.prototype.waitInterval = function () {
clearInterval(this.setWaitInterval);
var _local2 = this.getDirection();
var _local3 = (2 + random(5)) * 1000;
this.walkSpeed = 2 * _local2;
this.setMoveInterval = setInterval(this, "moveInterval", _local3);
};
enemyJeep2.prototype.getDirection = function () {
var _local2 = random(2);
var _local1 = 0;
if (_local2 == 0) {
_local1 = 1;
} else {
_local1 = -1;
}
return(_local1);
};
mineClass.prototype = new enemyJeep();
mineClass.prototype.initEnemy = function () {
this.objectRef = this;
this.initxpos = this._x;
this.initypos = this._y;
this.targetHero = _root.targetHeroClip;
this.spotNum = this.spotNumParam;
this.walkSpeed = this.wSpeed;
this.life = this.lifeParam;
this.targetHeropos = this.targetHero._x;
this.dieFlag = false;
this.hitFlag = false;
this.bulletHitFlag = false;
this.bulletHit2Flag = false;
this.bulletHit3Flag = false;
};
mineClass.prototype.movement = function () {
this._x = this._x + this.objectRef.walkSpeed;
if (this.clipRef.body_hit.hitTest(_root.targetHeroClip.body_hit2)) {
this.dieFlag = true;
this.clipRef.gotoAndStop("die2");
_root.heroHealth = _root.heroHealth - 2;
_root.targetHeroClip.gotoAndStop("die");
}
if (this._x > 650) {
this.dieFlag = true;
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.removeMovieClip();
}
};
powerUpClass.prototype = new enemyJeep();
powerUpClass.prototype.initEnemy = function () {
this.objectRef = this;
this.initxpos = this._x;
this.initypos = this._y;
this.targetHero = _root.targetHeroClip;
this.spotNum = this.spotNumParam;
this.walkSpeed = this.wSpeed;
this.life = this.lifeParam;
this.targetHeropos = this.targetHero._x;
this.dieFlag = false;
this.hitFlag = false;
this.bulletHitFlag = false;
this.bulletHit2Flag = false;
this.bulletHit3Flag = false;
};
powerUpClass.prototype.movement = function () {
this._x = this._x + this.objectRef.walkSpeed;
if (this.clipRef.hitTest(_root.targetHeroClip.body_hit2) && (!this.hitFlag)) {
this.clipRef.gotoAndStop("hit");
_root.heroHealth = _root.heroHealth - 4;
this.hitFlag = true;
_root.targetHeroClip.gotoAndStop("die");
}
if (this._x > 650) {
this.dieFlag = true;
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
_root.powerupStatus = false;
this.removeMovieClip();
} else if (this._x < -60) {
this.dieFlag = true;
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
_root.powerupStatus = false;
this.removeMovieClip();
}
};
Object.registerClass("eJeep", enemyJeep);
Object.registerClass("eJeep2", enemyJeep);
Object.registerClass("eTruck", enemyJeep);
Object.registerClass("eTruck4", enemyJeep2);
Object.registerClass("eTruck1", powerUpClass);
Object.registerClass("eTruck2", powerUpClass);
Object.registerClass("eTruck3", powerUpClass);
Object.registerClass("mines", mineClass);
enemyObject1 = function () {
this.objectRef = this;
this.init();
};
enemyObject1.prototype = new MovieClip();
enemyObject1.prototype.init = function () {
this.clip = eval (this.clipRef);
this.clip._x = -50;
this.clip._y = 400;
this.num = this.spotNumParam;
this.bulletFlag = false;
this.bulletLocation = _root.stage_mc;
this.targetEnemy = _root.targetHeroClip;
this.xvel = 11;
this.gravity = 0.1;
this.thrust = 3;
this.distance = 0;
this.bulletAngle = -90;
this.life = 15;
this.dieFlag = false;
this.rotationAngle = 1;
this.bulletCounter = 0;
this.blastFlag = false;
this.bulletHitFlag = false;
this.bulletHit2Flag = false;
this.bulletHit3Flag = false;
this.yvel = -this.thrust;
this.trackFlag = false;
};
enemyObject1.prototype.yMovement = function () {
this.clip._y = this.clip._y + this.yvel;
this.yvel = this.yvel + this.gravity;
if (this.yvel >= this.thrust) {
this.gravity = 0.1;
this.thrust = 3;
this.yvel = -this.thrust;
}
};
enemyObject1.prototype.xMovement = function () {
if (!this.trackFlag) {
this.clip._x = this.clip._x - this.xvel;
if (this.clip._x < 0) {
this.clip._x = 0;
} else if (this.clip._x > 650) {
this.clip._x = 650;
}
} else if (this.clip._x < this.targetEnemy._x) {
this.clip._x = this.clip._x + (((this.targetEnemy._x - 300) - this.clip._x) / 5);
if (this.clip._x < 0) {
this.clip._x = 0;
}
} else {
this.clip._x = this.targetEnemy._x - 350;
if (this.clip._x < 0) {
this.clip._x = 0;
}
}
};
enemyObject1.prototype.getXDistance = function () {
return(Math.abs(this.targetEnemy._x - this.clip._x));
};
enemyObject1.prototype.getYDistance = function () {
return(Math.abs(this.targetEnemy._y - this.clip._y));
};
enemyObject1.prototype.rotateObject = function () {
this.clip._rotation = this.clip._rotation + this.rotationAngle;
if (this.clip._rotation > 15) {
this.rotationAngle = this.rotationAngle * -1;
} else if (this.clip._rotation < -15) {
this.rotationAngle = this.rotationAngle * -1;
}
};
enemyObject1.prototype.heliMove = function () {
this.xMovement();
};
enemyObject1.prototype.reBounce = function () {
this.xvel = this.xvel * -1;
this.clip._y = this.inity;
};
enemyObject1.prototype.onEnterFrame = function () {
this.objectRef.heliMove();
};
enemyObject1_2 = function () {
super();
};
enemyObject1_2.prototype = new enemyObject1();
enemyObject1_2.prototype.heliMove = function () {
this.counter++;
if ((this.counter <= 5) && (this.counter > 0)) {
this.trackFlag = false;
} else if ((this.counter > 5) && (this.counter < 550)) {
this.trackFlag = true;
} else {
this.xvel = 10;
this.counter = 1;
this.trackFlag = false;
}
super.heliMove();
};
enemyObject1_2.prototype.attack = function () {
var _local8 = this.targetEnemy._x + this.targetEnemy.body._x;
var _local7 = this.targetEnemy._y + this.targetEnemy.body._y;
var _local9 = this.clip._x + this.clip.body._x;
var _local10 = this.clip._y + this.clip.body._y;
var _local5 = _local8 - _local9;
var _local4 = _local7 - _local10;
var _local6 = Math.atan2(_local4, _local5);
var _local3 = Math.ceil((_local6 / Math.PI) * 180);
this.clip.body.gun._rotation = _local3;
_root.bulletAngle2 = _local3;
};
enemyObject1_2.prototype.createBullet = function () {
if (this.bulletFlag && (!this.dieFlag)) {
_global.tempName2 = "enemybullet" + _root.heroBulletlevelNum;
_global.tempxpos = this.clip._x + this.clip.body._x;
_global.tempypos = this.clip._y + this.clip.body._y;
_global.tempAngle = this.bulletAngle;
this.bulletLocation.attachMovie("ebullet", _global.tempName2, _root.heroBulletlevelNum, {clipRef:_global.tempName2, initbulletx:_global.tempxpos, initbullety:_global.tempypos, initAngle:_global.tempAngle, mSpeed:13, bPowerParam:1});
_root.heroBulletlevelNum++;
this.bulletFlag = false;
}
};
enemyObject1_2.prototype.hitBullet = function () {
if (this.bulletHitFlag) {
this.life = this.life - 5;
if (this.life <= 0) {
this.blastFlag = true;
this.blast();
}
this.bulletHitFlag = false;
}
};
enemyObject1_2.prototype.hitBullet2 = function () {
if (this.bulletHit2Flag) {
trace("hit2 =" + this.life);
this.life = this.life - 10;
if (this.life <= 0) {
this.blastFlag = true;
this.blast();
}
this.bulletHit2Flag = false;
}
};
enemyObject1_2.prototype.hitBullet3 = function () {
if (this.bulletHit3Flag) {
trace("hit =" + this.life);
this.life = this.life - 100;
if (this.life <= 0) {
this.blastFlag = true;
this.blast();
}
this.bulletHit3Flag = false;
}
};
enemyObject1_2.prototype.blast = function () {
if (this.blastFlag && (this.dieFlag == false)) {
this.xvel = 0;
this.dieFlag = true;
_root.score = _root.score + 250;
_root[("dieEnemy" + this.num) + "Flag"] = true;
this.clip.gotoAndPlay("die2");
this.blastFlag = false;
return(undefined);
}
};
enemyObject1_2.prototype.onEnterFrame = function () {
if (!this.objectRef.dieFlag) {
trace("hitEnterFrame =" + this.life);
this.objectRef.heliMove();
this.objectRef.bulletCounter++;
if ((this.objectRef.bulletCounter > 20) && (!this.objectRef.bulletFlag)) {
this.bulletAnim.gotoAndPlay(2);
this.objectRef.bulletFlag = true;
this.objectRef.createBullet();
this.objectRef.bulletCounter = 0;
} else {
this.bulletAnim.gotoAndStop(1);
}
} else {
this._x = this._x + 2;
}
};
enemyObject1_3 = function () {
super();
this.bulletAngle = 90;
this.life = 5;
this.speed = 2;
};
enemyObject1_3.prototype = new enemyObject1_2();
enemyObject1_3.prototype.xMovement = function () {
this.clip._x = this.clip._x - this.speed;
if (this.clip._x < 520) {
this.speed = -4;
this.clip._x = 520;
}
if (this.clip.body_hit.hitTest(_root.targetHeroClip.body_hit2)) {
this.dieFlag = true;
_root[("dieEnemy" + this.num) + "Flag"] = true;
this.clip.gotoAndStop("die2");
_root.targetHeroClip.gotoAndStop("die");
}
if (this.clip._x > 650) {
_root[("dieEnemy" + this.num) + "Flag"] = true;
this.onEnterFrame = null;
this.removeMovieClip();
this=null;//parameter overwritten
}
};
Object.registerClass("eJeep3", enemyObject1_2);
Object.registerClass("soldier01", enemyObject1_3);
Object.registerClass("soldier02", enemyObject1_3);
Object.registerClass("soldier03", enemyObject1_3);
function civilianClass() {
this.objectRef = this;
this.init();
}
civilianClass.prototype = new MovieClip();
civilianClass.prototype.init = function () {
this.clip = eval (this.clipRef);
this.clip._x = this.initx;
this.clip._y = this.inity;
this.yvelocity = 0;
this.gravity = 1;
this.life = 10;
this.counter = 0;
this.fallSpeed = 7;
this.rotationVal = 0;
this.dieFlag = false;
this.civilianHitFlag = false;
this.civilianAnimateFlag = false;
this.randomNum = 1 + random(20);
if ((this.randomNum > 0) && (this.randomNum < 5)) {
this.clip.gotoAndStop(2);
} else if ((this.randomNum >= 5) && (this.randomNum < 10)) {
this.clip.gotoAndStop(3);
} else {
this.clip.gotoAndStop(1);
}
this.counter = 0;
};
civilianClass.prototype.movement = function () {
if (this.yvelocity < this.fallSpeed) {
this.yvelocity = this.yvelocity + this.gravity;
}
this.clip._rotation = this.clip._rotation + this.rotationVal;
this.clip._y = this.clip._y + this.yvelocity;
if (this.clip.hitTest(_root.targetHeroClip.body_hit) && (!this.dieFlag)) {
this.civilianHitFlag = true;
this.hitAmmunation();
}
if ((this.clip._y > 420) && (!this.civilianHitFlag)) {
this.dieFlag = true;
_root.civilianKilled++;
this.clip.removeMovieClip();
}
};
civilianClass.prototype.hitAmmunation = function () {
if (this.civilianHitFlag) {
this.civilianAnimateFlag = true;
this.animate();
this.civilianHitFlag = false;
}
};
civilianClass.prototype.animate = function () {
if (this.civilianAnimateFlag) {
this.clip.person.gotoAndStop(2);
this.civilianAnimateFlag = false;
}
};
civilianClass.prototype.onEnterFrame = function () {
if (!this.objectRef.dieFlag) {
this.objectRef.movement();
}
};
Object.registerClass("civilianClip", civilianClass);
Object.registerClass("powerupClip", civilianClass);
function bombClass() {
this.objectRef = this;
this.init();
}
bombClass.prototype = new MovieClip();
bombClass.prototype.init = function () {
this.clip = eval (this.clipRef);
this.clip._x = this.initx;
this.clip._y = this.inity;
this.yvelocity = 0;
this.gravity = 1;
this.life = 10;
this.counter = 0;
this.fallSpeed = this.fSpeed;
this.clip._rotation = 90;
this.rotationVal = -3;
this.dieFlag = false;
this.civilianHitFlag = false;
this.civilianAnimateFlag = false;
this.bulletHitFlag = false;
this.bulletHit2Flag = false;
this.bulletHit3Flag = false;
this.targetx = _root.targetHeroClip._x;
this.counter = 0;
};
bombClass.prototype.movement = function () {
if (this.yvelocity < this.fallSpeed) {
this.yvelocity = this.yvelocity + this.gravity;
}
if (this.clip._rotation > 0) {
this.clip._rotation = this.clip._rotation + this.rotationVal;
}
this.clip._y = this.clip._y + this.yvelocity;
if (this.clip.hitTest(_root.targetHeroClip.body_hit2)) {
this.civilianHitFlag = true;
_root.heroHealth = _root.heroHealth - 5;
_root.targetHeroClip.gotoAndStop("die");
this.hitAmmunation();
}
if (this.clip._y > 400) {
this.civilianHitFlag = true;
this.hitAmmunation();
}
};
bombClass.prototype.hitAmmunation = function () {
if (this.civilianHitFlag) {
this.civilianAnimateFlag = true;
this.animate();
this.civilianHitFlag = false;
}
};
bombClass.prototype.animate = function () {
if (this.civilianAnimateFlag) {
this.clip.gotoAndStop(2);
this.civilianAnimateFlag = false;
this.clip.onEnterFrame = null;
}
};
bombClass.prototype.hitBullet = function () {
if (this.bulletHitFlag) {
this.life = this.life - 5;
if (this.life < 0) {
this.civilianHitFlag = true;
this.hitAmmunation();
}
this.bulletHitFlag = false;
}
};
bombClass.prototype.hitBullet2 = function () {
if (this.bulletHit2Flag) {
this.life = this.life - 20;
if (this.life < 0) {
this.civilianHitFlag = true;
this.hitAmmunation();
}
this.bulletHit2Flag = false;
}
};
bombClass.prototype.hitBullet3 = function () {
if (this.bulletHit3Flag) {
this.life = this.life - 50;
if (this.life < 0) {
this.civilianHitFlag = true;
this.hitAmmunation();
}
this.bulletHit3Flag = false;
}
};
bombClass.prototype.onEnterFrame = function () {
if (!this.objectRef.dieFlag) {
this.objectRef.movement();
}
};
Object.registerClass("bombClip", bombClass);
function enemyPlane() {
super();
}
civilianPlane = function () {
this.objectRef = this;
};
civilianPlane.prototype = new MovieClip();
civilianPlane.prototype.onLoad = function () {
this.objectRef.clipRef = this;
this.initEnemy();
};
civilianPlane.prototype.initEnemy = function () {
this.objectRef = this;
this.initxpos = this._x;
this.initypos = this._y;
this.targetHero = _root.targetHeroClip;
this.spotNum = this.spotNumParam;
this.walkSpeed = this.wSpeed;
this.life = this.lifeParam;
this.civilianNum = this.cNum;
this.gravity = 5;
this.targetHeropos = this.targetHero._x;
this.targetXPosArray = new Array();
this.dieFlag = false;
this.bulletHitFlag = false;
this.bulletHit2Flag = false;
this.bulletHit3Flag = false;
this.xpos = 0;
this.mDist = 150;
if (this.civilianNum < 4) {
this.targetXpos = random(Stage.width / (this.civilianNum + 1));
this.remainingXpos = (Stage.width - this.targetXpos) - this.mDist;
} else {
this.targetXpos = 50;
this.remainingXpos = Stage.width - this.targetXpos;
}
this.setXPositions();
};
civilianPlane.prototype.setXPositions = function () {
this.targetXPosArray[0] = Stage.width - this.targetXpos;
if (this.civilianNum > 1) {
this.minDist = Math.ceil(this.remainingXpos / this.civilianNum);
var _local2 = 1;
while (_local2 <= this.civilianNum) {
var _local3 = Stage.width - (this.minDist * _local2);
this.targetXPosArray.push(_local3);
_local2 = _local2 + 1;
}
} else {
this.minDist = this.mDist + random(this.remainingXpos);
this.targetXPosArray.push(this.minDist);
}
this.targetdist = this.targetXPosArray[1];
this.num = 1;
};
civilianPlane.prototype.movement = function () {
this._x = this._x - this.objectRef.walkSpeed;
if (this._x < this.objectRef.targetdist) {
if (!_root.powerupStatus) {
this.dropCivilian();
} else {
this.dropPowerups();
_root.powerupStatus = false;
}
this.num = this.num + 1;
this.objectRef.targetdist = this.targetXPosArray[this.num];
}
if (this._x < -100) {
this.objectRef.dieFlag = true;
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.removeMovieClip();
}
};
civilianPlane.prototype.dropCivilian = function () {
var _local3 = "civilian" + this.num;
var _local5 = this.clipRef._x;
var _local4 = this.clipRef._y + 100;
_root.attachMovie("civilianClip", _local3, _root.heroBulletlevelNum, {clipRef:_local3, initx:_local5, inity:_local4});
_root.targetEnemyClip3 = _local3;
_root.heroBulletlevelNum++;
};
civilianPlane.prototype.dropPowerups = function () {
var _local3 = "civilian" + this.num;
var _local5 = this.clipRef._x;
var _local4 = this.clipRef._y + 100;
_root.attachMovie("powerupClip", _local3, _root.heroBulletlevelNum, {clipRef:_local3, initx:_local5, inity:_local4});
_root.targetEnemyClip3 = _local3;
_root.heroBulletlevelNum++;
};
civilianPlane.prototype.activeMovement = function () {
this.movement();
};
civilianPlane.prototype.hitBullet = function () {
if (this.bulletHitFlag) {
this.life = this.life - 8;
if (this.life < 0) {
this.clipRef.gotoAndStop("die2");
_global.deathCounter++;
_root.score = _root.score + 1000;
this.bSound.stop();
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.dieFlag = true;
_root.enemyOnStageStatus = false;
}
this.bulletHitFlag = false;
}
};
civilianPlane.prototype.hitBullet2 = function () {
if (this.bulletHit2Flag) {
this.life = this.life - 30;
if (this.life < 0) {
this.clipRef.gotoAndStop("die2");
_global.deathCounter++;
_root.score = _root.score + 1000;
this.bSound.stop();
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.dieFlag = true;
_root.enemyOnStageStatus = false;
}
this.bulletHit2Flag = false;
}
};
civilianPlane.prototype.hitBullet3 = function () {
if (this.bulletHit3Flag) {
this.life = this.life - 100;
if (this.life < 0) {
this.clipRef.gotoAndStop("die2");
_global.deathCounter++;
_root.score = _root.score + 1000;
this.bSound.stop();
_root.enemyOnStageStatus = false;
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.dieFlag = true;
}
this.bulletHit3Flag = false;
}
};
civilianPlane.prototype.onEnterFrame = function () {
if (_root.gameEnd != true) {
if (this.objectRef.dieFlag == false) {
this.activeMovement();
} else {
this._y = this._y + this.objectRef.gravity;
}
}
};
enemyPlane.prototype = new civilianPlane();
enemyPlane.prototype.initEnemy = function () {
this.objectRef = this;
this.initxpos = this._x;
this.initypos = this._y;
this.targetHero = _root.targetHeroClip;
this.spotNum = this.spotNumParam;
this.walkSpeed = this.wSpeed;
this.life = this.lifeParam;
this.civilianNum = this.cNum;
this.gravity = 5;
this.targetHeropos = this.targetHero._x;
this.targetXPosArray = new Array();
this.dieFlag = false;
this.bulletHitFlag = false;
this.bulletHit2Flag = false;
this.bulletHit3Flag = false;
this.xpos = 0;
this.mDist = 50;
if (this.civilianNum < 4) {
this.targetXpos = random(600 / (this.civilianNum + 1));
this.remainingXpos = (600 - this.targetXpos) - this.mDist;
} else {
this.targetXpos = 50;
this.remainingXpos = 600 - this.targetXpos;
}
this.setXPositions();
this.bSound = new Sound(this);
this.bSound.attachSound("planeSound");
this.bSound.start(3, 1);
this.bSound.setVolume(80);
};
enemyPlane.prototype.setXPositions = function () {
this.targetXPosArray[0] = 600 - this.targetXpos;
if (this.civilianNum > 1) {
this.minDist = Math.ceil(this.remainingXpos / this.civilianNum);
var _local2 = 1;
while (_local2 <= this.civilianNum) {
var _local3 = 600 - (this.minDist * _local2);
this.targetXPosArray.push(_local3);
_local2 = _local2 + 1;
}
} else {
this.minDist = this.mDist + random(this.remainingXpos);
this.targetXPosArray.push(this.minDist);
}
this.targetdist = this.targetXPosArray[1];
this.num = 1;
};
enemyPlane.prototype.movement = function () {
this._x = this._x - this.objectRef.walkSpeed;
if (this._x < this.objectRef.targetdist) {
this.dropBomb();
this.num = this.num + 1;
this.objectRef.targetdist = this.targetXPosArray[this.num];
}
if (this._x < -100) {
this.objectRef.dieFlag = true;
_root[("dieEnemy" + this.spotNum) + "Flag"] = true;
this.removeMovieClip();
}
};
enemyPlane.prototype.dropBomb = function () {
var _local3 = "bomb" + this.num;
var _local5 = this.clipRef._x;
var _local4 = this.clipRef._y;
_root.stage_mc.attachMovie("bombClip", _local3, _root.heroBulletlevelNum, {clipRef:_local3, initx:_local5, inity:_local4, trackNum:_root.bombTrackNum, fSpeed:_root.targetBombDropSpeed});
_root["targetBombClip" + this.num] = _root.stage_mc["bomb" + this.num];
_root.heroBulletlevelNum++;
};
Object.registerClass("ePlane", enemyPlane);
Instance of Symbol 450 MovieClip "heroJeep" in Symbol 464 MovieClip Frame 1
onClipEvent (load) {
this.inity = this._y;
}
Symbol 469 MovieClip Frame 1
stop();
Symbol 478 Button
on (press) {
_root.gotoAndPlay("intro");
}
Symbol 489 MovieClip Frame 90
stop();
Symbol 490 MovieClip Frame 57
stop();
Symbol 504 Button
on (release) {
if (((this.scoreName.text != "") && (_root.scoreSubmit == false)) && (Number(this.scoreText2.text) > 0)) {
trans_btn._visible = false;
var lv = new LoadVars();
var lvAnswer = new LoadVars();
this.message_text.text = "Saving your score...";
lv.scoreName = this.scoreName.text;
lv.scoreText = this.scoreText2.text;
lv.gameId = "ace015";
lv.gameName = "Taliban";
lv.sendAndLoad("http://www.flasharcade.com/setscores.php", lvAnswer, "POST");
lvAnswer.onLoad = function (success) {
if (lvAnswer.status1 == "success") {
trans_btn._visible = true;
_root.main_mc.message_text.text = "Your score is saved successfully.";
_root.gotoAndPlay("highScore");
} else {
trans_btn._visible = true;
trans_btn.useHandCursor = false;
_root.main_mc.message_text.text = "Your score could not be saved.";
}
};
} else if (Number(this.scoreText2.text) <= 0) {
_root.main_mc.message_text.text = "You cannot submit an invalid score";
}
trans_btn._visible = true;
trans_btn.useHandCursor = false;
_root.scoreSubmit = true;
}
Symbol 507 MovieClip Frame 34
this.scoreText2.text = Math.ceil(_root.score);
Instance of Symbol 500 MovieClip in Symbol 507 MovieClip Frame 34
onClipEvent (load) {
_root.scoreSubmit = false;
}
onClipEvent (enterFrame) {
if (_parent.scoreName.text != "") {
_parent.trans_btn._visible = false;
} else if (_root.scoreSubmit != true) {
_parent.trans_btn.useHandCursor = false;
_parent.trans_btn._visible = true;
}
}
Symbol 507 MovieClip Frame 41
stop();
_root.scoreSubmit = false;
Selection.setFocus(this.scoreName);
trans_btn.useHandCursor = false;
Symbol 545 MovieClip Frame 12
var lv = new LoadVars();
var lvAnswer = new LoadVars();
this.get_message_text.text = "";
lv.gameId = "ace015";
lv.sendAndLoad("http://www.flasharcade.com/getscores.php", lvAnswer, "POST");
lvAnswer.onLoad = function (success) {
if (lvAnswer.status1 == "success") {
_root.score_mc.name0.text = this.name0;
_root.score_mc.name1.text = this.name1;
_root.score_mc.name2.text = this.name2;
_root.score_mc.name3.text = this.name3;
_root.score_mc.name4.text = this.name4;
_root.score_mc.name5.text = this.name5;
_root.score_mc.name6.text = this.name6;
_root.score_mc.name7.text = this.name7;
_root.score_mc.name8.text = this.name8;
_root.score_mc.name9.text = this.name9;
_root.score_mc.score0.text = this.score0;
_root.score_mc.score1.text = this.score1;
_root.score_mc.score2.text = this.score2;
_root.score_mc.score3.text = this.score3;
_root.score_mc.score4.text = this.score4;
_root.score_mc.score5.text = this.score5;
_root.score_mc.score6.text = this.score6;
_root.score_mc.score7.text = this.score7;
_root.score_mc.score8.text = this.score8;
_root.score_mc.score9.text = this.score9;
_root.score_mc.date0.text = this.date0;
_root.score_mc.date1.text = this.date1;
_root.score_mc.date2.text = this.date2;
_root.score_mc.date3.text = this.date3;
_root.score_mc.date4.text = this.date4;
_root.score_mc.date5.text = this.date5;
_root.score_mc.date6.text = this.date6;
_root.score_mc.date7.text = this.date7;
_root.score_mc.date8.text = this.date8;
_root.score_mc.date9.text = this.date9;
}
i = 0;
while (i < 11) {
var _local5 = _root.score_mc["date" + i].text;
if (String(_local5) == "undefined") {
_root.score_mc["date" + i].text = "";
}
var _local4 = _root.score_mc["name" + i].text;
if (String(_local4) == "undefined") {
_root.score_mc["name" + i].text = "";
}
var _local3 = _root.score_mc["score" + i].text;
if (String(_local3) == "undefined") {
_root.score_mc["score" + i].text = "";
}
i++;
}
};
stop();