Frame 1
stop();
Instance of Symbol 273 MovieClip in Frame 1
onClipEvent (load) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
_root.gotoAndPlay(2);
}
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
total = _root.getBytesTotal();
this.bar._xscale = (loaded / total) * 100;
this.display = ((Math.round(loaded / 1000) + "KB / ") + Math.round(total / 1000)) + "KB";
if (this.bar._xscale == 100) {
_root.gotoAndPlay(2);
}
}
Frame 2
Mouse.hide();
cursor.stop();
cursor.onEnterFrame = function () {
this._x = _xmouse;
this._y = _ymouse;
};
cursor.onMouseDown = function () {
this.gotoAndStop("click");
trace("click");
};
cursor.onMouseUp = function () {
this.gotoAndStop(1);
};
Frame 34
stop();
Frame 35
Stage.ScaleMode = "noScale";
Stage.showMenu = false;
System.useCodepage = true;
gameInit = function () {
Mouse.hide();
_quality = "Medium";
movie_type = "b_type";
time = 120;
set_timer();
g = 3;
score = 0;
life = 3;
m_value = 5;
x_min = 15;
x_max = 535;
y_array = 418;
jump_value = 18;
up_value = 3;
max_add_y = 20;
block_w = 35;
block_h = 35;
set_timer();
set_score();
stage_num = 0;
cha.swapDepths(100);
cursor.swapDepths(101);
grid._visible = false;
cha_init_x = 500;
cha_init_y = 420;
next_stage();
};
game_restart = function () {
state = 1;
removeAllInterval();
time = 120;
time_interval = setInterval(time_f, 1000);
var _local2 = 0;
while (_local2 <= 13) {
this["s" + _local2] = new Array();
_local2++;
}
if (stage_num == 1) {
s0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s2 = ["b", "b", "b", "b", "b", "b", "b", 0, "b", "b", "b", "E", "b", "b", "b", "b"];
s3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0, 0, 0, 0];
s4 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0, 0, 0, 0];
s5 = ["b", "E", "b", 0, "b", "b", "b", "b", "b", "b", "b", "b", 0, "b", "b", 0];
s6 = [0, "L", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s7 = [0, "L", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s8 = ["b", "b", "b", "b", "b", "b", "b", 0, "b", "b", "b", "b", "b", "b", "E", "b"];
s9 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0];
s10 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "b", "b", "b", "b", "b"];
s11 = [0, 0, 0, 0, 0, 0, 0, 0, 0, "b", "E", 0, 0, 0, 0, 0];
s12 = ["b", "b", "b", "b", "b", "b", "b", "b", "s", "s", "L", 0, 0, 0, 0, 0];
s13 = ["b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b"];
} else if (stage_num == 2) {
s0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s2 = ["b", "b", "b", 0, "b", "b", 0, "b", "b", 0, "b", "b", 0, "b", "b", "E"];
s3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L"];
s4 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L"];
s5 = ["b", "E", "b", "b", "b", 0, "b", "b", "b", "b", "b", "b", "b", "b", "b", "b"];
s6 = [0, "L", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s7 = [0, "L", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s8 = ["b", "b", "b", "b", "b", "b", "b", "b", "b", "b", 0, "b", "b", "b", "E", "b"];
s9 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0];
s10 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0];
s11 = [0, 0, 0, "s", "b", "b", 0, "b", "b", 0, "b", "b", 0, "b", "b", "b"];
s12 = [0, "s", "b", "b", "b", "b", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s13 = ["b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b"];
} else if (stage_num == 3) {
s0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
s2 = ["b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "E", "b"];
s3 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0];
s4 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0];
s5 = ["b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "E", "b", "b", "b"];
s6 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0, 0, 0];
s7 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "L", 0, 0, 0];
s8 = ["b", "b", "E", "E", "E", "E", "E", "E", "E", "E", "E", "E", "b", "b", "b", "b"];
s9 = [0, 0, "L", "S", "S", "S", "S", "S", "S", "S", "S", "S", 0, 0, 0, 0];
s10 = ["b", "b", "b", "S", "S", "S", "S", "S", "S", "S", "S", "S", 0, 0, 0, 0];
s11 = [0, 0, 0, "S", "S", "S", "S", "S", "S", "S", "S", "S", 0, 0, 0, 0];
s12 = [0, 0, 0, "S", "S", "S", "S", "S", "S", "S", "S", "S", 0, 0, 0, 0];
s13 = ["b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b"];
}
create_evil();
};
game_out = function (input) {
if (ladderSound != undefined) {
ladderSound.stop("ladder_up_sound");
delete ladderSound;
}
success_check = input;
if (success_check == "success") {
snd_attach("stage_finish_sound");
if (stage_num == 3) {
game_over_interval = setInterval(game_over_f, 2000);
} else {
time = 120;
set_timer();
game_restart_interval = setInterval(next_stage, 2000);
}
} else if (success_check == "fail") {
life--;
score_m.life_mc.gotoAndStop(4 - life);
if (life <= 0) {
game_over();
} else {
game_replay_interval = setInterval(game_replay, 2000);
}
score_m.life_mc.gotoAndStop(4 - life);
}
};
game_over = function () {
state = 0;
cha.gotoAndStop("die");
cha.alpha = 100;
cha._alpha = 100;
cha.onEnterFrame = function () {
this.alpha = this.alpha - 3;
if (this.alpha <= 0) {
this.onEnterFrame = null;
game_over_f();
}
};
};
game_over_f = function () {
_quality = "High";
evil_control.removeMovieClip();
effect_control.removeMovieClip();
item_union.removeMovieClip();
cha.removeMovieClip();
if (success_check == "success") {
gotoAndStop (60);
replay_btn.onPress = function () {
getURL ("javascript:self.location.reload()");
};
exit_btn.onPress = function () {
getURL ("javascript:self.close()");
};
} else {
gotoAndStop (67);
replay_btn.onPress = function () {
getURL ("javascript:self.location.reload()");
};
exit_btn.onPress = function () {
getURL ("javascript:self.close()");
};
}
_root.onEnterFrame = function () {
cursor._x = _root._xmouse;
cursor._y = _root._ymouse;
};
removeAllInterval();
};
goto_scene = function () {
gotoAndStop (60);
};
next_stage = function () {
removeAllInterval();
remove_evil();
state = 0;
stage_num++;
if (stage_num == 1) {
cha_init_x = 500;
cha_init_y = 420;
} else if (stage_num == 2) {
cha_init_x = 500;
cha_init_y = 420;
jump_value = 18;
} else if (stage_num == 3) {
cha_init_x = 500;
cha_init_y = 420;
}
cha._x = cha_init_x;
cha._y = cha_init_y;
cha._xscale = 100;
cha.gotoAndStop("ready");
cha.mode = undefined;
cha.attack_check = undefined;
cha.attack_after = undefined;
_root.gotoAndStop("stage" + stage_num);
stage_message.stage_txt.gotoAndStop("stage" + stage_num);
stage_message.gotoAndPlay(1);
stopAllSounds();
snd_attach(("bg" + stage_num) + "_sound", "loop");
};
time_f = function () {
time--;
if (time <= 0) {
time_over();
}
set_timer();
};
time_over = function () {
life--;
score_m.life_mc.gotoAndStop(4 - life);
time = 120;
set_timer();
if (life <= 0) {
game_over();
}
};
set_timer = function () {
var _local3 = String(time);
var _local2 = 1;
while (_local2 <= 3) {
score_m.timer_mc["timer" + _local2].gotoAndStop("blind");
_local2++;
}
_local2 = 1;
while (_local2 <= _local3.length) {
var _local1 = Number(_local3.substr(_local2 - 1, 1));
if (_local1 == 0) {
_local1 = 10;
}
score_m.timer_mc["timer" + _local2].gotoAndStop(_local1);
_local2++;
}
};
_global.snd_attach = function (name, loop) {
mySound = new Sound();
mySound.attachSound(name);
if (loop == undefined) {
mySound.start();
} else {
mySound.start(0, 999);
}
};
removeAllInterval = function () {
var _local2 = setInterval(function () {
}, 1000);
var _local1 = 0;
while (_local1 <= _local2) {
clearInterval(_local1);
_local1++;
}
};
score_cul = function (item) {
switch (item) {
case "evil_die" :
var _local1 = 10;
break;
case "evil_damage" :
_local1 = 1;
break;
case "get_item" :
_local1 = 5;
break;
case "damage_cha" :
_local1 = -2;
break;
}
score = score + _local1;
score_disp._x = cha._x;
score_disp._y = cha._y - 20;
score_disp.gotoAndPlay("show");
if (_local1 > 0) {
score_disp.score_txt_m.score_txt.text = " +" + _local1;
} else {
score_disp.score_txt_m.score_txt.text = _local1;
}
if (score < 0) {
score = 0;
}
set_score();
};
set_score = function () {
var _local3 = String(score);
var _local2 = 1;
while (_local2 <= 4) {
score_m.score_mc["score" + _local2].gotoAndStop("blind");
_local2++;
}
_local2 = 1;
while (_local2 <= _local3.length) {
var _local1 = Number(_local3.substr(_local2 - 1, 1));
if (_local1 == 0) {
_local1 = 10;
}
score_m.score_mc["score" + _local2].gotoAndStop(_local1);
_local2++;
}
};
return_pos = function (x, y) {
return(this["s" + y][x]);
};
cha.onEnterFrame = function () {
if (state == 1) {
if (slope_m.hitTest(this._x, this._y, true) && (this.mode != "jump")) {
_root.imsi = true;
if ((this.mode != "attack") && (this.mode != "damage")) {
this.mode = "slope";
this.add_x = undefined;
this.add_y = undefined;
}
var _local5 = this._y + 100;
var _local3 = this._y - 50;
while (_local3 < _local5) {
if (slope_m.guide_m.hitTest(this._x, _local3, true)) {
break;
}
_local3 = _local3 + 1;
}
if (this.mode == "damage") {
if (this.add_y > 0) {
this._y = _local3;
this.gotoAndStop("ready");
this.mode = "slope";
this.attack_after = undefined;
this.attack_check = undefined;
}
} else {
this._y = _local3;
}
if (Key.isDown(37)) {
this._x = this._x + ((-0.838671 * m_value) * 1.2);
if (this._currentframe != 7) {
this.gotoAndStop("walk");
}
this._xscale = 100;
} else if (Key.isDown(39)) {
this._x = this._x + ((0.838671 * m_value) * 1.2);
if (this._currentframe != 7) {
this.gotoAndStop("walk");
}
this._xscale = -100;
}
if (Key.isDown(32)) {
var _local7 = Math.floor(this._x / block_w);
var _local6 = Math.floor(this._y / block_h);
var _local12 = return_pos(_local7, _local6 - 1);
if (((_local12 != "b") && (_local12 != "L")) && (_local12 != "E")) {
this.add_y = -jump_value;
this.mode = "jump";
this.gotoAndStop("jump");
if (Key.isDown(37)) {
this.add_x = -m_value;
} else if (Key.isDown(39)) {
this.add_x = m_value;
}
}
}
if (Key.isDown(88)) {
if (this.attack_check != true) {
this.attack_nife = random(3) + 1;
this.gotoAndStop("attack2");
this.mode = "attack";
this.attack_check = true;
attack_after();
}
}
} else {
if (this.mode == "slope") {
this.mode = undefined;
}
_root.imsi = false;
}
if ((((this.mode != "up") && (this.mode != "slope")) && (this.mode != "attack")) && (this.mode != "down")) {
this._x = this._x + this.add_x;
this._y = this._y + this.add_y;
if (this._x < x_min) {
this._x = x_min;
} else if (this._x > x_max) {
this._x = x_max;
}
var _local7 = Math.floor(this._x / block_w);
var _local6 = Math.floor(this._y / block_h);
var _local10 = return_pos(_local7, _local6);
var _local9 = return_pos(_local7, _local6 + 1);
if (this.add_y > 0) {
if (((_local9 == "b") || (_local9 == "E")) || (_local9 == "s")) {
this._y = _local6 * block_h;
this.add_x = 0;
this.add_y = 0;
if ((this.mode == "jump") || (this.mode == "fall")) {
snd_attach("reach_sound");
}
this.mode = undefined;
this.gotoAndStop("ready");
} else if (((_local9 == "L") || (_local9 == "S")) || (_local10 == "L")) {
this._x = (_local7 * block_w) + (block_w / 2);
this.add_x = 0;
this.add_y = 0;
if (this.mode == "jump") {
snd_attach("ladder_sound");
}
this.mode = "up";
this.gotoAndStop("up");
this.m.stop();
} else if ((this.mode != "jump") && (this.mode != "damage")) {
this.gotoAndStop("jump");
this.mode = "fall";
if ((this._x - (_local7 * block_w)) < (block_w / 2)) {
this._x = (_local7 * block_w) + (this.hit_m._width / 2);
} else {
this._x = ((_local7 + 1) * block_w) - (this.hit_m._width / 2);
}
}
}
}
if (this.mode == undefined) {
if (Key.isDown(37)) {
if (this._xscale == -100) {
this._xscale = 100;
}
if ((this.hit_m._width / 2) > (this._x - (_local7 * block_w))) {
var _local8 = return_pos(_local7 - 1, _local6);
if ((_local8 == "b") || (_local7 == 0)) {
} else {
this._x = this._x - m_value;
if (this._currentframe != 7) {
this.gotoAndStop("walk");
}
}
} else {
this._x = this._x - m_value;
}
} else if (Key.isDown(39)) {
if (this._xscale == 100) {
this._xscale = -100;
}
if ((((_local7 + 1) * block_w) - this._x) < (this.hit_m._width / 2)) {
var _local11 = return_pos(_local7 + 1, _local6);
if ((_local11 == "b") || (_local7 == 15)) {
} else {
this._x = this._x + m_value;
if (this._currentframe != 7) {
this.gotoAndStop("walk");
}
}
} else {
this._x = this._x + m_value;
}
}
if (Key.isDown(32)) {
var _local7 = Math.floor(this._x / block_w);
var _local6 = Math.floor(this._y / block_h);
var _local12 = return_pos(_local7, _local6 - 1);
var _local10 = return_pos(_local7, _local6);
if ((_local12 != "b") && (_local12 != "E")) {
this.add_y = -jump_value;
this.mode = "jump";
this.gotoAndStop("jump");
if (Key.isDown(37)) {
this.add_x = -m_value;
} else if (Key.isDown(39)) {
this.add_x = m_value;
}
}
}
if (Key.isDown(38)) {
if ((_local10 == "L") || (_local10 == "S")) {
this.mode = "up";
this._x = (_local7 * block_w) + (block_w / 2);
this.gotoAndStop("up");
this.xscale = this._xscale;
ladderSound = new Sound();
ladderSound.attachSound("ladder_up_sound");
ladderSound.start(0, 999);
}
}
if (Key.isDown(40)) {
if (_local9 == "E") {
this.mode = "up";
this._x = (_local7 * block_w) + (block_w / 2);
this.gotoAndStop("up");
this.xscale = this._xscale;
ladderSound = new Sound();
ladderSound.attachSound("ladder_up_sound");
ladderSound.start(0, 999);
} else if (((((_local9 != "L") && (_local9 != "S")) && (_local10 != "L")) && (_local10 != "S")) && (this.attack_check != true)) {
this.gotoAndStop("down");
this.mode = "attack";
this.attack_check = true;
attack_after();
}
}
if (Key.isDown(88)) {
if (this.attack_check != true) {
this.attack_nife = random(3) + 1;
this.gotoAndStop("attack" + this.attack_nife);
this.mode = "attack";
this.attack_check = true;
attack_after();
}
}
} else if (this.mode == "up") {
if (Key.isDown(38)) {
this.m.play();
this._y = this._y - up_value;
var _local7 = Math.floor(this._x / block_w);
var _local6 = Math.floor(this._y / block_h);
var _local10 = return_pos(_local7, _local6);
if ((_local10 == 0) && (Math.abs(this._y - (_local6 * block_h)) < 5)) {
this._y = _local6 * block_h;
this.mode = undefined;
this._xscale = this.xscale;
} else if (ladderSound == undefined) {
ladderSound = new Sound();
ladderSound.attachSound("ladder_up_sound");
ladderSound.start(0, 999);
}
} else if (Key.isDown(40)) {
this.m.play();
this._y = this._y + up_value;
var _local7 = Math.floor(this._x / block_w);
var _local6 = Math.floor(this._y / block_h);
var _local9 = return_pos(_local7, _local6 + 1);
if ((_local9 == "b") && (Math.abs(this._y - (_local6 * block_h)) < 5)) {
this._y = _local6 * block_h;
this.mode = undefined;
this._xscale = this.xscale;
} else if (ladderSound == undefined) {
ladderSound = new Sound();
ladderSound.attachSound("ladder_up_sound");
ladderSound.start(0, 999);
}
} else if (Key.isDown(32)) {
var _local7 = Math.floor(this._x / block_w);
var _local6 = Math.floor(this._y / block_h);
var _local12 = return_pos(_local7, _local6 - 1);
var _local10 = return_pos(_local7, _local6);
if ((_local10 == "S") && (_local12 != "E")) {
this.add_y = -jump_value;
this.mode = "jump";
this.gotoAndStop("jump");
if (Key.isDown(37)) {
this.add_x = -m_value;
} else if (Key.isDown(39)) {
this.add_x = m_value;
}
}
}
} else if ((this.mode == "attack") && (this.attack_after != true)) {
for (name in evil_control) {
if (typeof(evil_control[name]) == "movieclip") {
var _local4 = evil_control[name];
if (this.m.nife.hitTest(_local4.hit_m)) {
damage_evil(_local4);
this.attack_after = true;
}
}
}
} else if (this.mode == "damage") {
if (this._x < x_min) {
this._x = x_min;
} else if (this._x > x_max) {
this._x = x_max;
}
if (this._y >= this.ty) {
this.mode = undefined;
this.gotoAndStop("ready");
this.add_x = 0;
this.add_y = 0;
this.ty = undefined;
this.attack_check = undefined;
this.attack_after = undefined;
}
}
if ((this.add_y < max_add_y) && (this.mode != "up")) {
this.add_y = this.add_y + g;
}
if (this.mode != "up") {
if (ladderSound != undefined) {
ladderSound.stop("ladder_up_sound");
delete ladderSound;
}
}
}
};
attack_after = function () {
clearInterval(attack_interval);
attack_interval = setInterval(attack_interval_f, 500);
snd_attach("swing2_sound");
};
down_after = function () {
cha.gotoAndStop("ready");
cha.mode = undefined;
cha.attack_after = undefined;
cha.attack_check = undefined;
};
attack_interval_f = function () {
if (cha.mode == "attack") {
cha.gotoAndStop("ready");
cha.mode = undefined;
cha.attack_after = undefined;
cha.attack_check = undefined;
clearInterval(attack_interval);
}
};
create_evil = function () {
_root.createEmptyMovieClip("evil_control", 1);
_root.createEmptyMovieClip("effect_control", 2);
_root.effect_control.num = 0;
_root.createEmptyMovieClip("item_union", 3);
_root.item_union.num = 0;
if (stage_num == 1) {
evil_pos = [{x:random(125) + 75, y:70, min_x:18, max_x:210}, {x:random(200) + 300, y:68, min_x:300, max_x:530}, {x:random(180) + 180, y:172, min_x:160, max_x:395}, {x:random(150) + 50, y:278, min_x:16, max_x:219}, {x:random(200) + 320, y:278, min_x:300, max_x:540}, {x:random(200) + 35, y:420, min_x:35, max_x:250}, {x:random(60) + 360, y:455, min_x:354, max_x:535}];
evil_type = ["dal_m", "dal_m", "dal_m", "dal_m", "snake_m", "snake_m", "snake_m"];
var _local4 = 0;
while (_local4 < evil_pos.length) {
var _local5 = random(evil_type.length);
var _local6 = evil_type[_local5];
evil_type.splice(_local5, 1);
if (_local6 == "dal_m") {
evil_control.attachMovie("dal_m", "evil" + (_local4 + 1), _local4 + 1, {type:"dal"});
} else {
evil_control.attachMovie("snake_m", "evil" + (_local4 + 1), _local4 + 1, {type:"snake"});
}
var _local3 = evil_control["evil" + (_local4 + 1)];
_local3._x = evil_pos[_local4].x;
_local3._y = evil_pos[_local4].y;
_local3.min_x = evil_pos[_local4].min_x;
_local3.max_x = evil_pos[_local4].max_x;
_local3.damage_num = 0;
if (_local3.type == "dal") {
_local3.add_x = random(2) + 1;
} else {
_local3.add_x = random(3) + 1;
}
if (random(2) == 0) {
_local3.direct = "right";
_local3._xscale = -100;
} else {
_local3.direct = "left";
_local3.add_x = _local3.add_x * -1;
}
_local4++;
}
evil_num = evil_pos.length;
evil_control.num = 0;
evil_control._alpha = 0;
evil_control.onEnterFrame = function () {
this._alpha = this._alpha + 3;
if (this._alpha >= 100) {
this.onEnterFrame = null;
evil_control.onEnterFrame = function () {
this.num++;
if (this.num > 100) {
this.num = 0;
}
if ((this.num % 3) == 0) {
for (name in this) {
if (typeof(this[name]) == "movieclip") {
if (this[name].damage_check != true) {
var _local2 = this[name];
if (random(10) == 0) {
if (_local2.type == "dal") {
_local2.add_x = random(4);
} else {
_local2.add_x = random(5);
}
if (_local2.direct == "left") {
_local2.add_x = _local2.add_x * -1;
}
} else if (random(20) == 0) {
if (_local2.type == "dal") {
_local2.add_x = random(6) + 1;
} else {
_local2.add_x = random(6) + 2;
}
if (_local2.direct == "left") {
_local2.add_x = _local2.add_x * -1;
}
}
if (_local2.add_x == 0) {
_local2.gotoAndStop("ready");
} else {
_local2.gotoAndStop("walk");
}
if ((_local2._x + _local2.add_x) <= _local2.min_x) {
_local2.direct = "right";
if (_local2.add_x < 0) {
_local2.add_x = _local2.add_x * -1;
}
_local2._x = _local2.min_x;
_local2._xscale = -100;
} else if ((_local2._x + _local2.add_x) >= _local2.max_x) {
_local2.direct = "left";
if (_local2.add_x > 0) {
_local2.add_x = _local2.add_x * -1;
}
_local2._x = _local2.max_x;
_local2._xscale = 100;
}
_local2._x = _local2._x + _local2.add_x;
if (_local2.hit_m.hitTest(cha.hit_m)) {
if (cha.mode != "damage") {
if (cha.damage_check != true) {
damage_cha(_local2);
}
}
}
}
}
}
}
};
}
};
} else if (stage_num == 2) {
evil_pos = [{x:random(63) + 23, y:74, min_x:23, max_x:86}, {x:random(50) + 264, y:74, min_x:264, max_x:314}, {x:random(77) + 463, y:74, min_x:463, max_x:546}, {x:random(133) + 27, y:178, min_x:27, max_x:160}, {x:random(300) + 239, y:178, min_x:239, max_x:540}, {x:random(310) + 25, y:283, min_x:25, max_x:335}, {x:random(13) + 17, y:456, min_x:17, max_x:30}, {x:random(155) + 233, y:456, min_x:233, max_x:533}];
evil_type = ["mush_m", "mush_m", "mush_m", "mush_m", "slame_m", "slame_m", "slame_m", "slame_m"];
var _local4 = 0;
while (_local4 < evil_pos.length) {
var _local5 = random(evil_type.length);
var _local6 = evil_type[_local5];
evil_type.splice(_local5, 1);
if (_local6 == "mush_m") {
evil_control.attachMovie("mush_m", "evil" + (_local4 + 1), _local4 + 1, {type:"mush"});
} else {
evil_control.attachMovie("slame_m", "evil" + (_local4 + 1), _local4 + 1, {type:"slame"});
}
var _local3 = evil_control["evil" + (_local4 + 1)];
_local3._x = evil_pos[_local4].x;
_local3._y = evil_pos[_local4].y;
_local3.min_x = evil_pos[_local4].min_x;
_local3.max_x = evil_pos[_local4].max_x;
_local3.damage_num = 0;
if (_local3.type == "mush") {
_local3.add_x = random(2) + 1;
} else {
_local3.add_x = random(3) + 1;
}
if (random(2) == 0) {
_local3.direct = "right";
_local3._xscale = -100;
} else {
_local3.direct = "left";
_local3.add_x = _local3.add_x * -1;
}
_local4++;
}
evil_num = evil_pos.length;
evil_control.num = 0;
evil_control._alpha = 0;
evil_control.onEnterFrame = function () {
this._alpha = this._alpha + 2;
if (this._alpha >= 100) {
this.onEnterFrame = null;
evil_control.onEnterFrame = function () {
this.num++;
if (this.num > 100) {
this.num = 0;
}
if ((this.num % 3) == 0) {
for (name in this) {
if (typeof(this[name]) == "movieclip") {
if (this[name].damage_check != true) {
var _local2 = this[name];
if ((random(20) == 0) && (_local2.run_check == undefined)) {
if (_local2.type == "mush") {
_local2.add_x = random(5) + 2;
} else {
_local2.add_x = random(6) + 2;
}
_local2.gotoAndStop("run");
_local2.run_check = true;
if (_local2.direct == "left") {
_local2.add_x = _local2.add_x * -1;
}
} else if ((random(20) == 0) && (_local2.run_check == undefined)) {
if (_local2.type == "mush") {
_local2.add_x = random(4);
} else {
_local2.add_x = random(6) + 1;
}
_local2.gotoAndStop("walk");
if (_local2.direct == "left") {
_local2.add_x = _local2.add_x * -1;
}
}
if ((_local2._x + _local2.add_x) <= _local2.min_x) {
_local2.direct = "right";
if (_local2.add_x < 0) {
_local2.add_x = _local2.add_x * -1;
}
_local2._x = _local2.min_x;
_local2._xscale = -100;
} else if ((_local2._x + _local2.add_x) >= _local2.max_x) {
_local2.direct = "left";
if (_local2.add_x > 0) {
_local2.add_x = _local2.add_x * -1;
}
_local2._x = _local2.max_x;
_local2._xscale = 100;
}
_local2._x = _local2._x + _local2.add_x;
if (_local2.hit_m.hitTest(cha.hit_m)) {
if (cha.mode != "damage") {
if (cha.damage_check != true) {
damage_cha(_local2);
}
}
}
}
}
}
}
};
}
};
} else if (stage_num == 3) {
evil_pos = [{x:random(517) + 23, y:67, min_x:23, max_x:540}, {x:random(517) + 23, y:67, min_x:23, max_x:540}, {x:random(517) + 23, y:173, min_x:23, max_x:540}, {x:random(517) + 23, y:173, min_x:23, max_x:540}, {x:random(517) + 23, y:277, min_x:23, max_x:540}, {x:random(517) + 23, y:277, min_x:23, max_x:540}, {x:random(84) + 11, y:350, min_x:18, max_x:95}, {x:random(317) + 23, y:452, min_x:23, max_x:540}];
evil_type = ["clang_m", "clang_m", "clang_m", "clang_m", "clang_m", "picsy_m", "picsy_m", "picsy_m", "picsy_m"];
var _local4 = 0;
while (_local4 < evil_pos.length) {
var _local5 = random(evil_type.length);
var _local6 = evil_type[_local5];
evil_type.splice(_local5, 1);
if (_local6 == "clang_m") {
evil_control.attachMovie("clang_m", "evil" + (_local4 + 1), _local4 + 1, {type:"clang"});
} else {
evil_control.attachMovie("picsy_m", "evil" + (_local4 + 1), _local4 + 1, {type:"picsy"});
}
var _local3 = evil_control["evil" + (_local4 + 1)];
_local3._x = evil_pos[_local4].x;
_local3._y = evil_pos[_local4].y;
_local3.min_x = evil_pos[_local4].min_x;
_local3.max_x = evil_pos[_local4].max_x;
_local3.damage_num = 0;
if (_local3.type == "clang") {
_local3.add_x = random(5) + 1;
} else {
_local3.add_x = random(6) + 1;
}
if (random(2) == 0) {
_local3.direct = "right";
_local3._xscale = -100;
} else {
_local3.direct = "left";
_local3.add_x = _local3.add_x * -1;
}
_local4++;
}
evil_num = evil_pos.length;
evil_control.num = 0;
evil_control._alpha = 0;
evil_control.onEnterFrame = function () {
this._alpha = this._alpha + 2;
if (this._alpha >= 100) {
this.onEnterFrame = null;
evil_control.onEnterFrame = function () {
this.num++;
if (this.num > 100) {
this.num = 0;
}
if ((this.num % 3) == 0) {
for (name in this) {
if (typeof(this[name]) == "movieclip") {
if (this[name].damage_check != true) {
var _local2 = this[name];
if ((random(20) == 0) && (_local2.jump_check == undefined)) {
if (_local2.type == "clang") {
_local2.add_x = random(7);
} else {
_local2.add_x = random(9);
}
_local2.gotoAndStop("jump");
_local2.jump_check = true;
if (_local2.direct == "left") {
_local2.add_x = _local2.add_x * -1;
}
} else if ((random(20) == 0) && (_local2.jump_check == undefined)) {
if (_local2.type == "mush") {
_local2.add_x = random(7);
} else {
_local2.add_x = random(8);
}
_local2.gotoAndStop("walk");
if (_local2.direct == "left") {
_local2.add_x = _local2.add_x * -1;
}
}
if (_local2.add_x == 0) {
_local2.gotoAndStop("ready");
} else if (_local2.jump_check == undefined) {
_local2.gotoAndStop("walk");
}
if ((_local2._x + _local2.add_x) <= _local2.min_x) {
_local2.direct = "right";
if (_local2.add_x < 0) {
_local2.add_x = _local2.add_x * -1;
}
_local2._x = _local2.min_x;
_local2._xscale = -100;
} else if ((_local2._x + _local2.add_x) >= _local2.max_x) {
_local2.direct = "left";
if (_local2.add_x > 0) {
_local2.add_x = _local2.add_x * -1;
}
_local2._x = _local2.max_x;
_local2._xscale = 100;
}
_local2._x = _local2._x + _local2.add_x;
if (_local2.hit_m.hitTest(cha.hit_m)) {
if (cha.mode != "damage") {
if (cha.damage_check != true) {
damage_cha(_local2);
}
}
}
}
}
}
}
};
}
};
}
};
remove_evil = function () {
for (name in evil_control) {
if (typeof(evil_control[name]) == "movieclip") {
evil_control[name].removeMovieClip();
}
}
for (name in effect_control) {
if (typeof(effect_control[name]) == "movieclip") {
effect_control[name].removeMovieClip();
}
}
for (name in item_union) {
if (typeof(item_union[name]) == "movieclip") {
item_union[name].removeMovieClip();
}
}
};
create_item = function (evil_mc) {
item_union.num++;
var _local4 = random(4) + 1;
item_union.attachMovie("item" + _local4, "item" + item_union.num, item_union.num);
var _local2 = item_union["item" + item_union.num];
_local2._x = evil_mc._x;
_local2._y = evil_mc._y - 50;
_local2.ty = evil_mc._y;
_local2.add_y = -jump_value;
snd_attah("click_sound");
_local2.onEnterFrame = function () {
this._y = this._y + this.add_y;
this.add_y = this.add_y + g;
if (this._y >= this.ty) {
this.onEnterFrame = null;
this._y = this.ty;
snd_attach("reach_sound");
}
};
};
get_item = function () {
for (name in item_union) {
var _local2 = item_union[name];
if (typeof(_local2) == "movieclip") {
if (cha.hit_m.hitTest(_local2)) {
_local2.ty = _local2._y - 60;
_local2.gotoAndPlay(1);
_local2.onEnterFrame = function () {
smoothMove(this, this._x, this.ty, 0.3);
this._alpha = this._alpha - 2;
if (Math.abs(this.ty - this._y) < 1) {
this.onEnterFrame = null;
this.num = 0;
this.add_y = 0;
this.onEnterFrame = function () {
this.num++;
this.add_y = this.add_y + 2;
this._y = this._y + this.add_y;
if (this.num >= 10) {
this.onEnterFrame = null;
this.removeMovieClip();
}
};
}
};
score_cul("get_item");
snd_attach("get_item_sound");
}
}
}
};
damage_evil = function (mc) {
mc.gotoAndStop("damage");
if ((mc._x - cha._x) > 0) {
mc.tx = mc._x + 50;
mc.direct = "left";
mc._xscale = 100;
if (mc.add_x > 0) {
mc.add_x = mc.add_x * -1;
}
} else {
mc.tx = mc._x - 50;
mc.direct = "right";
mc._xscale = -100;
if (mc.add_x < 0) {
mc.add_x = mc.add_x * -1;
}
}
if (mc.tx > mc.max_x) {
mc.tx = mc.max_x;
} else if (mc.tx < mc.min_x) {
mc.tx = mc.min_x;
}
mc.damage_check = true;
mc.damage_num++;
score_cul("evil_damage");
if (mc.damage_num < 2) {
mc.onEnterFrame = function () {
smoothMove(this, this.tx, this._y, 0.3);
if (Math.abs(this.tx - this._x) < 1) {
this.onEnterFrame = null;
this.damage_check = undefined;
this.gotoAndStop("walk");
}
};
} else {
mc.gotoAndStop("die");
evil_num--;
score_cul("evil_die");
if (evil_num <= 0) {
game_out("success");
}
if (mc.type == "dal") {
snd_attach("dal_die_sound");
} else if (mc.type == "snake") {
snd_attach("snake_die_sound");
}
create_item(mc);
}
snd_attach("hit_sound");
effect_control.num++;
effect_control.attachMovie("damage_score_m", "damage" + effect_control.num, effect_control.num);
var _local3 = effect_control["damage" + effect_control.num];
_local3._x = mc._x;
_local3._y = mc._y - 20;
_local3.number.gotoAndStop(mc.damage_num);
};
damage_cha = function (evil_mc) {
cha.mode = "damage";
cha.damage_check = true;
if ((evil_mc._x - cha._x) > 0) {
cha.add_x = (-m_value) * 1.5;
} else {
cha.add_x = m_value * 1.5;
}
cha.add_y = (-jump_value) + 5;
cha.ty = cha._y;
cha.gotoAndStop("damage");
cha._y = mc._y;
score_cul("damage_cha");
game_out("fail");
damage_cha_effect_interval = setInterval(damage_cha_effect_f, 80);
damage_cha_after_interval = setInterval(damage_cha_after_f, 3000);
snd_attach("hit_sound");
snd_attach("cha_die_sound");
};
damage_cha_after_f = function () {
cha.mode = undefined;
cha.damage_check = undefined;
cha.attack_after = undefined;
cha.attack_check = undefined;
cha._alpha = 100;
if ((life > 0) && (cha.mode != "attack")) {
}
clearInterval(damage_cha_after_interval);
clearInterval(damage_cha_effect_interval);
};
damage_cha_effect_f = function () {
if (random(2) == 0) {
cha._alpha = 80;
} else {
cha._alpha = 20;
}
if (cha._currentframe == 49) {
}
};
smoothMove = function (mc, tx, ty, sp) {
var _local3 = tx - mc._x;
var _local2 = ty - mc._y;
mc._x = mc._x + (_local3 * sp);
mc._y = mc._y + (_local2 * sp);
};
view_ranking = function () {
var _local5 = new LoadVars();
_local5.user_name = popup_box.name_txt.text;
_local5.user_score = score;
_local5.sendAndLoad("./maple_game_end.asp", _local5, "POST");
_local5.onLoad = function (success) {
if (success) {
var _local3 = 1;
while (_local3 <= 8) {
_root["name_" + _local3] = this["name_" + _local3];
_root["score_" + _local3] = this["score_" + _local3];
var _local4 = ranking_list["rect" + _local3].rect;
_local4.name = _root["name_" + _local3];
_local4.score = _root["score_" + _local3];
_local3++;
}
} else {
alert("ranking error !");
}
};
};
game_replay = function () {
};
alert = function (input) {
getURL (("javascript:alert (\"" + input) + "\");");
};
myListen = new Object();
myListen.onKeyDown = function () {
if (Key.isDown(90)) {
get_item();
}
};
myListen.onKeyUp = function () {
if (Key.getCode(37) || (Key.getCode(39))) {
if ((!Key.isDown(37)) && (!Key.isDown(39))) {
if (((((cha.mode != "jump") && (cha.mode != "up")) && (cha.mode != "attack")) && (cha.mode != "down")) && (cha.mode != "damage")) {
cha.gotoAndStop("ready");
}
}
}
if (Key.getCode(38) && (cha.mode == "up")) {
cha.m.stop();
ladderSound.stop("ladder_up_sound");
delete ladderSound;
}
};
Key.addListener(myListen);
stop();
gameInit();
Frame 60
stop();
Frame 67
stop();
Symbol 47 MovieClip Frame 29
_parent.jump_check = undefined;
Symbol 58 MovieClip Frame 29
_parent.removeMovieClip();
Symbol 66 MovieClip Frame 9
_parent.jump_check = undefined;
Symbol 67 MovieClip [picsy_m] Frame 7
stop();
Symbol 81 MovieClip Frame 18
_parent.jump_check = undefined;
Symbol 90 MovieClip Frame 25
_parent.removeMovieClip();
Symbol 99 MovieClip Frame 11
_parent.jump_check = undefined;
Symbol 100 MovieClip [clang_m] Frame 7
stop();
Symbol 120 MovieClip Frame 27
_parent.run_check = undefined;
Symbol 129 MovieClip Frame 26
_parent.removeMovieClip();
Symbol 135 MovieClip [slame_m] Frame 7
stop();
Symbol 147 MovieClip Frame 14
_parent.run_check = undefined;
Symbol 154 MovieClip Frame 25
_parent.removeMovieClip();
Symbol 157 MovieClip [mush_m] Frame 7
stop();
Symbol 161 MovieClip [item4] Frame 13
stop();
Symbol 165 MovieClip [item3] Frame 13
stop();
Symbol 169 MovieClip [item2] Frame 13
stop();
Symbol 173 MovieClip [item1] Frame 13
stop();
Symbol 185 MovieClip [damage_score_m] Frame 22
_parent.num--;
this.removeMovieClip();
Symbol 201 MovieClip Frame 11
_parent.removeMovieClip();
Symbol 207 MovieClip [snake_m] Frame 7
stop();
Symbol 226 MovieClip Frame 19
_parent.removeMovieClip();
Symbol 230 MovieClip [dal_m] Frame 5
stop();
Symbol 234 MovieClip [score_disp] Frame 1
stop();
Symbol 246 Button
on (rollOver) {
gotoAndPlay (2);
}
on (rollOut) {
gotoAndPlay (8);
_parent.refalsh();
}
on (release) {
getURL ("http://en.mapleeurope.com/Maple.aspx?PART=/Download/GameDownload");
}
Symbol 250 MovieClip Frame 1
stop();
Symbol 250 MovieClip Frame 2
play();
Symbol 250 MovieClip Frame 7
stop();
Symbol 250 MovieClip Frame 13
stop();
Symbol 254 Button
on (rollOver) {
gotoAndPlay (2);
}
on (rollOut) {
gotoAndPlay (8);
_parent.refalsh();
}
on (release) {
getURL ("http://en.mapleeurope.com/Maple.aspx?PART=/Download/GameDownload");
}
Symbol 255 MovieClip Frame 1
stop();
Symbol 255 MovieClip Frame 2
play();
Symbol 255 MovieClip Frame 7
stop();
Symbol 255 MovieClip Frame 13
stop();
Symbol 258 Button
on (rollOver) {
gotoAndPlay (2);
}
on (rollOut) {
gotoAndPlay (8);
_parent.refalsh();
}
on (release) {
getURL ("http://en.mapleeurope.com/Maple.aspx?PART=/Download/GameDownload");
}
Symbol 259 MovieClip Frame 1
stop();
Symbol 259 MovieClip Frame 2
play();
Symbol 259 MovieClip Frame 7
stop();
Symbol 259 MovieClip Frame 13
stop();
Symbol 263 Button
on (rollOver) {
gotoAndPlay (2);
}
on (rollOut) {
gotoAndPlay (9);
_parent.refalsh();
}
on (release) {
getURL ("http://www.mapleeurope.com");
}
Symbol 266 MovieClip Frame 1
stop();
Symbol 266 MovieClip Frame 2
play();
Symbol 266 MovieClip Frame 8
stop();
Symbol 266 MovieClip Frame 15
stop();
Symbol 280 MovieClip Frame 80
stop();
Symbol 290 Button
on (release) {
gotoAndPlay (75);
}
Symbol 294 Button
on (release) {
gotoAndPlay (35);
}
Symbol 295 Button
on (press) {
tellTarget ("/timelineroot3") {
gotoAndStop (2);
};
}
Symbol 321 Button
on (release) {
gotoAndPlay (3);
}
Symbol 322 MovieClip Frame 1
stop();
Symbol 322 MovieClip Frame 2
stop();
Symbol 322 MovieClip Frame 3
stop();
Symbol 333 MovieClip Frame 7
stop();
Symbol 334 MovieClip Frame 92
stop();
_root.game_restart();
snd_attach("click_sound");
Symbol 337 MovieClip Frame 1
gotoAndStop(4 - _root.life);
Symbol 337 MovieClip Frame 4
stop();
Symbol 340 MovieClip Frame 1
stop();
Symbol 374 MovieClip Frame 20
_root.down_after();
Symbol 382 MovieClip Frame 17
_root.down_after();
Symbol 387 MovieClip Frame 13
_root.down_after();
Symbol 392 MovieClip Frame 33
stop();
Symbol 402 MovieClip Frame 12
_root.down_after();
Symbol 410 MovieClip Frame 6
stop();