Frame 1
function killstuff() {
removeMovieClip(tank);
removeMovieClip(ctank);
}
killstuff();
Frame 2
stop();
killstuff();
hit = "waka";
if (hit != "waka") {
gotoAndStop ("instructions");
}
Frame 3
stop();
_global.c = "nothing";
Frame 5
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 6
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 7
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 8
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 9
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 10
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local5 = -10;
while (_local5 <= 20) {
var _local7 = _local5 + 2500;
var _local2 = "projectile" + _local7;
var _local13 = Math.ceil(_root[_local2]._x / game.spacing);
var _local11 = Math.ceil(_root[_local2]._y / game.spacing);
var _local6 = (("block" + _local13) + "_") + _local11;
var _local12 = Math.ceil(ctank._x / game.spacing);
var _local9 = Math.ceil(ctank._x / game.spacing);
var _local4 = game.path[(("block" + _local12) + "_") + _local9];
var _local3 = _root[_local2];
var _local8 = game.path[_local6];
var _local10 = game[_local6];
if (_local3.hitTest(_local8)) {
if (_local10.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local6, 1);
}
if (_local3.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
n = 1;
while (n <= game.sections) {
_local4 = "bit" + n;
if (_local3.hitTest(_root[_local4])) {
killWorm(game.sections);
}
n = n + 2;
}
_local5++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start();
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function createWorm(sections) {
attachMovie("Wormhead", "head", 1900);
head._x = random(570);
head._y = random(570);
i = 1751;
while (i <= (sections + 1750)) {
var _local3 = i - 1750;
var _local2 = "bit" + _local3;
attachMovie("Wormbits", _local2, i);
_root[_local2]._yscale = (_root[_local2]._xscale = ((Math.sin(30 + ((_local3 / sections) * 70)) * 20) + 80) - ((_local3 / sections) * 70));
if ((_root[_local2]._xscale < 30) && (_local3 < (sections - 4))) {
_root[_local2]._yscale = (_root[_local2]._xscale = 30);
}
i++;
}
bit1._x = head._x;
bit1._y = head._y;
}
function moveHead(dir) {
if (dir == 0) {
head._x = head._x + ((game.speed * 2) + 1);
head._rotation = 0;
} else if (dir == 1) {
head._x = head._x - ((game.speed * 2) + 1);
head._rotation = 180;
} else if (dir == 2) {
head._y = head._y + ((game.speed * 2) + 1);
head._rotation = 90;
} else if (dir == 3) {
head._y = head._y - ((game.speed * 2) + 1);
head._rotation = 270;
}
}
function moveBits(sections) {
n = sections;
while (n >= 1) {
var _local4 = n + 1750;
var _local2 = "bit" + n;
if (n != 1) {
var _local3 = "bit" + (n - 1);
_root[_local2]._x = _root[_local3]._x;
_root[_local2]._y = _root[_local3]._y;
_root[_local2]._rotation = _root[_local3]._rotation;
} else {
_root[_local2]._x = head._x;
_root[_local2]._y = head._y;
_root[_local2]._rotation = head._rotation;
}
n--;
}
}
function headReactions() {
blockx = Math.ceil(head._x / game.spacing);
blocky = Math.ceil(head._y / game.spacing);
name = (("block" + blockx) + "_") + blocky;
tempBlock = game[name];
if (tempBlock.type == 2) {
changeColor(name, 1);
} else if (tempBlock.type == 1) {
changeColor(name, 2);
}
}
function killWorm(sectionNum) {
notalive = true;
killing = true;
var _local3 = "explode" + currentBit;
var _local2 = "bit" + currentBit;
var _local4 = currentBit + 1;
var _local5 = "bit" + _local4;
attachMovie("explode", _local3, currentBit + 100);
_root[_local3]._x = _root[_local2]._x;
_root[_local3]._y = _root[_local2]._y;
_root[_local3]._xscale = _root[_local2]._xscale;
_root[_local3]._yscale = _root[_local2]._yscale;
removeMovieClip(_local2);
removeMovieClip(head);
if (currentBit >= 1) {
currentBit--;
} else {
currentBit = sectionNum;
killing = false;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
function rollAgain(randIn) {
var _local1 = randIn;
if (_local1 == 0) {
var _local2 = 1;
} else if (_local1 == 1) {
var _local2 = 0;
} else if (_local1 == 2) {
var _local2 = 3;
} else if (_local1 == 3) {
var _local2 = 2;
}
randfour = random(4);
if (randfour == _local2) {
rollAgain(_local1);
}
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
game.sections = 50;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
cfdelay = cfdelay - 1;
wdelay = wdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = random(20) + 10;
var _local1 = compSmarts(ctank._x, ctank._y);
}
if ((cfdelay <= 0) && (Cexists)) {
cfdelay = 20;
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cfdelay * 5);
if (cbar._width >= 60) {
cbar._width = 60;
}
if ((random(300) == 1) && (notalive)) {
notalive = false;
createWorm(game.sections);
}
if (wdelay <= 0) {
wdelay = random(20) + 10;
rollAgain(randfour);
}
if (head._x < 25) {
head._x = 25;
randfour = 3;
}
if (head._y > 545) {
head._y = 545;
randfour = 1;
}
if (head._x > 545) {
head._x = 545;
randfour = 2;
}
if (head._y < 25) {
head._y = 25;
randfour = 0;
}
moveBits(game.sections);
moveHead(randfour);
if (!notalive) {
headReactions();
}
if (killing) {
killWorm(game.sections);
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = random(30);
cfdelay = 33;
wdelay = random(30);
Cexists = true;
notalive = true;
killing = false;
currentBit = game.sections;
randfour = 3;
Frame 11
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 12
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 13
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 14
function buildgrid() {
var _local2 = 1;
while (_local2 <= 10) {
var _local1 = 1;
while (_local1 <= 10) {
var _local3 = (("block" + _local1) + "_") + _local2;
var _local6 = (_local1 - 1) * game.spacing;
var _local5 = (_local2 - 1) * game.spacing;
game.path.attachMovie("block", _local3, ++game.depth);
game.path[_local3]._x = _local6;
game.path[_local3]._y = _local5;
if (_local2 <= _local1) {
if ((_local1 > 7) && (_local2 <= 3)) {
var _local7 = 2;
} else {
var _local7 = 1;
}
} else if ((_local1 <= 3) && (_local2 > 7)) {
var _local7 = 1;
} else {
var _local7 = 2;
}
if (_local1 == _local2) {
var _local7 = 3;
}
changeColor(_local3, _local7);
game[_local3] = {x:_local1, y:_local2, name:_local3, type:_local7, clip:game.path[_local3]};
_local1++;
}
_local2++;
}
}
function pbCollDet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2500;
var _local2 = "projectile" + _local6;
var _local12 = Math.ceil(_root[_local2]._x / game.spacing);
var _local10 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local12) + "_") + _local10;
var _local11 = Math.ceil(ctank._x / game.spacing);
var _local8 = Math.ceil(ctank._x / game.spacing);
var _local13 = game.path[(("block" + _local11) + "_") + _local8];
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local9 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local9.type != 1) {
removeMovieClip(_local2);
}
changeColor(_local4, 1);
}
if (_local5.hitTest(ctank)) {
attachMovie("explode", "explode", 2700);
explode._x = ctank._x;
explode._y = ctank._y;
removeMovieClip(ctank);
removeMovieClip(_local2);
Cexists = false;
gotoAndStop ("success");
}
_local3++;
}
}
function moveTank(dir) {
if (dir == "right") {
tank._rotation = 0;
var _local5 = tank._x + nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x + game.speed;
} else if (dir == "left") {
tank._rotation = 180;
var _local5 = tank._x - nose2;
var _local3 = tank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._x = tank._x - game.speed;
} else if (dir == "up") {
tank._rotation = 270;
var _local5 = tank._x;
var _local3 = tank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y - game.speed;
} else if (dir == "down") {
tank._rotation = 90;
var _local5 = tank._x;
var _local3 = tank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 1) {
return(undefined);
}
tank._y = tank._y + game.speed;
}
}
function compSmarts(tempx, tempy) {
var _local8 = Math.ceil(tempx / game.spacing);
var _local6 = Math.ceil(tempy / game.spacing);
var _local14 = game[(("block" + _local8) + "_") + _local6];
var _local4 = Math.ceil(ob.tempx / game.spacing);
var _local5 = Math.ceil(ob.tempy / game.spacing);
var _local3 = game[(("block" + _local4) + "_") + _local5];
if ((_local3.type != 2) || (cdelay < 0)) {
cdelay = 33;
tempx = x;
tempy = y;
var _local11 = dir;
var _local15 = 0;
var _local9 = 0;
var _local10 = Math.abs(speed);
var _local1 = (tank._x - ctank._x) / Math.abs(tank._x - ctank._x);
var _local2 = (tank._y - ctank._y) / Math.abs(tank._y - ctank._y);
if ((_local1 == _local2) || (_local1 == (-_local2))) {
var _local7 = random(2);
if (_local7 == 0) {
_local1 = 0;
} else {
_local2 = 0;
}
}
if (_local1 != 0) {
_local9 = 0;
_local15 = _local1 * game.speed;
if (_local15 > 0) {
var dir = "right";
} else {
var dir = "left";
}
} else if (_local2 != 0) {
_local15 = 0;
_local9 = _local2 * game.speed;
if (_local9 > 0) {
var dir = "down";
} else {
var dir = "up";
}
}
moveCtank(dir);
}
}
function compFire() {
var _local9 = new Sound();
_local9.attachSound("438476_SOUNDDOGS_HA.mp3", "fire");
fire.start;
var _local14 = ctank._x;
var _local13 = ctank._y;
var _local4 = (ctank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local4);
var _local6 = Math.sin(_local4);
var _local12 = nose * _local7;
var _local11 = nose * _local6;
var _local16 = _local14 + _local12;
var _local15 = _local13 + _local11;
var _local10 = ctank._rotation;
if (cdepth > 2610) {
var _local5 = cdepth;
cdepth = 2599;
} else {
var _local5 = cdepth;
cdepth = cdepth + 1;
}
var _local8 = "cprojectile" + _local5;
var _local3 = _root.attachMovie("cprojectile", _local8, _local5);
_local3._x = _local16;
_local3._y = _local15;
_local3._rotation = _local10;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local6;
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
function Cpbcolldet() {
var _local3 = -10;
while (_local3 <= 20) {
var _local6 = _local3 + 2600;
var _local2 = "cprojectile" + _local6;
var _local10 = Math.ceil(_root[_local2]._x / game.spacing);
var _local9 = Math.ceil(_root[_local2]._y / game.spacing);
var _local4 = (("block" + _local10) + "_") + _local9;
var _local5 = _root[_local2];
var _local7 = game.path[_local4];
var _local8 = game[_local4];
if (_local5.hitTest(_local7)) {
if (_local8.type != 2) {
removeMovieClip(_local2);
}
changeColor(_local4, 2);
}
if (_local5.hitTest(tank)) {
attachMovie("explode", "explode", 2700);
explode._x = tank._x;
explode._y = tank._y;
removeMovieClip(tank);
removeMovieClip(_local2);
gotoAndStop ("failure");
}
_local3++;
}
}
function moveCtank(dir) {
if (dir == "right") {
ctank._rotation = 0;
var _local5 = ctank._x + nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x + game.speed;
} else if (dir == "left") {
ctank._rotation = 180;
var _local5 = ctank._x - nose2;
var _local3 = ctank._y;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._x = ctank._x - game.speed;
}
if (dir == "up") {
ctank._rotation = 270;
var _local5 = ctank._x;
var _local3 = ctank._y - nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y - game.speed;
} else if (dir == "down") {
ctank._rotation = 90;
var _local5 = ctank._x;
var _local3 = ctank._y + nose2;
var _local6 = Math.ceil(_local5 / game.spacing);
var _local4 = Math.ceil(_local3 / game.spacing);
var _local2 = game[(("block" + _local6) + "_") + _local4];
if (_local2.type != 2) {
return(undefined);
}
ctank._y = ctank._y + game.speed;
}
}
function changeColor(block, type) {
game.path[block].gotoAndStop(type);
game.path[block].inblock.gotoAndStop(chosenColor);
game[block].type = type;
}
_root.stop();
chosenColor = _global.c;
tank.gotoAndStop(chosenColor);
bar.gotoAndStop(chosenColor);
game = {};
game.depth = 1000;
game.spacing = 57;
game.speed = 5;
game.dificulty = 1;
game.path = _root.grid;
buildgrid();
tank.swapDepths(2000);
ctank.swapDepths(2001);
var keyLis = new Object();
Key.addListener(keyLis);
keyLis.onKeyDown = function () {
if (Key.isDown(32)) {
if (delay < 0) {
delay = 33;
var _local10 = tank._x;
var _local9 = tank._y;
var _local6 = (tank._rotation * Math.PI) / 180;
var _local7 = Math.cos(_local6);
var _local5 = Math.sin(_local6);
var _local13 = nose * _local7;
var _local12 = nose * _local5;
var _local15 = _local10 + _local13;
var _local14 = _local9 + _local12;
var _local11 = tank._rotation;
if (depth <= 2510) {
var _local4 = depth;
depth = depth + 1;
} else {
var _local4 = depth;
depth = 2499;
}
var _local8 = "projectile" + _local4;
var _local3 = _root.attachMovie("projectile", _local8, _local4);
_local3._x = _local15;
_local3._y = _local14;
_local3._rotation = _local11;
_local3.xmov = speed * _local7;
_local3.ymov = speed * _local5;
_local3.inProj.gotoAndStop(chosenColor);
_local3.onEnterFrame = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
};
}
}
};
onEnterFrame = function () {
pbCollDet();
Cpbcolldet();
delay = delay - 1;
cdelay = cdelay - 1;
if ((cdelay <= 0) && (Cexists)) {
cdelay = game.dificulty;
var _local1 = compSmarts(ctank._x, ctank._y);
compFire();
}
if (ctank._rotation == 0) {
moveCtank("right");
} else if (ctank._rotation == 90) {
moveCtank("down");
} else if (ctank._rotation == 180) {
moveCtank("left");
}
if (((ctank._rotation != 0) && (ctank._rotation != 90)) && (ctank._rotation != 180)) {
moveCtank("up");
}
if (Key.isDown(37)) {
moveTank("left");
} else if (Key.isDown(39)) {
moveTank("right");
} else if (Key.isDown(38)) {
moveTank("up");
} else if (Key.isDown(40)) {
moveTank("down");
}
bar._xscale = 100 - (delay * 3);
if (bar._width >= 60) {
bar._width = 60;
}
cbar._xscale = 100 - (cdelay * 3);
if (cbar._width >= 60) {
cbar._width = 60;
}
};
newdepth = 0;
depth = 2500;
cdepth = 2600;
speed = 7;
nose = (tank._height / 2) + 6;
nose2 = tank._height / 2;
delay = 20;
cdelay = 20;
Cexists = true;
Frame 15
stop();
Frame 16
notalive = false;
removeMovieClip(ctank);
removeMovieClip(head);
n = game.sections;
while (n >= 1) {
var name = ("bit" + n);
removeMovieClip(name);
n--;
}
Frame 17
notalive = false;
removeMovieClip(tank);
removeMovieClip(head);
n = game.sections;
while (n >= 1) {
var name = ("bit" + n);
removeMovieClip(name);
n--;
}
Symbol 34 MovieClip Frame 18
stop();
Symbol 39 MovieClip [explode] Frame 41
_root.gotoAndStop("win");
this.removeMovieClip;
Symbol 39 MovieClip [explode] Frame 42
stop();
Symbol 47 MovieClip [tank] Frame 1
stop();
Symbol 55 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 2
stop();
Symbol 75 MovieClip Frame 3
stop();
Symbol 75 MovieClip Frame 4
stop();
Symbol 75 MovieClip Frame 5
stop();
Symbol 75 MovieClip Frame 6
stop();
Symbol 75 MovieClip Frame 7
stop();
Symbol 78 MovieClip [block] Frame 1
stop();
Symbol 99 Button
on (release) {
gotoAndPlay (58);
}
Symbol 103 Button
on (release) {
gotoAndPlay (1);
}
Symbol 109 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
gotoAndPlay ("loaded");
}
Symbol 109 MovieClip Frame 2
onEnterFrame = function () {
_root.gotoAndPlay("fudge");
};
Symbol 109 MovieClip Frame 57
stop();
Symbol 109 MovieClip Frame 112
_root.play();
Symbol 113 MovieClip Frame 1
block.gotoAndStop("blue");
Symbol 133 Button
on (release) {
_root.play();
}
Symbol 135 Button
on (release) {
_root.gotoAndStop("instructions");
}
Symbol 136 MovieClip Frame 24
stop();
Symbol 138 Button
on (press) {
select._x = r._x;
select._y = r._y;
samptank.gotoAndStop(1);
if ((select._x = r._x)) {
_global.c = 1;
}
}
Symbol 140 Button
on (press) {
select._x = o._x;
select._y = o._y;
samptank.gotoAndStop(2);
if ((select._x = o._x)) {
_global.c = 2;
}
}
Symbol 142 Button
on (press) {
select._x = y._x;
select._y = y._y;
samptank.gotoAndStop(3);
if ((select._x = y._x)) {
_global.c = 3;
}
}
Symbol 144 Button
on (press) {
select._x = g._x;
select._y = g._y;
samptank.gotoAndStop(4);
if ((select._x = g._x)) {
_global.c = 4;
}
}
Symbol 146 Button
on (press) {
select._x = b._x;
select._y = b._y;
samptank.gotoAndStop(5);
if ((select._x = b._x)) {
_global.c = 5;
}
}
Symbol 148 Button
on (press) {
select._x = p._x;
select._y = p._y;
samptank.gotoAndStop(6);
if ((select._x = p._x)) {
_global.c = 6;
}
}
Symbol 150 Button
on (press) {
select._x = w._x;
select._y = w._y;
samptank.gotoAndStop(7);
if ((select._x = w._x)) {
_global.c = 7;
}
}
Symbol 156 Button
on (release) {
if (_global.c != "nothing") {
gotoAndStop ("l6");
} else {
gotoAndStop ("error");
}
}
Symbol 160 Button
on (press) {
select._x = rand._x;
select._y = rand._y;
samptank.gotoAndPlay(2);
if ((select._x = rand._x)) {
_global.c = random(7) + 1;
}
}
Symbol 167 Button
on (release) {
gotoAndStop ("choose");
}
Symbol 176 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 186 Button
on (release) {
_root.gotoAndStop("menu");
}
Symbol 189 Button
on (release) {
play();
}
Symbol 192 Button
on (release) {
prevFrame();
}
Symbol 202 MovieClip Frame 140
gotoAndPlay (1);
Symbol 229 MovieClip Frame 1
stop();
Symbol 229 MovieClip Frame 2
stop();
Symbol 229 MovieClip Frame 3
stop();
Symbol 229 MovieClip Frame 4
stop();
Symbol 229 MovieClip Frame 5
stop();
Symbol 229 MovieClip Frame 6
stop();
Symbol 235 MovieClip Frame 10
stop();
Symbol 236 Button
on (release) {
gotoAndStop ("menu");
}
Symbol 243 MovieClip Frame 50
stop();