Frame 1
stopAllSounds();
mainSound = new Sound();
mainSound.attachSound("intro");
gameSound = new Sound();
gameSound.attachSound("game");
endSound = new Sound();
endSound.attachSound("end");
jumpSnd = new Sound();
jumpSnd.attachSound("jump");
st = 1;
rest = 3;
gem_count = 0;
score = 0;
Frame 2
_root.mainSound.start(0, 10);
Frame 143
stop();
Frame 144
_root.gem_count = 0;
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, 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 ladder = (random(15) + 2);
var l = (ladder - 3);
while (l < (ladder + 3)) {
if (((map[(i * 2) + 1][l] == 2) || (map[(i * 2) + 1][l] == 0)) || (map[(i * 2) - 1][ladder] == 2)) {
ladder = random(15) + 2;
l = ladder - 3;
}
l++;
}
var k = 1;
while (k < 3) {
map[(i * 2) + k][ladder] = 2;
k++;
}
map[(i * 2) + 1][ladder - 1] = 5;
map[(i * 2) + 1][ladder + 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 map_x = 0;
var map_y = 520;
count = 0;
var i = 12;
while (-1 < i) {
var j = 0;
while (j < 18) {
count++;
if (0 < map[i][j]) {
this["block" + map[i][j]].duplicateMovieClip("block" + count, count);
this["block" + count]._x = map_x;
this["block" + count]._y = map_y;
this["block" + count].kk2 = count;
}
map_x = map_x + 40;
j++;
}
map_x = 0;
map_y = map_y - 40;
i--;
}
}
map = new Array();
map[0] = [0, 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, 0, 0];
map[2] = [0, 0, 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, 0, 0];
map[4] = [0, 0, 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, 0, 0];
map[6] = [0, 0, 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, 0, 0];
map[8] = [0, 0, 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, 0, 0];
map[10] = [0, 0, 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, 0, 0];
_root.st = 1;
Frame 145
stopAllSounds();
_root.gameSound.start(0, 20);
Frame 151
generatemap();
drawmap();
Instance of Symbol 165 MovieClip in Frame 151
onClipEvent (enterFrame) {
if (0 >= _root.gem_count) {
_root.gate._x = 350;
_root.gate._y = 195;
_root.gate.swapDepths(30000);
_root.gate.play;
}
if (_root.player.hitTest(_root.gate)) {
_root.gotoAndPlay("stage_clear");
}
if (_root.time == 0) {
_root.gotoAndStop("loseplay");
}
}
Instance of Symbol 168 MovieClip "enemy1" in Frame 151
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 (50 < (walk_updown + 40)) {
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 (50 < (walk_updown + 40)) {
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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
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) or (_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) or (_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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 40) + 20);
_y = ((y_enemy * 40) + 60);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.lifeMov.nextFrame();
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 17.49;
check = -1;
}
if (17.49 < x_enemy) {
kk = 1;
x_enemy = -0.49;
check = 18;
}
}
Instance of Symbol 169 MovieClip "enemy2" in Frame 151
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 (50 < (walk_updown + 40)) {
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 (50 < (walk_updown + 40)) {
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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
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) or (_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) or (_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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 40) + 20);
_y = ((y_enemy * 40) + 60);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.lifeMov.nextFrame();
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 17.49;
check = -1;
}
if (17.49 < x_enemy) {
kk = 1;
x_enemy = -0.3;
check = 18;
}
}
Instance of Symbol 179 MovieClip "enemy3" in Frame 151
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 (50 < (walk_updown + 40)) {
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 (50 < (walk_updown + 40)) {
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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
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) or (_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) or (_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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 40) + 20);
_y = ((y_enemy * 40) + 60);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.lifeMov.nextFrame();
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 17.49;
check = -1;
}
if (17.49 < x_enemy) {
kk = 1;
x_enemy = -0.49;
check = 18;
}
}
Instance of Symbol 181 MovieClip "enemy4" in Frame 151
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 (50 < (walk_updown + 40)) {
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 (50 < (walk_updown + 40)) {
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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
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) or (_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) or (_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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 40) + 20);
_y = ((y_enemy * 40) + 60);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.lifeMov.nextFrame();
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 17.49;
check = -1;
}
if (17.49 < x_enemy) {
kk = 1;
x_enemy = -0.3;
check = 18;
}
}
Instance of Symbol 194 MovieClip "enemy5" in Frame 151
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 (50 < (walk_updown + 40)) {
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 (50 < (walk_updown + 40)) {
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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
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) or (_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) or (_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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 40) + 20);
_y = ((y_enemy * 40) + 60);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.lifeMov.nextFrame();
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 17.49;
check = -1;
}
if (17.49 < x_enemy) {
kk = 1;
x_enemy = -0.49;
check = 18;
}
}
Instance of Symbol 196 MovieClip "enemy6" in Frame 151
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 (50 < (walk_updown + 40)) {
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 (50 < (walk_updown + 40)) {
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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
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) or (_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) or (_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 (18 < (walk_left + 2)) {
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 (35 < (walk_right + 19)) {
walk_right = 0;
}
y_enemy = math.round(y_enemy);
gosub = walk_right + 19;
}
}
}
_x = ((x_enemy * 40) + 20);
_y = ((y_enemy * 40) + 60);
this.gotoAndPlay(gosub);
updown = 0;
if (this.hitTest(_root.player)) {
_root.lifeMov.nextFrame();
_root.player.dead = 1;
}
if (x_enemy < -0.4) {
kk = 1;
x_enemy = 17.49;
check = -1;
}
if (17.49 < x_enemy) {
kk = 1;
x_enemy = -0.3;
check = 18;
}
}
Frame 152
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 = 3;
}
if (st == 6) {
enemy_visible = 3;
}
if (st == 7) {
enemy_visible = 2;
}
if (st == 8) {
enemy_visible = 2;
}
if (st == 9) {
enemy_visible = 0;
}
if (9 < st) {
enemy_visible = -1;
}
var i = 0;
while (i < (enemy_visible + 1)) {
removeMovieClip("enemy" + i);
i++;
}
stop();
Instance of Symbol 224 MovieClip "player" in Frame 152
onClipEvent (load) {
x = 10;
y = -1;
xd = 0.125;
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 < 10) {
gosub = 100 + dead_count;
} else {
dead_count = 0;
dead = 0;
x = 10;
y = -1;
}
} else {
if ((Key.isDown(Key.SPACE) && (jum == 0)) && ((map != 0) && (map != 3))) {
_root.jumpSnd.start();
jum = 1;
jum_count = 0;
}
if (jum == 1) {
gosub = 30;
jum_count++;
if ((0 < jum_count) && (jum_count < 15)) {
y = y - (xd / 2);
} else {
y = y + (xd / 2);
}
if (jum_count == 18) {
jum_count = 0;
jum = 0;
}
}
if (((map == 0) || (map == 3)) && (jum == 0)) {
y = y + xd;
gosub = 28;
} else {
if (Key.isDown(Key.LEFT)) {
x = x - xd;
if (jum == 0) {
y = math.round(y);
}
walk_left++;
walk_right = 0;
if (18 < (walk_left + 2)) {
walk_left = 0;
}
gosub = walk_left + 2;
}
if (Key.isDown(Key.RIGHT)) {
x = x + xd;
if (jum == 0) {
y = math.round(y);
}
walk_right++;
walk_left = 0;
if (27 < (walk_right + 15)) {
walk_right = 0;
}
gosub = walk_right + 15;
}
if ((jum == 1) && (0 < walk_right)) {
gosub = 31;
}
if ((jum == 1) && (0 < walk_left)) {
gosub = 31;
}
if (Key.isDown(Key.UP)) {
if (Number(int(_root.map[math.round(y + 0.4)][int(x)])) == 2) {
y = y - 0.125;
walk_updown++;
if (50 < (walk_updown + 40)) {
walk_updown = 0;
}
gosub = walk_updown + 30;
}
}
if (Key.isDown(Key.DOWN)) {
if (map == 2) {
y = y + 0.125;
walk_updown++;
if (50 < (walk_updown + 40)) {
walk_updown = 0;
}
gosub = walk_updown + 30;
}
}
}
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(2);
_root.map[int(y)][math.round(x)] = 0;
_root.score = _root.score + 100;
_root.gem_count = _root.gem_count - 1;
}
}
_x = ((x * 40) + 20);
_y = ((y * 40) + 60);
_root.jump_count = jum_count;
this.gotoAndPlay(gosub);
if (x < -0.49) {
x = 17.4;
}
if (17.49 < x) {
x = -0.49;
}
}
Frame 153
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 210
st = st + 1;
if (_root.st == 4) {
_root.gotoAndStop("winplay");
} else {
gotoAndPlay (145);
}
Frame 211
stopAllSounds();
_root.endSound.start(0, 10);
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 212
stopAllSounds();
_root.endSound.start(0, 10);
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);
Symbol 38 Button
on (release) {
getURL ("http://web4.nartbox.com/ecard/index.htm", "_blank");
}
Symbol 125 Button
on (release) {
stopAllSounds();
gotoAndPlay (144);
}
Instance of Symbol 145 MovieClip in Symbol 146 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(random(10) + 1);
}
Symbol 148 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 17
stop();
Symbol 156 MovieClip Frame 23
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 4
_root.gotoAndStop("loseplay");
gotoAndStop (1);
Symbol 202 MovieClip Frame 991
_root.gotoAndStop("loseplay");
Symbol 224 MovieClip Frame 1
stop();
Symbol 224 MovieClip Frame 14
gotoAndPlay (2);
Symbol 224 MovieClip Frame 27
gotoAndPlay (19);
Symbol 224 MovieClip Frame 28
stop();
Symbol 224 MovieClip Frame 46
stop();
Symbol 224 MovieClip Frame 47
stop();
Symbol 224 MovieClip Frame 59
stop();
Symbol 251 Button
on (release) {
stopAllSounds();
gotoAndPlay (144);
}
Symbol 276 Button
on (release) {
stopAllSounds();
gotoAndPlay (1);
}