Frame 1
gamelocation = "www.squarecircleco.com";
_quality = "LOW";
Stage.scaleMode = "noScale";
Stage.showMenu = false;
if (this._url.indexOf("file://") != 0) {
localGame = false;
if (this._url.indexOf(gamelocation) == -1) {
gameValid = false;
} else {
gameValid = true;
}
} else {
localGame = true;
gameValid = true;
}
gameValid = true;
onEnterFrame = function () {
if (getBytesTotal() == getBytesLoaded()) {
if (gameValid == false) {
gotoAndStop ("stolen");
onEnterFrame = function () {
gotoAndStop ("stolen");
};
} else {
gotoAndPlay ("load");
onEnterFrame = null;
}
}
lod = ("loading - " + Math.floor((100 * getBytesLoaded()) / getBytesTotal())) + "%";
lb._xscale = (getBytesLoaded() / getBytesTotal()) * 480;
};
Frame 2
function createBorder(clip, depth, w, h) {
var _local5 = clip.createEmptyMovieClip("border", depth);
var _local1 = 0;
while (_local1 < h) {
var _local4 = _local5.attachMovie("borderTiles", ("b_" + _local1) + "_0", _local1 * w);
_local4._y = _local1 * th;
if (_local1 == 0) {
_local4.gotoAndStop(1);
var _local2 = 1;
while (_local2 < (w - 1)) {
_local4 = _local5.attachMovie("borderTiles", (("b_" + _local1) + "_") + _local2, (_local1 * w) + _local2);
_local4._y = _local1 * th;
_local4._x = (_local2 - 1) * tw;
_local4.gotoAndStop(2);
_local2++;
}
} else if (_local1 == (h - 1)) {
_local4.gotoAndStop(6);
var _local2 = 1;
while (_local2 < (w - 1)) {
_local4 = _local5.attachMovie("borderTiles", (("b_" + _local1) + "_") + _local2, (_local1 * w) + _local2);
_local4._y = _local1 * th;
_local4._x = _local2 * tw;
_local4.gotoAndStop(7);
_local2++;
}
} else {
_local4.gotoAndStop(4);
}
_local4 = _local5.attachMovie("borderTiles", (("b_" + _local1) + "_") + (w - 1), (_local1 * w) + (w - 1));
_local4._y = _local1 * th;
_local4._x = (w - 1) * tw;
if (_local1 == 0) {
_local4.gotoAndStop(3);
} else if (_local1 == (h - 1)) {
_local4.gotoAndStop(8);
} else {
_local4.gotoAndStop(5);
}
_local1++;
}
return(_local5);
}
tw = 32;
th = 32;
stw = 14;
sth = 11;
border = createBorder(_root, 1, stw + 2, sth + 3);
border._x = (border._y = -16);
Frame 3
stop();
Frame 25
function remove1(force) {
if (force) {
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
addBoom(this.x, this.y, 0);
this.removeMovieClip("");
}
}
function remove2(force) {
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
addBoom(this.x, this.y, 0);
this.removeMovieClip("");
}
function linker(num) {
this.countdown = num++;
if ((num % 4) == 0) {
this.sp = true;
}
if ((map[this.y][this.x + 1].t == 3) && (map[this.y][this.x + 1].countdown == -1)) {
map[this.y][this.x + 1].linker(num);
}
if ((map[this.y][this.x - 1].t == 3) && (map[this.y][this.x - 1].countdown == -1)) {
map[this.y][this.x - 1].linker(num);
}
if ((map[this.y + 1][this.x].t == 3) && (map[this.y + 1][this.x].countdown == -1)) {
map[this.y + 1][this.x].linker(num);
}
if ((map[this.y - 1][this.x].t == 3) && (map[this.y - 1][this.x].countdown == -1)) {
map[this.y - 1][this.x].linker(num);
}
this.onEnterFrame = linkerDie;
}
function remove3(force) {
this.linker(1);
}
function frame3() {
if (this.countdown > 0) {
return(1);
}
}
function linkerDie() {
if (this.countdown > 0) {
this.countdown--;
if (this.countdown == 0) {
if (this.sp || (random(4) == 2)) {
var _local3 = soundBoard.newSound("sLinker");
_local3.stop();
if (sounds) {
_local3.start(0, 0);
}
}
var _local2 = fg.attachMovie("boomlinker", (("boom_" + this.y) + "_") + this.x, ((w * h) + (this.y * w)) + this.x);
_local2._x = (this.x * tw) - (tw / 2);
_local2._y = (this.y * th) - (th / 2);
_local2.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
this.removeMovieClip("");
}
};
smap[this.y][this.x] = 0;
map[this.y][this.x] = 0;
this.removeMovieClip("");
}
return(1);
}
}
function remove4() {
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
addBoom(this.x, this.y, 1);
smap[this.y - 1][this.x].remove(true);
smap[this.y][this.x - 1].remove(true);
smap[this.y][this.x + 1].remove(true);
smap[this.y + 1][this.x].remove(true);
this.removeMovieClip("");
}
function frame5() {
if (map[this.y + 1][this.x] == 0) {
if (smap[this.y + 1][this.x]) {
smap[this.y + 1][this.x].remove(false);
}
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y + 1][this.x] = this;
smap[this.y + 1][this.x] = this;
this.y++;
var _local2 = map[this.y + 1][this.x].t;
if ((_local2 == 4) || (_local2 == 7)) {
map[this.y + 1][this.x].remove(false);
}
this.onEnterFrame = function () {
this._y = this._y + (tw / 3);
};
return(1);
}
this.onEnterFrame = null;
}
function frame7() {
if (map[this.y + 1][this.x] == 0) {
if (smap[this.y + 1][this.x]) {
smap[this.y + 1][this.x].remove(false);
return(undefined);
}
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y + 1][this.x] = this;
smap[this.y + 1][this.x] = this;
this.y++;
soundBoard.start("sFall", 0, 0);
this.fall = true;
this.onEnterFrame = function () {
this._y = this._y + (tw / 3);
};
return(1);
}
if (this.fall) {
this.remove(false);
}
this.onEnterFrame = null;
}
function frame9() {
if (map[this.y + 1][this.x] == 0) {
if (smap[this.y + 1][this.x]) {
smap[this.y + 1][this.x].remove(false);
}
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y + 1][this.x] = this;
smap[this.y + 1][this.x] = this;
this.y++;
var _local2 = map[this.y + 1][this.x].t;
if ((_local2 == 4) || (_local2 == 7)) {
map[this.y + 1][this.x].remove(false);
}
if (random(2)) {
soundBoard.start("sFall", 0, 0);
}
this.onEnterFrame = function () {
if (this._y < ((th * this.y) - 1)) {
this._y = this._y + (th / 3);
}
};
return(1);
}
if ((map[this.y + 1][this.x + 1] == 0) && (map[this.y][this.x + 1] == 0)) {
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y][this.x + 1] = this;
smap[this.y][this.x + 1] = this;
this.x++;
this.onEnterFrame = function () {
if (this._x < ((tw * this.x) - 1)) {
this._x = this._x + (tw / 3);
}
};
return(32);
}
if ((map[this.y + 1][this.x - 1] == 0) && (map[this.y][this.x - 1] == 0)) {
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
map[this.y][this.x - 1] = this;
smap[this.y][this.x - 1] = this;
this.x--;
this.onEnterFrame = function () {
if (this._x > ((tw * this.x) + 1)) {
this._x = this._x - (tw / 3);
}
};
return(1);
}
this.onEnterFrame = null;
}
sounds = true;
remove5 = remove2;
remove6 = remove2;
remove7 = remove4;
remove8 = function () {
smap[this.y][this.x] = 0;
addBoom(this.x, this.y, 2);
smap[this.y - 1][this.x - 1].remove(true);
smap[this.y - 1][this.x].remove(true);
smap[this.y - 1][this.x + 1].remove(true);
smap[this.y][this.x - 1].remove(true);
smap[this.y][this.x + 1].remove(true);
smap[this.y + 1][this.x - 1].remove(true);
smap[this.y + 1][this.x].remove(true);
smap[this.y + 1][this.x + 1].remove(true);
this.removeMovieClip("");
};
remove9 = remove2;
remove10 = remove2;
frame10 = frame5;
remove11 = remove2;
function copy(map) {
var _local3 = [];
var _local1 = 0;
while (_local1 < map.length) {
_local3[_local1] = map[_local1].slice(0, map[_local1].length);
_local1++;
}
return(_local3);
}
function parse(w, h, string) {
var _local3 = new Array();
_local3 = string.split(",");
var _local2 = new Array();
y = 0;
while (y < h) {
_local2[y] = new Array();
x = 0;
while (x < w) {
_local2[y][x] = int(_local3[(y * w) + x]);
x++;
}
y++;
}
return(_local2);
}
function addBoom(x, y, type) {
var _local4 = fg.attachMovie("boom", (("boom_" + y) + "_") + x, ((w * h) + (y * w)) + x);
_local4._x = x * tw;
_local4._y = y * th;
_local4.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
this.removeMovieClip("");
}
};
if (type == 1) {
_local4 = fg.attachMovie("boomCross", (("boom_" + y) + "_") + x, (((w * h) * 2) + (y * w)) + x);
_local4._x = (x - 1) * tw;
_local4._y = (y - 1) * th;
_local4.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
this.removeMovieClip("");
}
};
soundBoard.start("sBoom", 0, 0);
} else if (type == 2) {
_local4 = fg.attachMovie("boom3x3", (("boom_" + y) + "_") + x, (((w * h) * 2) + (y * w)) + x);
_local4._x = (x - 1) * tw;
_local4._y = (y - 1) * th;
_local4.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
this.removeMovieClip("");
}
};
soundBoard.start("sBoom", 0, 0);
}
}
function importMap(str) {
var _local2 = str.split("&");
var _local1 = new Object();
_local1.w = int(_local2[0].split("=")[1]);
_local1.h = int(_local2[1].split("=")[1]);
_local1.map = parse(_local1.w, _local1.h, _local2[2].split("=")[1]);
_local1.maxes = int(_local2[3].split("=")[1]);
_local1.mshoot = int(_local2[4].split("=")[1]);
_local1.mrockets = int(_local2[5].split("=")[1]);
_local1.mblocks = int(_local2[6].split("=")[1]);
_local1.mpushes = int(_local2[7].split("=")[1]);
_local1.mkamikazes = int(_local2[8].split("=")[1]);
_local1.minfo = _local2[9].split("=")[1];
_local1.mmoves = _local2[10].split("=")[1];
_local1.mname = _local2[11].split("=")[1];
return(_local1);
}
function addClick(x, y) {
var _local1 = train.attachMovie("clickHere", "clickHere", 0);
_local1._x = (x * tw) + tw;
_local1._y = (y * th) + th;
if ((_local1._x + _local1._width) > 450) {
_local1.gotoAndPlay(11);
}
}
function trainingFrame() {
if (this.lastGameCounter != gameCounter) {
this.createEmptyMovieClip("clickHere", 0);
if (active == null) {
addClick(soldiers[0].x, soldiers[0].y);
} else {
var _local3 = soldiers[0].x;
var _local2 = soldiers[0].y;
if (TRAINING == 1) {
if ((_local3 == 0) && (_local2 == 6)) {
addClick(2, 6);
}
if ((_local3 == 2) && (_local2 == 6)) {
addClick(3, 5);
}
if ((_local3 == 3) && (_local2 == 5)) {
addClick(4, 5);
}
if ((_local3 == 4) && (_local2 == 6)) {
addClick(5, 6);
}
if ((_local3 == 5) && (_local2 == 6)) {
addClick(6, 5);
}
if ((_local3 == 6) && (_local2 == 5)) {
addClick(7, 5);
}
if ((_local3 == 7) && (_local2 == 5)) {
addClick(9, 4);
}
if ((_local3 == 9) && (_local2 == 5)) {
addClick(10, 5);
}
if ((_local3 == 10) && (_local2 == 5)) {
addClick(12, 4);
}
if ((_local3 == 12) && (_local2 == 5)) {
addClick(13, 5);
}
} else if (!this.done) {
if ((_local3 == 0) && (_local2 == 4)) {
addClick(1, 4);
}
if ((_local3 == 1) && (_local2 == 5)) {
addClick(2, 5);
}
if ((_local3 == 2) && (_local2 == 5)) {
addClick(4, 5);
}
if ((_local3 == 4) && (_local2 == 5)) {
addClick(0, 11.5);
}
}
}
this.lastGameCounter = gameCounter;
}
if (movang) {
this.lastGameCounter = gameCounter;
}
}
function startGame(mapstring, level) {
if (level < 2) {
TRAINING = level + 1;
} else {
TRAINING = 0;
}
currentmap = importMap(mapstring);
map = currentmap.map;
w = currentmap.w;
h = currentmap.h;
world = createEmptyMovieClip("world", 0);
fg = world.createEmptyMovieClip("fg", 1);
bg = world.createEmptyMovieClip("bg", 0);
world._x = (world._y = 16);
border = createBorder(_root, 1, stw + 2, sth + 2);
border._x = (border._y = -16);
menus = createEmptyMovieClip("menus", 2);
menu = menus.createEmptyMovieClip("menu", 2);
menu._x = 16;
soldiers = [];
tiles = [];
var _local3 = 0;
while (_local3 < h) {
var _local2 = 0;
while (_local2 < w) {
if (random(2)) {
var _local5 = bg.attachMovie("tile", (("t_" + _local3) + "_") + _local2, (_local3 * w) + _local2);
_local5._x = _local2 * tw;
_local5._y = _local3 * th;
_local5.stop();
_local5.gfx.gotoAndStop(2 + random(_local5.gfx._totalframes - 1));
}
var _local4 = map[_local3][_local2] + 1;
if ((_local4 > 1) && (_local4 < 2500)) {
var _local5 = fg.attachMovie("tile", (("t_" + _local3) + "_") + _local2, (_local3 * w) + _local2);
_local5._x = _local2 * tw;
_local5._y = _local3 * th;
_local5.x = _local2;
_local5.y = _local3;
_local5.gotoAndStop(_local4);
_local5.gfx.gotoAndStop(random(_local5.gfx._totalframes) + 1);
_local4 = (_local5.t = map[_local3][_local2]);
map[_local3][_local2] = _local5;
_local5.remove = _root["remove" + _local4];
_local5.frame = _root["frame" + _local4];
tiles.push(_local5);
if (_local4 == 3) {
_local5.linker = linker;
_local5.countdown = -1;
}
if ((_local4 == 10) || (_local4 == 5)) {
_local5.p = true;
}
} else if (_local4 > 4999) {
var _local6 = soldiers.length;
var _local5 = fg.attachMovie("soldier", "soldier" + _local6, ((h * w) * 10) + _local6);
_local5._y = ((_local3 * th) - 1) + th;
_local5._x = ((_local2 * tw) - 1) + (tw / 2);
_local5.stop();
_local5.glow._visible = false;
soldiers.push(_local5);
_local5.hitArea = _local5.hit;
_local5.hit._visible = false;
_local5.x = _local2;
_local5.y = _local3;
_local5.frame = playerFrame;
_local5.ft = 0;
map[_local3][_local2] = 0;
_local5.remove = playerDie;
} else if (_local4 > 2499) {
var _local5 = fg.attachMovie("specialTile", (("t_" + _local3) + "_") + _local2, (_local3 * w) + _local2);
_local5._x = _local2 * tw;
_local5._y = _local3 * th;
_local5.gotoAndStop(_local4 - 2500);
_local5.x = _local2;
_local5.y = _local3;
if (map[_local3][_local2] != 2506) {
_local5.wt = true;
}
if (map[_local3][_local2] != 2500) {
_local5.remove = remove2;
}
_local5.t = map[_local3][_local2];
map[_local3][_local2] = _local5;
}
_local2++;
}
_local3++;
}
drawMenu(menu);
if (brief) {
brief = false;
tehbrief = attachMovie("brief", "brief", 2048);
tehbrief.name = ((level + 1) + ". ") + currentmap.mname;
tehbrief.brief = currentmap.minfo;
tehbrief.dig.btext = "x" + currentmap.maxes;
tehbrief.dig.gotoAndStop("digicon");
tehbrief.shoot.btext = "x" + currentmap.mshoot;
tehbrief.shoot.gotoAndStop("shooticon");
tehbrief.rocket.btext = "x" + currentmap.mrockets;
tehbrief.rocket.gotoAndStop("rocketicon");
tehbrief.build.btext = "x" + currentmap.mblocks;
tehbrief.build.gotoAndStop("buildicon");
onMouseDown = function () {
tehbrief.removeMovieClip("");
beginGame();
};
} else {
beginGame();
}
}
function beginGame() {
active = soldiers[0];
onEnterFrame = moving;
if (TRAINING) {
if (TRAINING == 1) {
active = null;
onEnterFrame = null;
soldiers[0].onRelease = function () {
soundBoard.start("sClick", 0, 0);
onEnterFrame = moving;
active = this;
};
}
train = border.createEmptyMovieClip("train", 1024);
train.onEnterFrame = trainingFrame;
}
through = 0;
var _local3 = soldiers.length;
if ((_local3 == 1) || (_local3 == 2)) {
needed = _local3;
} else {
needed = Math.ceil(_local3 / 2);
}
dead = 0;
pauseMoving = 0;
updateSmap();
gameCounter = 0;
onMouseDown = function () {
startscrollx = _root._xmouse;
startscrolly = _root._ymouse;
dragscroll = true;
dragcounter = 0;
};
onMouseUp = function () {
dragscroll = false;
};
onMouseMove = function () {
cursor._x = (_root._xmouse + tw) - 5;
cursor._y = _root._ymouse;
if (dragscroll) {
if (dragcounter > 10) {
world._x = world._x - (startscrollx - _root._xmouse);
world._y = world._y - (startscrolly - _root._ymouse);
if (world._x > 16) {
world._x = 16;
}
if (world._x < ((((-tw) * w) + (tw * stw)) + 16)) {
world._x = (((-tw) * w) + (tw * stw)) + 16;
}
if (world._y > 16) {
world._y = 16;
}
if (world._y < ((((-th) * h) + (th * sth)) + 16)) {
world._y = (((-th) * h) + (th * sth)) + 16;
}
}
startscrollx = _root._xmouse;
startscrolly = _root._ymouse;
}
};
cursor.onEnterFrame = function () {
cursor.gotoAndStop(9);
dragcounter++;
if ((dragcounter > 5) && (dragscroll)) {
cursor.gotoAndStop(14);
}
};
}
function attachButton(clip, depth, name, icon, x, y, alpha) {
var _local1 = clip.attachMovie("icon", name, depth);
_local1._x = x;
_local1._y = y;
_local1.gotoAndStop(icon);
_local1._alpha = alpha;
_local1.hitArea = _local1.hit;
return(_local1);
}
function attachActionButton(clip, depth, name, icon, x, y, alpha, func, tx, ty) {
var _local2 = attachButton(clip, depth, name, icon, x * tw, y * th, alpha);
_local2.x = tx;
_local2.y = ty;
_local2.func = func;
_local2.onRelease = function () {
playerFunc(this.func, this.x, this.y);
disableAll();
soundBoard.start("sClick", 0, 0);
};
if (TRAINING) {
var l = "";
if ((icon == "walkleft") || (icon == "walkright")) {
l = "walk";
}
if ((icon == "climbleft") || (icon == "climbright")) {
l = "climb";
}
if ((icon == "jumpleft") || (icon == "jumpright")) {
l = "jump";
}
_local2.onRollOver = function () {
this.label = l;
this._alpha = 100;
};
_local2.onRollOut = (_local2.onDragOut = function () {
this.label = "";
this._alpha = 50;
});
} else {
_local2.onRollOver = function () {
this._alpha = 100;
};
_local2.onRollOut = (_local2.onDragOut = function () {
this._alpha = 50;
});
}
return(_local2);
}
function drawMenu(clip) {
mdig = int(currentmap.maxes);
attachButton(clip, 0, "dig", "dig", 0, 382, 50).text = "x" + mdig;
mshoot = currentmap.mshoot;
attachButton(clip, 1, "shoot", "shoot", 48, 382, 50).text = "x" + mshoot;
mrocket = currentmap.mrockets;
attachButton(clip, 2, "rocket", "rocket", 96, 382, 50).text = "x" + mrocket;
mbuild = currentmap.mblocks;
attachButton(clip, 3, "build", "build", 144, 382, 50).text = "x" + mbuild;
attachButton(clip, 4, "label", "label", 192, 365, 100);
var _local3 = attachButton(clip, 7, "restart", "restart", 326, 382, 100);
_local3.onRollOver = function () {
this.label = "restart";
};
_local3.onRollOut = (_local3.dragOut = function () {
this.label = "";
});
_local3.onRelease = function () {
startGame(maps[level], level);
soundBoard.start("sClick", 0, 0);
};
if (soldiers.length > 1) {
_local3 = attachButton(clip, 8, "next", "next", 374, 382, 100);
_local3.onRollOver = function () {
this.label = "next soldier";
};
_local3.onRollOut = (_local3.dragOut = function () {
this.label = "";
});
_local3.onRelease = function () {
nextSoldier();
soundBoard.start("sClick", 0, 0);
};
}
}
function nextSoldier() {
var _local3 = active;
var _local2;
var _local1 = 0;
while (_local1 < soldiers.length) {
if (active == soldiers[_local1]) {
_local2 = _local1;
break;
}
_local1++;
}
_local2++;
var _local4 = false;
while (!_local4) {
_local2 = _local2 % soldiers.length;
if (soldiers[_local2]._visible) {
active = soldiers[_local2];
onEnterFrame = moving;
if (active == _local3) {
active = null;
}
return(undefined);
}
_local2++;
}
}
function updateMenu(clip, disable) {
menu.dig.text = "x" + mdig;
menu.shoot.text = "x" + mshoot;
menu.rocket.text = "x" + mrocket;
menu.build.text = "x" + mbuild;
if ((mdig > 0) && (!disable)) {
menu.dig.gotoAndStop("digicon");
menu.dig._alpha = 100;
menu.dig.onRelease = function () {
soundBoard.start("sClick", 0, 0);
buttons = world.createEmptyMovieClip("icons", 2);
buttons.b = 0;
showDigs(active, buttons);
updateMenu(menu, true);
};
menu.dig.enabled = true;
} else {
menu.dig.gotoAndStop("dig");
menu.dig._alpha = 50;
menu.dig.enabled = false;
}
if ((mshoot > 0) && (!disable)) {
menu.shoot.gotoAndStop("shooticon");
menu.shoot._alpha = 100;
menu.shoot.onRelease = function () {
soundBoard.start("sClick", 0, 0);
buttons = world.createEmptyMovieClip("icons", 2);
buttons.b = 0;
showShoots(active, buttons);
updateMenu(menu, true);
};
menu.shoot.enabled = true;
} else {
menu.shoot.gotoAndStop("shoot");
menu.shoot._alpha = 50;
menu.shoot.enabled = false;
}
if ((mrocket > 0) && (!disable)) {
menu.rocket.gotoAndStop("rocketicon");
menu.rocket._alpha = 100;
menu.rocket.onRelease = function () {
soundBoard.start("sClick", 0, 0);
buttons = world.createEmptyMovieClip("icons", 2);
buttons.b = 0;
showRockets(active, buttons);
updateMenu(menu, true);
};
menu.rocket.enabled = true;
} else {
menu.rocket.gotoAndStop("rocket");
menu.rocket._alpha = 50;
menu.rocket.enabled = false;
}
if ((mbuild > 0) && (!disable)) {
menu.build.gotoAndStop("buildicon");
menu.build._alpha = 100;
menu.build.onRelease = function () {
soundBoard.start("sClick", 0, 0);
buttons = world.createEmptyMovieClip("icons", 2);
buttons.b = 0;
showBuilds(active, buttons);
updateMenu(menu, true);
};
menu.build.enabled = true;
} else {
menu.build.gotoAndStop("build");
menu.build._alpha = 50;
menu.build.enabled = false;
}
}
function setActives(clip) {
var _local2 = 0;
while (_local2 < soldiers.length) {
if (soldiers[_local2] != clip) {
var _local3 = soldiers[_local2];
_local3.enabled = true;
_local3.onRelease = function () {
setActives(this);
};
_local3.glow._visible = false;
}
_local2++;
}
active = clip;
clip.enabled = false;
clip.glow._visible = true;
buttons = world.createEmptyMovieClip("icons", 2);
buttons.b = 0;
showWalks(clip, buttons);
showClimbs(clip, buttons);
showJumps(clip, buttons);
showPushes(clip, buttons);
}
function showWalks(clip, draw) {
var _local6 = clip.x;
var _local1 = clip.y;
var _local3 = 1;
var _local2 = _local6 + 1;
for ( ; _local2 < w ; _local2++) {
if ((smap[_local1][_local2] == 0) || (smap[_local1][_local2].wt)) {
var _local4 = false;
if (smap[_local1 + 1][_local2] != 0) {
_local4 = true;
} else if (_local3 != 0) {
_local3--;
_local4 = true;
}
if (_local4) {
var _local5 = buttons.b++;
attachActionButton(draw, _local5, "walk_" + _local5, "walkright", _local2, _local1, 50, walkFunc, _local2, _local1);
if (_local3 != 0) {
continue;
}
}
break;
}
break;
}
_local3 = 1;
_local2 = _local6 - 1;
for ( ; _local2 >= 0 ; _local2--) {
if ((smap[_local1][_local2] == 0) || (smap[_local1][_local2].wt)) {
var _local4 = false;
if (smap[_local1 + 1][_local2] != 0) {
_local4 = true;
} else if (_local3 != 0) {
_local3--;
_local4 = true;
}
if (_local4) {
var _local5 = buttons.b++;
attachActionButton(draw, _local5, "walk_" + _local5, "walkleft", _local2, _local1, 50, walkFunc, _local2, _local1);
if (_local3 != 0) {
continue;
}
}
break;
}
break;
}
}
function showClimbs(clip, draw) {
var _local2 = clip.x;
var _local1 = clip.y;
if (smap[_local1][_local2 + 1] != 0) {
if ((smap[_local1 - 1][_local2] == 0) || (smap[_local1 - 1][_local2].wt)) {
if ((smap[_local1 - 1][_local2 + 1] == 0) || (smap[_local1 - 1][_local2 + 1].wt)) {
var _local3 = buttons.b++;
attachActionButton(draw, _local3, "climb_" + _local3, "climbright", _local2 + 1, _local1 - 1, 50, climbFunc, _local2 + 1, _local1 - 1);
}
}
}
if (smap[_local1][_local2 - 1] != 0) {
if ((smap[_local1 - 1][_local2] == 0) || (smap[_local1 - 1][_local2].wt)) {
if ((smap[_local1 - 1][_local2 - 1] == 0) || (smap[_local1 - 1][_local2 - 1].wt)) {
var _local3 = buttons.b++;
attachActionButton(draw, _local3, "climb_" + _local3, "climbleft", _local2 - 1, _local1 - 1, 50, climbFunc, _local2 - 1, _local1 - 1);
}
}
}
}
function showJumps(clip, draw) {
var _local2 = clip.x;
var _local1 = clip.y;
if ((smap[_local1][_local2 + 1] == 0) || (smap[_local1][_local2 + 1].wt)) {
if ((smap[_local1][_local2 + 2] == 0) || (smap[_local1][_local2 + 2].wt)) {
var _local3 = buttons.b++;
attachActionButton(draw, _local3, "jump_" + _local3, "jumpright", _local2 + 2, _local1 - 1, 50, jumpFunc, _local2 + 2, _local1);
}
}
if ((smap[_local1][_local2 - 1] == 0) || (smap[_local1][_local2 - 1].wt)) {
if ((smap[_local1][_local2 - 2] == 0) || (smap[_local1][_local2 - 2].wt)) {
var _local3 = buttons.b++;
attachActionButton(draw, _local3, "jump_" + _local3, "jumpleft", _local2 - 2, _local1 - 1, 50, jumpFunc, _local2 - 2, _local1);
}
}
}
function showDigs(clip, draw) {
var _local2 = clip.x;
var _local1 = clip.y;
if (smap[_local1][_local2 + 1] != 0) {
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "dig_" + _local4, "dig", _local2 + 1, _local1, 50, digFunc, _local2 + 1, _local1);
}
if (smap[_local1][_local2 - 1] != 0) {
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "dig_" + _local4, "dig", _local2 - 1, _local1, 50, digFunc, _local2 - 1, _local1);
}
if (smap[_local1 + 1][_local2] != 0) {
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "dig_" + _local4, "dig", _local2, _local1 + 1, 50, digFunc, _local2, _local1 + 1);
}
if (smap[_local1 - 1][_local2] != 0) {
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "dig_" + _local4, "dig", _local2, _local1 - 1, 50, digFunc, _local2, _local1 - 1);
}
if (TRAINING == 2) {
if ((soldiers[0].x == 4) && (soldiers[0].y == 5)) {
addClick(5, 5);
train.done = true;
}
}
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "cancel_" + _local4, "cancel", _local2, _local1, 100, function () {
onEnterFrame = moving;
}, _local2, _local1);
}
function showBuilds(clip, draw) {
var _local2 = clip.x;
var _local1 = clip.y;
if (smap[_local1][_local2 + 1] == 0) {
if (smap[_local1 + 1][_local2 + 1] == 0) {
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "build_" + _local4, "build", _local2 + 1, _local1 + 1, 50, buildFunc, _local2 + 1, _local1 + 1);
} else {
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "build_" + _local4, "build", _local2 + 1, _local1, 50, buildFunc, _local2 + 1, _local1);
}
}
if (smap[_local1][_local2 - 1] == 0) {
if (smap[_local1 + 1][_local2 - 1] == 0) {
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "build_" + _local4, "build", _local2 - 1, _local1 + 1, 50, buildFunc, _local2 - 1, _local1 + 1);
} else {
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "build_" + _local4, "build", _local2 - 1, _local1, 50, buildFunc, _local2 - 1, _local1);
}
}
var _local4 = buttons.b++;
attachActionButton(draw, _local4, "cancel_" + _local4, "cancel", _local2, _local1, 100, function () {
onEnterFrame = moving;
}, _local2, _local1);
}
function showShoots(clip, draw) {
var _local2 = clip.x;
var _local1 = clip.y;
var _local6 = _local2 + 1;
while (_local6 < w) {
if (smap[_local1][_local6] != 0) {
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "shoot_" + _local7, "shoot", _local6, _local1, 50, shootFunc, _local6, _local1);
break;
}
_local6++;
}
_local6 = _local2 - 1;
while (_local6 >= 0) {
if (smap[_local1][_local6] != 0) {
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "shoot_" + _local7, "shoot", _local6, _local1, 50, shootFunc, _local6, _local1);
break;
}
_local6--;
}
_local6 = _local1 + 1;
while (_local6 < h) {
if (smap[_local6][_local2] != 0) {
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "shoot_" + _local7, "shoot", _local2, _local6, 50, shootFunc, _local2, _local6);
break;
}
_local6++;
}
_local6 = _local1 - 1;
while (_local6 >= 0) {
if (smap[_local6][_local2] != 0) {
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "shoot_" + _local7, "shoot", _local2, _local6, 50, shootFunc, _local2, _local6);
break;
}
_local6--;
}
var _local5 = _local2;
var _local4 = _local1;
while ((_local5 < w) && (_local4 < w)) {
if ((smap[_local4 + 1][_local5] == 0) || (smap[_local4][_local5 + 1] == 0)) {
if (smap[_local4 + 1][_local5 + 1] == 0) {
_local5++;
_local4++;
} else {
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "shoot_" + _local7, "shoot", _local5 + 1, _local4 + 1, 50, shootFunc, _local5 + 1, _local4 + 1);
break;
}
} else {
break;
}
}
_local5 = _local2;
_local4 = _local1;
while ((_local5 < w) && (_local4 > 0)) {
if ((smap[_local4 - 1][_local5] == 0) || (smap[_local4][_local5 + 1] == 0)) {
if (smap[_local4 - 1][_local5 + 1] == 0) {
_local5++;
_local4--;
} else {
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "shoot_" + _local7, "shoot", _local5 + 1, _local4 - 1, 50, shootFunc, _local5 + 1, _local4 - 1);
break;
}
} else {
break;
}
}
_local5 = _local2;
_local4 = _local1;
while ((_local5 > 0) && (_local4 < w)) {
if ((smap[_local4 + 1][_local5] == 0) || (smap[_local4][_local5 - 1] == 0)) {
if (smap[_local4 + 1][_local5 - 1] == 0) {
_local5--;
_local4++;
} else {
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "shoot_" + _local7, "shoot", _local5 - 1, _local4 + 1, 50, shootFunc, _local5 - 1, _local4 + 1);
break;
}
} else {
break;
}
}
_local5 = _local2;
_local4 = _local1;
while ((_local5 > 0) && (_local4 > 0)) {
if ((smap[_local4 - 1][_local5] == 0) || (smap[_local4][_local5 - 1] == 0)) {
if (smap[_local4 - 1][_local5 - 1] == 0) {
_local5--;
_local4--;
} else {
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "shoot_" + _local7, "shoot", _local5 - 1, _local4 - 1, 50, shootFunc, _local5 - 1, _local4 - 1);
break;
}
} else {
break;
}
}
var _local7 = buttons.b++;
attachActionButton(draw, _local7, "cancel_" + _local7, "cancel", _local2, _local1, 100, function () {
onEnterFrame = moving;
}, _local2, _local1);
}
function showRockets(clip, draw) {
var _local3 = clip.x;
var _local1 = clip.y;
var _local2 = _local3 + 1;
while (_local2 < w) {
if (smap[_local1][_local2] != 0) {
var _local5 = buttons.b++;
attachActionButton(draw, _local5, "rocket_" + _local5, "rocket", _local2, _local1, 50, rocketFunc, _local2, _local1);
break;
}
_local2++;
}
_local2 = _local3 - 1;
while (_local2 >= 0) {
if (smap[_local1][_local2] != 0) {
var _local5 = buttons.b++;
attachActionButton(draw, _local5, "rocket_" + _local5, "rocket", _local2, _local1, 50, rocketFunc, _local2, _local1);
break;
}
_local2--;
}
_local2 = _local1 - 1;
while (_local2 >= 0) {
if (smap[_local2][_local3] != 0) {
var _local5 = buttons.b++;
attachActionButton(draw, _local5, "rocket_" + _local5, "rocket", _local3, _local2, 50, rocketFunc, _local3, _local2);
break;
}
_local2--;
}
var _local5 = buttons.b++;
attachActionButton(draw, _local5, "cancel_" + _local5, "cancel", _local3, _local1, 100, function () {
onEnterFrame = moving;
}, _local3, _local1);
}
function showPushes(clip, draw) {
var _local2 = clip.x;
var _local1 = clip.y;
if (smap[_local1][_local2 + 1].p && (smap[_local1][_local2 + 2] == 0)) {
var _local3 = buttons.b++;
attachActionButton(draw, _local3, "push_" + _local3, "pushright", _local2 + 1, _local1, 50, pushFunc, _local2 + 1, _local1);
}
if (smap[_local1][_local2 - 1].p && (smap[_local1][_local2 - 2] == 0)) {
var _local3 = buttons.b++;
attachActionButton(draw, _local3, "push_" + _local3, "pushleft", _local2 - 1, _local1, 50, pushFunc, _local2 - 1, _local1);
}
}
function playerFunc(func, x, y) {
active.fx = x;
active.fy = y;
active.onEnterFrame = func;
active.glow._visible = false;
buttons.removeMovieClip("");
updateMenu(menu, true);
train.createEmptyMovieClip("clickHere", 0);
}
function walkFunc() {
if (this.gfx._currentframe == 1) {
checkOn(this);
if (this.x < this.fx) {
this.x++;
this._x = this._x + tw;
this._xscale = 100;
this.gotoAndStop("walk");
soundBoard.start("sWalk", 0, 0);
} else if (this.x > this.fx) {
this.x--;
this._x = this._x - tw;
this._xscale = -100;
this.gotoAndStop("walk");
soundBoard.start("sWalk", 0, 0);
} else {
this.gotoAndStop("stand");
this.onEnterFrame = null;
onEnterFrame = moving;
}
}
}
function pushFunc() {
if (this.gfx._currentframe == 1) {
if (this.x < this.fx) {
this.x++;
this._x = this._x + tw;
this._xscale = 100;
this.gotoAndStop("walk");
var _local2 = map[this.y][this.x];
map[this.y][this.x] = 0;
_local2.x++;
_local2._x = _local2._x + tw;
map[this.y][this.x + 1] = _local2;
} else if (this.x > this.fx) {
this.x--;
this._x = this._x - tw;
this._xscale = -100;
this.gotoAndStop("walk");
var _local2 = map[this.y][this.x];
map[this.y][this.x] = 0;
_local2.x--;
_local2._x = _local2._x - tw;
map[this.y][this.x - 1] = _local2;
} else {
this.gotoAndStop("stand");
this.onEnterFrame = null;
onEnterFrame = moving;
}
}
}
function climbFunc() {
if (this.gfx._currentframe == 1) {
if (this.x < this.fx) {
this.x = this.fx;
this.y = this.fy;
this._x = this._x + tw;
this._y = this._y - th;
this._xscale = 100;
this.gotoAndStop("climb");
soundBoard.start("sClimb", 0, 0);
} else if (this.x > this.fx) {
this.x = this.fx;
this.y = this.fy;
this._x = this._x - tw;
this._y = this._y - th;
this._xscale = -100;
this.gotoAndStop("climb");
soundBoard.start("sClimb", 0, 0);
} else {
this.gotoAndStop("stand");
this.onEnterFrame = null;
onEnterFrame = moving;
}
}
}
function jumpFunc() {
if (this.gfx._currentframe == 1) {
if (this.x < this.fx) {
this.x = this.fx;
this.y = this.fy;
this._x = this._x + (tw * 2);
this._xscale = 100;
this.gotoAndStop("jump");
soundBoard.start("sJump", 0, 0);
} else if (this.x > this.fx) {
this.x = this.fx;
this.y = this.fy;
this._x = this._x - (tw * 2);
this._xscale = -100;
this.gotoAndStop("jump");
soundBoard.start("sJump", 0, 0);
} else {
this.gotoAndStop("stand");
this.onEnterFrame = null;
onEnterFrame = moving;
}
}
}
function digFunc() {
if ((this.gfx._currentframe % 3) == 0) {
soundBoard.start("sDig", 0, 0);
}
if (this.gfx._currentframe == 1) {
if (map[this.fy][this.fx].t > 1) {
mdig--;
}
this.gotoAndStop("dig");
if (this.x < this.fx) {
this._xscale = 100;
} else {
this._xscale = -100;
}
smap[this.fy][this.fx].remove(false);
} else if (this.gfx._currentframe == this.gfx._totalframes) {
this.gotoAndStop("stand");
this.onEnterFrame = null;
onEnterFrame = moving;
}
}
function buildFunc() {
if (this.gfx._currentframe == 1) {
mbuild--;
this.gotoAndStop("build");
if (this.x < this.fx) {
this._xscale = 100;
} else {
this._xscale = -100;
}
var _local2 = fg.attachMovie("tile", (("t_" + this.fy) + "_") + this.fx, (this.fy * w) + this.fx);
_local2._x = this.fx * tw;
_local2._y = this.fy * th;
_local2.gotoAndStop(12);
_local2.t = 11;
map[this.fy][this.fx] = _local2;
soundBoard.start("sWalk", 0, 0);
} else if (this.gfx._currentframe == this.gfx._totalframes) {
this.gotoAndStop("stand");
this.onEnterFrame = null;
onEnterFrame = moving;
}
}
function shootFunc() {
if (this.gfx._currentframe == 1) {
if (map[this.fy][this.fx].t > 1) {
mshoot--;
}
this.gotoAndStop("shoot");
if (this.fy == this.y) {
this.gfx.gfx.gotoAndStop(1);
} else if (this.fy < this.y) {
if (this.x == this.fx) {
this.gfx.gfx.gotoAndStop(3);
} else {
this.gfx.gfx.gotoAndStop(2);
}
} else {
this.gfx.gfx.gotoAndStop(4);
}
if (this.x < this.fx) {
this._xscale = 100;
} else {
this._xscale = -100;
}
smap[this.fy][this.fx].remove(false);
soundBoard.start("sShoot", 0, 0);
} else if (this.gfx._currentframe == this.gfx._totalframes) {
this.gotoAndStop("stand");
this.onEnterFrame = null;
onEnterFrame = moving;
}
}
function rocketFrame() {
var _local2 = this.y + this.ys;
var _local3 = this.x + this.xs;
if (smap[_local2][_local3] == 0) {
map[this.y][this.x] = 0;
smap[this.y][this.x] = 0;
smap[_local2][_local3] = this;
map[_local2][_local3] = this;
this.y = _local2;
this.x = _local3;
this._x = this.x * tw;
this._y = this.y * th;
if ((this.xs > 0) || (this.ys < 32)) {
return(32);
}
} else {
smap[_local2 - 1][_local3].remove(true);
smap[_local2][_local3 - 1].remove(true);
smap[_local2][_local3].remove(true);
smap[_local2][_local3 + 1].remove(true);
smap[_local2 + 1][_local3].remove(true);
addBoom(_local3, _local2, 1);
smap[this.y][this.x] = 0;
map[this.y][this.x] = 0;
this.removeMovieClip("");
}
return(1);
}
function rocketFunc() {
if (this.gfx._currentframe == 1) {
mrocket--;
this.gotoAndStop("shootb");
if (this.fy == this.y) {
this.gfx.gfx.gotoAndStop(1);
} else if (this.fy < this.y) {
this.gfx.gfx.gotoAndStop(3);
}
if (this.x < this.fx) {
this._xscale = 100;
} else {
this._xscale = -100;
}
soundBoard.start("sRocket", 0, 0);
} else if (this.gfx._currentframe == this.gfx._totalframes) {
var _local2 = fg.attachMovie("bazookaShot", "bazookaShot", (w * h) * 4);
if (this.fy == this.y) {
this.gfx.gfx.gotoAndStop(1);
_local2.y = this.y;
_local2._y = this.y * th;
_local2.ys = 0;
if (this.x < this.fx) {
_local2.gotoAndStop(1);
_local2.x = this.x + 1;
_local2._x = (this.x + 1) * tw;
_local2.xs = 1;
} else {
_local2.gotoAndStop(3);
_local2.x = this.x - 1;
_local2._x = (this.x - 1) * tw;
_local2.xs = -1;
}
} else if (this.fy < this.y) {
this.gfx.gfx.gotoAndStop(3);
_local2.gotoAndStop(5);
_local2.y = this.y - 1;
_local2._y = (this.y - 1) * tw;
_local2.x = this.x;
_local2._x = this.x * tw;
_local2.xs = 0;
_local2.ys = -1;
}
_local2.frame = rocketFrame;
if (map[_local2.y][_local2.x] == 0) {
map[_local2.y][_local2.x] = _local2;
} else {
map[this.fy][this.fx].remove(true);
map[this.fy][this.fx + 1].remove(true);
map[this.fy][this.fx - 1].remove(true);
map[this.fy + 1][this.fx].remove(true);
map[this.fy - 1][this.fx].remove(true);
addBoom(this.fx, this.fy, 1);
}
this.gotoAndStop("stand");
this.onEnterFrame = null;
onEnterFrame = moving;
}
}
function winFunc() {
if (this.gfx._currentframe == this.gfx._totalframes) {
this.removeMovieClip("");
through++;
}
}
function dieFunc() {
if (this.gfx._currentframe == this.gfx._totalframes) {
dead++;
this.removeMovieClip("");
}
}
function fallFunc() {
this._y = this._y + (tw / 3);
this.gotoAndStop("fall");
}
function disableAll() {
var _local1 = 0;
while (_local1 < soldiers.length) {
soldiers[_local1].enabled = false;
_local1++;
}
}
function checkOn(clip) {
var _local2 = clip.x;
var _local1 = clip.y;
var _local3 = map[_local1][_local2].t;
if (_local3 == 2502) {
mdig++;
fg[(("t_" + _local1) + "_") + _local2].gotoAndStop(2);
map[_local1][_local2].t = 2501;
soundBoard.start("sAmmo", 0, 0);
} else if (_local3 == 2503) {
mshoot++;
fg[(("t_" + _local1) + "_") + _local2].gotoAndStop(2);
map[_local1][_local2].t = 2501;
soundBoard.start("sAmmo", 0, 0);
} else if (_local3 == 2504) {
mrocket++;
fg[(("t_" + _local1) + "_") + _local2].gotoAndStop(2);
map[_local1][_local2].t = 2501;
soundBoard.start("sAmmo", 0, 0);
} else if (_local3 == 2505) {
mbuild++;
fg[(("t_" + _local1) + "_") + _local2].gotoAndStop(2);
map[_local1][_local2].t = 2501;
soundBoard.start("sAmmo", 0, 0);
}
updateMenu(menu, true);
}
function playerFrame() {
this.onEnterFrame = null;
checkOn(this);
if (smap[this.y + 1][this.x] == 0) {
smap[this.y][this.x] = 0;
smap[this.y + 1][this.x] = this;
this.y++;
this.onEnterFrame = fallFunc;
this.ft++;
return(1);
}
if (this.ft != 0) {
if (this.ft >= 4) {
smap[this.y][this.x] = 0;
this.onEnterFrame = dieFunc;
this.gotoAndStop("die");
this.frame = function () {
return(1);
};
nextSoldier();
return(1);
}
this.gotoAndStop("land");
}
this.ft = 0;
if (map[this.y][this.x].t == 2500) {
this.onEnterFrame = winFunc;
this.gotoAndStop("win");
this.frame = function () {
return(1);
};
return(1);
}
if (map[this.y + 1][this.x].t == 2506) {
smap[this.y][this.x] = 0;
this.onEnterFrame = dieFunc;
this.gotoAndStop("die");
this.frame = function () {
return(1);
};
nextSoldier();
return(1);
}
return(0);
}
function playerDie() {
smap[this.y][this.x] = 0;
this.onEnterFrame = dieFunc;
this.gotoAndStop("die");
this.frame = function () {
return(1);
};
nextSoldier();
}
function updateSmap() {
smap = copy(map);
var _local1 = 0;
while (_local1 < soldiers.length) {
smap[soldiers[_local1].y][soldiers[_local1].x] = soldiers[_local1];
_local1++;
}
}
function scroll() {
if (Key.isDown(37)) {
world._x = world._x + 10;
if (world._x > 16) {
world._x = 16;
}
}
if (Key.isDown(39)) {
world._x = world._x - 10;
if (world._x < ((((-tw) * w) + (tw * stw)) + 16)) {
world._x = (((-tw) * w) + (tw * stw)) + 16;
}
}
if (Key.isDown(38)) {
world._y = world._y + 10;
if (world._y > 16) {
world._y = 16;
}
}
if (Key.isDown(40)) {
world._y = world._y - 10;
if (world._y < ((((-th) * h) + (th * sth)) + 16)) {
world._y = (((-th) * h) + (th * sth)) + 16;
}
}
}
function moving() {
gameCounter++;
scroll();
if (!smapg) {
smapg = 1;
updateSmap();
}
pauseMoving++;
if ((pauseMoving % 3) == 1) {
var _local5 = 0;
var _local4 = 0;
var _local3 = h - 1;
while (_local3 >= 0) {
var _local2 = 0;
while (_local2 < w) {
if (_local4) {
} else {
var _local1 = smap[_local3][_local2];
if (_local1.MESKIP) {
} else {
_local1 = _local1.frame();
if (_local1) {
if (_local1 == 32) {
_local4 = 1;
smap[_local3][_local2].MESKIP = true;
}
_local5 = true;
}
}
}
_local2++;
}
_local3--;
}
if (!_local5) {
if (needed == through) {
endGame();
gotoAndStop ("completed");
}
if ((soldiers.length - dead) < needed) {
endGame();
gotoAndStop ("failed");
}
pauseMoving = 0;
setActives(active);
updateMenu(clip);
updateSmap();
onEnterFrame = stopped;
}
}
}
function stopped() {
movang = 0;
scroll();
smapg = 0;
if (needed == through) {
endGame();
gotoAndStop ("completed");
}
if ((soldiers.length - dead) < needed) {
endGame();
gotoAndStop ("failed");
}
}
function endGame() {
onEnterFrame = null;
onMouseDown = (onMouseUp = (onMouseMove = null));
onMouseMove = function () {
cursor._x = (_root._xmouse + tw) - 5;
cursor._y = _root._ymouse;
};
world = createEmptyMovieClip("world", 0);
menus = createEmptyMovieClip("menus", 2);
}
cursor = _root.attachMovie("icon", "mousePointer", 4096);
cursor.gotoAndStop(9);
cursor._xscale = -100;
Mouse.hide();
onMouseMove = function () {
cursor._x = (_root._xmouse + tw) - 5;
cursor._y = _root._ymouse;
};
maps = new Array();
maps[0] = "width=14&height=11&map=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2500,5000,0,0,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,2506,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1&axes=0&bullets=0&rockets=0&blocks=0&pushes=0&kamikazes=0&info=Learn how to walk, climb, and jump&moves=-1&name=Kinetics";
maps[1] = "width=14&height=11&map=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,5000,0,0,0,0,1,0,0,0,0,0,2,0,2500,1,0,2502,0,0,2,0,0,2503,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1&axes=0&bullets=0&rockets=0&blocks=0&pushes=0&kamikazes=0&info=Learn how to dig and shoot&moves=-1&name=Load Out";
maps[2] = "width=14&height=11&map=0,0,0,0,0,3,3,3,3,3,3,3,3,3,0,0,0,0,0,3,5,3,5,3,5,3,5,3,0,0,0,0,0,3,3,3,3,3,3,3,3,3,0,0,0,0,0,3,0,0,0,0,0,0,0,0,5000,0,0,0,3,3,3,0,0,0,0,0,0,2500,1,1,1,1,1,1,3,1,5,1,5,1,5,1,1,1,1,1,1,1,3,3,3,3,3,3,3,3,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1&axes=&bullets=1&rockets=&blocks=&pushes=&kamikazes=&info=Set off a Chain Reaction!&moves=-1&name=Chain Reaction";
maps[3] = "width=14&height=11&map=1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,5000,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,0,2,2,0,1,1,1,1,1,1,0,0,0,2506,2506,2506,2506,0,1,1,1,1,1,0,0,0,0,2501,2501,2501,2501,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,2,2,2,2,1,0,1,0,0,1,1,0,0,1,1,0,0,0,0,0,1,2503,0,0,0,0,1,1,0,2500,0,2506,2506,2506,1,1,1,1,1,1,1,1,1,1,1,1,1,1&axes=0&bullets=0&rockets=0&blocks=0&pushes=0&kamikazes=0&info=Piece of cake just choose your target carefully&moves=-1&name=Cake Walk";
maps[4] = "width=14&height=11&map=1,5,1,0,0,0,0,0,0,0,0,1,5,1,5,1,0,0,0,0,0,1,1,0,0,0,1,5,1,0,0,0,0,0,1,1,5,1,0,0,0,1,0,0,0,1,1,1,1,5,1,1,2,2,0,0,1,0,0,0,1,1,1,1,5,1,0,0,0,1,1,1,2502,0,0,0,0,0,1,0,0,0,1,5,5,1,1,2,2,2,1,0,1,0,0,1,1,1,1,0,0,10,0,0,0,0,1,1,0,0,0,0,1,0,1,2,1,1,1,1,1,1,2,1,0,0,1,0,0,0,0,0,2500,1,2505,2505,2505,0,5000,1,5,1,1,1,5,5,5,1,1,1,1,1,1,1&axes=0&bullets=0&rockets=0&blocks=0&pushes=0&kamikazes=0&info=Build and dig the paths to get around&moves=-1&name=Build";
maps[5] = "width=14&height=11&map=0,0,0,10,0,10,0,10,0,0,0,0,1,1,1,2,2,2,2,2,2,2,2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,2500,2502,0,0,0,10,0,10,0,1,1,1,1,1,1,1,0,2501,2503,2501,2503,2501,2503,0,1,5,1,1,1,1,1,1,1,1,1,1,1,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,4,0,0,4,0,0,1,5000,1,5000,5000,1,2506,2506,1,2506,2506,1,2506,2506,1,1,1,1,1&axes=0&bullets=0&rockets=0&blocks=0&pushes=0&kamikazes=0&info=Sacrifice, 2 soldiers must escape to complete the mission!&moves=-1&name=Teamwork";
maps[6] = "width=14&height=11&map=1,2500,9,9,9,9,9,9,9,9,9,9,2501,1,1,1,9,9,7,9,9,9,9,7,9,9,1,1,0,1,1,9,9,9,7,7,9,9,9,1,1,0,0,0,1,1,9,9,9,9,9,9,1,1,0,0,0,0,5,1,1,7,9,9,7,1,1,5,0,0,0,1,1,2,1,1,9,9,1,1,2,2,1,0,0,0,0,0,0,1,9,9,1,0,0,0,0,0,2504,0,0,1,3,3,3,3,3,3,1,0,0,2504,2501,2504,0,0,0,0,0,0,0,0,0,0,2504,2501,2501,2501,2503,0,0,0,5000,5000,0,0,0,2503,2501,2501,1,1,1,2,2,2,2,2,2,2,2,1,1,1&axes=0&bullets=0&rockets=0&blocks=0&pushes=0&kamikazes=0&info=Get out of the way use your shots wisely&moves=-1&name=Rolling Stone";
maps[7] = "width=30&height=12&map=0,0,0,0,0,0,0,0,9,9,9,9,9,9,2502,0,10,0,0,0,0,10,3,3,3,3,3,10,5,0,0,0,0,0,0,0,0,3,3,9,9,9,9,9,1,3,3,0,0,0,0,3,3,1,0,0,3,3,5,2500,0,0,0,0,0,0,0,0,3,9,9,9,9,9,1,0,0,0,0,0,0,3,3,1,0,0,0,3,3,1,0,0,0,0,0,0,0,0,3,9,9,9,9,1,0,0,0,0,0,0,0,3,3,1,0,0,0,0,3,1,0,0,0,0,0,0,0,0,3,9,9,9,9,1,0,1,1,1,1,0,1,1,1,1,3,3,2,1,3,1,0,0,0,0,0,0,0,0,3,9,9,1,1,1,0,1,1,1,1,4,3,3,3,3,3,2,1,3,3,1,5000,0,0,0,0,0,0,0,3,9,9,1,1,1,0,1,1,1,1,3,3,3,3,3,2,1,3,3,1,1,1,1,1,1,1,1,0,0,3,1,1,1,1,1,0,1,1,1,1,2,2,2,2,2,1,1,3,1,1,1,1,1,1,1,1,1,0,0,3,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,3,3,3,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1&axes=0&bullets=1&rockets=0&blocks=0&pushes=0&kamikazes=0&info=Use the arrow keys to look around the level and be sure to plan ahead!&moves=-1&name=Road Ahead";
gotoAndPlay ("intro");
Frame 26
border = createBorder(_root, 1, stw + 2, sth + 3);
border._x = (border._y = -16);
soundBoard = new Object();
soundBoard.soundNum = 0;
soundBoard.soundBoardClip = createEmptyMovieClip("soundBoardClip", 32);
soundBoard.sounds = new Array();
soundBoard.newSound = function (name) {
var _local2 = 0;
while (_local2 < this.sounds.length) {
if (this.sounds[_local2].name == name) {
return(this.sounds[_local2].tsound);
}
_local2++;
}
var _local3 = this.soundBoardClip.createEmptyMovieClip("SoundClip_" + this.soundNum, this.soundNum);
var _local4;
_local4 = (this.soundBoardClip["Sound_" + this.soundNum] = new Sound(_local3));
_local4.attachSound(name);
this.soundNum++;
this.sounds.push({name:name, tsound:_local4});
return(_local4);
};
soundBoard.getSound = soundBoard.newSound;
soundBoard.start = function (name, secondsOffset, loops) {
if (sounds) {
var _local2 = 0;
while (_local2 < this.sounds.length) {
if (this.sounds[_local2].name == name) {
this.sounds[_local2].tsound.start(secondsOffset, loops);
break;
}
_local2++;
}
}
};
soundBoard.stop = function (name) {
var _local2 = 0;
while (_local2 < this.sounds.length) {
if (this.sounds[_local2].name == name) {
this.sounds[_local2].tsound.stop();
break;
}
_local2++;
}
};
soundBoard.stopAll = function () {
var _local2 = 0;
while (_local2 < this.sounds.length) {
this.sounds[_local2].tsound.stop();
_local2++;
}
};
sMusic = soundBoard.newSound("sMusic");
soundBoard.start("sMusic", 0, 999999);
soundBoard.newSound("sLinker");
soundBoard.newSound("sClick");
soundBoard.newSound("sClimb");
soundBoard.newSound("sWalk");
soundBoard.newSound("sBoom");
soundBoard.newSound("sShoot");
soundBoard.newSound("sJump");
soundBoard.newSound("sRocket");
soundBoard.newSound("sAmmo");
soundBoard.newSound("sDig");
soundBoard.newSound("sFall");
Frame 34
menustuff.start.stop();
menustuff.sound.stop();
if (sounds) {
menustuff.sound.checked.gotoAndStop(1);
} else {
menustuff.sound.checked.gotoAndStop(2);
}
menustuff.start.onRollOver = function () {
this.gotoAndStop(2);
};
menustuff.start.onRollOut = (menustuff.start.onDragOut = function () {
this.gotoAndStop(1);
});
menustuff.start.onRelease = function () {
soundBoard.start("sClick", 0, 0);
brief = true;
level = 0;
gotoAndStop ("game");
};
menustuff.sound.onRollOver = function () {
this.gotoAndStop(2);
};
menustuff.sound.onRollOut = (menustuff.start.onDragOut = function () {
this.gotoAndStop(1);
});
menustuff.sound.onRelease = function () {
sounds = !sounds;
if (sounds) {
soundBoard.start("sMusic", 0, 99999);
menustuff.sound.checked.gotoAndStop(1);
} else {
sMusic = soundBoard.stopAll();
menustuff.sound.checked.gotoAndStop(2);
}
};
menustuff.demo.onRollOver = function () {
this.gotoAndStop(2);
};
menustuff.demo.onRollOut = (menustuff.start.onDragOut = function () {
this.gotoAndStop(1);
});
menustuff.demo.onRelease = function () {
gotoAndStop ("upsell2");
};
Frame 40
stop();
Frame 45
hit.onRelease = function () {
if (level >= maps.length) {
gotoAndStop ("upsell");
} else {
brief = true;
gotoAndStop ("game");
}
};
level++;
border = createBorder(_root, 1, stw + 2, sth + 3);
border._x = (border._y = -16);
Frame 50
hit.onRelease = function () {
gotoAndStop ("game");
};
border = createBorder(_root, 1, stw + 2, sth + 3);
border._x = (border._y = -16);
Frame 55
hit.onRelease = function () {
gotoAndPlay ("menustart");
};
Frame 60
hit.onRelease = function () {
gotoAndPlay ("menustart");
};
Frame 65
startGame(maps[level], level);
Symbol 27 MovieClip [inflatable] Frame 18
stop();
Symbol 56 MovieClip [boom] Frame 6
removeMovieClip("");
Symbol 67 MovieClip [boom3x3] Frame 9
removeMovieClip("");
Symbol 72 MovieClip [boomCross] Frame 9
removeMovieClip("");
Symbol 85 MovieClip [boomlinker] Frame 7
removeMovieClip("");
Symbol 157 MovieClip [clickHere] Frame 9
gotoAndPlay (1);
Symbol 157 MovieClip [clickHere] Frame 18
gotoAndPlay (10);
Symbol 232 MovieClip Frame 4
_parent.gotoAndStop(1);
Symbol 376 MovieClip Frame 1
stop();
Symbol 445 MovieClip Frame 1
stop();