Frame 2
fscommand ("allowScale", "false");
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)) {
_root.gotoAndPlay("main1");
_root.animationCompleted = false;
}
};
animation.onPress = function () {
getURL ("http://www.flasharcade.com/", _blank);
};
stop();
Frame 8
stop();
Frame 12
stop();
Frame 16
stop();
Frame 20
stop();
Frame 23
stop();
Frame 26
stop();
Frame 29
stop();
Frame 32
stop();
Frame 35
stop();
Frame 38
stop();
Frame 39
fscommand ("allowScale", "false");
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(30);
_root.levelEndStatus = false;
_root.baseDestroyed = false;
Frame 40
function createTile() {
_root.container.createEmptyMovieClip("tileBox", 1);
_root.container._x = -20;
_root.container._y = -20;
game.clip = _root.container.tileBox;
i = 0;
while (i < tileMap.length) {
j = 0;
while (j < tileMap[0].length) {
var _local2 = (("t_" + i) + "_") + j;
game[_local2] = new game["Tile" + tileMap[i][j]]();
var _local3 = game[_local2];
var _local4 = game.clip.attachMovie("tile", _local2, _root.depthNum);
game.clip[_local2]._x = j * game.tileWidth;
game.clip[_local2]._y = i * game.tileHeight;
game.clip[_local2].x = j * game.tileWidth;
game.clip[_local2].y = i * game.tileHeight;
game[_local2].clip = _local4;
game.clip[_local2].initDepth = _root.depthNum;
game.clip[_local2].gotoAndStop(game[_local2].frame);
if (_local3.shield) {
game.baseShieldTiles.unshift({tObj:_local3, tClip:_local4});
}
_root.depthNum++;
j++;
}
i++;
}
}
function createEnemies() {
var _local5 = myEnemies;
game.currentEnemies = [];
var _local4 = 0;
while (_local4 < _local5.length) {
var _local3 = "enemy" + _local4;
game[_local3] = new game["Enemyp" + _local5[_local4][0]]();
game[_local3].id = _local4;
game.currentEnemies.push(game[_local3]);
game.clip.attachMovie("enemy" + _local5[_local4][0], _local3, _root.depthNum + 150000);
game[_local3].clip = game.clip[_local3];
game[_local3].clip.oRef = game[_local3];
game[_local3].xtile = _local5[_local4][1];
game[_local3].ytile = _local5[_local4][2];
game[_local3].wid = game.clip[_local3]._width / 2;
game[_local3].hei = game.clip[_local3]._height / 2;
game[_local3].x = (game[_local3].xtile * game.tileWidth) + (game.tileWidth / 2);
game[_local3].y = (game[_local3].ytile * game.tileHeight) + (game.tileHeight / 2);
game[_local3].clip._x = game[_local3].x;
game[_local3].clip._y = game[_local3].y;
var _local6 = game[_local3].shootSpeed;
var _local7 = game[_local3];
game[_local3].missileId = setInterval(this, "enemyMissileInterval", _local6, _local7);
_root.depthNum++;
_local4++;
}
}
function enemyMissileInterval(o) {
if ((!_root.freezeEnemy) && (!_root.levelEndStatus)) {
createEnemyMissile(o);
}
}
function moveEnemies() {
var _local3 = 0;
while (_local3 < game.currentEnemies.length) {
var _local4 = "enemy" + game.currentEnemies[_local3].id;
var _local2 = game[_local4];
if ((!_root.freezeEnemy) && (!_root.baseDestroyed)) {
_local2.moveFunc(_local2);
} else {
checkTankCollision(_local2);
}
_local3++;
}
}
function createHeroTank() {
heroTankObj.clip = game.clip.attachMovie("heroClip", "heroClip", _root.depthNum + 150000);
heroTankObj.wid = heroTankObj.clip._width / 2;
heroTankObj.hei = heroTankObj.clip._height / 2;
heroTankObj.x = (heroTankObj.xtile * game.tileWidth) + heroTankObj.wid;
heroTankObj.y = (heroTankObj.ytile * game.tileHeight) + heroTankObj.hei;
heroTankObj.clip.oRef = heroTankObj;
heroTankObj.clip._x = heroTankObj.x;
heroTankObj.clip._y = heroTankObj.y;
heroTankObj.direction = "up";
heroTankObj.lifePowerUp = false;
heroTankObj.shieldPowerUp = false;
heroTankObj.basePowerUp = false;
heroTankObj.freezePowerUp = false;
heroTankObj.ammunationPowerUp = false;
heroTankObj.invisiblePowerUp = false;
heroTankObj.bonusPowerUp = false;
_root.recreateHero(heroTankObj);
_root.depthNum++;
}
function createHeroBase() {
heroBaseObj.clip = game.clip.attachMovie("heroBase", "heroBase", _root.depthNum + 150000);
heroBaseObj.wid = heroBaseObj.clip._width / 2;
heroBaseObj.hei = heroBaseObj.clip._height / 2;
heroBaseObj.x = (heroBaseObj.xtile * game.tileWidth) + heroBaseObj.wid;
heroBaseObj.y = (heroBaseObj.ytile * game.tileHeight) + heroBaseObj.hei;
heroBaseObj.clip._x = heroBaseObj.x;
heroBaseObj.clip._y = heroBaseObj.y;
_root.depthNum++;
}
function createMissile(obj) {
var _local3 = obj;
var _local5 = _local3.currentMissile;
var _local4 = _local3.totalMissile;
if (_local5 < _local4) {
_local3.currentMissile++;
_local3.missileFlag = true;
_local3.lastshot = getTimer();
game.missileDepth1++;
if (game.missileDepth1 > 4000) {
game.missileDepth1 = 1;
}
var _local2 = "heromissile_" + game.missileDepth1;
game[_local2] = new game.heroMissile();
game.heroBullets.push(game[_local2]);
if (_local3.direction == "up") {
game[_local2].direction = "up";
game[_local2].xtile = _local3.xtile;
game[_local2].ytile = _local3.ytile;
game[_local2].dirx = 0;
game[_local2].diry = -1;
} else if (_local3.direction == "down") {
game[_local2].direction = "down";
game[_local2].xtile = _local3.xtile;
game[_local2].ytile = _local3.ytile;
game[_local2].dirx = 0;
game[_local2].diry = 1;
} else if (_local3.direction == "left") {
game[_local2].direction = "left";
game[_local2].xtile = _local3.xtile;
game[_local2].ytile = _local3.ytile;
game[_local2].dirx = -1;
game[_local2].diry = 0;
} else if (_local3.direction == "right") {
game[_local2].direction = "right";
game[_local2].xtile = _local3.xtile;
game[_local2].ytile = _local3.ytile;
game[_local2].dirx = 1;
game[_local2].diry = 0;
}
game[_local2].clip = game.clip.attachMovie("heroMissileClip", _local2, _root.depthNum + game.missileDepth1);
game[_local2].clip._x = _local3.x + (game[_local2].dirx * 10);
game[_local2].clip._y = _local3.y + (game[_local2].diry * 10);
game[_local2].x = game[_local2].clip._x;
game[_local2].y = game[_local2].clip._y;
game[_local2].clip.gotoAndStop(game[_local2].direction);
game[_local2].id = game.missileDepth1;
_root.shotMissileInterval = 0;
_root.shotMissile = false;
_root.depthNum++;
} else {
_local3.missileFlag = false;
}
}
function createEnemyMissile(obj) {
var _local3 = obj;
if (!_root.freezeEnemy) {
if (!_local3.dieFlag) {
game.missileDepth2++;
if (game.missileDepth2 > 10000) {
game.missileDepth2 = 5000;
}
var _local2 = "enemymissile_" + game.missileDepth2;
game[_local2] = new game.enemyMissile();
game.enemyBullets.push(game[_local2]);
if (_local3.direction == "up") {
game[_local2].direction = "up";
game[_local2].xtile = _local3.xtile;
game[_local2].ytile = _local3.ytile;
game[_local2].dirx = 0;
game[_local2].diry = -1;
} else if (_local3.direction == "down") {
game[_local2].direction = "down";
game[_local2].xtile = _local3.xtile;
game[_local2].ytile = _local3.ytile;
game[_local2].dirx = 0;
game[_local2].diry = 1;
} else if (_local3.direction == "left") {
game[_local2].direction = "left";
game[_local2].xtile = _local3.xtile;
game[_local2].ytile = _local3.ytile;
game[_local2].dirx = -1;
game[_local2].diry = 0;
} else if (_local3.direction == "right") {
game[_local2].direction = "right";
game[_local2].xtile = _local3.xtile;
game[_local2].ytile = _local3.ytile;
game[_local2].dirx = 1;
game[_local2].diry = 0;
}
game[_local2].clip = game.clip.attachMovie("enemyMissileClip", _local2, _root.depthNum + game.missileDepth2);
game.clip[_local2]._x = _local3.x + (game[_local2].dirx * _local3.speed);
game.clip[_local2]._y = _local3.y + (game[_local2].diry * _local3.speed);
game[_local2].x = game.clip[_local2]._x;
game[_local2].y = game.clip[_local2]._y;
game.clip[_local2].gotoAndStop(game[_local2].direction);
game[_local2].id = game.missileDepth2;
_root.depthNum++;
}
}
}
function checkCorners(xmove, ymove, ob) {
var _local1 = ob;
_local1.upMove = Math.floor((ymove - _local1.hei) / game.tileHeight);
_local1.downMove = Math.floor(((ymove + _local1.hei) - 1) / game.tileHeight);
_local1.leftMove = Math.floor((xmove - _local1.wid) / game.tileWidth);
_local1.rightMove = Math.floor(((xmove + _local1.wid) - 1) / game.tileWidth);
_local1.upLeftMove = game[(("t_" + _local1.upMove) + "_") + _local1.leftMove].walkable;
_local1.downLeftMove = game[(("t_" + _local1.downMove) + "_") + _local1.leftMove].walkable;
_local1.upRightMove = game[(("t_" + _local1.upMove) + "_") + _local1.rightMove].walkable;
_local1.downRightMove = game[(("t_" + _local1.downMove) + "_") + _local1.rightMove].walkable;
_local1.upLeftTile = game[(("t_" + _local1.upMove) + "_") + _local1.leftMove];
_local1.downLeftTile = game[(("t_" + _local1.downMove) + "_") + _local1.leftMove];
_local1.upRightTile = game[(("t_" + _local1.upMove) + "_") + _local1.rightMove];
_local1.downRightTile = game[(("t_" + _local1.downMove) + "_") + _local1.rightMove];
_local1.upLeftBreakable = game[(("t_" + _local1.upMove) + "_") + _local1.leftMove].breakable;
_local1.downLeftBreakable = game[(("t_" + _local1.downMove) + "_") + _local1.leftMove].breakable;
_local1.upRightBreakable = game[(("t_" + _local1.upMove) + "_") + _local1.rightMove].breakable;
_local1.downRightBreakable = game[(("t_" + _local1.downMove) + "_") + _local1.rightMove].breakable;
_local1.upLeftInvisible = game[(("t_" + _local1.upMove) + "_") + _local1.leftMove].invisible;
_local1.downLeftInvisible = game[(("t_" + _local1.downMove) + "_") + _local1.leftMove].invisible;
_local1.upRightInvisible = game[(("t_" + _local1.upMove) + "_") + _local1.rightMove].invisible;
_local1.downRightInvisible = game[(("t_" + _local1.downMove) + "_") + _local1.rightMove].invisible;
}
function moveFunction(obj, xdir, ydir) {
var _local1 = obj;
checkCorners(_local1.x, _local1.y + (_local1.speed * ydir), _local1);
if (ydir == 1) {
if (_local1.invisibleFlag) {
if (_local1.downLeftInvisible && (_local1.downRightInvisible)) {
_local1.direction = "down";
_local1.y = _local1.y + (_local1.speed * ydir);
} else {
_local1.direction = "down";
_local1.y = ((_local1.ytile + 1) * game.tileHeight) - _local1.hei;
}
} else if (_local1.downLeftMove && (_local1.downRightMove)) {
_local1.direction = "down";
_local1.y = _local1.y + (_local1.speed * ydir);
} else {
_local1.direction = "down";
_local1.y = ((_local1.ytile + 1) * game.tileHeight) - _local1.hei;
}
}
if (ydir == -1) {
if (_local1.invisibleFlag) {
if (_local1.upLeftInvisible && (_local1.upRightInvisible)) {
_local1.direction = "up";
_local1.y = _local1.y + (_local1.speed * ydir);
} else {
_local1.direction = "up";
_local1.y = (_local1.ytile * game.tileHeight) + _local1.hei;
}
} else if (_local1.upLeftMove && (_local1.upRightMove)) {
_local1.direction = "up";
_local1.y = _local1.y + (_local1.speed * ydir);
} else {
_local1.direction = "up";
_local1.y = (_local1.ytile * game.tileHeight) + _local1.hei;
}
}
checkCorners(_local1.x + (_local1.speed * xdir), _local1.y, _local1);
if (xdir == 1) {
if (_local1.invisibleFlag) {
if (_local1.downRightInvisible && (_local1.upRightInvisible)) {
_local1.direction = "right";
_local1.x = _local1.x + (_local1.speed * xdir);
} else {
_local1.direction = "right";
_local1.x = ((_local1.xtile + 1) * game.tileWidth) - _local1.wid;
}
} else if (_local1.downRightMove && (_local1.upRightMove)) {
_local1.direction = "right";
_local1.x = _local1.x + (_local1.speed * xdir);
} else {
_local1.direction = "right";
_local1.x = ((_local1.xtile + 1) * game.tileWidth) - _local1.wid;
}
}
if (xdir == -1) {
if (_local1.invisibleFlag) {
if (_local1.downLeftInvisible && (_local1.upLeftInvisible)) {
_local1.direction = "left";
_local1.x = _local1.x + (_local1.speed * xdir);
} else {
_local1.direction = "left";
_local1.x = (_local1.xtile * game.tileWidth) + _local1.wid;
}
} else if (_local1.downLeftMove && (_local1.upLeftMove)) {
_local1.direction = "left";
_local1.x = _local1.x + (_local1.speed * xdir);
} else {
_local1.direction = "left";
_local1.x = (_local1.xtile * game.tileWidth) + _local1.wid;
}
}
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.clip.gotoAndStop((xdir + (ydir * 2)) + 3);
_local1.xtile = Math.floor(_local1.clip._x / game.tileWidth);
_local1.ytile = Math.floor(_local1.clip._y / game.tileHeight);
}
function moveFunction2(obj, xdir, ydir) {
var _local1 = obj;
checkCorners(_local1.x, _local1.y + (_local1.speed * ydir), _local1);
if (ydir == 1) {
if (_local1.downLeftMove || (_local1.downRightMove)) {
_local1.direction = "down";
_local1.y = _local1.y + (_local1.speed * ydir);
} else {
_local1.direction = "down";
_local1.y = ((_local1.ytile + 1) * game.tileHeight) - _local1.hei;
}
}
if (ydir == -1) {
if (_local1.upLeftMove || (_local1.upRightMove)) {
_local1.direction = "up";
_local1.y = _local1.y + (_local1.speed * ydir);
} else {
_local1.direction = "up";
_local1.y = (_local1.ytile * game.tileHeight) + _local1.hei;
}
}
checkCorners(_local1.x + (_local1.speed * xdir), _local1.y, _local1);
if (xdir == 1) {
if (_local1.downRightMove || (_local1.upRightMove)) {
_local1.direction = "right";
_local1.x = _local1.x + (_local1.speed * xdir);
} else {
_local1.direction = "right";
_local1.x = ((_local1.xtile + 1) * game.tileWidth) - _local1.wid;
}
}
if (xdir == -1) {
if (_local1.downLeftMove || (_local1.upLeftMove)) {
_local1.direction = "left";
_local1.x = _local1.x + (_local1.speed * xdir);
} else {
_local1.direction = "left";
_local1.x = (_local1.xtile * game.tileWidth) + _local1.wid;
}
}
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.clip.gotoAndStop((xdir + (ydir * 2)) + 3);
_local1.xtile = Math.floor(_local1.clip._x / game.tileWidth);
_local1.ytile = Math.floor(_local1.clip._y / game.tileHeight);
}
function assignEnemiesMove() {
var _local2 = 0;
while (_local2 < game.currentEnemies.length) {
var _local3 = "enemy" + game.currentEnemies[_local2].id;
var _local1 = game[_local3];
var _local4 = random(4);
if (_local4 == 0) {
_local1.moveFunc = function (obj) {
move1(obj);
};
} else {
_local1.moveFunc = function (obj) {
move2(obj);
};
}
_local2++;
}
}
function changeEnemyMove(ob) {
var _local1 = ob;
assignEnemiesMove();
clearInterval(_local1.changeInterval);
return(undefined);
}
function move1(obj) {
var _local2 = obj;
if ((!_local2.dieFlag) && (!_root.freezeEnemy)) {
checkCorners(_local2.x + (_local2.speed * _local2.xmove), _local2.y + (_local2.speed * _local2.ymove), _local2);
if (((_local2.downLeftMove and _local2.upLeftMove) and _local2.downRightMove) and _local2.upRightMove) {
moveFunction(_local2, _local2.xmove, _local2.ymove);
} else {
changeDirection(_local2);
moveFunction(_local2, _local2.xmove, _local2.ymove);
}
checkTankCollision(_local2);
}
}
function move2(obj) {
var _local2 = obj;
if ((!_local2.dieFlag) && (!_root.freezeEnemy)) {
checkCorners(_local2.x + (_local2.speed * _local2.xmove), _local2.y + (_local2.speed * _local2.ymove), _local2);
if (((_local2.downLeftMove and _local2.upLeftMove) and _local2.downRightMove) and _local2.upRightMove) {
moveFunction(_local2, _local2.xmove, _local2.ymove);
} else if ((((!_local2.downLeftBreakable) and (!_local2.upLeftBreakable)) and (!_local2.downRightBreakable)) and (!_local2.upRightBreakable)) {
changeDirection(_local2);
moveFunction(_local2, _local2.xmove, _local2.ymove);
}
}
checkTankCollision(_local2);
}
function moveBullets() {
var _local5 = 0;
while (_local5 < game.heroBullets.length) {
var _local1 = game.heroBullets[_local5];
if (_local1.direction == "down") {
checkCorners(_local1.x, _local1.y + (_local1.speed * _local1.diry), _local1);
if (_local1.downLeftMove) {
moveFunction2(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.dieFlag = true;
}
if (_local1.downRightMove) {
moveFunction2(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.dieFlag = true;
}
}
if (_local1.direction == "up") {
checkCorners(_local1.x, _local1.y + (_local1.speed * _local1.diry), _local1);
if (_local1.upLeftMove) {
moveFunction2(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.dieFlag = true;
}
if (_local1.upRightMove) {
moveFunction2(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.dieFlag = true;
}
}
if (_local1.direction == "right") {
checkCorners(_local1.x + (_local1.speed * _local1.dirx), _local1.y, _local1);
if (_local1.downRightMove) {
moveFunction2(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.dieFlag = true;
}
if (_local1.upRightMove) {
moveFunction2(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.dieFlag = true;
}
}
if (_local1.direction == "left") {
checkCorners(_local1.x + (_local1.speed * _local1.dirx), _local1.y, _local1);
if (_local1.downLeftMove) {
moveFunction2(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.dieFlag = true;
}
if (_local1.upLeftMove) {
moveFunction2(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.dieFlag = true;
}
}
var _local2 = 0;
while (_local2 < game.currentEnemies.length) {
var _local4 = "enemy" + game.currentEnemies[_local2].id;
var _local3 = game[_local4];
if (!_local3.dieFlag) {
checkEnemyLife(_local1, _local3);
}
_local2++;
}
checkBaseLife(_local1);
if (_local1.dieFlag) {
game.heroBullets.splice(_local5, 1);
_local1.clip.removeMovieClip();
}
_local5++;
}
}
function checkBaseLife(ob, num) {
var _local2 = heroBaseObj;
var _local4 = ob;
if (!_local2.dieFlag) {
var _local8 = _local4.x - _local2.x;
var _local7 = _local4.y - _local2.y;
if (Math.sqrt((_local8 * _local8) + (_local7 * _local7)) < (Number(_local4.wid) + Number(_local2.wid))) {
_local4.dieFlag = true;
var _local3 = game[(("t_" + _local2.ytile) + "_") + _local2.xtile].strength;
var _local5 = game[(("t_" + _local2.ytile) + "_") + _local2.xtile];
_local3 = _local3 - ob.mPower;
if ((_local3 < 200) && (_local3 > 150)) {
_local5.strength = _local5.strength - ob.mPower;
} else if ((_local3 < 150) && (_local3 > 100)) {
_local5.walkable = false;
_local5.strength = _local5.strength - ob.mPower;
} else if ((_local3 < 100) && (_local3 >= 50)) {
_local5.strength = _local5.strength - ob.mPower;
} else if (_local3 < 10) {
_local5.strength = _local5.strength - ob.mPower;
_local5.breakable = false;
_root.freezeEnemy = true;
_root.baseDestroyed = true;
_local2.dieFlag = true;
_local2.clip.removeMovieClip();
}
if (_local4.dieFlag) {
_local4.clip.removeMovieClip();
game.enemyBullets.splice(num, 1);
delete game["enemymissile_" + _local4.id];
}
}
}
}
function checkTankLife(ob, num) {
var _local1 = heroTankObj;
var _local2 = ob;
var _local4 = _local2.x - _local1.x;
var _local3 = _local2.y - _local1.y;
if (Math.sqrt((_local4 * _local4) + (_local3 * _local3)) < (Number(_local2.wid) + Number(_local1.wid))) {
if (((!_local1.shieldFlag) && (!_local1.dieFlag)) && (!heroTankObj.invisibleFlag)) {
_local2.dieFlag = true;
_local1.strength = _local1.strength - _local2.mPower;
_local1.clip.hitClip.gotoAndPlay("start");
if (_local1.strength < 10) {
_local1.strength = 0;
_local1.dieFlag = true;
_local1.clip.gotoAndPlay("die");
clearInterval(_local1.missileId);
}
if (_local2.dieFlag) {
_local2.clip.removeMovieClip();
game.enemyBullets.splice(num, 1);
delete game["enemymissile_" + _local2.id];
}
}
}
}
function checkEnemyLife(ob, objenemy) {
var _local1 = objenemy;
var _local2 = ob;
var _local4 = _local2.x - _local1.x;
var _local3 = _local2.y - _local1.y;
if (Math.sqrt((_local4 * _local4) + (_local3 * _local3)) < (Number(_local2.wid) + Number(_local1.wid))) {
_local2.dieFlag = true;
_local1.strength = _local1.strength - _local2.mPower;
_local1.clip.hitClip.gotoAndPlay("start");
if (_local1.strength < 10) {
_local1.strength = 0;
_local1.dieFlag = true;
_local1.clip.gotoAndPlay("die");
clearInterval(_local1.missileId);
}
}
}
function checkTankCollision(obj) {
var _local1 = obj;
var _local3 = _local1.x - heroTankObj.x;
var _local2 = _local1.y - heroTankObj.y;
if ((!heroTankObj.dieFlag) && (!_local1.dieFlag)) {
if (Math.sqrt((_local3 * _local3) + (_local2 * _local2)) < (Number(_local1.wid) + Number(heroBaseObj.wid))) {
if (heroTankObj.shieldFlag == true) {
clearInterval(_local1.missileId);
_local1.dieFlag = true;
_local1.clip.gotoAndPlay("die");
} else if (heroTankObj.freezeFlag == true) {
clearInterval(_local1.missileId);
_local1.dieFlag = true;
_local1.clip.gotoAndPlay("die");
} else if (heroTankObj.invisibleFlag == true) {
clearInterval(_local1.missileId);
_local1.dieFlag = true;
_local1.clip.gotoAndPlay("die");
} else {
clearInterval(_local1.missileId);
_local1.dieFlag = true;
_local1.clip.gotoAndPlay("die");
clearInterval(heroTankObj.missileId);
heroTankObj.dieFlag = true;
heroTankObj.clip.gotoAndPlay("die");
}
}
}
}
function moveEnemyBullets() {
var _local2 = 0;
while (_local2 < game.enemyBullets.length) {
var _local1 = game.enemyBullets[_local2];
checkCorners(_local1.x + (_local1.speed * _local1.dirx), _local1.y + (_local1.speed * _local1.diry), _local1);
if (((_local1.upLeftMove and _local1.downLeftMove) and _local1.upRightMove) and _local1.downRightMove) {
moveFunction(_local1, _local1.dirx, _local1.diry);
} else {
breakableFunction(_local1, _local1.dirx, _local1.diry);
_local1.clip.removeMovieClip();
game.enemyBullets.splice(_local2, 1);
delete game["enemymissile_" + _local1.id];
}
checkBaseLife(_local1, _local2);
checkTankLife(_local1, _local2);
_local2++;
}
}
function breakableFunction(obj, xdir, ydir) {
var _local1 = obj;
if (!_local1.downRightMove) {
var _local3 = _local1.downRightTile.strength;
var _local2 = _local1.downRightTile;
} else if (!_local1.upRightMove) {
var _local3 = _local1.upRightTile.strength;
var _local2 = _local1.upRightTile;
} else if (!_local1.upLeftMove) {
var _local3 = _local1.upLeftTile.strength;
var _local2 = _local1.upLeftTile;
} else if (!_local1.downLeftMove) {
var _local3 = _local1.downLeftTile.strength;
var _local2 = _local1.downLeftTile;
}
if (((_local1.downRightBreakable || (_local1.upRightBreakable)) || (_local1.upLeftBreakable)) || (_local1.downLeftBreakable)) {
_local2.strength = _local2.strength - _local1.mPower;
if ((_local3 <= 200) && (_local3 > 150)) {
_local2.strength = _local2.strength - _local1.mPower;
_local2.clip.bclip.gotoAndStop(2);
} else if ((_local3 < 150) && (_local3 > 100)) {
_local2.strength = _local2.strength - _local1.mPower;
_local2.clip.bclip.gotoAndStop(3);
} else if ((_local3 < 100) && (_local3 >= 50)) {
_local2.strength = _local2.strength - _local1.mPower;
_local2.clip.bclip.gotoAndStop(4);
} else if (_local3 < 10) {
_local2.strength = _local2.strength - _local1.mPower;
_local2.clip.bclip.gotoAndStop(5);
_local2.walkable = true;
_local2.breakable = false;
}
}
return(true);
}
function checkBase() {
var _local2 = 0;
while (_local2 < game.currentEnemies.length) {
var _local3 = "enemy" + game.currentEnemies[_local2].id;
var _local1 = game[_local3];
counter = 0;
if (!_local1.dieFlag) {
var _local4 = random(100);
if (_local1.ytile == heroBaseObj.ytile) {
if (_local1.xtile < heroBaseObj.xtile) {
_local1.ytile = heroBaseObj.ytile;
_local1.clip._y = _local1.clip._y + ((heroBaseObj.clip._y - _local1.clip._y) / 5);
_local1.clip.gotoAndStop("right");
_local1.direction = "right";
} else if (_local1.xtile > heroBaseObj.xtile) {
_local1.ytile = heroBaseObj.ytile;
_local1.clip._y = _local1.clip._y + ((heroBaseObj.clip._y - _local1.clip._y) / 5);
_local1.clip.gotoAndStop("left");
_local1.direction = "left";
}
}
}
_local2++;
}
}
function changeDirection(obj) {
var _local1 = obj;
if (!_local1.dieFlag) {
if (_local1.xmove == 0) {
var _local2 = random(5);
if (_local2 == 1) {
_local1.xmove = -1;
_local1.ymove = 0;
} else if (_local2 == 2) {
_local1.xmove = 1;
_local1.ymove = 0;
} else if (_local2 == 3) {
_local1.xmove = 0;
_local1.ymove = 1;
} else {
_local1.xmove = 0;
_local1.ymove = -1;
}
checkCorners(_local1.x + (_local1.speed * _local1.xmove), _local1.y + (_local1.speed * _local1.ymove), _local1);
if ((((!_local1.downLeftMove) or (!_local1.upLeftMove)) or (!_local1.downRightMove)) or (!_local1.upRightMove)) {
_local1.xmove = -_local1.xmove;
}
} else {
var _local2 = random(5);
if (_local2 == 1) {
_local1.xmove = -1;
_local1.ymove = 0;
} else if (_local2 == 2) {
_local1.xmove = 1;
_local1.ymove = 0;
} else if (_local2 == 3) {
_local1.xmove = 0;
_local1.ymove = 1;
} else {
_local1.xmove = 0;
_local1.ymove = -1;
}
checkCorners(_local1.x + (_local1.speed * _local1.xmove), _local1.y + (_local1.speed * _local1.ymove), _local1);
if ((((!_local1.downLeftMove) or (!_local1.upLeftMove)) or (!_local1.downRightMove)) or (!_local1.upRightMove)) {
_local1.ymove = -_local1.ymove;
}
}
moveFunction(_local1, _local1.xmove, _local1.ymove);
}
}
function createEnemyLivesPanel() {
_root.panel_mc.attachMovie("enemyLivesClip", "enemyLivesClip", 1);
}
function createHeroLivesPanel() {
_root.panel_mc.attachMovie("heroLivesClip", "heroLivesClip", 2);
_root.panel_mc.heroLivesClip._y = 315;
}
function disableAllPowerUp() {
_root.mc_freezeIcon.gotoAndStop(2);
_root.mc_bonusIcon.gotoAndStop(2);
_root.mc_shieldIcon.gotoAndStop(2);
_root.mc_castleIcon.gotoAndStop(2);
_root.mc_invisibleIcon.gotoAndStop(2);
_root.mc_ammunationIcon.gotoAndStop(2);
_root.mc_lifeIcon.gotoAndStop(2);
}
function removeAllBullets() {
var _local1 = 0;
while (_local1 < game.enemyBullets.length) {
var _local2 = game.enemyBullets[_local1];
_local2.clip.removeMovieClip();
_local1++;
}
game.enemyBullets = new Array();
}
function checkLevelEndStatus() {
if (_root.heroDead == game.totalHeroLife) {
_root.levelEndStatus = true;
_root.freezeEnemy = true;
gameOver();
} else if (_root.enemyDead == game.totalEnemyLife) {
_root.levelEndStatus = true;
_root.freezeEnemy = true;
nextLevel();
} else if (_root.baseDestroyed) {
_root.levelEndStatus = true;
_root.freezeEnemy = true;
gameOver();
}
}
function removeAllEnemyLives() {
i = 1;
while (i <= 16) {
var _local2 = _root.panel_mc.enemyLivesClip["e" + i];
_local2._visible = false;
i++;
}
}
function removeAllEnemyObject() {
game.currentEnemies = [];
var _local1 = 0;
while (_local1 < 4) {
var _local2 = game["enemy" + _local1];
clearInterval(_local2.missileId);
_local1++;
}
}
function updateEnemyLives() {
removeAllEnemyLives();
var _local3 = Number(game.totalEnemyLife - _root.enemyDead);
_root.enemyLivesArray = [];
i = 1;
while (i <= _local3) {
var _local2 = _root.panel_mc.enemyLivesClip["e" + i];
_local2._visible = true;
_root.enemyLivesArray.push(_local2);
i++;
}
}
function removeSingleEnemy() {
var _local2 = _root.enemyLivesArray.length;
var _local3 = _root.enemyLivesArray[_local2 - 1];
_local3.gotoAndStop(2);
_root.enemyLivesArray.pop();
}
function levelEnd() {
if (_root.levelEndStatus) {
delete game.currentEnemies;
delete tileMap;
delete myEnemies;
delete heroBaseArray;
clearInterval(game.lifePowerUpInterval);
clearInterval(game.removeLifePowerUpInterval);
clearInterval(game.shieldInterval);
clearInterval(game.shieldPowerUpInterval);
clearInterval(game.removeShieldPowerUpInterval);
clearInterval(game.baseShieldInterval);
clearInterval(game.baseShieldPowerUpInterval);
clearInterval(game.removeBaseShieldPowerUpInterval);
clearInterval(game.freezeInterval);
clearInterval(game.freezePowerUpInterval);
clearInterval(game.removeFreezePowerUpInterval);
clearInterval(game.bonusPowerUpInterval);
clearInterval(game.removeBonusPowerUpInterval);
clearInterval(game.ammunationPowerUpInterval);
clearInterval(game.removeAmmunationPowerUpInterval);
clearInterval(game.invisibleInterval);
clearInterval(game.invisiblePowerUpInterval);
clearInterval(game.removeInvisiblePowerUpInterval);
clearInterval(game.triggerMineInterval);
heroTankObj.lifePowerUp = false;
heroTankObj.shieldPowerUp = false;
heroTankObj.basePowerUp = false;
heroTankObj.freezePowerUp = false;
heroTankObj.ammunationPowerUp = false;
heroTankObj.invisiblePowerUp = false;
heroTankObj.bonusPowerUp = false;
removeAllEnemyObject();
_root.onEnterFrame = null;
removeAllBullets();
keyDetect = false;
delete ob;
delete obj;
delete game;
delete heroTankObj;
delete heroBaseObj;
}
}
function gameOver() {
levelEnd();
_root.gameover_mc.gotoAndPlay(2);
}
function removeSound() {
_root.gameBGSound.stop();
_root.gameBGSound = null;
delete eval (_root.gameBGSound());
}
function createLifePowerUp() {
var ob = heroTankObj;
if (ob.lifePowerUp) {
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
while (!tileStatus) {
tempx = 1 + random(12);
tempy = 1 + random(12);
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileName = game[(("t_" + tempy) + "_") + tempx];
}
_root.lifeUpClip = game.clip.attachMovie("lifeUp", "lifeUp", _root.powerupDepth);
_root.lifeUpClip.dieStatus = false;
_root.powerupDepth++;
_root.lifeUpClip._x = (tempx * game.tileWidth) + (game.tileWidth / 2);
_root.lifeUpClip._y = (tempy * game.tileHeight) + (game.tileHeight / 2);
_root.mc_lifeIcon.gotoAndStop(1);
_root.lifeUpClip.onEnterFrame = function () {
var _local3 = _root.heroTankObj.clip;
if (this.hitTest(_local3)) {
this.dieStatus = true;
ob.lifeFlag = true;
_root.mc_lifeIcon.gotoAndStop(2);
_root.addHeroLives();
this.removeMovieClip();
}
};
ob.lifePowerUp = true;
game.removeLifePowerUpInterval = setInterval(removeLifePowerUp, 20000);
clearInterval(game.lifePowerUpInterval);
}
}
function removeLifePowerUp() {
_root.lifeUpClip.dieStatus = true;
_root.heroTankObj.lifeFlag = false;
_root.lifeUpClip.removeMovieClip();
_root.heroTankObj.lifePowerUp = false;
_root.mc_lifeIcon.gotoAndStop(2);
clearInterval(game.removeLifePowerUpInterval);
}
function removeAllHeroLives() {
i = 1;
while (i <= 8) {
var _local2 = _root.panel_mc.heroLivesClip["e" + i];
_local2._visible = false;
i++;
}
}
function updateHeroLives() {
removeAllHeroLives();
var _local3 = Number(game.totalHeroLife - game.numOfHero);
_root.heroLivesArray = [];
i = 1;
while (i <= _local3) {
var _local2 = _root.panel_mc.heroLivesClip["e" + i];
_local2._visible = true;
_root.heroLivesArray.push(_local2);
i++;
}
}
function removeSingleHero() {
var _local2 = _root.heroLivesArray.length;
var _local3 = _root.heroLivesArray[_local2 - 1];
_local3.gotoAndStop(2);
_root.heroLivesArray.pop();
}
function addHeroLives() {
if (game.numOfHero == 0) {
game.totalHeroLife++;
updateHeroLives();
} else {
game.totalHeroLife++;
var _local3 = _root.heroLivesArray.length;
var _local2 = _root.panel_mc.heroLivesClip["e" + (_local3 + 1)];
_local2._visible = true;
_local2.gotoAndStop(1);
_root.heroLivesArray.push(_local2);
}
}
function createShieldPowerUp() {
var ob = heroTankObj;
if (ob.shieldPowerUp) {
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 1 + random(12);
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileName = game[(("t_" + tempy) + "_") + tempx];
}
_root.shieldClip = game.clip.attachMovie("shieldClip", "shieldClip", _root.powerupDepth);
_root.shieldClip.dieStatus = false;
_root.mc_shieldIcon.gotoAndStop(1);
_root.powerupDepth++;
_root.shieldClip._x = (tempx * game.tileWidth) + (game.tileWidth / 2);
_root.shieldClip._y = (tempy * game.tileHeight) + (game.tileHeight / 2);
_root.shieldClip.onEnterFrame = function () {
var _local3 = _root.heroTankObj.clip;
if (this.hitTest(_local3)) {
this.dieStatus = true;
ob.shieldFlag = true;
_root.setShield(ob, 8000);
_root.mc_shieldIcon.gotoAndStop(2);
this.removeMovieClip();
}
};
ob.shieldPowerUp = true;
clearInterval(game.shieldPowerUpInterval);
game.removeShieldPowerUpInterval = setInterval(removeShieldPowerUp, 20000);
}
}
function removeShieldPowerUp() {
if (!_root.heroTankObj.shieldPowerUp) {
_root.shieldClip.dieStatus = true;
_root.heroTankObj.shieldFlag = false;
_root.shieldClip.removeMovieClip();
_root.heroTankObj.shieldPowerUp = false;
}
_root.mc_shieldIcon.gotoAndStop(2);
clearInterval(game.removeShieldPowerUpInterval);
}
function shieldFunc(obj) {
var _local1 = obj;
if (_local1.shieldFlag) {
_local1.shieldPowerUp = false;
_local1.speed = 10;
_local1.shieldFlag = false;
_local1.clip.shieldClip.gotoAndStop(1);
clearInterval(game.shieldInterval);
}
}
function setShield(obj, t) {
var _local2 = obj;
if (_local2.shieldFlag) {
_local2.speed = 10;
var _local3 = t;
obj = _local2;
_local2.clip.shieldClip.gotoAndPlay("start");
game.shieldInterval = setInterval(this, "shieldFunc", _local3, obj);
}
}
function createFreezePowerUp() {
var ob = heroTankObj;
if (ob.freezePowerUp) {
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 1 + random(12);
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileName = game[(("t_" + tempy) + "_") + tempx];
}
_root.freezeClip = game.clip.attachMovie("freezeClip", "freezeClip", _root.powerupDepth);
_root.freezeClip.dieStatus = false;
_root.mc_freezeIcon.gotoAndStop(1);
_root.powerupDepth++;
_root.freezeClip._x = (tempx * game.tileWidth) + (game.tileWidth / 2);
_root.freezeClip._y = (tempy * game.tileHeight) + (game.tileHeight / 2);
_root.freezeClip.onEnterFrame = function () {
var _local3 = _root.heroTankObj.clip;
if (this.hitTest(_local3)) {
this.dieStatus = true;
ob.freezeFlag = true;
ob.shieldFlag = true;
_root.freezeEnemy = true;
_root.mc_freezeIcon.gotoAndStop(2);
_root.setFreeze(ob, 13000);
this.removeMovieClip();
}
};
ob.freezePowerUp = true;
clearInterval(game.freezePowerUpInterval);
game.removeFreezePowerUpInterval = setInterval(removeFreezePowerUp, 20000);
}
}
function removeFreezePowerUp() {
if (!_root.heroTankObj.freezePowerUp) {
_root.freezeClip.dieStatus = true;
_root.heroTankObj.freezeFlag = false;
_root.freezeClip.removeMovieClip();
_root.heroTankObj.freezePowerUp = false;
}
_root.mc_freezeIcon.gotoAndStop(2);
clearInterval(game.removeFreezePowerUpInterval);
}
function freezeFunc(obj) {
var _local2 = obj;
_local2.freezeFlag = false;
_local2.shieldFlag = false;
_local2.clip.shieldClip.gotoAndStop(1);
_root.freezeEnemy = false;
_local2.freezePowerUp = false;
clearInterval(game.freezeInterval);
}
function setFreeze(obj, t) {
var _local2 = obj;
var _local3 = t;
obj = _local2;
_local2.clip.shieldClip.gotoAndPlay("start");
game.freezeInterval = setInterval(this, "freezeFunc", _local3, obj);
}
function createInvisiblePowerUp() {
var ob = heroTankObj;
if (ob.invisiblePowerUp) {
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 1 + random(12);
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileName = game[(("t_" + tempy) + "_") + tempx];
}
_root.invisibleClip = game.clip.attachMovie("invisibleClip", "invisibleClip", _root.powerupDepth);
_root.invisibleClip.dieStatus = false;
_root.powerupDepth++;
_root.invisibleClip._x = (tempx * game.tileWidth) + (game.tileWidth / 2);
_root.invisibleClip._y = (tempy * game.tileHeight) + (game.tileHeight / 2);
_root.invisibleClip.onEnterFrame = function () {
var _local3 = _root.heroTankObj.clip;
if (this.hitTest(_local3)) {
this.dieStatus = true;
ob.invisibleFlag = true;
ob.shieldFlag = true;
_root.mc_invisibleIcon.gotoAndStop(2);
_root.setInvisible(ob, 15000);
this.removeMovieClip();
}
};
ob.invisiblePowerUp = true;
game.removeInvisiblePowerUpInterval = setInterval(removeInvisiblePowerUp, 20000);
clearInterval(game.invisiblePowerUpInterval);
}
}
function removeInvisiblePowerUp() {
if (!_root.heroTankObj.invisiblePowerUp) {
_root.invisibleClip.dieStatus = true;
_root.heroTankObj.invisibleFlag = false;
_root.heroTankObj.shieldFlag = false;
_root.invisibleClip.removeMovieClip();
_root.heroTankObj.invisiblePowerUp = false;
}
_root.mc_invisibleIcon.gotoAndStop(2);
clearInterval(game.removeInvisiblePowerUpInterval);
}
function invisibleFunc(obj) {
var _local1 = obj;
_local1.invisibleFlag = false;
_local1.shieldFlag = false;
_local1.invisiblePowerUp = false;
_local1.speed = 10;
_local1.clip._alpha = 100;
clearInterval(game.invisibleInterval);
}
function setInvisible(obj, t) {
var _local2 = obj;
_local2.speed = 10;
var _local3 = t;
obj = _local2;
_local2.clip._alpha = 30;
game.invisibleInterval = setInterval(this, "invisibleFunc", _local3, obj);
}
function createBaseShieldPowerUp() {
var ob = heroTankObj;
if (ob.baseShieldPowerUp) {
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 1 + random(9);
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileName = game[(("t_" + tempy) + "_") + tempx];
}
_root.baseShieldClip = game.clip.attachMovie("baseShieldClip", "baseShieldClip", _root.powerupDepth);
_root.baseShieldClip.dieStatus = false;
_root.mc_castleIcon.gotoAndStop(1);
_root.powerupDepth++;
_root.baseShieldClip._x = (tempx * game.tileWidth) + (game.tileWidth / 2);
_root.baseShieldClip._y = (tempy * game.tileHeight) + (game.tileHeight / 2);
_root.outputClip.outputText.text = _root.outputClip.outputText.text + newline;
_root.outputClip.outputText.text = _root.outputClip.outputText.text + "=================base shield offered===================";
_root.outputClip.outputText.text = _root.outputClip.outputText.text + newline;
_root.baseShieldClip.onEnterFrame = function () {
var _local3 = _root.heroTankObj.clip;
if (this.hitTest(_local3)) {
this.dieStatus = true;
ob.baseShieldFlag = true;
_root.mc_castleIcon.gotoAndStop(2);
_root.outputClip.outputText.text = _root.outputClip.outputText.text + "=================base shield activated===================";
_root.outputClip.outputText.text = _root.outputClip.outputText.text + newline;
_root.outputClip.outputText.text = _root.outputClip.outputText.text + "baseShieldFlag =";
_root.outputClip.outputText.text = _root.outputClip.outputText.text + ob.baseShieldFlag;
_root.setBaseShield(ob, 20000);
this.removeMovieClip();
}
};
ob.baseShieldPowerUp = true;
clearInterval(game.baseShieldPowerUpInterval);
game.removeBaseShieldPowerUpInterval = setInterval(removeBaseShieldPowerUp, 20000);
}
}
function removeBaseShieldPowerUp() {
if (!_root.heroTankObj.baseShieldPowerUp) {
_root.baseShieldClip.dieStatus = true;
_root.heroTankObj.baseShieldFlag = false;
_root.baseShieldClip.removeMovieClip();
}
_root.heroTankObj.baseShieldPowerUp = false;
_root.mc_castleIcon.gotoAndStop(2);
clearInterval(game.removeBaseShieldPowerUpInterval);
}
function baseShieldFunc(obj) {
var _local5 = obj;
var _local3 = game.baseShieldTiles;
i = 0;
while (i < _local3.length) {
var _local4 = _local3[i].tClip;
var _local2 = _local3[i].tObj;
_local4.mc_shieldClip.gotoAndStop(1);
_local2.walkable = false;
_local2.breakable = true;
i++;
}
_local5.baseShieldFlag = false;
_local5.baseShieldPowerUp = false;
_root.outputClip.outputText.text = _root.outputClip.outputText.text + "=================base shield removed===================\n";
_root.outputClip.outputText.text = _root.outputClip.outputText.text + "baseShieldFlag =";
_root.outputClip.outputText.text = _root.outputClip.outputText.text + _local5.baseShieldFlag;
clearInterval(game.baseShieldInterval);
}
function setBaseShield(o, t) {
var _local5 = t;
var _local6 = o;
t = game.baseShieldTiles;
i = 0;
while (i < t.length) {
var _local4 = t[i].tClip;
var _local2 = t[i].tObj;
_local4.mc_shieldClip.gotoAndStop(2);
_local2.walkable = false;
_local2.breakable = false;
i++;
}
game.baseShieldInterval = setInterval(this, "baseShieldFunc", _local5, _local6);
}
function createAmmunationPowerUp() {
var ob = heroTankObj;
if (ob.ammunationPowerUp) {
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(14);
tempy = 1 + random(9);
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileName = game[(("t_" + tempy) + "_") + tempx];
}
_root.ammunationClip = game.clip.attachMovie("ammunationClip", "ammunationClip", _root.powerupDepth);
_root.ammunationClip.dieStatus = false;
_root.mc_ammunationIcon.gotoAndStop(1);
_root.powerupDepth++;
_root.ammunationClip._x = (tempx * game.tileWidth) + (game.tileWidth / 2);
_root.ammunationClip._y = (tempy * game.tileHeight) + (game.tileHeight / 2);
_root.ammunationClip.onEnterFrame = function () {
var _local3 = _root.heroTankObj.clip;
if (this.hitTest(_local3)) {
this.dieStatus = true;
_root.mc_ammunationIcon.gotoAndStop(2);
ob.ammunationFlag = true;
this.removeMovieClip();
}
};
ob.ammunationPowerUp = true;
clearInterval(game.ammunationPowerUpInterval);
game.removeAmmunationPowerUpInterval = setInterval(removeAmmunationPowerUp, 20000);
}
}
function removeAmmunationPowerUp() {
if (!_root.heroTankObj.ammunationPowerUp) {
_root.ammunationClip.dieStatus = true;
_root.ammunationClip.removeMovieClip();
_root.heroTankObj.ammunationFlag = false;
_root.heroTankObj.ammunationPowerUp = false;
}
_root.mc_ammunationIcon.gotoAndStop(2);
clearInterval(game.removeAmmunationPowerUpInterval);
}
function bombFunc(o) {
}
function setMines(obj, t) {
var _local7 = obj;
if (heroTankObj.ammunationPowerUp) {
if (game.usedMines < game.totalMines) {
var xt = heroTankObj.xtile;
var yt = heroTankObj.ytile;
game[(("t_" + yt) + "_") + xt].occupied = true;
var _local6 = "mineClip" + _root.depthNum;
_root[_local6] = game.clip.attachMovie("mineClip", _local6, _root.powerupDepth);
_root[_local6].dieStatus = false;
_root[_local6]._x = (xt * game.tileWidth) + (game.tileWidth / 2);
_root[_local6]._y = (yt * game.tileHeight) + (game.tileHeight / 2);
_root.powerupDepth++;
_root.depthNum++;
game.usedMines++;
_root[_local6].onEnterFrame = function () {
var _local3 = 0;
while (_local3 < game.currentEnemies.length) {
var _local4 = "enemy" + game.currentEnemies[_local3].id;
var _local2 = game[_local4];
if (this.mc_hit.hitTest(_local2.clip.mc_hit)) {
this.dieStatus = true;
game[(("t_" + yt) + "_") + xt].occupied = false;
_local2.strength = 0;
_local2.dieFlag = true;
_local2.clip.gotoAndPlay("die");
clearInterval(_local2.missileId);
this.removeMovieClip();
}
_local3++;
}
};
}
}
}
function createBonusPowerUp() {
var ob = heroTankObj;
if (ob.bonusPowerUp) {
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 1 + random(12);
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileName = game[(("t_" + tempy) + "_") + tempx];
}
_root.bonusClip = game.clip.attachMovie("bonusClip", "bonusClip", _root.powerupDepth);
_root.bonusClip.dieStatus = false;
_root.mc_bonusIcon.gotoAndStop(1);
_root.powerupDepth++;
_root.bonusClip._x = (tempx * game.tileWidth) + (game.tileWidth / 2);
_root.bonusClip._y = (tempy * game.tileHeight) + (game.tileHeight / 2);
_root.bonusClip.onEnterFrame = function () {
var _local3 = _root.heroTankObj.clip;
if (this.hitTest(_local3)) {
this.dieStatus = true;
ob.bonusFlag = false;
ob.bonusPowerUp = false;
_root.mc_bonusIcon.gotoAndStop(2);
_root.setBonus();
this.removeMovieClip();
}
};
ob.bonusPowerUp = true;
clearInterval(game.bonusPowerUpInterval);
game.removeBonusPowerUpInterval = setInterval(removeBonusPowerUp, 20000);
}
}
function removeBonusPowerUp() {
_root.bonusClip.dieStatus = true;
_root.heroTankObj.bonusFlag = false;
_root.bonusClip.removeMovieClip();
_root.heroTankObj.bonusPowerUp = false;
_root.mc_bonusIcon.gotoAndStop(2);
clearInterval(game.removeBonusPowerUpInterval);
}
function setBonus() {
_root.gameScore = _root.gameScore + ((4 + random(10)) * 200);
return(undefined);
}
Instance of Symbol 540 MovieClip "gameover_mc" in Frame 40
/* no clip actions */
Frame 41
function powerUpManager() {
var _local1 = heroTankObj;
if (!_local1.lifePowerUp) {
game.lifePowerUpInterval = setInterval(createLifePowerUp, 4000);
_local1.lifePowerUp = true;
}
if (!_local1.shieldPowerUp) {
}
if (!_local1.freezePowerUp) {
}
if (!_local1.baseShieldPowerUp) {
}
if (!_local1.ammunationPowerUp) {
game.ammunationPowerUpInterval = setInterval(createAmmunationPowerUp, 2000);
_local1.ammunationPowerUp = true;
}
if (!_local1.bonusPowerUp) {
game.bonusPowerUpInterval = setInterval(createBonusPowerUp, 8000);
_local1.bonusPowerUp = true;
}
if (!_local1.invisiblePowerUp) {
}
}
function nextLevel() {
_root.outputClip.outputText.text = "";
_root.gameScore = _root.gameScore + _root.levelBonusPoints;
levelEnd();
_root.gotoAndStop("level2_start");
}
function recreateEnemy(o) {
var _local3 = o;
if (game.numOfEnemy < (game.totalEnemyLife - 4)) {
game.numOfEnemy++;
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 2;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
_local3.xtile = tempx;
_local3.ytile = tempy;
}
_local3.x = (_local3.xtile * game.tileWidth) + (game.tileWidth / 2);
_local3.y = (_local3.ytile * game.tileHeight) + (game.tileHeight / 2);
_local3.strength = 100;
_local3.clip._x = _local3.x;
_local3.clip._y = _local3.y;
_local3.clip._alpha = 100;
var _local4 = _local3.shootSpeed;
var _local5 = _local3;
_local3.clip.gotoAndPlay("recreate");
_local3.missileId = setInterval(this, "enemyMissileInterval", _local4, _local5);
_root.outputText.text = game.numOfEnemy;
}
removeSingleEnemy();
}
function recreateHero(o) {
var _local1 = o;
if (game.numOfHero < game.totalHeroLife) {
_local1.xtile = 8;
_local1.ytile = 9;
_local1.x = (_local1.xtile * game.tileWidth) + (game.tileWidth / 2);
_local1.y = (_local1.ytile * game.tileHeight) + (game.tileHeight / 2);
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.direction = "up";
_local1.strength = 100;
_local1.clip.gotoAndStop("recreate");
game.numOfHero++;
removeSingleHero();
}
}
tileMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 3, 0, 0, 3, 2, 2, 2, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 4, 4, 4, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 0, 0, 0, 3, 0, 0, 3, 0, 0, 1], [1, 4, 4, 6, 4, 4, 6, 4, 4, 4, 5, 4, 4, 5, 4, 4, 1], [1, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 1], [1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1], [1, 0, 0, 6, 0, 3, 0, 0, 0, 0, 0, 3, 0, 5, 0, 0, 1], [1, 6, 0, 3, 0, 3, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 1], [1, 3, 0, 3, 0, 3, 6, 4, 2, 4, 5, 3, 0, 3, 0, 0, 1], [1, 3, 0, 3, 0, 3, 3, 9, 12, 9, 3, 3, 0, 3, 0, 5, 1], [1, 3, 7, 3, 7, 3, 3, 8, 13, 8, 3, 3, 7, 3, 7, 3, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
myEnemies = [[1, 1, 1], [2, 4, 1], [1, 14, 1], [2, 11, 1]];
heroBaseArray = [[1, 8, 11], [2, 8, 11], [3, 9, 13], [4, 9, 13]];
_root.freezeEnemy = false;
_root.heroDead = 0;
_root.enemyDead = 0;
_root.gameScore = 0;
_root.currentLevel = 1;
_root.levelBonusPoints = 2000;
_root.levelEndStatus = false;
_root.depthNum = 50000;
_root.powerupDepth = 200000 /* 0x030D40 */;
_root.gameover_mc.gotoAndStop(1);
_root.shotMissileInterval = 0;
_root.attackFlag = false;
_root.outputClipText = "";
heroTankObj = {};
heroTankObj.xtile = 8;
heroTankObj.ytile = 9;
heroTankObj.speed = 10;
heroTankObj.lastshot = 0;
heroTankObj.dieFlag = false;
heroTankObj.shieldFlag = false;
heroTankObj.ammunationFlag = false;
heroTankObj.lifeFlag = false;
heroTankObj.baseShieldFlag = false;
heroTankObj.invisibleFlag = false;
heroTankObj.totalMissile = 50000;
heroTankObj.currentMissile = 0;
heroTankObj.shootspeed = 500;
heroTankObj.strength = 100;
heroBaseObj = {};
heroBaseObj.xtile = 8;
heroBaseObj.ytile = 11;
game = {};
game.tileWidth = 40;
game.tileHeight = 40;
game.missileDepth1 = 0;
game.missileDepth2 = 5000;
game.totalMines = 5;
game.usedMines = 0;
game.heroBullets = new Array();
game.enemyBullets = new Array();
game.baseShieldTiles = new Array();
game.numOfEnemy = 0;
game.totalEnemyLife = 10;
game.numOfHero = -1;
game.totalHeroLife = 2;
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile0.prototype.breakable = false;
game.Tile0.prototype.occupied = false;
game.Tile0.prototype.strength = 100;
game.Tile0.prototype.invisible = true;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile1.prototype.breakable = false;
game.Tile1.prototype.occupied = false;
game.Tile1.prototype.strength = 100;
game.Tile1.prototype.invisible = false;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile2.prototype.breakable = false;
game.Tile2.prototype.occupied = false;
game.Tile2.prototype.strength = 100;
game.Tile2.prototype.invisible = true;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile3.prototype.breakable = true;
game.Tile3.prototype.occupied = false;
game.Tile3.prototype.strength = 100;
game.Tile3.prototype.invisible = true;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile4.prototype.breakable = true;
game.Tile4.prototype.occupied = false;
game.Tile4.prototype.strength = 100;
game.Tile4.prototype.invisible = true;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile5.prototype.breakable = true;
game.Tile5.prototype.occupied = false;
game.Tile5.prototype.strength = 100;
game.Tile5.prototype.invisible = true;
game.Tile6 = function () {
};
game.Tile6.prototype.walkable = false;
game.Tile6.prototype.frame = 7;
game.Tile6.prototype.breakable = true;
game.Tile6.prototype.occupied = false;
game.Tile6.prototype.strength = 100;
game.Tile6.prototype.invisible = true;
game.Tile7 = function () {
};
game.Tile7.prototype.walkable = false;
game.Tile7.prototype.frame = 8;
game.Tile7.prototype.breakable = true;
game.Tile7.prototype.occupied = false;
game.Tile7.prototype.strength = 100;
game.Tile7.prototype.invisible = true;
game.Tile8 = function () {
};
game.Tile8.prototype.walkable = false;
game.Tile8.prototype.frame = 10;
game.Tile8.prototype.breakable = true;
game.Tile8.prototype.occupied = false;
game.Tile8.prototype.strength = 200;
game.Tile8.prototype.shield = true;
game.Tile8.prototype.invisible = false;
game.Tile9 = function () {
};
game.Tile9.prototype.walkable = false;
game.Tile9.prototype.frame = 11;
game.Tile9.prototype.breakable = true;
game.Tile9.prototype.occupied = false;
game.Tile9.prototype.strength = 200;
game.Tile9.prototype.shield = true;
game.Tile9.prototype.invisible = false;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = false;
game.Tile12.prototype.frame = 12;
game.Tile12.prototype.breakable = true;
game.Tile12.prototype.occupied = false;
game.Tile12.prototype.strength = 200;
game.Tile12.prototype.shield = true;
game.Tile12.prototype.invisible = false;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = false;
game.Tile13.prototype.frame = 13;
game.Tile13.prototype.breakable = true;
game.Tile13.prototype.occupied = false;
game.Tile13.prototype.strength = 300;
game.Tile13.prototype.shield = true;
game.Tile13.prototype.invisible = false;
game.Enemyp1 = function () {
};
game.Enemyp1.prototype.xmove = 1;
game.Enemyp1.prototype.ymove = 0;
game.Enemyp1.prototype.speed = 4;
game.Enemyp1.prototype.dieFlag = false;
game.Enemyp1.prototype.changeInterval = 7000;
game.Enemyp1.prototype.strength = 100;
game.Enemyp1.prototype.shootSpeed = 700;
game.Enemyp2 = function () {
};
game.Enemyp2.prototype.xmove = -1;
game.Enemyp2.prototype.ymove = 0;
game.Enemyp2.prototype.speed = 4;
game.Enemyp2.prototype.dieFlag = false;
game.Enemyp2.prototype.changeInterval = 3000;
game.Enemyp2.prototype.strength = 100;
game.Enemyp2.prototype.shootSpeed = 700;
game.heroMissile = function () {
};
game.heroMissile.prototype.xtile = 0;
game.heroMissile.prototype.ytile = 0;
game.heroMissile.prototype.wid = 5;
game.heroMissile.prototype.hei = 5;
game.heroMissile.prototype.dieFlag = false;
game.heroMissile.prototype.speed = 15;
game.heroMissile.prototype.mPower = 50;
game.enemyMissile = function () {
};
game.enemyMissile.prototype.xtile = 0;
game.enemyMissile.prototype.ytile = 0;
game.enemyMissile.prototype.wid = 5;
game.enemyMissile.prototype.hei = 5;
game.enemyMissile.prototype.speed = 20;
game.enemyMissile.prototype.mPower = 50;
keyDetect = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
_root.keyPressVal = Key.getCode();
if (Key.isDown(38)) {
_root.movement = "up";
_root.heroTankObj.clip.gotoAndStop("up");
_root.moveFunction(obj, 0, -1);
} else if (Key.isDown(40)) {
_root.movement = "down";
_root.heroTankObj.clip.gotoAndStop("down");
_root.moveFunction(obj, 0, 1);
} else if (Key.isDown(37)) {
_root.movement = "left";
_root.heroTankObj.clip.gotoAndStop("left");
_root.moveFunction(obj, -1, 0);
} else if (Key.isDown(39)) {
_root.movement = "right";
_root.heroTankObj.clip.gotoAndStop("right");
_root.moveFunction(obj, 1, 0);
}
}
}
};
var myListener = new Object();
myListener.onKeyDown = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if ((Key.getCode() == 83) && (!_root.keyPressFlag)) {
_root.createMissile(obj);
_root.keyPressFlag = true;
}
if (((Key.getCode() == 65) && (!_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.setMines();
_root.keyPressFlag2 = true;
}
}
}
};
myListener.onKeyUp = function () {
if ((Key.getCode() == 83) && (_root.keyPressFlag)) {
_root.keyPressFlag = false;
}
if (((Key.getCode() == 65) && (_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.keyPressFlag2 = false;
}
};
Key.addListener(myListener);
_root.onEnterFrame = function () {
moveBullets();
moveEnemyBullets();
moveEnemies();
keyDetect();
checkBase();
checkLevelEndStatus();
};
createTile();
createHeroTank();
createHeroBase();
createEnemies();
assignEnemiesMove();
createEnemyLivesPanel();
createHeroLivesPanel();
powerUpManager();
disableAllPowerUp();
updateHeroLives();
updateEnemyLives();
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(30);
stop();
Frame 43
stop();
Instance of Symbol 548 MovieClip "nextLevel_mc" in Frame 43
onClipEvent (load) {
this.nextLevel = "level2";
}
Instance of Symbol 540 MovieClip "gameover_mc" in Frame 45
/* no clip actions */
Frame 46
function powerUpManager() {
var _local1 = heroTankObj;
if (!_local1.lifePowerUp) {
game.lifePowerUpInterval = setInterval(createLifePowerUp, 2000);
_local1.lifePowerUp = true;
}
if (!_local1.shieldPowerUp) {
game.shieldPowerUpInterval = setInterval(createShieldPowerUp, 6000);
_local1.shieldPowerUp = true;
}
if (!_local1.freezePowerUp) {
}
if (!_local1.baseShieldPowerUp) {
}
if (!_local1.ammunationPowerUp) {
}
if (!_local1.bonusPowerUp) {
game.bonusPowerUpInterval = setInterval(createBonusPowerUp, 8000);
_local1.bonusPowerUp = true;
}
if (!_local1.invisiblePowerUp) {
}
}
function nextLevel() {
_root.outputClip.outputText.text = "";
_root.gameScore = _root.gameScore + _root.levelBonusPoints;
levelEnd();
_root.gotoAndStop("level3_start");
}
function recreateEnemy(o) {
var _local3 = o;
if (game.numOfEnemy < (game.totalEnemyLife - 4)) {
game.numOfEnemy++;
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 2;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
_local3.xtile = tempx;
_local3.ytile = tempy;
}
_local3.x = (_local3.xtile * game.tileWidth) + (game.tileWidth / 2);
_local3.y = (_local3.ytile * game.tileHeight) + (game.tileHeight / 2);
_local3.strength = 200;
_local3.clip._x = _local3.x;
_local3.clip._y = _local3.y;
_local3.clip._alpha = 100;
var _local4 = _local3.shootSpeed;
var _local5 = _local3;
_local3.clip.gotoAndPlay("recreate");
_local3.missileId = setInterval(this, "enemyMissileInterval", _local4, _local5);
_root.outputText.text = game.numOfEnemy;
}
removeSingleEnemy();
}
function recreateHero(o) {
var _local1 = o;
if (game.numOfHero < game.totalHeroLife) {
_local1.xtile = 8;
_local1.ytile = 9;
_local1.x = (_local1.xtile * game.tileWidth) + (game.tileWidth / 2);
_local1.y = (_local1.ytile * game.tileHeight) + (game.tileHeight / 2);
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.strength = 100;
_local1.direction = "up";
_local1.clip.gotoAndStop("recreate");
game.numOfHero++;
removeSingleHero();
}
}
tileMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 3, 0, 0, 3, 2, 2, 2, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 4, 4, 4, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 0, 0, 0, 3, 0, 0, 3, 0, 0, 1], [1, 4, 4, 6, 4, 4, 6, 4, 4, 4, 5, 4, 4, 5, 4, 4, 1], [1, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 1], [1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1], [1, 0, 0, 6, 0, 3, 0, 0, 0, 0, 0, 3, 0, 5, 0, 0, 1], [1, 6, 0, 3, 0, 3, 0, 0, 0, 0, 0, 3, 0, 3, 0, 5, 1], [1, 3, 0, 3, 0, 3, 6, 4, 2, 4, 5, 3, 0, 3, 0, 3, 1], [1, 3, 0, 3, 0, 3, 3, 9, 12, 9, 3, 3, 0, 3, 0, 3, 1], [1, 3, 7, 3, 7, 3, 3, 8, 13, 8, 3, 3, 7, 3, 7, 3, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
myEnemies = [[1, 1, 1], [2, 4, 1], [1, 14, 1], [2, 11, 1]];
heroBaseArray = [[1, 8, 11], [2, 8, 11], [3, 9, 13], [4, 9, 13]];
_root.freezeEnemy = false;
_root.heroDead = 0;
_root.enemyDead = 0;
_root.currentLevel = 2;
_root.levelBonusPoints = 2000;
_root.levelEndStatus = false;
_root.depthNum = 50000;
_root.powerupDepth = 100000 /* 0x0186A0 */;
_root.gameover_mc.gotoAndStop(1);
_root.shotMissileInterval = 0;
_root.attackFlag = false;
heroTankObj = {};
heroTankObj.xtile = 8;
heroTankObj.ytile = 9;
heroTankObj.speed = 10;
heroTankObj.lastshot = 0;
heroTankObj.dieFlag = false;
heroTankObj.shieldFlag = false;
heroTankObj.ammunationFlag = false;
heroTankObj.lifeFlag = false;
heroTankObj.baseShieldFlag = false;
heroTankObj.invisibleFlag = false;
heroTankObj.totalMissile = 50000;
heroTankObj.currentMissile = 0;
heroTankObj.shootspeed = 500;
heroTankObj.strength = 100;
heroBaseObj = {};
heroBaseObj.xtile = 8;
heroBaseObj.ytile = 11;
game = {};
game.tileWidth = 40;
game.tileHeight = 40;
game.missileDepth1 = 0;
game.missileDepth2 = 5000;
game.totalMines = 5;
game.usedMines = 0;
game.heroBullets = new Array();
game.enemyBullets = new Array();
game.baseShieldTiles = new Array();
game.numOfEnemy = 0;
game.totalEnemyLife = 12;
game.numOfHero = -1;
game.totalHeroLife = 2;
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile0.prototype.breakable = false;
game.Tile0.prototype.occupied = false;
game.Tile0.prototype.strength = 100;
game.Tile0.prototype.invisible = true;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile1.prototype.breakable = false;
game.Tile1.prototype.occupied = false;
game.Tile1.prototype.strength = 100;
game.Tile1.prototype.invisible = false;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile2.prototype.breakable = false;
game.Tile2.prototype.occupied = false;
game.Tile2.prototype.strength = 100;
game.Tile2.prototype.invisible = true;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile3.prototype.breakable = true;
game.Tile3.prototype.occupied = false;
game.Tile3.prototype.strength = 100;
game.Tile3.prototype.invisible = true;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile4.prototype.breakable = true;
game.Tile4.prototype.occupied = false;
game.Tile4.prototype.strength = 100;
game.Tile4.prototype.invisible = true;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile5.prototype.breakable = true;
game.Tile5.prototype.occupied = false;
game.Tile5.prototype.strength = 100;
game.Tile5.prototype.invisible = true;
game.Tile6 = function () {
};
game.Tile6.prototype.walkable = false;
game.Tile6.prototype.frame = 7;
game.Tile6.prototype.breakable = true;
game.Tile6.prototype.occupied = false;
game.Tile6.prototype.strength = 100;
game.Tile6.prototype.invisible = true;
game.Tile7 = function () {
};
game.Tile7.prototype.walkable = false;
game.Tile7.prototype.frame = 8;
game.Tile7.prototype.breakable = true;
game.Tile7.prototype.occupied = false;
game.Tile7.prototype.strength = 100;
game.Tile7.prototype.invisible = true;
game.Tile8 = function () {
};
game.Tile8.prototype.walkable = false;
game.Tile8.prototype.frame = 10;
game.Tile8.prototype.breakable = true;
game.Tile8.prototype.occupied = false;
game.Tile8.prototype.strength = 200;
game.Tile8.prototype.shield = true;
game.Tile8.prototype.invisible = false;
game.Tile9 = function () {
};
game.Tile9.prototype.walkable = false;
game.Tile9.prototype.frame = 11;
game.Tile9.prototype.breakable = true;
game.Tile9.prototype.occupied = false;
game.Tile9.prototype.strength = 200;
game.Tile9.prototype.shield = true;
game.Tile9.prototype.invisible = false;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = false;
game.Tile12.prototype.frame = 12;
game.Tile12.prototype.breakable = true;
game.Tile12.prototype.occupied = false;
game.Tile12.prototype.strength = 200;
game.Tile12.prototype.shield = true;
game.Tile12.prototype.invisible = false;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = false;
game.Tile13.prototype.frame = 13;
game.Tile13.prototype.breakable = true;
game.Tile13.prototype.occupied = false;
game.Tile13.prototype.strength = 300;
game.Tile13.prototype.shield = true;
game.Tile13.prototype.invisible = false;
game.Enemyp1 = function () {
};
game.Enemyp1.prototype.xmove = 1;
game.Enemyp1.prototype.ymove = 0;
game.Enemyp1.prototype.speed = 4;
game.Enemyp1.prototype.dieFlag = false;
game.Enemyp1.prototype.changeInterval = 7000;
game.Enemyp1.prototype.strength = 200;
game.Enemyp1.prototype.shootSpeed = 700;
game.Enemyp2 = function () {
};
game.Enemyp2.prototype.xmove = -1;
game.Enemyp2.prototype.ymove = 0;
game.Enemyp2.prototype.speed = 4;
game.Enemyp2.prototype.dieFlag = false;
game.Enemyp2.prototype.changeInterval = 3000;
game.Enemyp2.prototype.strength = 200;
game.Enemyp2.prototype.shootSpeed = 700;
game.heroMissile = function () {
};
game.heroMissile.prototype.xtile = 0;
game.heroMissile.prototype.ytile = 0;
game.heroMissile.prototype.wid = 5;
game.heroMissile.prototype.hei = 5;
game.heroMissile.prototype.dieFlag = false;
game.heroMissile.prototype.speed = 15;
game.heroMissile.prototype.mPower = 50;
game.enemyMissile = function () {
};
game.enemyMissile.prototype.xtile = 0;
game.enemyMissile.prototype.ytile = 0;
game.enemyMissile.prototype.wid = 5;
game.enemyMissile.prototype.hei = 5;
game.enemyMissile.prototype.speed = 25;
game.enemyMissile.prototype.mPower = 50;
keyDetect = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if (Key.isDown(38)) {
_root.movement = "up";
_root.moveFunction(obj, 0, -1);
} else if (Key.isDown(40)) {
_root.movement = "down";
_root.moveFunction(obj, 0, 1);
} else if (Key.isDown(37)) {
_root.movement = "left";
_root.moveFunction(obj, -1, 0);
} else if (Key.isDown(39)) {
_root.movement = "right";
_root.moveFunction(obj, 1, 0);
}
}
}
};
var myListener = new Object();
myListener.onKeyDown = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if ((Key.getCode() == 83) && (!_root.keyPressFlag)) {
_root.createMissile(obj);
_root.keyPressFlag = true;
}
if (((Key.getCode() == 65) && (!_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.setMines();
_root.keyPressFlag2 = true;
}
}
}
};
myListener.onKeyUp = function () {
if ((Key.getCode() == 83) && (_root.keyPressFlag)) {
_root.keyPressFlag = false;
}
if (((Key.getCode() == 65) && (_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.keyPressFlag2 = false;
}
};
Key.addListener(myListener);
_root.onEnterFrame = function () {
moveBullets();
moveEnemyBullets();
moveEnemies();
keyDetect();
checkBase();
checkLevelEndStatus();
_root.outputText.text = _root.enemyDead;
};
createTile();
createHeroTank();
createHeroBase();
createEnemies();
assignEnemiesMove();
createEnemyLivesPanel();
createHeroLivesPanel();
powerUpManager();
disableAllPowerUp();
updateHeroLives();
updateEnemyLives();
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(30);
stop();
Frame 48
stop();
Instance of Symbol 553 MovieClip "nextLevel_mc" in Frame 48
onClipEvent (load) {
this.nextLevel = "level3";
}
Instance of Symbol 540 MovieClip "gameover_mc" in Frame 50
/* no clip actions */
Frame 51
function powerUpManager() {
var _local1 = heroTankObj;
if (!_local1.lifePowerUp) {
game.lifePowerUpInterval = setInterval(createLifePowerUp, 2000);
_local1.lifePowerUp = true;
}
if (!_local1.shieldPowerUp) {
}
if (!_local1.freezePowerUp) {
game.freezePowerUpInterval = setInterval(createFreezePowerUp, 4000);
_local1.freezePowerUp = true;
}
if (!_local1.baseShieldPowerUp) {
}
if (!_local1.ammunationPowerUp) {
}
if (!_local1.bonusPowerUp) {
game.bonusPowerUpInterval = setInterval(createBonusPowerUp, 8000);
_local1.bonusPowerUp = true;
}
if (!_local1.invisiblePowerUp) {
}
}
function nextLevel() {
_root.outputClip.outputText.text = "";
_root.gameScore = _root.gameScore + _root.levelBonusPoints;
levelEnd();
_root.gotoAndStop("level4_start");
}
function recreateEnemy(o) {
var _local3 = o;
if (game.numOfEnemy < (game.totalEnemyLife - 4)) {
game.numOfEnemy++;
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 3 + random(5);
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
_local3.xtile = tempx;
_local3.ytile = tempy;
}
_local3.x = (_local3.xtile * game.tileWidth) + (game.tileWidth / 2);
_local3.y = (_local3.ytile * game.tileHeight) + (game.tileHeight / 2);
_local3.strength = 200;
_local3.clip._alpha = 100;
_local3.clip._x = _local3.x;
_local3.clip._y = _local3.y;
var _local4 = _local3.shootSpeed;
var _local5 = _local3;
_local3.clip.gotoAndPlay("recreate");
_local3.missileId = setInterval(this, "enemyMissileInterval", _local4, _local5);
_root.outputText.text = game.numOfEnemy;
}
removeSingleEnemy();
}
function recreateHero(o) {
var _local1 = o;
if (game.numOfHero < game.totalHeroLife) {
_local1.xtile = 8;
_local1.ytile = 9;
_local1.x = (_local1.xtile * game.tileWidth) + (game.tileWidth / 2);
_local1.y = (_local1.ytile * game.tileHeight) + (game.tileHeight / 2);
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.strength = 100;
_local1.direction = "up";
_local1.clip.gotoAndStop("recreate");
game.numOfHero++;
removeSingleHero();
}
}
tileMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 3, 0, 0, 3, 2, 2, 2, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 4, 4, 4, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 0, 0, 0, 3, 0, 0, 3, 0, 0, 1], [1, 4, 4, 6, 4, 4, 6, 4, 4, 4, 5, 4, 4, 5, 4, 4, 1], [1, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 1], [1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1], [1, 0, 0, 6, 0, 3, 0, 0, 0, 0, 0, 3, 0, 5, 0, 0, 1], [1, 6, 0, 3, 0, 3, 0, 0, 0, 0, 0, 3, 0, 3, 0, 5, 1], [1, 3, 0, 3, 0, 3, 6, 4, 2, 4, 5, 3, 0, 3, 0, 3, 1], [1, 3, 0, 3, 0, 3, 3, 9, 12, 9, 3, 3, 0, 3, 0, 3, 1], [1, 3, 7, 3, 7, 3, 3, 8, 13, 8, 3, 3, 7, 3, 7, 3, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
myEnemies = [[1, 1, 1], [2, 4, 1], [1, 14, 1], [2, 11, 1]];
heroBaseArray = [[1, 8, 11], [2, 8, 11], [3, 9, 13], [4, 9, 13]];
_root.freezeEnemy = false;
_root.heroDead = 0;
_root.enemyDead = 0;
_root.currentLevel = 3;
_root.levelBonusPoints = 2000;
_root.levelEndStatus = false;
_root.depthNum = 50000;
_root.powerupDepth = 100000 /* 0x0186A0 */;
_root.gameover_mc.gotoAndStop(1);
_root.shotMissileInterval = 0;
_root.attackFlag = false;
heroTankObj = {};
heroTankObj.xtile = 8;
heroTankObj.ytile = 9;
heroTankObj.speed = 10;
heroTankObj.lastshot = 0;
heroTankObj.dieFlag = false;
heroTankObj.shieldFlag = false;
heroTankObj.ammunationFlag = false;
heroTankObj.lifeFlag = false;
heroTankObj.baseShieldFlag = false;
heroTankObj.invisibleFlag = false;
heroTankObj.totalMissile = 50000;
heroTankObj.currentMissile = 0;
heroTankObj.shootspeed = 500;
heroTankObj.strength = 100;
heroBaseObj = {};
heroBaseObj.xtile = 8;
heroBaseObj.ytile = 11;
game = {};
game.tileWidth = 40;
game.tileHeight = 40;
game.missileDepth1 = 0;
game.missileDepth2 = 5000;
game.totalMines = 5;
game.usedMines = 0;
game.heroBullets = new Array();
game.enemyBullets = new Array();
game.baseShieldTiles = new Array();
game.numOfEnemy = 0;
game.totalEnemyLife = 14;
game.numOfHero = -1;
game.totalHeroLife = 2;
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile0.prototype.breakable = false;
game.Tile0.prototype.occupied = false;
game.Tile0.prototype.strength = 100;
game.Tile0.prototype.invisible = true;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile1.prototype.breakable = false;
game.Tile1.prototype.occupied = false;
game.Tile1.prototype.strength = 100;
game.Tile1.prototype.invisible = false;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile2.prototype.breakable = false;
game.Tile2.prototype.occupied = false;
game.Tile2.prototype.strength = 100;
game.Tile2.prototype.invisible = true;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile3.prototype.breakable = true;
game.Tile3.prototype.occupied = false;
game.Tile3.prototype.strength = 100;
game.Tile3.prototype.invisible = true;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile4.prototype.breakable = true;
game.Tile4.prototype.occupied = false;
game.Tile4.prototype.strength = 100;
game.Tile4.prototype.invisible = true;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile5.prototype.breakable = true;
game.Tile5.prototype.occupied = false;
game.Tile5.prototype.strength = 100;
game.Tile5.prototype.invisible = true;
game.Tile6 = function () {
};
game.Tile6.prototype.walkable = false;
game.Tile6.prototype.frame = 7;
game.Tile6.prototype.breakable = true;
game.Tile6.prototype.occupied = false;
game.Tile6.prototype.strength = 100;
game.Tile6.prototype.invisible = true;
game.Tile7 = function () {
};
game.Tile7.prototype.walkable = false;
game.Tile7.prototype.frame = 8;
game.Tile7.prototype.breakable = true;
game.Tile7.prototype.occupied = false;
game.Tile7.prototype.strength = 100;
game.Tile7.prototype.invisible = true;
game.Tile8 = function () {
};
game.Tile8.prototype.walkable = false;
game.Tile8.prototype.frame = 10;
game.Tile8.prototype.breakable = true;
game.Tile8.prototype.occupied = false;
game.Tile8.prototype.strength = 200;
game.Tile8.prototype.shield = true;
game.Tile8.prototype.invisible = false;
game.Tile9 = function () {
};
game.Tile9.prototype.walkable = false;
game.Tile9.prototype.frame = 11;
game.Tile9.prototype.breakable = true;
game.Tile9.prototype.occupied = false;
game.Tile9.prototype.strength = 200;
game.Tile9.prototype.shield = true;
game.Tile9.prototype.invisible = false;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = false;
game.Tile12.prototype.frame = 12;
game.Tile12.prototype.breakable = true;
game.Tile12.prototype.occupied = false;
game.Tile12.prototype.strength = 200;
game.Tile12.prototype.shield = true;
game.Tile12.prototype.invisible = false;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = false;
game.Tile13.prototype.frame = 13;
game.Tile13.prototype.breakable = true;
game.Tile13.prototype.occupied = false;
game.Tile13.prototype.strength = 300;
game.Tile13.prototype.shield = true;
game.Tile13.prototype.invisible = false;
game.Enemyp1 = function () {
};
game.Enemyp1.prototype.xmove = 1;
game.Enemyp1.prototype.ymove = 0;
game.Enemyp1.prototype.speed = 5;
game.Enemyp1.prototype.dieFlag = false;
game.Enemyp1.prototype.changeInterval = 7000;
game.Enemyp1.prototype.strength = 250;
game.Enemyp1.prototype.shootSpeed = 700;
game.Enemyp2 = function () {
};
game.Enemyp2.prototype.xmove = -1;
game.Enemyp2.prototype.ymove = 0;
game.Enemyp2.prototype.speed = 5;
game.Enemyp2.prototype.dieFlag = false;
game.Enemyp2.prototype.changeInterval = 3000;
game.Enemyp2.prototype.strength = 200;
game.Enemyp2.prototype.shootSpeed = 700;
game.heroMissile = function () {
};
game.heroMissile.prototype.xtile = 0;
game.heroMissile.prototype.ytile = 0;
game.heroMissile.prototype.wid = 5;
game.heroMissile.prototype.hei = 5;
game.heroMissile.prototype.dieFlag = false;
game.heroMissile.prototype.speed = 15;
game.heroMissile.prototype.mPower = 50;
game.enemyMissile = function () {
};
game.enemyMissile.prototype.xtile = 0;
game.enemyMissile.prototype.ytile = 0;
game.enemyMissile.prototype.wid = 5;
game.enemyMissile.prototype.hei = 5;
game.enemyMissile.prototype.speed = 25;
game.enemyMissile.prototype.mPower = 50;
keyDetect = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if (Key.isDown(38)) {
_root.movement = "up";
_root.moveFunction(obj, 0, -1);
} else if (Key.isDown(40)) {
_root.movement = "down";
_root.moveFunction(obj, 0, 1);
} else if (Key.isDown(37)) {
_root.movement = "left";
_root.moveFunction(obj, -1, 0);
} else if (Key.isDown(39)) {
_root.movement = "right";
_root.moveFunction(obj, 1, 0);
}
}
}
};
var myListener = new Object();
myListener.onKeyDown = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if ((Key.getCode() == 83) && (!_root.keyPressFlag)) {
_root.createMissile(obj);
_root.keyPressFlag = true;
}
if (((Key.getCode() == 65) && (!_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.setMines();
_root.keyPressFlag2 = true;
}
}
}
};
myListener.onKeyUp = function () {
if ((Key.getCode() == 83) && (_root.keyPressFlag)) {
_root.keyPressFlag = false;
}
if (((Key.getCode() == 65) && (_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.keyPressFlag2 = false;
}
};
Key.addListener(myListener);
_root.onEnterFrame = function () {
moveBullets();
moveEnemyBullets();
moveEnemies();
keyDetect();
checkBase();
checkLevelEndStatus();
_root.outputText.text = _root.enemyDead;
};
createTile();
createHeroTank();
createHeroBase();
createEnemies();
assignEnemiesMove();
createEnemyLivesPanel();
createHeroLivesPanel();
powerUpManager();
disableAllPowerUp();
updateHeroLives();
updateEnemyLives();
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(30);
stop();
Frame 53
stop();
Instance of Symbol 558 MovieClip "nextLevel_mc" in Frame 53
onClipEvent (load) {
this.nextLevel = "level4";
}
Instance of Symbol 540 MovieClip "gameover_mc" in Frame 55
/* no clip actions */
Frame 56
function powerUpManager() {
var _local1 = heroTankObj;
if (!_local1.lifePowerUp) {
game.lifePowerUpInterval = setInterval(createLifePowerUp, 2000);
_local1.lifePowerUp = true;
}
if (!_local1.shieldPowerUp) {
}
if (!_local1.freezePowerUp) {
}
if (!_local1.baseShieldPowerUp) {
game.baseShieldPowerUpInterval = setInterval(createBaseShieldPowerUp, 8000);
_local1.baseShieldPowerUp = true;
}
if (!_local1.ammunationPowerUp) {
}
if (!_local1.bonusPowerUp) {
game.bonusPowerUpInterval = setInterval(createBonusPowerUp, 10000);
_local1.bonusPowerUp = true;
}
if (!_local1.invisiblePowerUp) {
}
}
function nextLevel() {
_root.outputClip.outputText.text = "";
_root.gameScore = _root.gameScore + _root.levelBonusPoints;
levelEnd();
_root.gotoAndStop("level5_start");
}
function recreateEnemy(o) {
var _local3 = o;
if (game.numOfEnemy < (game.totalEnemyLife - 4)) {
game.numOfEnemy++;
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 2;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
_local3.xtile = tempx;
_local3.ytile = tempy;
}
_local3.x = (_local3.xtile * game.tileWidth) + (game.tileWidth / 2);
_local3.y = (_local3.ytile * game.tileHeight) + (game.tileHeight / 2);
_local3.strength = 200;
_local3.clip._x = _local3.x;
_local3.clip._y = _local3.y;
var _local4 = _local3.shootSpeed;
var _local5 = _local3;
_local3.clip.gotoAndPlay("recreate");
_local3.missileId = setInterval(this, "enemyMissileInterval", _local4, _local5);
_root.outputText.text = game.numOfEnemy;
}
removeSingleEnemy();
}
function recreateHero(o) {
var _local1 = o;
if (game.numOfHero < game.totalHeroLife) {
_local1.xtile = 8;
_local1.ytile = 9;
_local1.x = (_local1.xtile * game.tileWidth) + (game.tileWidth / 2);
_local1.y = (_local1.ytile * game.tileHeight) + (game.tileHeight / 2);
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.strength = 100;
_local1.direction = "up";
_local1.clip.gotoAndStop("recreate");
game.numOfHero++;
removeSingleHero();
}
}
tileMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 3, 0, 0, 3, 2, 2, 2, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 4, 4, 4, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 0, 0, 0, 3, 0, 0, 3, 0, 0, 1], [1, 4, 4, 6, 4, 4, 6, 4, 4, 4, 5, 4, 4, 5, 4, 4, 1], [1, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 1], [1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1], [1, 0, 0, 6, 0, 3, 0, 0, 0, 0, 0, 3, 0, 5, 0, 0, 1], [1, 6, 0, 3, 0, 3, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 1], [1, 3, 0, 3, 0, 3, 6, 4, 2, 4, 5, 3, 0, 3, 0, 0, 1], [1, 3, 0, 3, 0, 3, 3, 9, 12, 9, 3, 3, 0, 3, 0, 0, 1], [1, 3, 7, 3, 7, 3, 3, 8, 13, 8, 3, 3, 7, 3, 7, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
myEnemies = [[1, 1, 1], [2, 4, 1], [1, 14, 1], [2, 11, 1]];
heroBaseArray = [[1, 8, 11], [2, 8, 11], [3, 9, 13], [4, 9, 13]];
_root.freezeEnemy = false;
_root.heroDead = 0;
_root.enemyDead = 0;
_root.currentLevel = 4;
_root.levelBonusPoints = 2000;
_root.levelEndStatus = false;
_root.depthNum = 50000;
_root.powerupDepth = 100000 /* 0x0186A0 */;
_root.gameover_mc.gotoAndStop(1);
_root.shotMissileInterval = 0;
_root.attackFlag = false;
heroTankObj = {};
heroTankObj.xtile = 8;
heroTankObj.ytile = 9;
heroTankObj.speed = 10;
heroTankObj.lastshot = 0;
heroTankObj.dieFlag = false;
heroTankObj.shieldFlag = false;
heroTankObj.ammunationFlag = false;
heroTankObj.lifeFlag = false;
heroTankObj.baseShieldFlag = false;
heroTankObj.invisibleFlag = false;
heroTankObj.totalMissile = 50000;
heroTankObj.currentMissile = 0;
heroTankObj.shootspeed = 500;
heroTankObj.strength = 100;
heroBaseObj = {};
heroBaseObj.xtile = 8;
heroBaseObj.ytile = 11;
game = {};
game.tileWidth = 40;
game.tileHeight = 40;
game.missileDepth1 = 0;
game.missileDepth2 = 5000;
game.totalMines = 5;
game.usedMines = 0;
game.heroBullets = new Array();
game.enemyBullets = new Array();
game.baseShieldTiles = new Array();
game.numOfEnemy = 0;
game.totalEnemyLife = 14;
game.numOfHero = -1;
game.totalHeroLife = 2;
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile0.prototype.breakable = false;
game.Tile0.prototype.occupied = false;
game.Tile0.prototype.strength = 100;
game.Tile0.prototype.invisible = true;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile1.prototype.breakable = false;
game.Tile1.prototype.occupied = false;
game.Tile1.prototype.strength = 100;
game.Tile1.prototype.invisible = false;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile2.prototype.breakable = false;
game.Tile2.prototype.occupied = false;
game.Tile2.prototype.strength = 100;
game.Tile2.prototype.invisible = true;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile3.prototype.breakable = true;
game.Tile3.prototype.occupied = false;
game.Tile3.prototype.strength = 100;
game.Tile3.prototype.invisible = true;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile4.prototype.breakable = true;
game.Tile4.prototype.occupied = false;
game.Tile4.prototype.strength = 100;
game.Tile4.prototype.invisible = true;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile5.prototype.breakable = true;
game.Tile5.prototype.occupied = false;
game.Tile5.prototype.strength = 100;
game.Tile5.prototype.invisible = true;
game.Tile6 = function () {
};
game.Tile6.prototype.walkable = false;
game.Tile6.prototype.frame = 7;
game.Tile6.prototype.breakable = true;
game.Tile6.prototype.occupied = false;
game.Tile6.prototype.strength = 100;
game.Tile6.prototype.invisible = true;
game.Tile7 = function () {
};
game.Tile7.prototype.walkable = false;
game.Tile7.prototype.frame = 8;
game.Tile7.prototype.breakable = true;
game.Tile7.prototype.occupied = false;
game.Tile7.prototype.strength = 100;
game.Tile7.prototype.invisible = true;
game.Tile8 = function () {
};
game.Tile8.prototype.walkable = false;
game.Tile8.prototype.frame = 10;
game.Tile8.prototype.breakable = true;
game.Tile8.prototype.occupied = false;
game.Tile8.prototype.strength = 200;
game.Tile8.prototype.shield = true;
game.Tile8.prototype.invisible = false;
game.Tile9 = function () {
};
game.Tile9.prototype.walkable = false;
game.Tile9.prototype.frame = 11;
game.Tile9.prototype.breakable = true;
game.Tile9.prototype.occupied = false;
game.Tile9.prototype.strength = 200;
game.Tile9.prototype.shield = true;
game.Tile9.prototype.invisible = false;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = false;
game.Tile12.prototype.frame = 12;
game.Tile12.prototype.breakable = true;
game.Tile12.prototype.occupied = false;
game.Tile12.prototype.strength = 200;
game.Tile12.prototype.shield = true;
game.Tile12.prototype.invisible = false;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = false;
game.Tile13.prototype.frame = 13;
game.Tile13.prototype.breakable = true;
game.Tile13.prototype.occupied = false;
game.Tile13.prototype.strength = 300;
game.Tile13.prototype.shield = true;
game.Tile13.prototype.invisible = false;
game.Enemyp1 = function () {
};
game.Enemyp1.prototype.xmove = 1;
game.Enemyp1.prototype.ymove = 0;
game.Enemyp1.prototype.speed = 5;
game.Enemyp1.prototype.dieFlag = false;
game.Enemyp1.prototype.changeInterval = 7000;
game.Enemyp1.prototype.strength = 200;
game.Enemyp1.prototype.shootSpeed = 700;
game.Enemyp2 = function () {
};
game.Enemyp2.prototype.xmove = -1;
game.Enemyp2.prototype.ymove = 0;
game.Enemyp2.prototype.speed = 5;
game.Enemyp2.prototype.dieFlag = false;
game.Enemyp2.prototype.changeInterval = 3000;
game.Enemyp2.prototype.strength = 200;
game.Enemyp2.prototype.shootSpeed = 700;
game.heroMissile = function () {
};
game.heroMissile.prototype.xtile = 0;
game.heroMissile.prototype.ytile = 0;
game.heroMissile.prototype.wid = 5;
game.heroMissile.prototype.hei = 5;
game.heroMissile.prototype.dieFlag = false;
game.heroMissile.prototype.speed = 15;
game.heroMissile.prototype.mPower = 50;
game.enemyMissile = function () {
};
game.enemyMissile.prototype.xtile = 0;
game.enemyMissile.prototype.ytile = 0;
game.enemyMissile.prototype.wid = 5;
game.enemyMissile.prototype.hei = 5;
game.enemyMissile.prototype.speed = 25;
game.enemyMissile.prototype.mPower = 50;
keyDetect = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if (Key.isDown(38)) {
_root.movement = "up";
_root.moveFunction(obj, 0, -1);
} else if (Key.isDown(40)) {
_root.movement = "down";
_root.moveFunction(obj, 0, 1);
} else if (Key.isDown(37)) {
_root.movement = "left";
_root.moveFunction(obj, -1, 0);
} else if (Key.isDown(39)) {
_root.movement = "right";
_root.moveFunction(obj, 1, 0);
}
}
}
};
var myListener = new Object();
myListener.onKeyDown = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if ((Key.getCode() == 83) && (!_root.keyPressFlag)) {
_root.createMissile(obj);
_root.keyPressFlag = true;
}
if (((Key.getCode() == 65) && (!_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.setMines();
_root.keyPressFlag2 = true;
}
}
}
};
myListener.onKeyUp = function () {
if ((Key.getCode() == 83) && (_root.keyPressFlag)) {
_root.keyPressFlag = false;
}
if (((Key.getCode() == 65) && (_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.keyPressFlag2 = false;
}
};
Key.addListener(myListener);
_root.onEnterFrame = function () {
moveBullets();
moveEnemyBullets();
moveEnemies();
keyDetect();
checkBase();
checkLevelEndStatus();
_root.outputText.text = _root.enemyDead;
};
createTile();
createHeroTank();
createHeroBase();
createEnemies();
assignEnemiesMove();
createEnemyLivesPanel();
createHeroLivesPanel();
powerUpManager();
disableAllPowerUp();
updateHeroLives();
updateEnemyLives();
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(30);
stop();
Frame 58
stop();
Instance of Symbol 566 MovieClip "nextLevel_mc" in Frame 58
onClipEvent (load) {
this.nextLevel = "level5";
}
Instance of Symbol 540 MovieClip "gameover_mc" in Frame 60
/* no clip actions */
Frame 61
function powerUpManager() {
var _local1 = heroTankObj;
if (!_local1.lifePowerUp) {
game.lifePowerUpInterval = setInterval(createLifePowerUp, 4000);
_local1.lifePowerUp = true;
}
if (!_local1.shieldPowerUp) {
}
if (!_local1.freezePowerUp) {
}
if (!_local1.baseShieldPowerUp) {
game.baseShieldPowerUpInterval = setInterval(createBaseShieldPowerUp, 8000);
_local1.baseShieldPowerUp = true;
}
if (!_local1.ammunationPowerUp) {
}
if (!_local1.bonusPowerUp) {
game.bonusPowerUpInterval = setInterval(createBonusPowerUp, 10000);
_local1.bonusPowerUp = true;
}
if (!_local1.invisiblePowerUp) {
game.invisiblePowerUpInterval = setInterval(createInvisiblePowerUp, 2000);
_local1.invisiblePowerUp = true;
}
}
function nextLevel() {
_root.outputClip.outputText.text = "";
_root.gameScore = _root.gameScore + _root.levelBonusPoints;
levelEnd();
_root.gotoAndPlay("level6_start");
}
function recreateEnemy(o) {
var _local2 = o;
if (game.numOfEnemy < (game.totalEnemyLife - 4)) {
game.numOfEnemy++;
var _local3 = random(10);
if (_local3 < 5) {
tempx = 0;
tempy = 0;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
tileOccupied = game[(("t_" + tempy) + "_") + tempx].occupied;
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 2;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
_local2.xtile = tempx;
_local2.ytile = tempy;
}
} else if ((_local3 > 5) && (_local3 < 8)) {
while ((!tileStatus) && (!tileOccupied)) {
tempx = 1 + random(12);
tempy = 9;
tileStatus = game[(("t_" + tempy) + "_") + tempx].walkable;
_local2.xtile = tempx;
_local2.ytile = tempy;
}
} else {
_local2.xtile = 1;
_local2.ytile = 9;
}
_local2.x = (_local2.xtile * game.tileWidth) + (game.tileWidth / 2);
_local2.y = (_local2.ytile * game.tileHeight) + (game.tileHeight / 2);
_local2.strength = 300;
_local2.clip._x = _local2.x;
_local2.clip._y = _local2.y;
var _local4 = _local2.shootSpeed;
var _local5 = _local2;
_local2.clip.gotoAndPlay("recreate");
_local2.missileId = setInterval(this, "enemyMissileInterval", _local4, _local5);
}
removeSingleEnemy();
}
function recreateHero(o) {
var _local1 = o;
if (game.numOfHero < game.totalHeroLife) {
_local1.xtile = 8;
_local1.ytile = 9;
_local1.x = (_local1.xtile * game.tileWidth) + (game.tileWidth / 2);
_local1.y = (_local1.ytile * game.tileHeight) + (game.tileHeight / 2);
_local1.clip._x = _local1.x;
_local1.clip._y = _local1.y;
_local1.strength = 100;
_local1.direction = "up";
_local1.clip.gotoAndStop("recreate");
game.numOfHero++;
removeSingleHero();
}
}
tileMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 3, 0, 0, 3, 2, 2, 2, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 4, 4, 4, 3, 0, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 0, 3, 0, 0, 0, 3, 0, 0, 3, 0, 0, 1], [1, 4, 4, 6, 4, 4, 6, 4, 4, 4, 5, 4, 4, 5, 4, 4, 1], [1, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 2, 0, 1], [1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1], [1, 0, 0, 6, 0, 3, 0, 0, 0, 0, 0, 3, 0, 5, 0, 0, 1], [1, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 3, 6, 4, 2, 4, 5, 3, 0, 3, 0, 0, 1], [1, 0, 0, 3, 0, 3, 3, 9, 12, 9, 3, 3, 0, 3, 0, 0, 1], [1, 0, 7, 3, 7, 3, 3, 8, 13, 8, 3, 3, 7, 3, 7, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]];
myEnemies = [[1, 1, 1], [2, 4, 1], [1, 14, 1], [2, 11, 1]];
heroBaseArray = [[1, 8, 11], [2, 8, 11], [3, 9, 13], [4, 9, 13]];
_root.freezeEnemy = false;
_root.heroDead = 0;
_root.enemyDead = 0;
_root.currentLevel = 5;
_root.levelBonusPoints = 2000;
_root.levelEndStatus = false;
_root.depthNum = 50000;
_root.powerupDepth = 100000 /* 0x0186A0 */;
_root.gameover_mc.gotoAndStop(1);
_root.shotMissileInterval = 0;
_root.attackFlag = false;
heroTankObj = {};
heroTankObj.xtile = 8;
heroTankObj.ytile = 9;
heroTankObj.speed = 10;
heroTankObj.lastshot = 0;
heroTankObj.dieFlag = false;
heroTankObj.shieldFlag = false;
heroTankObj.ammunationFlag = false;
heroTankObj.lifeFlag = false;
heroTankObj.baseShieldFlag = false;
heroTankObj.invisibleFlag = false;
heroTankObj.totalMissile = 50000;
heroTankObj.currentMissile = 0;
heroTankObj.shootspeed = 500;
heroTankObj.strength = 100;
heroBaseObj = {};
heroBaseObj.xtile = 8;
heroBaseObj.ytile = 11;
game = {};
game.tileWidth = 40;
game.tileHeight = 40;
game.missileDepth1 = 0;
game.missileDepth2 = 5000;
game.totalMines = 5;
game.usedMines = 0;
game.heroBullets = new Array();
game.enemyBullets = new Array();
game.baseShieldTiles = new Array();
game.numOfEnemy = 0;
game.totalEnemyLife = 16;
game.numOfHero = -1;
game.totalHeroLife = 2;
game.Tile0 = function () {
};
game.Tile0.prototype.walkable = true;
game.Tile0.prototype.frame = 1;
game.Tile0.prototype.breakable = false;
game.Tile0.prototype.occupied = false;
game.Tile0.prototype.strength = 100;
game.Tile0.prototype.invisible = true;
game.Tile1 = function () {
};
game.Tile1.prototype.walkable = false;
game.Tile1.prototype.frame = 2;
game.Tile1.prototype.breakable = false;
game.Tile1.prototype.occupied = false;
game.Tile1.prototype.strength = 100;
game.Tile1.prototype.invisible = false;
game.Tile2 = function () {
};
game.Tile2.prototype.walkable = false;
game.Tile2.prototype.frame = 3;
game.Tile2.prototype.breakable = false;
game.Tile2.prototype.occupied = false;
game.Tile2.prototype.strength = 100;
game.Tile2.prototype.invisible = true;
game.Tile3 = function () {
};
game.Tile3.prototype.walkable = false;
game.Tile3.prototype.frame = 4;
game.Tile3.prototype.breakable = true;
game.Tile3.prototype.occupied = false;
game.Tile3.prototype.strength = 100;
game.Tile3.prototype.invisible = true;
game.Tile4 = function () {
};
game.Tile4.prototype.walkable = false;
game.Tile4.prototype.frame = 5;
game.Tile4.prototype.breakable = true;
game.Tile4.prototype.occupied = false;
game.Tile4.prototype.strength = 100;
game.Tile4.prototype.invisible = true;
game.Tile5 = function () {
};
game.Tile5.prototype.walkable = false;
game.Tile5.prototype.frame = 6;
game.Tile5.prototype.breakable = true;
game.Tile5.prototype.occupied = false;
game.Tile5.prototype.strength = 100;
game.Tile5.prototype.invisible = true;
game.Tile6 = function () {
};
game.Tile6.prototype.walkable = false;
game.Tile6.prototype.frame = 7;
game.Tile6.prototype.breakable = true;
game.Tile6.prototype.occupied = false;
game.Tile6.prototype.strength = 100;
game.Tile6.prototype.invisible = true;
game.Tile7 = function () {
};
game.Tile7.prototype.walkable = false;
game.Tile7.prototype.frame = 8;
game.Tile7.prototype.breakable = true;
game.Tile7.prototype.occupied = false;
game.Tile7.prototype.strength = 100;
game.Tile7.prototype.invisible = true;
game.Tile8 = function () {
};
game.Tile8.prototype.walkable = false;
game.Tile8.prototype.frame = 10;
game.Tile8.prototype.breakable = true;
game.Tile8.prototype.occupied = false;
game.Tile8.prototype.strength = 200;
game.Tile8.prototype.shield = true;
game.Tile8.prototype.invisible = false;
game.Tile9 = function () {
};
game.Tile9.prototype.walkable = false;
game.Tile9.prototype.frame = 11;
game.Tile9.prototype.breakable = true;
game.Tile9.prototype.occupied = false;
game.Tile9.prototype.strength = 200;
game.Tile9.prototype.shield = true;
game.Tile9.prototype.invisible = false;
game.Tile12 = function () {
};
game.Tile12.prototype.walkable = false;
game.Tile12.prototype.frame = 12;
game.Tile12.prototype.breakable = true;
game.Tile12.prototype.occupied = false;
game.Tile12.prototype.strength = 200;
game.Tile12.prototype.shield = true;
game.Tile12.prototype.invisible = false;
game.Tile13 = function () {
};
game.Tile13.prototype.walkable = false;
game.Tile13.prototype.frame = 13;
game.Tile13.prototype.breakable = true;
game.Tile13.prototype.occupied = false;
game.Tile13.prototype.strength = 300;
game.Tile13.prototype.shield = true;
game.Tile13.prototype.invisible = false;
game.Enemyp1 = function () {
};
game.Enemyp1.prototype.xmove = 1;
game.Enemyp1.prototype.ymove = 0;
game.Enemyp1.prototype.speed = 3;
game.Enemyp1.prototype.dieFlag = false;
game.Enemyp1.prototype.changeInterval = 7000;
game.Enemyp1.prototype.strength = 300;
game.Enemyp1.prototype.shootSpeed = 700;
game.Enemyp2 = function () {
};
game.Enemyp2.prototype.xmove = -1;
game.Enemyp2.prototype.ymove = 0;
game.Enemyp2.prototype.speed = 5;
game.Enemyp2.prototype.dieFlag = false;
game.Enemyp2.prototype.changeInterval = 3000;
game.Enemyp2.prototype.strength = 300;
game.Enemyp2.prototype.shootSpeed = 700;
game.heroMissile = function () {
};
game.heroMissile.prototype.xtile = 0;
game.heroMissile.prototype.ytile = 0;
game.heroMissile.prototype.wid = 5;
game.heroMissile.prototype.hei = 5;
game.heroMissile.prototype.dieFlag = false;
game.heroMissile.prototype.speed = 15;
game.heroMissile.prototype.mPower = 50;
game.enemyMissile = function () {
};
game.enemyMissile.prototype.xtile = 0;
game.enemyMissile.prototype.ytile = 0;
game.enemyMissile.prototype.wid = 5;
game.enemyMissile.prototype.hei = 5;
game.enemyMissile.prototype.speed = 25;
game.enemyMissile.prototype.mPower = 50;
keyDetect = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if (Key.isDown(38)) {
_root.movement = "up";
_root.moveFunction(obj, 0, -1);
} else if (Key.isDown(40)) {
_root.movement = "down";
_root.moveFunction(obj, 0, 1);
} else if (Key.isDown(37)) {
_root.movement = "left";
_root.moveFunction(obj, -1, 0);
} else if (Key.isDown(39)) {
_root.movement = "right";
_root.moveFunction(obj, 1, 0);
}
}
}
};
var myListener = new Object();
myListener.onKeyDown = function () {
if (!_root.levelEndStatus) {
obj = _root.heroTankObj;
if (!obj.dieFlag) {
if ((Key.getCode() == 83) && (!_root.keyPressFlag)) {
_root.createMissile(obj);
_root.keyPressFlag = true;
}
if (((Key.getCode() == 65) && (!_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.setMines();
_root.keyPressFlag2 = true;
}
}
}
};
myListener.onKeyUp = function () {
if ((Key.getCode() == 83) && (_root.keyPressFlag)) {
_root.keyPressFlag = false;
}
if (((Key.getCode() == 65) && (_root.keyPressFlag2)) && (obj.ammunationFlag)) {
_root.keyPressFlag2 = false;
}
};
Key.addListener(myListener);
_root.onEnterFrame = function () {
moveBullets();
moveEnemyBullets();
moveEnemies();
keyDetect();
checkBase();
checkLevelEndStatus();
_root.outputText.text = _root.enemyDead;
};
createTile();
createHeroTank();
createHeroBase();
createEnemies();
assignEnemiesMove();
createEnemyLivesPanel();
createHeroLivesPanel();
powerUpManager();
disableAllPowerUp();
updateHeroLives();
updateEnemyLives();
_root.gameBGSound.stop();
_root.gameBGSound = null;
_root.gameBGSound = new Sound();
_root.gameBGSound.attachSound("bgSound");
_root.gameBGSound.start(0, 1000);
_root.gameBGSound.setVolume(30);
stop();
Frame 64
stop();
Frame 67
stop();
Symbol 17 MovieClip Frame 1
stop();
Symbol 17 MovieClip Frame 27
if (_parent.oRef.shieldFlag) {
gotoAndPlay ("start");
} else {
gotoAndStop (1);
}
Symbol 21 MovieClip Frame 1
stop();
Symbol 21 MovieClip Frame 12
gotoAndStop (1);
Symbol 29 MovieClip Frame 1
_parent.oRef.dieFlag = true;
Symbol 29 MovieClip Frame 27
_parent.oRef.dieFlag = false;
_root.gameFreeze = false;
_parent.gotoAndStop(1);
Symbol 44 MovieClip Frame 15
stop();
Symbol 64 MovieClip [heroClip] Frame 1
stop();
Symbol 64 MovieClip [heroClip] Frame 8
_root.heroDead = _root.heroDead + 1;
_root.gameFreeze = true;
play();
Symbol 64 MovieClip [heroClip] Frame 21
stop();
_root.recreateHero(this.oRef);
Symbol 70 MovieClip Frame 1
stop();
Symbol 70 MovieClip Frame 2
stop();
Symbol 71 MovieClip [heroLivesClip] Frame 1
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 2
stop();
Symbol 83 MovieClip Frame 2
Symbol 83 MovieClip Frame 9
Symbol 90 MovieClip [enemy3] Frame 1
Symbol 90 MovieClip [enemy3] Frame 6
Symbol 90 MovieClip [enemy3] Frame 7
_root.enemyDead = _root.enemyDead + 1;
_root.game.numOfEnemy++;
this.oRef.dieFlag = true;
Symbol 90 MovieClip [enemy3] Frame 8
play();
Symbol 90 MovieClip [enemy3] Frame 21
Symbol 90 MovieClip [enemy3] Frame 24
stop();
_root.gameScore = _root.gameScore + 200;
_root.recreateEnemy(this.oRef);
Symbol 94 MovieClip Frame 16
stop();
Symbol 95 MovieClip [enemy2] Frame 1
this.oRef.dieFlag = false;
stop();
Instance of Symbol 92 MovieClip "mc_hit" in Symbol 95 MovieClip [enemy2] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 95 MovieClip [enemy2] Frame 2
this.oRef.dieFlag = false;
stop();
Symbol 95 MovieClip [enemy2] Frame 4
this.oRef.dieFlag = false;
stop();
Symbol 95 MovieClip [enemy2] Frame 5
this.oRef.dieFlag = false;
stop();
Symbol 95 MovieClip [enemy2] Frame 15
gotoAndStop (1);
Symbol 95 MovieClip [enemy2] Frame 16
this.oRef.dieFlag = true;
play();
Symbol 95 MovieClip [enemy2] Frame 26
Symbol 95 MovieClip [enemy2] Frame 29
stop();
_root.gameScore = _root.gameScore + 200;
_root.enemyDead = _root.enemyDead + 1;
_root.recreateEnemy(this.oRef);
Symbol 98 MovieClip [enemy1] Frame 1
this.oRef.dieFlag = false;
stop();
Instance of Symbol 92 MovieClip "mc_hit" in Symbol 98 MovieClip [enemy1] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 98 MovieClip [enemy1] Frame 2
this.oRef.dieFlag = false;
stop();
Symbol 98 MovieClip [enemy1] Frame 4
this.oRef.dieFlag = false;
stop();
Symbol 98 MovieClip [enemy1] Frame 5
this.oRef.dieFlag = false;
stop();
Symbol 98 MovieClip [enemy1] Frame 14
this.gotoAndStop(1);
Symbol 98 MovieClip [enemy1] Frame 15
this.oRef.dieFlag = true;
play();
Symbol 98 MovieClip [enemy1] Frame 29
stop();
_root.gameScore = _root.gameScore + 200;
_root.enemyDead = _root.enemyDead + 1;
_root.recreateEnemy(this.oRef);
Symbol 102 MovieClip Frame 6
stop();
Symbol 106 MovieClip [heroBase] Frame 1
stop();
Symbol 110 MovieClip Frame 1
stop();
Symbol 110 MovieClip Frame 2
stop();
Symbol 117 MovieClip Frame 17
stop();
Symbol 141 MovieClip Frame 10
stop();
Symbol 143 MovieClip Frame 16
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 145 MovieClip Frame 14
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 146 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 2
stop();
Symbol 146 MovieClip Frame 3
stop();
Symbol 146 MovieClip Frame 4
stop();
Symbol 146 MovieClip Frame 5
stop();
Symbol 151 MovieClip Frame 18
stop();
Symbol 153 MovieClip Frame 18
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 155 MovieClip Frame 20
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 156 MovieClip Frame 1
stop();
Symbol 156 MovieClip Frame 2
stop();
Symbol 156 MovieClip Frame 3
stop();
Symbol 156 MovieClip Frame 4
stop();
Symbol 156 MovieClip Frame 5
stop();
Symbol 165 MovieClip Frame 10
stop();
Symbol 169 MovieClip Frame 10
stop();
Symbol 173 MovieClip Frame 10
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 177 MovieClip Frame 10
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 2
stop();
Symbol 178 MovieClip Frame 3
stop();
Symbol 178 MovieClip Frame 4
stop();
Symbol 178 MovieClip Frame 5
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 182 MovieClip Frame 10
stop();
Symbol 184 MovieClip Frame 10
stop();
Symbol 186 MovieClip Frame 18
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 188 MovieClip Frame 18
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 189 MovieClip Frame 1
stop();
Symbol 189 MovieClip Frame 2
stop();
Symbol 189 MovieClip Frame 3
_root.levelBonusPoints = _root.levelBonusPoints - 100;
stop();
Symbol 189 MovieClip Frame 4
_root.levelBonusPoints = _root.levelBonusPoints - 100;
stop();
Symbol 189 MovieClip Frame 5
_root.levelBonusPoints = _root.levelBonusPoints - 100;
stop();
Symbol 193 MovieClip Frame 13
stop();
Symbol 195 MovieClip Frame 13
stop();
Symbol 197 MovieClip Frame 13
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 199 MovieClip Frame 22
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 200 MovieClip Frame 1
stop();
Symbol 200 MovieClip Frame 2
stop();
Symbol 200 MovieClip Frame 3
stop();
Symbol 200 MovieClip Frame 4
stop();
Symbol 200 MovieClip Frame 5
stop();
Symbol 207 MovieClip Frame 16
stop();
Symbol 209 MovieClip Frame 20
stop();
Symbol 211 MovieClip Frame 20
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 213 MovieClip Frame 20
_parent._parent.swapDepths(_parent._parent.initDepth);
stop();
Symbol 214 MovieClip Frame 1
stop();
Symbol 214 MovieClip Frame 2
stop();
Symbol 214 MovieClip Frame 3
_root.levelBonusPoints = _root.levelBonusPoints - 200;
stop();
Symbol 214 MovieClip Frame 4
_root.levelBonusPoints = _root.levelBonusPoints - 500;
stop();
Symbol 214 MovieClip Frame 5
stop();
_root.freezeEnemy = true;
_root.baseDestroyed = true;
Symbol 215 MovieClip [tile] Frame 1
stop();
this.bclip._visible = false;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 2
stop();
this.bclip._visible = false;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 3
stop();
this.bclip._visible = true;
this.bclip.gotoAndStop(2);
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 4
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 5
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 6
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 7
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 8
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 10
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 11
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 12
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 215 MovieClip [tile] Frame 13
stop();
this.bclip._visible = true;
this.mc_shieldClip.gotoAndStop(1);
Symbol 222 MovieClip Frame 1
stop();
Symbol 222 MovieClip Frame 2
stop();
Symbol 224 MovieClip [freezeClip] Frame 30
stop();
Symbol 228 MovieClip Frame 1
stop();
Symbol 228 MovieClip Frame 2
stop();
Symbol 232 MovieClip Frame 1
stop();
Symbol 232 MovieClip Frame 2
stop();
Symbol 233 MovieClip [bonusClip] Frame 30
stop();
Symbol 236 MovieClip Frame 1
stop();
Symbol 236 MovieClip Frame 2
stop();
Instance of Symbol 92 MovieClip "mc_hit" in Symbol 237 MovieClip [mineClip] Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 244 MovieClip Frame 1
stop();
Symbol 244 MovieClip Frame 2
stop();
Symbol 245 MovieClip [invisibleClip] Frame 30
stop();
Symbol 249 MovieClip Frame 15
stop();
Symbol 250 MovieClip [shieldClip] Frame 30
stop();
Symbol 253 MovieClip Frame 1
stop();
Symbol 253 MovieClip Frame 2
stop();
Symbol 254 MovieClip [lifeUp] Frame 30
stop();
Symbol 294 MovieClip Frame 95
stop();
Symbol 310 MovieClip Frame 180
stop();
_root.animationCompleted = true;
Instance of Symbol 315 MovieClip "bar_mc" in Symbol 316 MovieClip Frame 1
onClipEvent (enterFrame) {
_xscale = (_root.percentDone * 4);
}
Symbol 334 Button
on (release) {
_root.gotoAndPlay("main4");
}
Symbol 338 Button
on (release) {
_root.gotoAndPlay("main2");
}
Symbol 340 Button
on (release) {
_root.gotoAndPlay("hs1");
}
Symbol 359 MovieClip Frame 6
stop();
Symbol 360 Button
on (release) {
getURL ("http://www.flasharcade.com", "_blank");
}
Symbol 364 Button
on (release) {
getURL ("http://www.flasharcade.com/flash-games/", "_blank");
}
Symbol 381 MovieClip Frame 1
Symbol 381 MovieClip Frame 17
stop();
Symbol 383 MovieClip Frame 1
Symbol 383 MovieClip Frame 17
_root.gotoAndPlay("inst1");
Symbol 384 MovieClip Frame 1
Symbol 384 MovieClip Frame 17
_root.gotoAndPlay("level1");
Symbol 391 Button
on (release) {
_root.gotoAndPlay("main1");
}
Symbol 397 MovieClip Frame 1
stop();
Symbol 397 MovieClip Frame 2
stop();
Symbol 398 MovieClip Frame 1
stop();
Symbol 398 MovieClip Frame 2
stop();
Symbol 414 MovieClip Frame 1
Symbol 414 MovieClip Frame 30
stop();
Symbol 415 MovieClip Frame 1
Symbol 415 MovieClip Frame 30
_root.gotoAndPlay("main1");
Symbol 453 MovieClip Frame 1
Symbol 453 MovieClip Frame 30
var lv = new LoadVars();
var lvAnswer = new LoadVars();
this.get_message_text.text = "";
lv.gameId = "ace005";
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();
Symbol 488 MovieClip Frame 1
stop();
Symbol 488 MovieClip Frame 30
stop();
Symbol 508 Button
on (release) {
if ((this.gameNameText.text != "") && (_root.scoreSubmit == false)) {
trans_btn._visible = false;
var lv = new LoadVars();
var lvAnswer = new LoadVars();
this.message_text.text = "Saving your score...";
lv.scoreName = this.gameNameText.text;
lv.scoreText = this.gameScoreText.text;
lv.gameId = "ace005";
lv.gameName = "Battle Royale";
lv.sendAndLoad("http://www.flasharcade.com/setscores.php", lvAnswer, "POST");
lvAnswer.onLoad = function (success) {
if (lvAnswer.status1 == "success") {
trans_btn._visible = true;
_root.gameName = this.gameNameText.text;
_root.gameScore = this.gameScoreText.text;
_root.mainmc.message_text.text = "Your score is saved successfully.";
_root.gotoAndPlay("hs1");
} else {
trans_btn._visible = true;
trans_btn.useHandCursor = false;
_root.mainmc.message_text.text = "Your score could not be saved.";
}
};
}
trans_btn._visible = true;
trans_btn.useHandCursor = false;
_root.scoreSubmit = true;
}
Symbol 514 Button
on (release) {
_root.gotoAndPlay("main1");
}
Symbol 515 MovieClip Frame 1
Symbol 515 MovieClip Frame 2
Symbol 515 MovieClip Frame 27
gameScoreText.text = _root.gameScore;
gameNameText.text = "";
message_text.text = "";
Instance of Symbol 513 MovieClip in Symbol 515 MovieClip Frame 27
onClipEvent (load) {
_root.scoreSubmit = false;
}
onClipEvent (enterFrame) {
if (_parent.gameNameText.text != "") {
_parent.trans_btn._visible = false;
} else if (_root.scoreSubmit != true) {
_parent.trans_btn.useHandCursor = false;
_parent.trans_btn._visible = true;
}
}
Symbol 515 MovieClip Frame 30
stop();
Symbol 520 MovieClip Frame 1
Symbol 520 MovieClip Frame 2
gameScoreText.text = _root.gameScore;
gameNameText.text = _root.gameName;
Symbol 520 MovieClip Frame 30
stop();
Symbol 536 Button
on (release) {
if ((this.gameNameText.text != "") && (_root.scoreSubmit == false)) {
trans_btn._visible = false;
var lv = new LoadVars();
var lvAnswer = new LoadVars();
this.message_text.text = "Saving your score...";
lv.scoreName = this.gameNameText.text;
lv.scoreText = this.gameScoreText.text;
lv.gameId = "ace005";
lv.gameName = "Battle Royale";
lv.sendAndLoad("http://www.flasharcade.com/setscores.php", lvAnswer, "POST");
lvAnswer.onLoad = function (success) {
if (lvAnswer.status1 == "success") {
trans_btn._visible = true;
_root.gameName = this.gameNameText.text;
_root.gameScore = this.gameScoreText.text;
_root.gameover_mc.message_text.text = "Your score is saved successfully.";
_root.gotoAndPlay("hs1");
} else {
trans_btn._visible = true;
trans_btn.useHandCursor = false;
_root.gameover_mc.message_text.text = "Your score could not be saved.";
}
};
}
trans_btn._visible = true;
trans_btn.useHandCursor = false;
_root.scoreSubmit = true;
}
Symbol 538 Button
on (release) {
_root.gotoAndPlay("main1");
}
Symbol 540 MovieClip Frame 1
Symbol 540 MovieClip Frame 2
Symbol 540 MovieClip Frame 27
gameScoreText.text = _root.gameScore;
Instance of Symbol 513 MovieClip in Symbol 540 MovieClip Frame 27
onClipEvent (load) {
_root.scoreSubmit = false;
}
onClipEvent (enterFrame) {
if (_parent.gameNameText.text != "") {
_parent.trans_btn._visible = false;
} else if (_root.scoreSubmit != true) {
_parent.trans_btn.useHandCursor = false;
_parent.trans_btn._visible = true;
}
}
Symbol 540 MovieClip Frame 30
stop();
g_btn.enabled = false;
g_btn.useHandCursor = false;
g_btn.tabEnabled = false;
Symbol 541 MovieClip Frame 15
stop();
Symbol 547 Button
on (release) {
_root.gotoAndPlay(this.nextLevel);
}
Symbol 548 MovieClip Frame 1
_root.onEnterFrame = null;
Symbol 548 MovieClip Frame 35
stop();
Symbol 549 MovieClip Frame 35
stop();
Symbol 553 MovieClip Frame 1
_root.onEnterFrame = null;
Symbol 553 MovieClip Frame 35
stop();
Symbol 554 MovieClip Frame 35
stop();
Symbol 558 MovieClip Frame 1
_root.onEnterFrame = null;
Symbol 558 MovieClip Frame 35
stop();
Symbol 562 MovieClip Frame 35
stop();
Symbol 566 MovieClip Frame 1
_root.onEnterFrame = null;
Symbol 566 MovieClip Frame 35
stop();
Symbol 567 MovieClip Frame 35
stop();