Frame 35
stop();
Frame 43
function initmazegrid(x, y) {
var i;
var j;
maze = new Object(y);
j = 0;
while (j < y) {
maze[j] = new Array(x);
i = 0;
while (i < x) {
if (((i % 2) != 0) && ((j % 2) != 0)) {
maze[j][i] = 0;
} else {
maze[j][i] = 1;
}
i++;
}
j++;
}
mazedepth = new Object(y);
j = 0;
while (j < y) {
mazedepth[j] = new Array(x);
i = 0;
while (i < x) {
mazedepth[j][i] = -1;
i++;
}
j++;
}
}
function knockcell(x, y, px, py, pdepth) {
var choice;
var cx;
var cy;
var wx;
var wy;
var neighborsx = new Array(-2, 0, 2, 0);
var neighborsy = new Array(0, -2, 0, 2);
var depth = (pdepth + 2);
_root.maze_visited[(y * _root.maze_width) + x] = 1;
if (px != undefined) {
wx = (x + px) / 2;
wy = (y + py) / 2;
_root.maze[wy][wx] = 0;
_root.mazedepth[wy][wx] = depth - 1;
_root.mazedepth[y][x] = depth;
if (_root.maxdepth < depth) {
_root.maxdepth = depth;
_root.end_x = x;
_root.end_y = y;
}
}
while (0 < neighborsx.length) {
choice = Math.floor(Math.random() * neighborsx.length);
cx = neighborsx[choice];
cy = neighborsy[choice];
neighborsx.splice(choice, 1);
neighborsy.splice(choice, 1);
if (((((x + cx) < _root.maze_width) and ((y + cy) < _root.maze_height)) and (0 < (x + cx))) and (0 < (y + cy))) {
if (_root.maze_visited[((y + cy) * _root.maze_width) + (x + cx)] != 1) {
if (px != undefined) {
if (int(random(6)) == 1) {
return;
}
}
knockcell(x + cx, y + cy, x, y, depth);
}
}
}
}
function randomcoord(dir) {
if (dir == "x") {
return((Math.floor(Math.random() * ((maze_width - 1) / 2)) * 2) + 1);
}
return((Math.floor(Math.random() * ((maze_height - 1) / 2)) * 2) + 1);
}
function placecredits(cnum) {
var i;
var crx;
var cry;
i = 1;
while (cnum >= i) {
totalcredits++;
crx = randomcoord("x");
cry = randomcoord("y");
if (maze[cry][crx] != -1) {
mazeclip.attachMovie("credit", (("credit_" + crx) + "_") + cry, ((totalblocks + 4) + totalbadguys) + i);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _x , crx * 16);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _y , cry * 16);
maze[cry][crx] = -1;
}
i++;
}
}
function placebadguys(bg) {
var i;
var bgx;
var bgy;
trace("placing bad guys");
totalbadguys++;
mazeclip.attachMovie("enemya", "enemy0", totalblocks + 3);
mazeclip.enemy0.xpos = end_x;
mazeclip.enemy0.ypos = end_y;
i = 1;
while (bg >= i) {
totalbadguys++;
badguytype = Math.floor(Math.random() * 2);
bgx = randomcoord("x");
bgy = randomcoord("y");
while (mazedepth[bgy][bgx] < 8) {
bgx = randomcoord("x");
bgy = randomcoord("y");
}
if (badguytype == 1) {
mazeclip.attachMovie("enemya", "enemy" + i, (totalblocks + 3) + i);
} else {
mazeclip.attachMovie("enemyb", "enemy" + i, (totalblocks + 3) + i);
}
Set(("mazeclip.enemy" + i) + ".xpos", bgx);
Set(("mazeclip.enemy" + i) + ".ypos", bgy);
i++;
}
}
maze_height = 17;
maze_width = 17;
maze_visited = new Array(maze_width * maze_height);
maxdepth = 0;
totalblocks = 0;
totalbadguys = 0;
totalcredits = 0;
initmazegrid(maze_width, maze_height);
start_x = randomcoord("x");
start_y = randomcoord("y");
setProperty("mazeclip", _x , 96 - (start_x * 16));
setProperty("mazeclip", _y , 96 - (start_y * 16));
knockcell(start_x, start_y);
Frame 44
j = 0;
done = false;
Frame 46
i = 0;
while (i < maze_width) {
if (maze[j][i] == 1) {
totalblocks++;
mazeclip.attachMovie("block", (("block_" + i) + "_") + j, totalblocks);
setProperty((("mazeclip.block_" + i) + "_") + j, _x , i * 16);
setProperty((("mazeclip.block_" + i) + "_") + j, _y , j * 16);
}
i++;
}
if (j != maze_height) {
j++;
} else {
done = true;
}
if (!done) {
gotoAndPlay (45);
} else {
mazeclip.attachMovie("start", (("block_" + start_x) + "_") + start_y, totalblocks + 1);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _x , start_x * 16);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _y , start_y * 16);
mazeclip.attachMovie("end", (("block_" + end_x) + "_") + end_y, totalblocks + 2);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _x , end_x * 16);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _y , end_y * 16);
}
Frame 47
placecredits(16);
Frame 48
placebadguys(5);
Frame 49
stop();
Frame 50
stop();
Frame 51
stop();
Frame 52
function initmazegrid(x, y) {
var i;
var j;
maze = new Object(y);
j = 0;
while (j < y) {
maze[j] = new Array(x);
i = 0;
while (i < x) {
if (((i % 2) != 0) && ((j % 2) != 0)) {
maze[j][i] = 0;
} else {
maze[j][i] = 1;
}
i++;
}
j++;
}
mazedepth = new Object(y);
j = 0;
while (j < y) {
mazedepth[j] = new Array(x);
i = 0;
while (i < x) {
mazedepth[j][i] = -1;
i++;
}
j++;
}
}
function knockcell(x, y, px, py, pdepth) {
var choice;
var cx;
var cy;
var wx;
var wy;
var neighborsx = new Array(-2, 0, 2, 0);
var neighborsy = new Array(0, -2, 0, 2);
var depth = (pdepth + 2);
_root.maze_visited[(y * _root.maze_width) + x] = 1;
if (px != undefined) {
wx = (x + px) / 2;
wy = (y + py) / 2;
_root.maze[wy][wx] = 0;
_root.mazedepth[wy][wx] = depth - 1;
_root.mazedepth[y][x] = depth;
if (_root.maxdepth < depth) {
_root.maxdepth = depth;
_root.end_x = x;
_root.end_y = y;
}
}
while (0 < neighborsx.length) {
choice = Math.floor(Math.random() * neighborsx.length);
cx = neighborsx[choice];
cy = neighborsy[choice];
neighborsx.splice(choice, 1);
neighborsy.splice(choice, 1);
if (((((x + cx) < _root.maze_width) and ((y + cy) < _root.maze_height)) and (0 < (x + cx))) and (0 < (y + cy))) {
if (_root.maze_visited[((y + cy) * _root.maze_width) + (x + cx)] != 1) {
if (px != undefined) {
if (int(random(6)) == 1) {
return;
}
}
knockcell(x + cx, y + cy, x, y, depth);
}
}
}
}
function randomcoord(dir) {
if (dir == "x") {
return((Math.floor(Math.random() * ((maze_width - 1) / 2)) * 2) + 1);
}
return((Math.floor(Math.random() * ((maze_height - 1) / 2)) * 2) + 1);
}
function placecredits(cnum) {
var i;
var crx;
var cry;
i = 1;
while (cnum >= i) {
totalcredits++;
crx = randomcoord("x");
cry = randomcoord("y");
if (maze[cry][crx] != -1) {
mazeclip.attachMovie("credit", (("credit_" + crx) + "_") + cry, ((totalblocks + 4) + totalbadguys) + i);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _x , crx * 16);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _y , cry * 16);
maze[cry][crx] = -1;
}
i++;
}
}
function placebadguys(bg) {
var i;
var bgx;
var bgy;
trace("placing bad guys");
totalbadguys++;
mazeclip.attachMovie("enemya", "enemy0", totalblocks + 3);
mazeclip.enemy0.xpos = end_x;
mazeclip.enemy0.ypos = end_y;
i = 1;
while (bg >= i) {
totalbadguys++;
badguytype = Math.floor(Math.random() * 2);
bgx = randomcoord("x");
bgy = randomcoord("y");
while (mazedepth[bgy][bgx] < 8) {
bgx = randomcoord("x");
bgy = randomcoord("y");
}
if (badguytype == 1) {
mazeclip.attachMovie("enemya", "enemy" + i, (totalblocks + 3) + i);
} else {
mazeclip.attachMovie("enemyb", "enemy" + i, (totalblocks + 3) + i);
}
Set(("mazeclip.enemy" + i) + ".xpos", bgx);
Set(("mazeclip.enemy" + i) + ".ypos", bgy);
i++;
}
}
maze_height = 17;
maze_width = 17;
maze_visited = new Array(maze_width * maze_height);
maxdepth = 0;
totalblocks = 0;
totalbadguys = 0;
totalcredits = 0;
initmazegrid(maze_width, maze_height);
start_x = randomcoord("x");
start_y = randomcoord("y");
setProperty("mazeclip", _x , 96 - (start_x * 16));
setProperty("mazeclip", _y , 96 - (start_y * 16));
knockcell(start_x, start_y);
Frame 53
j = 0;
done = false;
Frame 55
i = 0;
while (i < maze_width) {
if (maze[j][i] == 1) {
totalblocks++;
mazeclip.attachMovie("block", (("block_" + i) + "_") + j, totalblocks);
setProperty((("mazeclip.block_" + i) + "_") + j, _x , i * 16);
setProperty((("mazeclip.block_" + i) + "_") + j, _y , j * 16);
}
i++;
}
if (j != maze_height) {
j++;
} else {
done = true;
}
if (!done) {
gotoAndPlay (54);
} else {
mazeclip.attachMovie("start", (("block_" + start_x) + "_") + start_y, totalblocks + 1);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _x , start_x * 16);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _y , start_y * 16);
mazeclip.attachMovie("end", (("block_" + end_x) + "_") + end_y, totalblocks + 2);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _x , end_x * 16);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _y , end_y * 16);
}
Frame 56
placecredits(16);
Frame 57
placebadguys(5);
Frame 58
stop();
Frame 59
stop();
Frame 60
stop();
Frame 61
function initmazegrid(x, y) {
var i;
var j;
maze = new Object(y);
j = 0;
while (j < y) {
maze[j] = new Array(x);
i = 0;
while (i < x) {
if (((i % 2) != 0) && ((j % 2) != 0)) {
maze[j][i] = 0;
} else {
maze[j][i] = 1;
}
i++;
}
j++;
}
mazedepth = new Object(y);
j = 0;
while (j < y) {
mazedepth[j] = new Array(x);
i = 0;
while (i < x) {
mazedepth[j][i] = -1;
i++;
}
j++;
}
}
function knockcell(x, y, px, py, pdepth) {
var choice;
var cx;
var cy;
var wx;
var wy;
var neighborsx = new Array(-2, 0, 2, 0);
var neighborsy = new Array(0, -2, 0, 2);
var depth = (pdepth + 2);
_root.maze_visited[(y * _root.maze_width) + x] = 1;
if (px != undefined) {
wx = (x + px) / 2;
wy = (y + py) / 2;
_root.maze[wy][wx] = 0;
_root.mazedepth[wy][wx] = depth - 1;
_root.mazedepth[y][x] = depth;
if (_root.maxdepth < depth) {
_root.maxdepth = depth;
_root.end_x = x;
_root.end_y = y;
}
}
while (0 < neighborsx.length) {
choice = Math.floor(Math.random() * neighborsx.length);
cx = neighborsx[choice];
cy = neighborsy[choice];
neighborsx.splice(choice, 1);
neighborsy.splice(choice, 1);
if (((((x + cx) < _root.maze_width) and ((y + cy) < _root.maze_height)) and (0 < (x + cx))) and (0 < (y + cy))) {
if (_root.maze_visited[((y + cy) * _root.maze_width) + (x + cx)] != 1) {
if (px != undefined) {
if (int(random(6)) == 1) {
return;
}
}
knockcell(x + cx, y + cy, x, y, depth);
}
}
}
}
function randomcoord(dir) {
if (dir == "x") {
return((Math.floor(Math.random() * ((maze_width - 1) / 2)) * 2) + 1);
}
return((Math.floor(Math.random() * ((maze_height - 1) / 2)) * 2) + 1);
}
function placecredits(cnum) {
var i;
var crx;
var cry;
i = 1;
while (cnum >= i) {
totalcredits++;
crx = randomcoord("x");
cry = randomcoord("y");
if (maze[cry][crx] != -1) {
mazeclip.attachMovie("credit", (("credit_" + crx) + "_") + cry, ((totalblocks + 4) + totalbadguys) + i);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _x , crx * 16);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _y , cry * 16);
maze[cry][crx] = -1;
}
i++;
}
}
function placebadguys(bg) {
var i;
var bgx;
var bgy;
trace("placing bad guys");
totalbadguys++;
mazeclip.attachMovie("enemya", "enemy0", totalblocks + 3);
mazeclip.enemy0.xpos = end_x;
mazeclip.enemy0.ypos = end_y;
i = 1;
while (bg >= i) {
totalbadguys++;
badguytype = Math.floor(Math.random() * 2);
bgx = randomcoord("x");
bgy = randomcoord("y");
while (mazedepth[bgy][bgx] < 8) {
bgx = randomcoord("x");
bgy = randomcoord("y");
}
if (badguytype == 1) {
mazeclip.attachMovie("enemya", "enemy" + i, (totalblocks + 3) + i);
} else {
mazeclip.attachMovie("enemyb", "enemy" + i, (totalblocks + 3) + i);
}
Set(("mazeclip.enemy" + i) + ".xpos", bgx);
Set(("mazeclip.enemy" + i) + ".ypos", bgy);
i++;
}
}
maze_height = 17;
maze_width = 17;
maze_visited = new Array(maze_width * maze_height);
maxdepth = 0;
totalblocks = 0;
totalbadguys = 0;
totalcredits = 0;
initmazegrid(maze_width, maze_height);
start_x = randomcoord("x");
start_y = randomcoord("y");
setProperty("mazeclip", _x , 96 - (start_x * 16));
setProperty("mazeclip", _y , 96 - (start_y * 16));
knockcell(start_x, start_y);
Frame 62
j = 0;
done = false;
Frame 64
i = 0;
while (i < maze_width) {
if (maze[j][i] == 1) {
totalblocks++;
mazeclip.attachMovie("block", (("block_" + i) + "_") + j, totalblocks);
setProperty((("mazeclip.block_" + i) + "_") + j, _x , i * 16);
setProperty((("mazeclip.block_" + i) + "_") + j, _y , j * 16);
}
i++;
}
if (j != maze_height) {
j++;
} else {
done = true;
}
if (!done) {
gotoAndPlay (63);
} else {
mazeclip.attachMovie("start", (("block_" + start_x) + "_") + start_y, totalblocks + 1);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _x , start_x * 16);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _y , start_y * 16);
mazeclip.attachMovie("end", (("block_" + end_x) + "_") + end_y, totalblocks + 2);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _x , end_x * 16);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _y , end_y * 16);
}
Frame 65
placecredits(16);
Frame 66
placebadguys(5);
Frame 67
stop();
Frame 68
stop();
Frame 69
stop();
Frame 70
function initmazegrid(x, y) {
var i;
var j;
maze = new Object(y);
j = 0;
while (j < y) {
maze[j] = new Array(x);
i = 0;
while (i < x) {
if (((i % 2) != 0) && ((j % 2) != 0)) {
maze[j][i] = 0;
} else {
maze[j][i] = 1;
}
i++;
}
j++;
}
mazedepth = new Object(y);
j = 0;
while (j < y) {
mazedepth[j] = new Array(x);
i = 0;
while (i < x) {
mazedepth[j][i] = -1;
i++;
}
j++;
}
}
function knockcell(x, y, px, py, pdepth) {
var choice;
var cx;
var cy;
var wx;
var wy;
var neighborsx = new Array(-2, 0, 2, 0);
var neighborsy = new Array(0, -2, 0, 2);
var depth = (pdepth + 2);
_root.maze_visited[(y * _root.maze_width) + x] = 1;
if (px != undefined) {
wx = (x + px) / 2;
wy = (y + py) / 2;
_root.maze[wy][wx] = 0;
_root.mazedepth[wy][wx] = depth - 1;
_root.mazedepth[y][x] = depth;
if (_root.maxdepth < depth) {
_root.maxdepth = depth;
_root.end_x = x;
_root.end_y = y;
}
}
while (0 < neighborsx.length) {
choice = Math.floor(Math.random() * neighborsx.length);
cx = neighborsx[choice];
cy = neighborsy[choice];
neighborsx.splice(choice, 1);
neighborsy.splice(choice, 1);
if (((((x + cx) < _root.maze_width) and ((y + cy) < _root.maze_height)) and (0 < (x + cx))) and (0 < (y + cy))) {
if (_root.maze_visited[((y + cy) * _root.maze_width) + (x + cx)] != 1) {
if (px != undefined) {
if (int(random(6)) == 1) {
return;
}
}
knockcell(x + cx, y + cy, x, y, depth);
}
}
}
}
function randomcoord(dir) {
if (dir == "x") {
return((Math.floor(Math.random() * ((maze_width - 1) / 2)) * 2) + 1);
}
return((Math.floor(Math.random() * ((maze_height - 1) / 2)) * 2) + 1);
}
function placecredits(cnum) {
var i;
var crx;
var cry;
i = 1;
while (cnum >= i) {
totalcredits++;
crx = randomcoord("x");
cry = randomcoord("y");
if (maze[cry][crx] != -1) {
mazeclip.attachMovie("credit", (("credit_" + crx) + "_") + cry, ((totalblocks + 4) + totalbadguys) + i);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _x , crx * 16);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _y , cry * 16);
maze[cry][crx] = -1;
}
i++;
}
}
function placebadguys(bg) {
var i;
var bgx;
var bgy;
trace("placing bad guys");
totalbadguys++;
mazeclip.attachMovie("enemya", "enemy0", totalblocks + 3);
mazeclip.enemy0.xpos = end_x;
mazeclip.enemy0.ypos = end_y;
i = 1;
while (bg >= i) {
totalbadguys++;
badguytype = Math.floor(Math.random() * 2);
bgx = randomcoord("x");
bgy = randomcoord("y");
while (mazedepth[bgy][bgx] < 8) {
bgx = randomcoord("x");
bgy = randomcoord("y");
}
if (badguytype == 1) {
mazeclip.attachMovie("enemya", "enemy" + i, (totalblocks + 3) + i);
} else {
mazeclip.attachMovie("enemyb", "enemy" + i, (totalblocks + 3) + i);
}
Set(("mazeclip.enemy" + i) + ".xpos", bgx);
Set(("mazeclip.enemy" + i) + ".ypos", bgy);
i++;
}
}
maze_height = 17;
maze_width = 17;
maze_visited = new Array(maze_width * maze_height);
maxdepth = 0;
totalblocks = 0;
totalbadguys = 0;
totalcredits = 0;
initmazegrid(maze_width, maze_height);
start_x = randomcoord("x");
start_y = randomcoord("y");
setProperty("mazeclip", _x , 96 - (start_x * 16));
setProperty("mazeclip", _y , 96 - (start_y * 16));
knockcell(start_x, start_y);
Frame 71
j = 0;
done = false;
Frame 73
i = 0;
while (i < maze_width) {
if (maze[j][i] == 1) {
totalblocks++;
mazeclip.attachMovie("block", (("block_" + i) + "_") + j, totalblocks);
setProperty((("mazeclip.block_" + i) + "_") + j, _x , i * 16);
setProperty((("mazeclip.block_" + i) + "_") + j, _y , j * 16);
}
i++;
}
if (j != maze_height) {
j++;
} else {
done = true;
}
if (!done) {
gotoAndPlay (72);
} else {
mazeclip.attachMovie("start", (("block_" + start_x) + "_") + start_y, totalblocks + 1);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _x , start_x * 16);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _y , start_y * 16);
mazeclip.attachMovie("end", (("block_" + end_x) + "_") + end_y, totalblocks + 2);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _x , end_x * 16);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _y , end_y * 16);
}
Frame 74
placecredits(16);
Frame 75
placebadguys(5);
Frame 76
stop();
Frame 77
stop();
Frame 78
stop();
Frame 80
function initmazegrid(x, y) {
var i;
var j;
maze = new Object(y);
j = 0;
while (j < y) {
maze[j] = new Array(x);
i = 0;
while (i < x) {
if (((i % 2) != 0) && ((j % 2) != 0)) {
maze[j][i] = 0;
} else {
maze[j][i] = 1;
}
i++;
}
j++;
}
mazedepth = new Object(y);
j = 0;
while (j < y) {
mazedepth[j] = new Array(x);
i = 0;
while (i < x) {
mazedepth[j][i] = -1;
i++;
}
j++;
}
}
function knockcell(x, y, px, py, pdepth) {
var choice;
var cx;
var cy;
var wx;
var wy;
var neighborsx = new Array(-2, 0, 2, 0);
var neighborsy = new Array(0, -2, 0, 2);
var depth = (pdepth + 2);
_root.maze_visited[(y * _root.maze_width) + x] = 1;
if (px != undefined) {
wx = (x + px) / 2;
wy = (y + py) / 2;
_root.maze[wy][wx] = 0;
_root.mazedepth[wy][wx] = depth - 1;
_root.mazedepth[y][x] = depth;
if (_root.maxdepth < depth) {
_root.maxdepth = depth;
_root.end_x = x;
_root.end_y = y;
}
}
while (0 < neighborsx.length) {
choice = Math.floor(Math.random() * neighborsx.length);
cx = neighborsx[choice];
cy = neighborsy[choice];
neighborsx.splice(choice, 1);
neighborsy.splice(choice, 1);
if (((((x + cx) < _root.maze_width) and ((y + cy) < _root.maze_height)) and (0 < (x + cx))) and (0 < (y + cy))) {
if (_root.maze_visited[((y + cy) * _root.maze_width) + (x + cx)] != 1) {
if (px != undefined) {
if (int(random(6)) == 1) {
return;
}
}
knockcell(x + cx, y + cy, x, y, depth);
}
}
}
}
function randomcoord(dir) {
if (dir == "x") {
return((Math.floor(Math.random() * ((maze_width - 1) / 2)) * 2) + 1);
}
return((Math.floor(Math.random() * ((maze_height - 1) / 2)) * 2) + 1);
}
function placecredits(cnum) {
var i;
var crx;
var cry;
i = 1;
while (cnum >= i) {
totalcredits++;
crx = randomcoord("x");
cry = randomcoord("y");
if (maze[cry][crx] != -1) {
mazeclip.attachMovie("credit", (("credit_" + crx) + "_") + cry, ((totalblocks + 4) + totalbadguys) + i);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _x , crx * 16);
setProperty((("mazeclip.credit_" + crx) + "_") + cry, _y , cry * 16);
maze[cry][crx] = -1;
}
i++;
}
}
function placebadguys(bg) {
var i;
var bgx;
var bgy;
trace("placing bad guys");
totalbadguys++;
mazeclip.attachMovie("enemya", "enemy0", totalblocks + 3);
mazeclip.enemy0.xpos = end_x;
mazeclip.enemy0.ypos = end_y;
i = 1;
while (bg >= i) {
totalbadguys++;
badguytype = Math.floor(Math.random() * 2);
bgx = randomcoord("x");
bgy = randomcoord("y");
while (mazedepth[bgy][bgx] < 8) {
bgx = randomcoord("x");
bgy = randomcoord("y");
}
if (badguytype == 1) {
mazeclip.attachMovie("enemya", "enemy" + i, (totalblocks + 3) + i);
} else {
mazeclip.attachMovie("enemyb", "enemy" + i, (totalblocks + 3) + i);
}
Set(("mazeclip.enemy" + i) + ".xpos", bgx);
Set(("mazeclip.enemy" + i) + ".ypos", bgy);
i++;
}
}
maze_height = 17;
maze_width = 17;
maze_visited = new Array(maze_width * maze_height);
maxdepth = 0;
totalblocks = 0;
totalbadguys = 0;
totalcredits = 0;
initmazegrid(maze_width, maze_height);
start_x = randomcoord("x");
start_y = randomcoord("y");
setProperty("mazeclip", _x , 96 - (start_x * 16));
setProperty("mazeclip", _y , 96 - (start_y * 16));
knockcell(start_x, start_y);
Frame 81
j = 0;
done = false;
Frame 83
i = 0;
while (i < maze_width) {
if (maze[j][i] == 1) {
totalblocks++;
mazeclip.attachMovie("block", (("block_" + i) + "_") + j, totalblocks);
setProperty((("mazeclip.block_" + i) + "_") + j, _x , i * 16);
setProperty((("mazeclip.block_" + i) + "_") + j, _y , j * 16);
}
i++;
}
if (j != maze_height) {
j++;
} else {
done = true;
}
if (!done) {
gotoAndPlay (82);
} else {
mazeclip.attachMovie("start", (("block_" + start_x) + "_") + start_y, totalblocks + 1);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _x , start_x * 16);
setProperty((("mazeclip.block_" + start_x) + "_") + start_y, _y , start_y * 16);
mazeclip.attachMovie("end", (("block_" + end_x) + "_") + end_y, totalblocks + 2);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _x , end_x * 16);
setProperty((("mazeclip.block_" + end_x) + "_") + end_y, _y , end_y * 16);
}
Frame 84
placecredits(16);
Frame 85
placebadguys(5);
Frame 86
stop();
Frame 87
stop();
Frame 88
stop();
Symbol 8 MovieClip Frame 1
function checkdistance() {
var distance;
xsep = Math.abs(_root.player.xpos - _parent.xpos);
ysep = Math.abs(_root.player.ypos - _parent.ypos);
distance = xsep + ysep;
return(distance);
}
Symbol 8 MovieClip Frame 12
if (checkdistance() < ((4 + Math.floor(random(4))) + 1)) {
_parent.follow(_root.player.xpos - _parent.xpos, _root.player.ypos - _parent.ypos);
} else {
_parent.follow(Math.floor(random(3)) - 1, Math.floor(random(3) - 1));
}
gotoAndPlay(int(random(4)) + 1);
Symbol 13 MovieClip [enemyb] Frame 1
function initplayer() {
depth = _root.mazedepth[ypos][xpos];
_x = (xpos * 16);
_y = (ypos * 16);
}
function moveplayer(x, y) {
if (!walking) {
xdir = x;
ydir = y;
walking = true;
gotoAndPlay ("startwalk");
}
}
function checkpath(x, y) {
if (_root.maze[ypos + y][xpos + x] != 1) {
return(true);
}
return(false);
}
function walk(x, y) {
if (checkpath(x, y) and (!walking)) {
xpos = xpos + x;
ypos = ypos + y;
if ((xpos == _root.player.xpos) and (ypos == _root.player.ypos)) {
_root.player.gotoAndPlay("die");
gotoAndPlay ("die");
}
depth = _root.mazedepth[ypos][xpos];
moveplayer(x, y);
}
}
function follow(x, y) {
var tryx;
if (Math.abs(y) < Math.abs(x)) {
tryx = true;
} else {
tryx = false;
}
if (x != 0) {
x = x / Math.abs(x);
}
if (y != 0) {
y = y / Math.abs(y);
}
if (tryx) {
if (checkpath(x, 0)) {
walk(x, 0);
} else {
walk(0, y);
}
} else if (checkpath(0, y)) {
walk(0, y);
} else {
walk(x, 0);
}
}
function checkfornet() {
if ((xpos == _root.player.xpos) and (ypos == _root.player.ypos)) {
_root.player.gotoAndPlay("die");
gotoAndPlay ("die");
} else if (_root.maze[ypos][xpos] == -2) {
tellTarget ((("_root.mazeclip.net_" + xpos) + "_") + ypos) {
killnet();
};
gotoAndPlay ("die");
}
}
initplayer();
Symbol 13 MovieClip [enemyb] Frame 2
walking = false;
checkfornet();
stop();
Symbol 13 MovieClip [enemyb] Frame 3
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 13 MovieClip [enemyb] Frame 4
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 13 MovieClip [enemyb] Frame 5
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 13 MovieClip [enemyb] Frame 6
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
gotoAndStop ("idle");
Symbol 13 MovieClip [enemyb] Frame 7
play();
Symbol 13 MovieClip [enemyb] Frame 12
stop();
Symbol 15 MovieClip Frame 1
function movetostart() {
depth = _parent.depth;
var neighborsx = new Array(-1, 0, 1, 0);
var neighborsy = new Array(0, -1, 0, 1);
do {
choice = int(random(neighborsx.length));
cx = neighborsx[choice];
cy = neighborsy[choice];
neighborsx.splice(choice, 1);
neighborsy.splice(choice, 1);
if (_root.mazedepth[_parent.ypos + cy][_parent.xpos + cx] == (depth - 1)) {
_parent.walk(cx, cy);
return;
}
} while (0 < neighborsx.length);
}
function checkdistance() {
var distance;
xsep = Math.abs(_root.player.xpos - _parent.xpos);
ysep = Math.abs(_root.player.ypos - _parent.ypos);
distance = xsep + ysep;
return(distance);
}
Symbol 15 MovieClip Frame 12
if (checkdistance() < ((4 + Math.floor(random(4))) + 1)) {
_parent.follow(_root.player.xpos - _parent.xpos, _root.player.ypos - _parent.ypos);
} else if (_root.player.depth < depth) {
movetostart();
}
gotoAndPlay(int(random(4)) + 3);
Symbol 18 MovieClip [enemya] Frame 1
function initplayer() {
depth = _root.mazedepth[ypos][xpos];
_x = (xpos * 16);
_y = (ypos * 16);
}
function moveplayer(x, y) {
if (!walking) {
xdir = x;
ydir = y;
walking = true;
gotoAndPlay ("startwalk");
}
}
function checkpath(x, y) {
if (_root.maze[ypos + y][xpos + x] != 1) {
return(true);
}
return(false);
}
function walk(x, y) {
if (checkpath(x, y) and (!walking)) {
xpos = xpos + x;
ypos = ypos + y;
if ((xpos == _root.player.xpos) and (ypos == _root.player.ypos)) {
_root.player.gotoAndPlay("die");
gotoAndPlay ("die");
}
depth = _root.mazedepth[ypos][xpos];
moveplayer(x, y);
}
}
function follow(x, y) {
var tryx;
if (Math.abs(y) < Math.abs(x)) {
tryx = true;
} else {
tryx = false;
}
if (x != 0) {
x = x / Math.abs(x);
}
if (y != 0) {
y = y / Math.abs(y);
}
if (tryx) {
if (checkpath(x, 0)) {
walk(x, 0);
} else {
walk(0, y);
}
} else if (checkpath(0, y)) {
walk(0, y);
} else {
walk(x, 0);
}
}
function checkfornet() {
if ((xpos == _root.player.xpos) and (ypos == _root.player.ypos)) {
_root.player.gotoAndPlay("die");
gotoAndPlay ("die");
} else if (_root.maze[ypos][xpos] == -2) {
tellTarget ((("_root.mazeclip.net_" + xpos) + "_") + ypos) {
killnet();
};
gotoAndPlay ("die");
}
}
initplayer();
Symbol 18 MovieClip [enemya] Frame 2
walking = false;
checkfornet();
stop();
Symbol 18 MovieClip [enemya] Frame 3
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 18 MovieClip [enemya] Frame 4
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 18 MovieClip [enemya] Frame 5
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 18 MovieClip [enemya] Frame 6
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
gotoAndStop ("idle");
Symbol 18 MovieClip [enemya] Frame 7
play();
Symbol 18 MovieClip [enemya] Frame 12
stop();
Symbol 25 MovieClip [net] Frame 1
function initnet() {
_x = (xpos * 16);
_y = (ypos * 16);
_root.maze[ypos][xpos] = -2;
}
function killnet() {
_root.maze[ypos][xpos] = 0;
gotoAndStop ("dead");
}
initnet();
play();
Symbol 25 MovieClip [net] Frame 2
_x = (xpos * 16);
_y = (ypos * 16);
Symbol 25 MovieClip [net] Frame 5
_root.player.dropping = false;
trace((((((((("name=" + _name) + " netxpos=") + xpos) + " netypos=") + ypos) + " _x=") + _x) + " _y=") + _y);
Symbol 25 MovieClip [net] Frame 39
killnet();
Symbol 25 MovieClip [net] Frame 40
_name = "deadnet";
this.unloadMovie();
stop();
Symbol 30 MovieClip [credit] Frame 1
stop();
Symbol 30 MovieClip [credit] Frame 2
_root.maze[ypos][xpos] = 0;
Symbol 30 MovieClip [credit] Frame 6
_root.maze[ypos][xpos] = 0;
stop();
Symbol 65 Button
on (release) {
play();
}
Symbol 71 MovieClip Frame 1
function scrollmaze(x, y) {
if (!scrolling) {
xdir = x;
ydir = y;
scrolling = true;
gotoAndPlay ("startscroll");
}
}
Symbol 71 MovieClip Frame 2
scrolling = false;
_root.player.checkforcredit();
stop();
Symbol 71 MovieClip Frame 3
_x = (_x - (xdir * 4));
_y = (_y - (ydir * 4));
Symbol 71 MovieClip Frame 4
_x = (_x - (xdir * 4));
_y = (_y - (ydir * 4));
Symbol 71 MovieClip Frame 5
_x = (_x - (xdir * 4));
_y = (_y - (ydir * 4));
Symbol 71 MovieClip Frame 6
_x = (_x - (xdir * 4));
_y = (_y - (ydir * 4));
gotoAndStop ("idle");
Symbol 78 Button
on (keyPress "<Right>") {
walk(1, 0);
}
on (keyPress "<Left>") {
walk(-1, 0);
}
on (keyPress "<Up>") {
walk(0, -1);
}
on (keyPress "<Down>") {
walk(0, 1);
}
on (keyPress "<Space>") {
dropnet();
}
Symbol 86 MovieClip Frame 1
function initplayer() {
xoffset = 0;
yoffset = 0;
xpos = _root.start_x;
ypos = _root.start_y;
depth = 0;
totalnets = 0;
credits = 3;
}
function moveplayer(x, y) {
if (!walking) {
xdir = x;
ydir = y;
walking = true;
gotoAndPlay ("startwalk");
}
}
function walk(x, y) {
if (((_root.maze[ypos + y][xpos + x] != 1) and (!walking)) and (!_parent.mazeclip.scrolling)) {
xpos = xpos + x;
ypos = ypos + y;
depth = _root.mazedepth[ypos][xpos];
if (y == 0) {
if (1 >= Math.abs(xoffset + x)) {
xoffset = xoffset + x;
moveplayer(x, y);
} else {
_parent.mazeclip.scrollmaze(x, y);
}
} else if (1 >= Math.abs(yoffset + y)) {
yoffset = yoffset + y;
moveplayer(x, y);
} else {
_parent.mazeclip.scrollmaze(x, y);
}
}
}
function dropnet() {
if ((0 < credits) and (!dropping)) {
dropping = true;
totalnets++;
if (_root.maze[ypos][xpos] != -2) {
_root.mazeclip.attachMovie("net", (("net_" + xpos) + "_") + ypos, (((_root.totalblocks + 3) + _root.totalbadguys) + _root.totalcredits) + totalnets);
Set(((("_root.mazeclip.net_" + xpos) + "_") + ypos) + ".xpos", xpos);
Set(((("_root.mazeclip.net_" + xpos) + "_") + ypos) + ".ypos", ypos);
credits = credits - 1;
}
}
}
function checkforcredit() {
if (_parent.maze[ypos][xpos] == -1) {
credits++;
_parent.maze[ypos][xpos] = 0;
tellTarget ((("_root.mazeclip.credit_" + xpos) + "_") + ypos) {
gotoAndPlay ("cashin");
};
}
if ((xpos == _root.end_x) && (ypos == _root.end_y)) {
_root.gotoAndPlay("youwin");
}
}
initplayer();
Symbol 86 MovieClip Frame 2
walking = false;
checkforcredit();
stop();
Symbol 86 MovieClip Frame 3
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 86 MovieClip Frame 4
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 86 MovieClip Frame 5
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
Symbol 86 MovieClip Frame 6
_x = (_x + (xdir * 4));
_y = (_y + (ydir * 4));
gotoAndStop ("idle");
Symbol 86 MovieClip Frame 7
play();
Symbol 86 MovieClip Frame 16
_root.gotoAndPlay("gameover");
stop();
Symbol 90 Button
on (release) {
gotoAndStop (35);
}
Symbol 92 Button
on (release) {
gotoAndPlay (52);
}
Symbol 97 Button
on (release) {
gotoAndStop (43);
}
Symbol 98 Button
on (release) {
gotoAndPlay (61);
}
Symbol 104 Button
on (release) {
gotoAndStop (52);
}
Symbol 106 Button
on (release) {
gotoAndPlay (43);
}
Symbol 111 Button
on (release) {
gotoAndStop (61);
}
Symbol 116 Button
on (release) {
gotoAndStop (70);
}