Frame 2
trace("============");
byteloaded = _root.getBytesLoaded();
trace(byteloaded);
bytetotal = _root.getBytesTotal();
trace(bytetotal);
loaded = int((byteloaded / bytetotal) * 100);
trace(loaded);
percent = ((((loaded + "% (") + int(byteloaded / 1000)) + "k/") + int(bytetotal / 1000)) + "k)";
trace(percent);
proload.gotoAndStop(loaded);
trace("============");
Frame 3
if (byteloaded == bytetotal) {
gotoAndPlay ("start");
} else {
gotoAndPlay ("loop");
}
Frame 4
gotoAndPlay (5);
Frame 64
st = 1;
rest = 3;
gem_count = 0;
score = 0;
Frame 428
stop();
Frame 429
function generatemap() {
var i = 0;
while (i < 13) {
j = 0;
while (j < 19) {
map[i][j] = 0;
j++;
}
i++;
}
var i = 0;
while (i < 13) {
map[(i * 2) - 1] = [4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5];
i++;
}
var i = 0;
while (i < 3) {
var x_gem = (random(16) + 1);
var y_gem = random(11);
if (map[y_gem][x_gem] == 1) {
map[y_gem][x_gem] = 0;
map[y_gem][x_gem + 1] = 4;
map[y_gem][x_gem - 1] = 5;
} else {
i--;
}
i++;
}
var i = 0;
while (i < 5) {
var j = 0;
while (j < 2) {
var _local1 = random(15) + 2;
var _local2 = _local1 - 3;
while (_local2 < (_local1 + 3)) {
if (((map[(i * 2) + 1][_local2] == 2) || (map[(i * 2) + 1][_local2] == 0)) || (map[(i * 2) - 1][_local1] == 2)) {
_local1 = random(15) + 2;
_local2 = _local1 - 3;
}
_local2++;
}
var _local3 = 1;
while (_local3 < 3) {
map[(i * 2) + _local3][_local1] = 2;
_local3++;
}
map[(i * 2) + 1][_local1 - 1] = 5;
map[(i * 2) + 1][_local1 + 1] = 4;
j++;
}
i++;
}
var i = 0;
while (i < 11) {
var x_gem = (random(16) + 2);
var y_gem = random(10);
if ((map[y_gem + 1][x_gem] == 1) && (map[y_gem][x_gem] == 0)) {
map[y_gem][x_gem] = 3;
_root.gem_count++;
} else {
i = i - 1;
}
i++;
}
}
function drawmap() {
var _local2 = this;
var _local3 = 0;
var map_y = 419;
count = 0;
var i = 12;
while (i > -1) {
var _local1 = 0;
while (_local1 < 18) {
count++;
if (map[i][_local1] > 0) {
_local2["block" + map[i][_local1]].duplicateMovieClip("block" + count, count);
_local2["block" + count]._x = _local3;
_local2["block" + count]._y = map_y;
_local2["block" + count].kk2 = count;
}
_local3 = _local3 + 31;
_local1++;
}
_local3 = 0;
map_y = map_y - 31;
i--;
}
}
map = new Array();
map[0] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[1] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[2] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[3] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[4] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[5] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[6] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[7] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[8] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[9] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[10] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
map[11] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
Frame 430
time = 3000;
if (_root.st > 5) {
_root.gotoAndPlay("gameget");
}
Frame 452
generatemap();
drawmap();
Instance of Symbol 184 MovieClip "enemy2" in Frame 452
onClipEvent (load) {
x_enemy = random(15) + 1;
y_enemy = random(5) + 5;
xd_enemy = 1 / (random(5) + 10);
gosub = 1;
this.swapDepths(10012);
}
onClipEvent (enterFrame) {
map_enemy = _root.map[int(y_enemy) + 1][int(math.round(x_enemy))];
x_player = _root.player.x;
y_player = _root.player.y;
if ((map_enemy == 0) || (map_enemy == 3)) {
y_enemy = y_enemy + 0.125;
kk = 0;
gosub = 36;
} else {
if (y_player < y_enemy) {
if ((Number(int(_root.map[math.round(y_enemy)][math.round(x_enemy)])) == 2) || (Number(int(_root.map[math.round(y_enemy + 0.49)][math.round(x_enemy)])) == 2)) {
y_enemy = y_enemy - 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (y_enemy < y_player) {
if (Number(int(_root.map[int(y_enemy + 1)][math.round(x_enemy)])) == 2) {
y_enemy = y_enemy + 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (int(y_enemy) == int(y_player)) {
if ((x_player < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
gosub = walk_left + 2;
y_enemy = math.round(y_enemy);
}
if ((x_enemy < x_player) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
gosub = walk_right + 19;
y_enemy = math.round(y_enemy);
}
} else {
var check_r = 20;
var check_l = 0;
if (kk == 0) {
if (y_player < y_enemy) {
var j = 18;
while (x_enemy < j) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_l = j;
}
j++;
}
} else {
var j = 18;
while (x_enemy < j) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_l = j;
}
j++;
}
}
if ((x_enemy - check_l) < (check_r - x_enemy)) {
check = 18;
} else {
check = -1;
}
kk = 1;
}
if ((check < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_left + 2;
}
if ((x_enemy < check) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 31) + 14);
_y = ((y_enemy * 31) + 52);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 15;
check = -1;
}
if (x_enemy > 15) {
kk = 1;
x_enemy = -0.3;
check = 18;
}
}
Instance of Symbol 190 MovieClip "enemy1" in Frame 452
onClipEvent (load) {
x_enemy = random(15) + 1;
y_enemy = random(5) + 5;
xd_enemy = 1 / (random(5) + 10);
gosub = 1;
this.swapDepths(10011);
}
onClipEvent (enterFrame) {
map_enemy = _root.map[int(y_enemy) + 1][int(math.round(x_enemy))];
x_player = _root.player.x;
y_player = _root.player.y;
if ((map_enemy == 0) || (map_enemy == 3)) {
y_enemy = y_enemy + 0.125;
kk = 0;
gosub = 36;
} else {
if (y_player < y_enemy) {
if ((Number(int(_root.map[math.round(y_enemy)][math.round(x_enemy)])) == 2) || (Number(int(_root.map[math.round(y_enemy + 0.49)][math.round(x_enemy)])) == 2)) {
y_enemy = y_enemy - 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (y_enemy < y_player) {
if (Number(int(_root.map[int(y_enemy + 1)][math.round(x_enemy)])) == 2) {
y_enemy = y_enemy + 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (int(y_enemy) == int(y_player)) {
if ((x_player < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
gosub = walk_left + 2;
y_enemy = math.round(y_enemy);
}
if ((x_enemy < x_player) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
gosub = walk_right + 19;
y_enemy = math.round(y_enemy);
}
} else {
var check_r = 20;
var check_l = 0;
if (kk == 0) {
if (y_player < y_enemy) {
var j = 18;
while (x_enemy < j) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_l = j;
}
j++;
}
} else {
var j = 18;
while (x_enemy < j) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_l = j;
}
j++;
}
}
if ((x_enemy - check_l) < (check_r - x_enemy)) {
check = -1;
} else {
check = 18;
}
kk = 1;
}
if ((check < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_left + 2;
}
if ((x_enemy < check) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 31) + 14);
_y = ((y_enemy * 31) + 52);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 15;
check = -1;
}
if (x_enemy > 15) {
kk = 1;
x_enemy = -0.49;
check = 18;
}
}
Instance of Symbol 199 MovieClip in Frame 452
onClipEvent (enterFrame) {
if (_root.gem_count < 1) {
_root.gate._x = 230;
_root.gate._y = 150;
_root.gate.swapDepths(30000);
_root.gate.play;
}
if (_root.player.hitTest(_root.gate)) {
_root.gotoAndPlay("stage_clear");
}
_root.time--;
_root.time_bar._xscale = _root.time / 30;
if (_root.rest < 0) {
_root.gotoAndPlay("gameover");
}
if (_root.st > 5) {
_root.gotoAndPlay("gameget");
}
}
Instance of Symbol 190 MovieClip "enemy4" in Frame 452
onClipEvent (load) {
x_enemy = random(15) + 1;
y_enemy = random(5) + 5;
xd_enemy = 1 / (random(5) + 10);
gosub = 1;
this.swapDepths(10014);
}
onClipEvent (enterFrame) {
map_enemy = _root.map[int(y_enemy) + 1][int(math.round(x_enemy))];
x_player = _root.player.x;
y_player = _root.player.y;
if ((map_enemy == 0) || (map_enemy == 3)) {
y_enemy = y_enemy + 0.125;
kk = 0;
gosub = 36;
} else {
if (y_player < y_enemy) {
if ((Number(int(_root.map[math.round(y_enemy)][math.round(x_enemy)])) == 2) || (Number(int(_root.map[math.round(y_enemy + 0.49)][math.round(x_enemy)])) == 2)) {
y_enemy = y_enemy - 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (y_enemy < y_player) {
if (Number(int(_root.map[int(y_enemy + 1)][math.round(x_enemy)])) == 2) {
y_enemy = y_enemy + 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (int(y_enemy) == int(y_player)) {
if ((x_player < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
gosub = walk_left + 2;
y_enemy = math.round(y_enemy);
}
if ((x_enemy < x_player) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
gosub = walk_right + 19;
y_enemy = math.round(y_enemy);
}
} else {
var check_r = 20;
var check_l = 0;
if (kk == 0) {
if (y_player < y_enemy) {
var j = 18;
while (x_enemy < j) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_l = j;
}
j++;
}
} else {
var j = 18;
while (x_enemy < j) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_l = j;
}
j++;
}
}
if ((x_enemy - check_l) < (check_r - x_enemy)) {
check = 18;
} else {
check = -1;
}
kk = 1;
}
if ((check < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_left + 2;
}
if ((x_enemy < check) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 31) + 14);
_y = ((y_enemy * 31) + 52);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 15;
check = -1;
}
if (x_enemy > 15) {
kk = 1;
x_enemy = -0.3;
check = 18;
}
}
Instance of Symbol 207 MovieClip "enemy3" in Frame 452
onClipEvent (load) {
x_enemy = random(15) + 1;
y_enemy = random(5) + 5;
xd_enemy = 1 / (random(5) + 10);
gosub = 1;
this.swapDepths(10013);
}
onClipEvent (enterFrame) {
map_enemy = _root.map[int(y_enemy) + 1][int(math.round(x_enemy))];
x_player = _root.player.x;
y_player = _root.player.y;
if ((map_enemy == 0) || (map_enemy == 3)) {
y_enemy = y_enemy + 0.125;
kk = 0;
gosub = 36;
} else {
if (y_player < y_enemy) {
if ((Number(int(_root.map[math.round(y_enemy)][math.round(x_enemy)])) == 2) || (Number(int(_root.map[math.round(y_enemy + 0.49)][math.round(x_enemy)])) == 2)) {
y_enemy = y_enemy - 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (y_enemy < y_player) {
if (Number(int(_root.map[int(y_enemy + 1)][math.round(x_enemy)])) == 2) {
y_enemy = y_enemy + 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (int(y_enemy) == int(y_player)) {
if ((x_player < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
gosub = walk_left + 2;
y_enemy = math.round(y_enemy);
}
if ((x_enemy < x_player) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
gosub = walk_right + 19;
y_enemy = math.round(y_enemy);
}
} else {
var check_r = 20;
var check_l = 0;
if (kk == 0) {
if (y_player < y_enemy) {
var j = 18;
while (x_enemy < j) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_l = j;
}
j++;
}
} else {
var j = 18;
while (x_enemy < j) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_l = j;
}
j++;
}
}
if ((x_enemy - check_l) < (check_r - x_enemy)) {
check = -1;
} else {
check = 18;
}
kk = 1;
}
if ((check < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_left + 2;
}
if ((x_enemy < check) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 31) + 14);
_y = ((y_enemy * 31) + 52);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 15;
check = -1;
}
if (x_enemy > 15) {
kk = 1;
x_enemy = -0.49;
check = 18;
}
}
Instance of Symbol 207 MovieClip "enemy6" in Frame 452
onClipEvent (load) {
x_enemy = random(15) + 1;
y_enemy = random(5) + 5;
xd_enemy = 1 / (random(5) + 10);
gosub = 1;
this.swapDepths(10017);
}
onClipEvent (enterFrame) {
map_enemy = _root.map[int(y_enemy) + 1][int(math.round(x_enemy))];
x_player = _root.player.x;
y_player = _root.player.y;
if ((map_enemy == 0) || (map_enemy == 3)) {
y_enemy = y_enemy + 0.125;
kk = 0;
gosub = 36;
} else {
if (y_player < y_enemy) {
if ((Number(int(_root.map[math.round(y_enemy)][math.round(x_enemy)])) == 2) || (Number(int(_root.map[math.round(y_enemy + 0.49)][math.round(x_enemy)])) == 2)) {
y_enemy = y_enemy - 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (y_enemy < y_player) {
if (Number(int(_root.map[int(y_enemy + 1)][math.round(x_enemy)])) == 2) {
y_enemy = y_enemy + 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (int(y_enemy) == int(y_player)) {
if ((x_player < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
gosub = walk_left + 2;
y_enemy = math.round(y_enemy);
}
if ((x_enemy < x_player) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
gosub = walk_right + 19;
y_enemy = math.round(y_enemy);
}
} else {
var check_r = 20;
var check_l = 0;
if (kk == 0) {
if (y_player < y_enemy) {
var j = 18;
while (x_enemy < j) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_l = j;
}
j++;
}
} else {
var j = 18;
while (x_enemy < j) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_l = j;
}
j++;
}
}
if ((x_enemy - check_l) < (check_r - x_enemy)) {
check = 18;
} else {
check = -1;
}
kk = 1;
}
if ((check < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_left + 2;
}
if ((x_enemy < check) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 31) + 12);
_y = ((y_enemy * 31) + 52);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 15;
check = -1;
}
if (x_enemy > 15) {
kk = 1;
x_enemy = -0.3;
check = 18;
}
}
Instance of Symbol 184 MovieClip "enemy5" in Frame 452
onClipEvent (load) {
x_enemy = random(15) + 1;
y_enemy = random(5) + 5;
xd_enemy = 1 / (random(5) + 10);
gosub = 1;
this.swapDepths(10016);
}
onClipEvent (enterFrame) {
map_enemy = _root.map[int(y_enemy) + 1][int(math.round(x_enemy))];
x_player = _root.player.x;
y_player = _root.player.y;
if ((map_enemy == 0) || (map_enemy == 3)) {
y_enemy = y_enemy + 0.125;
kk = 0;
gosub = 36;
} else {
if (y_player < y_enemy) {
if ((Number(int(_root.map[math.round(y_enemy)][math.round(x_enemy)])) == 2) || (Number(int(_root.map[math.round(y_enemy + 0.49)][math.round(x_enemy)])) == 2)) {
y_enemy = y_enemy - 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (y_enemy < y_player) {
if (Number(int(_root.map[int(y_enemy + 1)][math.round(x_enemy)])) == 2) {
y_enemy = y_enemy + 0.125;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
updown = 1;
kk = 0;
}
}
if (int(y_enemy) == int(y_player)) {
if ((x_player < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
gosub = walk_left + 2;
y_enemy = math.round(y_enemy);
}
if ((x_enemy < x_player) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
gosub = walk_right + 19;
y_enemy = math.round(y_enemy);
}
} else {
var check_r = 20;
var check_l = 0;
if (kk == 0) {
if (y_player < y_enemy) {
var j = 18;
while (x_enemy < j) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if (_root.map[math.round(y_enemy)][j] == 2) {
check_l = j;
}
j++;
}
} else {
var j = 18;
while (x_enemy < j) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_r = j;
}
j--;
}
var j = 0;
while (j < x_enemy) {
if ((_root.map[math.round(y_enemy) + 1][j] == 2) || (_root.map[math.round(y_enemy) + 1][j] == 0)) {
check_l = j;
}
j++;
}
}
if ((x_enemy - check_l) < (check_r - x_enemy)) {
check = -1;
} else {
check = 18;
}
kk = 1;
}
if ((check < x_enemy) && (updown == 0)) {
x_enemy = x_enemy - xd_enemy;
walk_left++;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_left + 2;
}
if ((x_enemy < check) && (updown == 0)) {
x_enemy = x_enemy + xd_enemy;
walk_right++;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 31) + 14);
_y = ((y_enemy * 31) + 52);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 15;
check = -1;
}
if (x_enemy > 15) {
kk = 1;
x_enemy = -0.49;
check = 18;
}
}
Frame 453
if (st == 1) {
enemy_visible = 5;
}
if (st == 2) {
enemy_visible = 4;
}
if (st == 3) {
enemy_visible = 3;
}
if (st == 4) {
enemy_visible = 3;
}
if (st == 5) {
enemy_visible = 2;
}
if (st > 5) {
enemy_visible = -1;
}
var i = 0;
while (i < (enemy_visible + 1)) {
removeMovieClip("enemy" + i);
i++;
}
stop();
Instance of Symbol 234 MovieClip "player" in Frame 453
onClipEvent (load) {
x = 10;
y = -1;
xd = 0.15;
gosub = 1;
jum = 0;
dead = 0;
this.swapDepths(10000);
}
onClipEvent (enterFrame) {
map = Number(_root.map[int(y + 1)][int(math.round(x))]);
if (dead) {
dead_count++;
if (dead_count < 21) {
gosub = 75 + dead_count;
} else {
dead_count = 0;
dead = 0;
x = 10;
y = -1;
_root.rest--;
}
} else {
if ((Key.isDown(32) && (jum == 0)) && ((map != 0) && (map != 3))) {
jum = 1;
jum_count = 0;
}
if (jum == 1) {
jum_count++;
if ((jum_count > 0) && (jum_count < 10)) {
y = y - (xd / 2);
} else {
y = y + (xd / 2);
}
if (jum_count == 16) {
jum_count = 0;
jum = 0;
}
}
if (((map == 0) || (map == 3)) && (jum == 0)) {
y = y + xd;
gosub = 36;
} else {
if (Key.isDown(37)) {
x = x - xd;
if (jum == 0) {
y = math.round(y);
}
walk_left++;
walk_right = 0;
if ((walk_left + 2) > 18) {
walk_left = 0;
}
gosub = walk_left + 2;
}
if (Key.isDown(39)) {
x = x + xd;
if (jum == 0) {
y = math.round(y);
}
walk_right++;
walk_left = 0;
if ((walk_right + 19) > 35) {
walk_right = 0;
}
gosub = walk_right + 19;
}
if ((jum == 1) && (walk_right > 0)) {
gosub = 61;
}
if ((jum == 1) && (walk_left > 0)) {
gosub = 60;
}
if (Key.isDown(38)) {
if (Number(int(_root.map[math.round(y + 0.4)][int(x)])) == 2) {
y = y - 0.15;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
}
}
if (Key.isDown(40)) {
if (map == 2) {
y = y + 0.15;
walk_updown++;
if ((walk_updown + 40) > 50) {
walk_updown = 0;
}
gosub = walk_updown + 40;
}
}
}
if (Number(_root.map[int(y)][math.round(x)]) == 3) {
var getscore = int(((int(12 - y) * 18) + math.round(x)) + 1);
_root["block" + getscore].gotoAndPlay(3);
_root.map[int(y)][math.round(x)] = 0;
_root.score = _root.score + 100;
_root.gem_count = _root.gem_count - 1;
}
}
_x = ((x * 31) + 14);
_y = ((y * 31) + 52);
_root.jump_count = jum_count;
this.gotoAndPlay(gosub);
if (x < -0.49) {
x = 15;
}
if (x > 15) {
x = -0.49;
}
}
Frame 454
var i = 0;
while (count >= i) {
removeMovieClip(["block" + i]);
i++;
}
removeMovieClip(player);
removeMovieClip(enemy1);
removeMovieClip(enemy2);
removeMovieClip(enemy3);
removeMovieClip(enemy4);
removeMovieClip(enemy5);
removeMovieClip(enemy6);
removeMovieClip(gate);
bonus = time * 100;
score = score + bonus;
Frame 455
stopAllSounds();
Frame 534
st = st + 1;
gotoAndPlay (430);
Frame 535
var i = 0;
while (count >= i) {
removeMovieClip(["block" + i]);
i++;
}
removeMovieClip(player);
removeMovieClip(enemy1);
removeMovieClip(enemy2);
removeMovieClip(enemy3);
removeMovieClip(enemy4);
removeMovieClip(enemy5);
removeMovieClip(enemy6);
removeMovieClip(gate);
Frame 640
stop();
Frame 648
var i = 0;
while (count >= i) {
removeMovieClip(["block" + i]);
i++;
}
removeMovieClip(player);
removeMovieClip(enemy1);
removeMovieClip(enemy2);
removeMovieClip(enemy3);
removeMovieClip(enemy4);
removeMovieClip(enemy5);
removeMovieClip(enemy6);
removeMovieClip(gate);
Frame 714
stop();
Symbol 25 Button
on (release) {
getURL ("http://www.fniao.com/", "_blank");
}
Symbol 113 Button
on (release) {
_root.gotoAndPlay("play");
}
Symbol 142 MovieClip Frame 15
stop();
Symbol 156 MovieClip Frame 23
stop();
Symbol 167 MovieClip Frame 1
corn = random(3) + 1;
if (corn == 1) {
gotoAndStop (2);
} else if (corn == 2) {
gotoAndStop (20);
} else {
gotoAndStop (21);
}
trace(corn);
Symbol 167 MovieClip Frame 2
stop();
Symbol 167 MovieClip Frame 19
stop();
Symbol 167 MovieClip Frame 20
stop();
Symbol 167 MovieClip Frame 21
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 18
gotoAndPlay (2);
Symbol 184 MovieClip Frame 35
gotoAndPlay (19);
Symbol 184 MovieClip Frame 39
stop();
Symbol 184 MovieClip Frame 60
stop();
Symbol 184 MovieClip Frame 61
stop();
Symbol 184 MovieClip Frame 76
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 18
gotoAndPlay (2);
Symbol 190 MovieClip Frame 35
gotoAndPlay (19);
Symbol 190 MovieClip Frame 39
stop();
Symbol 190 MovieClip Frame 60
stop();
Symbol 190 MovieClip Frame 61
stop();
Symbol 190 MovieClip Frame 76
stop();
Symbol 207 MovieClip Frame 1
stop();
Symbol 207 MovieClip Frame 18
gotoAndPlay (2);
Symbol 207 MovieClip Frame 35
gotoAndPlay (19);
Symbol 207 MovieClip Frame 39
stop();
Symbol 207 MovieClip Frame 60
stop();
Symbol 207 MovieClip Frame 61
stop();
Symbol 207 MovieClip Frame 76
stop();
Symbol 224 MovieClip Frame 7
stop();
Symbol 234 MovieClip Frame 1
stop();
Symbol 234 MovieClip Frame 18
stop();
Symbol 234 MovieClip Frame 35
stop();
Symbol 234 MovieClip Frame 39
stop();
Symbol 234 MovieClip Frame 60
stop();
Symbol 234 MovieClip Frame 61
stop();
Symbol 234 MovieClip Frame 76
stop();
Symbol 265 Button
on (release) {
gotoAndPlay (63);
}
on (release) {
stopAllSounds();
}
Symbol 340 Button
on (release) {
stopAllSounds();
_root.gotoAndPlay("26");
}
Symbol 344 MovieClip Frame 1042
stop();