Frame 1
_root.start_lives = 5;
_root.start_shurikens = 5;
_root.start_health = 100;
_root.shurikens = _root.start_shurikens;
_root.health = _root.start_health;
_root.deaths = 0;
_root.lives = _root.start_lives;
_root.death_level = "level_one";
_root.debug = false;
stopAllSounds();
loader.gotoAndPlay(2);
stop();
Instance of Symbol 37 MovieClip "loader" in Frame 1
onClipEvent (load) {
injury = false;
}
Frame 2
stopAllSounds();
stop();
Frame 3
stopAllSounds();
stop();
Frame 4
stopAllSounds();
stop();
Frame 5
stopAllSounds();
stop();
Frame 6
stopAllSounds();
stop();
Frame 7
stopAllSounds();
stop();
Frame 8
stopAllSounds();
stop();
Frame 9
stopAllSounds();
stop();
Frame 10
stopAllSounds();
stop();
Frame 11
stopAllSounds();
stop();
Frame 12
stopAllSounds();
stop();
Frame 13
stopAllSounds();
stop();
Frame 14
stopAllSounds();
stop();
Frame 15
stopAllSounds();
stop();
Frame 16
stopAllSounds();
stop();
Frame 17
stopAllSounds();
stop();
Frame 18
stopAllSounds();
stop();
Frame 19
stopAllSounds();
stop();
Frame 20
stopAllSounds();
stop();
Frame 21
stopAllSounds();
stop();
Instance of Symbol 6 MovieClip in Symbol 7 MovieClip [export_shuriken] Frame 1
onClipEvent (load) {
xspeed = 20;
_parent.wait = true;
}
onClipEvent (enterFrame) {
if (_parent.cdir == "left") {
_parent._x = _parent._x - xspeed;
} else {
_parent._x = _parent._x + xspeed;
}
if ((_parent._x < 0) || (_parent._x > _parent._parent.variables.SWFWidth)) {
_parent.removeMovieClip();
}
i = 0;
while (i < _parent._parent.variables.enemy_list.length) {
eName = _parent._parent.variables.enemy_list[i];
if (_parent.hitTest(_parent._parent.level[eName].enemy)) {
_parent._parent.level[eName].health = _parent._parent.level[eName].health - variables:shuriken_damage;
_parent.removeMovieClip();
}
i++;
}
}
Symbol 12 MovieClip [enemy_3_weapon] Frame 1
stop();
Instance of Symbol 11 MovieClip in Symbol 12 MovieClip [enemy_3_weapon] Frame 1
onClipEvent (load) {
posSet = false;
xspeed = 40;
if (_parent.cdir == "right") {
_parent.gotoAndStop(1);
} else {
_parent.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (!posSet) {
posSet = true;
if (_parent.cdir == "right") {
_parent.gotoAndStop(1);
} else {
_parent.gotoAndStop(2);
}
}
if (_parent.cdir == "left") {
_parent._x = _parent._x - xspeed;
} else {
_parent._x = _parent._x + xspeed;
}
if ((_parent._x < 0) || (_parent._x > _parent._parent.variables.SWFWidth)) {
_parent.removeMovieClip();
}
if (_parent.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - _parent.damage);
_parent._parent.character_container.injury = true;
_parent.removeMovieClip();
}
}
Symbol 12 MovieClip [enemy_3_weapon] Frame 2
stop();
Symbol 37 MovieClip Frame 1
loadCount = 0;
loopCount = 0;
stop();
Symbol 37 MovieClip Frame 2
play();
Symbol 37 MovieClip Frame 6
barFill._xscale = 0;
Instance of Symbol 29 MovieClip in Symbol 37 MovieClip Frame 6
onClipEvent (enterFrame) {
this._x = _parent.barFill._x + _parent.barFill._width;
}
Symbol 37 MovieClip Frame 7
loadPercent = _level0.getBytesLoaded() / _level0.getBytesTotal();
loadValue = int(loadPercent * 100);
barFill._xscale = loadValue;
gotoAndPlay (7);
Symbol 37 MovieClip Frame 9
if (loadpercent >= 1) {
gotoAndPlay (10);
} else {
gotoAndPlay (7);
}
Symbol 37 MovieClip Frame 17
_parent.gotoAndPlay("introduction");
stop();
Symbol 44 Button
on (release) {
stopAllSounds();
_parent.gotoAndPlay("instructions");
}
Symbol 86 MovieClip Frame 520
_parent.gotoAndPlay("instructions");
stop();
Symbol 94 MovieClip Frame 70
_root.health = 100;
_root.gotoAndPlay(_root.death_level);
Symbol 179 Button
on (release) {
_root.shurikens = _root.start_shurikens;
_root.health = _root.start_health;
_root.lives = _root.start_lives;
_root.deaths = 0;
_root.gotoAndPlay("instructions");
}
Symbol 180 MovieClip Frame 465
stop();
Symbol 194 Button
on (release) {
level_code = level_code.toLowerCase();
switch (level_code) {
case "axe man" :
_parent.gotoAndPlay("cutscene_one");
break;
case "yamuri" :
_parent.gotoAndPlay("cutscene_two");
break;
case "the river" :
_parent.gotoAndPlay("cutscene_three");
break;
case "capture" :
_parent.gotoAndPlay("cutscene_four");
break;
case "dungeon" :
_parent.gotoAndPlay("cutscene_five");
break;
default :
_parent.gotoAndPlay("level_one");
}
}
Symbol 198 MovieClip Frame 1
level_code = "";
Symbol 205 MovieClip Frame 1
if (!_root.debug) {
this._alpha = 0;
}
Symbol 207 MovieClip Frame 1
if (!variables:debug) {
this._alpha = 0;
}
Symbol 209 MovieClip Frame 1
if (!_root.debug) {
this._alpha = 0;
}
Instance of Symbol 221 MovieClip "head" in Symbol 222 MovieClip Frame 1
onClipEvent (load) {
points = 5;
started = false;
_parent._parent.stop();
}
onClipEvent (enterFrame) {
if ((!variables:game_paused) && (!started)) {
started = true;
_parent._parent.play();
}
if (this.hitTest(_parent._parent._parent._parent.character_container.feet_mask) || (this.hitTest(_parent._parent._parent._parent.character_container.head_mask))) {
_parent._parent._parent._parent.variables.health = _parent._parent._parent._parent.variables.health - points;
_parent._parent._parent._parent.character_container.injury = true;
}
}
Symbol 249 MovieClip Frame 1
stop();
Instance of Symbol 247 MovieClip in Symbol 249 MovieClip Frame 1
onClipEvent (load) {
pickedUp = false;
started = false;
this.stop();
}
onClipEvent (enterFrame) {
if ((!variables:game_paused) && (!started)) {
started = true;
this.play();
}
if (this.hitTest(_parent._parent._parent.character_container.character) && (!pickedUp)) {
pickedUp = true;
_parent._parent._parent.variables.health = _parent._parent._parent.variables.health + _parent.addon;
if (_parent._parent._parent.variables.health > 100) {
_parent._parent._parent.variables.health = 100;
}
_parent.gotoAndPlay(2);
}
}
Symbol 249 MovieClip Frame 10
stop();
Symbol 251 MovieClip Frame 1
stop();
Instance of Symbol 6 MovieClip in Symbol 251 MovieClip Frame 1
onClipEvent (load) {
pickedUp = false;
started = false;
this.stop();
}
onClipEvent (enterFrame) {
if ((!variables:game_paused) && (!started)) {
started = true;
this.play();
}
if (this.hitTest(_parent._parent._parent.character_container.character) && (!pickedUp)) {
pickedUp = true;
_parent._parent._parent.variables.shurikens = _parent._parent._parent.variables.shurikens + _parent.addon;
if (_parent._parent._parent.variables.shurikens > 20) {
_parent._parent._parent.variables.shurikens = 20;
}
_parent.gotoAndPlay(2);
}
}
Symbol 251 MovieClip Frame 10
stop();
Symbol 297 MovieClip Frame 31
_parent.controller.slashing = false;
_parent.controller.donehit = false;
Symbol 300 MovieClip Frame 9
_parent.removeMe = true;
Symbol 301 MovieClip Frame 1
stop();
Instance of Symbol 273 MovieClip "controller" in Symbol 301 MovieClip Frame 1
onClipEvent (load) {
x_left = "x";
x_right = "x";
x_speed = 5;
cdir = "left";
dead = false;
slashing = false;
donehit = false;
frame_walk_left = 1;
frame_walk_right = 2;
frame_hit_left = 3;
frame_hit_right = 4;
frame_die_left = 5;
frame_die_right = 6;
frame_dead = 7;
_parent.enemy.stop();
started = false;
}
onClipEvent (enterFrame) {
if (dead) {
return(undefined);
}
if (variables:game_paused) {
return(undefined);
}
if (!started) {
started = true;
_parent.enemy.play();
}
if ((x_left == "x") || (x_right == "x")) {
x_left = _parent.x_left;
x_right = _parent.x_right;
cdir = _parent.cdir;
x_speed = _parent.x_speed;
}
if (_parent.removeMe) {
dead = true;
_parent.gotoAndStop(frame_dead);
}
if (_parent.health <= 0) {
if (cdir == "left") {
_parent.gotoAndStop(frame_die_left);
} else {
_parent.gotoAndStop(frame_die_right);
}
return(undefined);
}
if (_parent.hitTest(_parent._parent._parent.character_container.character.sword)) {
_parent.health = _parent.health - variables:sword_damage;
}
if (_parent.enemy.sword.hitTest(_parent._parent._parent.character_container) && (!donehit)) {
_parent._parent._parent.variables.health = _parent._parent._parent.variables.health - _parent.strength;
_parent._parent._parent.character_container.injury = true;
donehit = true;
}
if (slashing) {
return(undefined);
}
if (_parent.enemy.locator.hitTest(_parent._parent._parent.character_container)) {
slashing = true;
if (cdir == "left") {
_parent.gotoAndStop(frame_hit_left);
cdir = "right";
} else {
_parent.gotoAndStop(frame_hit_right);
cdir = "left";
}
return(undefined);
}
if (cdir == "left") {
_parent.gotoAndStop(frame_walk_left);
_parent._x = _parent._x - x_speed;
if (_parent._x < x_left) {
_parent._x = x_left;
cdir = "right";
}
}
if (cdir == "right") {
_parent.gotoAndStop(frame_walk_right);
_parent._x = _parent._x + x_speed;
if (_parent._x > x_right) {
_parent._x = x_right;
cdir = "left";
}
}
}
Instance of Symbol 277 MovieClip "health_bar" in Symbol 301 MovieClip Frame 1
onClipEvent (enterFrame) {
percent = Math.ceil((_parent.health / _parent.max_health) * 100);
this.fill._xscale = percent;
}
Symbol 301 MovieClip Frame 2
stop();
Symbol 301 MovieClip Frame 3
stop();
Symbol 301 MovieClip Frame 4
stop();
Symbol 301 MovieClip Frame 5
stop();
Symbol 301 MovieClip Frame 6
stop();
Symbol 301 MovieClip Frame 7
stop();
Symbol 303 MovieClip Frame 2
stop();
Symbol 306 MovieClip Frame 25
Set("variables:game_paused", false);
stop();
Symbol 307 MovieClip Frame 1
stop();
Instance of Symbol 205 MovieClip "platform_1" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_3" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_6" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_7" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_8" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_9" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_10" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_11" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_12" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_13" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_14" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_15" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_16" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 207 MovieClip in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
done = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container) && (!done)) {
_parent._parent.levelcompleted.gotoAndPlay(2);
_parent._parent.character_container.character.stop();
done = true;
}
}
Instance of Symbol 209 MovieClip "ladder_2" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_1" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_3" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 217 MovieClip in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
points = 1;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 249 MovieClip "health_1" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 251 MovieClip in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
addon = 2;
}
Instance of Symbol 249 MovieClip "health_2" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 301 MovieClip "enemy_3" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
x_left = -400;
x_right = -200;
x_speed = 7;
cdir = "right";
max_health = 10;
health = max_health;
strength = 3;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_2" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
x_left = -70;
x_right = 70;
x_speed = 5;
cdir = "left";
max_health = 10;
health = max_health;
strength = 3;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_1" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
x_left = -400;
x_right = -200;
x_speed = 5;
cdir = "left";
max_health = 10;
health = max_health;
strength = 3;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_4" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
x_left = -70;
x_right = 200;
x_speed = 9;
cdir = "right";
max_health = 10;
health = max_health;
strength = 3;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_5" in Symbol 307 MovieClip Frame 1
onClipEvent (load) {
x_left = -70;
x_right = 70;
x_speed = 5;
cdir = "left";
max_health = 10;
health = max_health;
strength = 3;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Symbol 330 MovieClip Frame 1
Set("variables:firing", false);
Symbol 330 MovieClip Frame 2
Set("variables:firing", true);
Symbol 330 MovieClip Frame 5
Set("variables:firing", false);
gotoAndStop (1);
Symbol 337 MovieClip Frame 1
Set("variables:firing", false);
Symbol 337 MovieClip Frame 2
Set("variables:firing", true);
Symbol 337 MovieClip Frame 9
newName = "shuriken_" + variables:current_level;
_parent._parent.attachMovie("export_shuriken", newName, variables:current_level);
variables.:current_level++;
variables:shurikens--;
if (variables:last_direction == "left") {
_parent._parent[newName]._x = _parent._x - 5;
} else {
_parent._parent[newName]._x = _parent._x + 25;
}
_parent._parent[newName]._y = _parent._y - (_parent._height / 2);
_parent._parent[newName].cdir = variables:last_direction;
_parent._parent[newName].wait = false;
Set("variables:firing", false);
gotoAndStop (1);
Symbol 364 MovieClip Frame 1
Set("variables:firing", false);
Symbol 364 MovieClip Frame 2
Set("variables:firing", true);
Symbol 364 MovieClip Frame 5
Set("variables:firing", false);
Symbol 365 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 2
stop();
Symbol 365 MovieClip Frame 3
stop();
Symbol 365 MovieClip Frame 4
stop();
Symbol 365 MovieClip Frame 5
stop();
Symbol 365 MovieClip Frame 6
stop();
Symbol 365 MovieClip Frame 7
stop();
Symbol 365 MovieClip Frame 8
stop();
Symbol 365 MovieClip Frame 9
stop();
Symbol 365 MovieClip Frame 10
stop();
Symbol 365 MovieClip Frame 11
stop();
Symbol 365 MovieClip Frame 12
stop();
Symbol 365 MovieClip Frame 13
stop();
Symbol 365 MovieClip Frame 14
stop();
Symbol 365 MovieClip Frame 15
stop();
Symbol 365 MovieClip Frame 16
stop();
Symbol 365 MovieClip Frame 17
stop();
Symbol 365 MovieClip Frame 18
stop();
Symbol 365 MovieClip Frame 19
stop();
Symbol 398 MovieClip Frame 1
stop();
Symbol 401 MovieClip Frame 1
stop();
Symbol 401 MovieClip Frame 2
stop();
Symbol 405 MovieClip Frame 1
stop();
Symbol 405 MovieClip Frame 2
stop();
Symbol 407 MovieClip Frame 1
stop();
Symbol 407 MovieClip Frame 2
Set("variables:game_paused", true);
Symbol 407 MovieClip Frame 31
stopAllSounds();
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndPlay("cutscene_one");
stop();
Instance of Symbol 307 MovieClip "level" in Symbol 415 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 415 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 415 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 415 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_one";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = true;
point = new Object();
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 2;
sword_damage = 1;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 415 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 415 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 415 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 415 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 415 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 426 MovieClip Frame 24
stop();
Symbol 431 MovieClip Frame 160
_parent.gotoAndPlay("level_two");
Symbol 444 MovieClip Frame 1
donehit = false;
Instance of Symbol 443 MovieClip in Symbol 444 MovieClip Frame 1
onClipEvent (enterFrame) {
if (variables:game_paused) {
_parent.stop();
return(undefined);
}
if ((!variables:game_paused) && (!_parent.started)) {
_parent.started = true;
startpos = random(25) + 60;
_parent.gotoAndPlay(startpos);
}
if (this.hitTest(_parent._parent._parent.character_container.character) && (!donehit)) {
_parent._parent._parent.variables.health = _parent._parent._parent.variables.health - _parent.points;
_parent._parent._parent.character_container.injury = true;
donehit = true;
startpos = random(25) + 60;
gotoAndPlay(startpos);
}
}
Symbol 444 MovieClip Frame 89
gotoAndPlay (1);
Symbol 444 MovieClip Frame 90
stop();
Symbol 478 MovieClip Frame 6
_parent.controller.slashing = false;
_parent.controller.donehit = false;
Symbol 481 MovieClip Frame 9
_parent.removeMe = true;
Symbol 482 MovieClip Frame 1
stop();
Instance of Symbol 459 MovieClip "controller" in Symbol 482 MovieClip Frame 1
onClipEvent (load) {
x_left = "x";
x_right = "x";
x_speed = 5;
cdir = "left";
dead = false;
slashing = false;
donehit = false;
frame_walk_left = 1;
frame_walk_right = 2;
frame_hit_left = 3;
frame_hit_right = 4;
frame_die_left = 5;
frame_die_right = 6;
frame_dead = 7;
_parent.enemy.stop();
started = false;
}
onClipEvent (enterFrame) {
if (dead) {
return(undefined);
}
if (variables:game_paused) {
return(undefined);
}
if (!started) {
started = true;
_parent.enemy.play();
}
if ((x_left == "x") || (x_right == "x")) {
x_left = _parent.x_left;
x_right = _parent.x_right;
cdir = _parent.cdir;
x_speed = _parent.x_speed;
}
if (_parent.removeMe) {
dead = true;
_parent.gotoAndStop(frame_dead);
}
if (_parent.health <= 0) {
if (cdir == "left") {
_parent.gotoAndStop(frame_die_left);
} else {
_parent.gotoAndStop(frame_die_right);
}
return(undefined);
}
if (_parent.hitTest(_parent._parent._parent.character_container.character.sword)) {
_parent.health = _parent.health - variables:sword_damage;
}
if (_parent.enemy.axe.hitTest(_parent._parent._parent.character_container) && (!donehit)) {
_parent._parent._parent.variables.health = _parent._parent._parent.variables.health - _parent.strength;
_parent._parent._parent.character_container.injury = true;
}
if (slashing) {
return(undefined);
}
donehit = true;
if (_parent.enemy.locator.hitTest(_parent._parent._parent.character_container)) {
slashing = true;
if (cdir == "left") {
_parent.gotoAndStop(frame_hit_left);
} else {
_parent.gotoAndStop(frame_hit_right);
}
return(undefined);
}
if (cdir == "left") {
_parent.gotoAndStop(frame_walk_left);
_parent._x = _parent._x - x_speed;
if (_parent._x < x_left) {
_parent._x = x_left;
cdir = "right";
}
}
if (cdir == "right") {
_parent.gotoAndStop(frame_walk_right);
_parent._x = _parent._x + x_speed;
if (_parent._x > x_right) {
_parent._x = x_right;
cdir = "left";
}
}
}
Instance of Symbol 462 MovieClip "health_bar" in Symbol 482 MovieClip Frame 1
onClipEvent (enterFrame) {
percent = Math.ceil((_parent.health / _parent.max_health) * 100);
this.fill._xscale = percent;
}
Symbol 482 MovieClip Frame 2
stop();
Symbol 482 MovieClip Frame 3
stop();
Symbol 482 MovieClip Frame 4
stop();
Symbol 482 MovieClip Frame 5
stop();
Symbol 482 MovieClip Frame 6
stop();
Symbol 482 MovieClip Frame 7
stop();
Symbol 484 MovieClip Frame 2
stop();
Symbol 486 MovieClip Frame 25
Set("variables:game_paused", false);
stop();
Symbol 487 MovieClip Frame 1
stop();
Instance of Symbol 205 MovieClip "platform_1" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_3" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_6" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_8" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_9" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 207 MovieClip in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
done = false;
}
onClipEvent (enterFrame) {
if ((this.hitTest(_parent._parent.character_container) && (!done)) && (_parent.level_boss.controller.dead != false)) {
_parent._parent.levelcompleted.gotoAndPlay(2);
_parent._parent.character_container.character.stop();
Set("variables:game_paused", true);
done = true;
}
}
Instance of Symbol 205 MovieClip "platform_7" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_2" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_1" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 249 MovieClip "health_1" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 251 MovieClip "shurikens_2" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 249 MovieClip "health_2" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 251 MovieClip "shurikens_1" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 249 MovieClip "health_3" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_5" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 301 MovieClip "enemy_1" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
x_left = -740;
x_right = -460;
x_speed = 5;
cdir = "right";
max_health = 20;
health = max_health;
strength = 5;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_2" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
x_left = -600;
x_right = -460;
x_speed = 3;
cdir = "right";
max_health = 20;
health = max_health;
strength = 7;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 444 MovieClip "arrow_1" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
points = 10;
started = false;
stop();
}
Instance of Symbol 444 MovieClip "arrow_2" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
points = 10;
started = false;
stop();
}
Instance of Symbol 444 MovieClip "arrow_3" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
points = 10;
started = false;
stop();
}
Instance of Symbol 482 MovieClip "level_boss" in Symbol 487 MovieClip Frame 1
onClipEvent (load) {
x_left = -70;
x_right = 70;
x_speed = 3;
cdir = "right";
max_health = 50;
health = max_health;
strength = 10;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Symbol 488 MovieClip Frame 1
stop();
Symbol 488 MovieClip Frame 2
Set("variables:game_paused", true);
Symbol 488 MovieClip Frame 31
stopAllSounds();
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndPlay("cutscene_two");
stop();
Instance of Symbol 487 MovieClip "level" in Symbol 489 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 489 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 489 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 489 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_two";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = true;
point = new Object();
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 4;
sword_damage = 1.5;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 511 MovieClip Frame 55
_root.gotoAndStop("level_three");
Instance of Symbol 539 MovieClip "controller" in Symbol 540 MovieClip Frame 1
onClipEvent (load) {
if (!_root.debug) {
_parent._alpha = 0;
}
}
onClipEvent (enterFrame) {
function platformMoveNinjai(dir, speed) {
if (_parent.hitTest(_parent._parent._parent.character_container.feet_mask)) {
if (dir == "right") {
if ((_parent._parent._parent.character_container._x >= variables:scroll_right) && ((_parent._parent._x + _parent._parent.background._width) > ((_parent._parent.startX + variables:SWFWidth) + 20))) {
_parent._parent._x = _parent._parent._x - speed;
} else {
_parent._parent._parent.character_container._x = _parent._parent._parent.character_container._x + speed;
}
} else if (dir == "left") {
if ((_parent._parent._parent.character_container._x <= variables:scroll_left) && (_parent._parent._x < _parent._parent.startX)) {
_parent._parent._x = _parent._parent._x + speed;
} else {
_parent._parent._parent.character_container._x = _parent._parent._parent.character_container._x - speed;
}
}
}
}
if (_parent.cdir == "left") {
_parent._x = _parent._x - _parent.x_speed;
platformMoveNinjai(_parent.cdir, _parent.x_speed);
if (_parent._x < _parent.x_left) {
_parent._x = _parent.x_left;
_parent.cdir = "right";
}
}
if (_parent.cdir == "right") {
_parent._x = _parent._x + _parent.x_speed;
platformMoveNinjai(_parent.cdir, _parent.x_speed);
if (_parent._x > _parent.x_right) {
_parent._x = _parent.x_right;
_parent.cdir = "left";
}
}
}
Symbol 549 MovieClip Frame 1
_parent.inair = false;
_parent.firepossible = false;
Symbol 549 MovieClip Frame 3
_parent.inair = true;
Symbol 549 MovieClip Frame 15
_parent.inair = false;
Symbol 549 MovieClip Frame 21
_parent.firepossible = true;
Symbol 555 MovieClip Frame 10
_parent.firepossible = false;
_parent.controller.slashing = false;
_parent.inair = true;
tbounds = new Object();
tbounds = _parent.getBounds(_root.game_container);
newName = "enemy_3_" + variables:current_level;
_parent._parent._parent.attachMovie("enemy_3_weapon", newName, variables:current_level);
variables:current_level++;
_parent._parent._parent[newName]._x = tbounds.xMin + ((tbounds.xMax - tbounds.xMin) / 2);
_parent._parent._parent[newName]._y = (tbounds.yMin + ((tbounds.yMax - tbounds.yMin) / 2)) + 20;
_parent._parent._parent[newName].cdir = _parent.controller.throwDir;
_parent._parent._parent[newName].damage = _parent.strength;
Symbol 558 MovieClip Frame 9
_parent.removeMe = true;
Symbol 559 MovieClip Frame 1
stop();
Instance of Symbol 550 MovieClip "controller" in Symbol 559 MovieClip Frame 1
onClipEvent (load) {
x_left = "x";
x_right = "x";
x_speed = 5;
cdir = "left";
dead = false;
slashing = false;
donehit = false;
frame_walk_left = 1;
frame_walk_right = 2;
frame_hit_left = 3;
frame_hit_right = 4;
frame_die_left = 5;
frame_die_right = 6;
frame_dead = 7;
_parent.enemy.stop();
started = false;
}
onClipEvent (enterFrame) {
if (dead) {
return(undefined);
}
if (!started) {
started = true;
_parent.enemy.play();
}
if ((x_left == "x") || (x_right == "x")) {
x_left = _parent.x_left;
x_right = _parent.x_right;
cdir = _parent.cdir;
x_speed = _parent.x_speed;
}
if (_parent.removeMe) {
dead = true;
_parent.gotoAndStop(frame_dead);
}
if (_parent.health <= 0) {
_parent.dead = true;
if (cdir == "left") {
_parent.gotoAndStop(frame_die_left);
} else {
_parent.gotoAndStop(frame_die_right);
}
return(undefined);
}
if (_parent.hitTest(_parent._parent._parent.character_container.character.sword)) {
_parent.health = _parent.health - variables:sword_damage;
}
if (slashing) {
return(undefined);
}
if (_parent.firepossible && (!slashing)) {
ninjaiPos = _parent._parent._parent.character_container.my_bounds.xMin + (_parent._parent._parent.character_container._width / 2);
enemyPos = _parent.enemy_bounds.xMin + (_parent._width / 2);
slashing = true;
_parent.enemy.stop();
if (enemyPos < ninjaiPos) {
throwDir = "right";
_parent.gotoAndStop(frame_hit_right);
} else {
throwDir = "left";
_parent.gotoAndStop(frame_hit_left);
}
}
if ((cdir == "left") && (_parent.inair)) {
_parent.gotoAndStop(frame_walk_left);
_parent._x = _parent._x - x_speed;
if (_parent._x < x_left) {
_parent._x = x_left;
cdir = "right";
}
}
if ((cdir == "right") && (_parent.inair)) {
_parent.gotoAndStop(frame_walk_right);
_parent._x = _parent._x + x_speed;
if (_parent._x > x_right) {
_parent._x = x_right;
cdir = "left";
}
}
}
Instance of Symbol 277 MovieClip "health_bar" in Symbol 559 MovieClip Frame 1
onClipEvent (enterFrame) {
percent = Math.ceil((_parent.health / _parent.max_health) * 100);
this.fill._xscale = percent;
}
Symbol 559 MovieClip Frame 2
stop();
Symbol 559 MovieClip Frame 3
stop();
Symbol 559 MovieClip Frame 4
stop();
Symbol 559 MovieClip Frame 5
stop();
Symbol 559 MovieClip Frame 6
stop();
Symbol 559 MovieClip Frame 7
stop();
Symbol 561 MovieClip Frame 2
stop();
Symbol 562 MovieClip Frame 1
stop();
Instance of Symbol 249 MovieClip "health_2" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 251 MovieClip "shurikens_1" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 249 MovieClip "health_3" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_5" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 251 MovieClip "shurikens_2" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 536 MovieClip in Symbol 562 MovieClip Frame 1
onClipEvent (enterFrame) {
this._x = _parent.move_platform_1._x;
}
Instance of Symbol 205 MovieClip "platform_1" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_3" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_6" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 207 MovieClip "level_done" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
done = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container) && (!done)) {
_parent._parent.levelcompleted.gotoAndPlay(2);
_parent._parent.character_container.character.stop();
Set("variables:game_paused", true);
done = true;
}
}
Instance of Symbol 205 MovieClip "platform_7" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_8" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_9" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_10" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_11" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_12" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_13" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_14" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_15" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 540 MovieClip "move_platform_1" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
x_left = -530;
x_right = 450;
x_speed = 5;
cdir = "left";
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_2" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_1" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_3" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_1" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
x_left = -380;
x_right = -195;
x_speed = 5;
cdir = "right";
max_health = 20;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_2" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
x_left = 200;
x_right = 570;
x_speed = 7;
cdir = "right";
max_health = 20;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 559 MovieClip "enemy_5" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
x_left = -650;
x_right = -350;
x_speed = 9;
cdir = "right";
max_health = 40;
health = max_health;
strength = 25;
removeMe = false;
pushed = false;
enemy_bounds = new Object();
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
enemy_bounds = getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_3" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
x_left = 200;
x_right = 570;
x_speed = 9;
cdir = "left";
max_health = 20;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_4" in Symbol 562 MovieClip Frame 1
onClipEvent (load) {
x_left = -650;
x_right = -350;
x_speed = 7;
cdir = "right";
max_health = 20;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Symbol 563 MovieClip Frame 1
stop();
Symbol 563 MovieClip Frame 2
Set("variables:game_paused", true);
Symbol 563 MovieClip Frame 31
stopAllSounds();
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndPlay("cutscene_three");
stop();
Symbol 565 MovieClip Frame 25
Set("variables:game_paused", false);
stop();
Instance of Symbol 562 MovieClip "level" in Symbol 566 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 566 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 566 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 566 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_three";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = true;
point = new Object();
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 5;
sword_damage = 1.5;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 566 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 566 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 566 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 566 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 566 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 603 MovieClip Frame 35
stop();
Symbol 607 MovieClip Frame 295
_root.gotoAndPlay("level_four");
stop();
Symbol 620 MovieClip Frame 1
stop();
Symbol 620 MovieClip Frame 2
_parent.wall._alpha = 75;
Symbol 620 MovieClip Frame 4
_parent.wall._alpha = 60;
Symbol 620 MovieClip Frame 6
_parent.wall._alpha = 30;
Symbol 620 MovieClip Frame 8
_parent.wall._alpha = 15;
Symbol 620 MovieClip Frame 9
_parent.wall._alpha = 0;
stop();
Symbol 620 MovieClip Frame 10
_parent.wall._alpha = 15;
Symbol 620 MovieClip Frame 12
_parent.wall._alpha = 30;
Symbol 620 MovieClip Frame 14
_parent.wall._alpha = 60;
Symbol 620 MovieClip Frame 16
_parent.wall._alpha = 75;
Symbol 620 MovieClip Frame 18
_parent.wall._alpha = 100;
stop();
Instance of Symbol 620 MovieClip "door" in Symbol 621 MovieClip Frame 1
onClipEvent (load) {
isOpen = false;
}
onClipEvent (enterFrame) {
if ((this.hitTest(_parent._parent._parent.character_container.character) && (variables:has_key)) && (!isOpen)) {
isOpen = true;
this.gotoAndPlay(2);
}
if (((!this.hitTest(_parent._parent._parent.character_container.character)) && (variables:has_key)) && (isOpen)) {
isOpen = false;
this.gotoAndPlay(10);
}
}
Symbol 633 MovieClip Frame 1
stop();
Symbol 633 MovieClip Frame 11
stop();
Symbol 634 MovieClip Frame 2
stop();
Symbol 635 MovieClip Frame 1
stop();
Instance of Symbol 251 MovieClip "shurikens_1" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 249 MovieClip "health_3" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_5" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 251 MovieClip "shurikens_2" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 625 MovieClip "boat_01" in Symbol 635 MovieClip Frame 1
onClipEvent (enterFrame) {
this._x = _parent.move_platform_1._x;
}
Instance of Symbol 625 MovieClip "boat_01" in Symbol 635 MovieClip Frame 1
onClipEvent (enterFrame) {
this._x = _parent.move_platform_2._x;
}
Instance of Symbol 633 MovieClip in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
picked_up = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.character) && (!picked_up)) {
picked_up = true;
Set("variables:has_key", true);
pos = -1;
i = 0;
while (i < _parent.platforms.length) {
if (_parent.platforms[i] == "door_blocker_01") {
pos = i;
}
i++;
}
if (pos != 1) {
_parent.platforms.splice(pos, 1);
}
gotoAndPlay (2);
}
}
Instance of Symbol 205 MovieClip "platform_1" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
points = 3.5;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 205 MovieClip "platform_3" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_6" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 207 MovieClip "level_done" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
done = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container) && (!done)) {
_parent._parent.levelcompleted.gotoAndPlay(2);
_parent._parent.character_container.character.stop();
Set("variables:game_paused", true);
done = true;
}
}
Instance of Symbol 205 MovieClip "platform_7" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_8" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_9" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_10" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_11" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "door_blocker_01" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 540 MovieClip "move_platform_1" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
x_left = -580;
x_right = -440;
x_speed = 2;
cdir = "left";
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 540 MovieClip "move_platform_2" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
x_left = -40;
x_right = 80;
x_speed = 2;
cdir = "left";
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_2" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_1" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_3" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_4" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_5" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_1" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
x_left = -714;
x_right = -314;
x_speed = 5;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_2" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
x_left = -270;
x_right = -140;
x_speed = 5;
cdir = "right";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 559 MovieClip "enemy_5" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
x_left = 185;
x_right = 375;
x_speed = 5;
cdir = "right";
max_health = 40;
health = max_health;
strength = 25;
removeMe = false;
pushed = false;
enemy_bounds = new Object();
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
enemy_bounds = getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_3" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
x_left = 520;
x_right = 670;
x_speed = 6;
cdir = "left";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_4" in Symbol 635 MovieClip Frame 1
onClipEvent (load) {
x_left = -714;
x_right = -314;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Symbol 652 MovieClip Frame 1
stop();
Symbol 652 MovieClip Frame 2
Set("variables:game_paused", true);
Symbol 652 MovieClip Frame 31
stopAllSounds();
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndPlay("cutscene_four");
stop();
Symbol 654 MovieClip Frame 25
Set("variables:game_paused", false);
stop();
Instance of Symbol 635 MovieClip "level" in Symbol 655 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 655 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 637 MovieClip in Symbol 655 MovieClip Frame 1
onClipEvent (load) {
diff = _parent.level._y - this._y;
}
onClipEvent (enterFrame) {
this._y = _parent.level._y - diff;
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 655 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 655 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_four";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = true;
point = new Object();
has_key = false;
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 5;
sword_damage = 1.5;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 655 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 655 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 655 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 655 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 655 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 732 MovieClip Frame 231
stop();
Symbol 733 MovieClip Frame 295
stop();
Symbol 734 MovieClip Frame 470
_root.gotoAndPlay("level_five");
Symbol 744 MovieClip Frame 2
stop();
Symbol 745 MovieClip Frame 1
stop();
Instance of Symbol 249 MovieClip "health_3" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_5" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 743 MovieClip in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
points = 2;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 743 MovieClip in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
points = 2;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 743 MovieClip in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
points = 2;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 743 MovieClip in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
points = 2;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 743 MovieClip in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
points = 2;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 743 MovieClip in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
points = 2;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 743 MovieClip in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
points = 2;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.feet_mask)) {
_parent._parent.variables.health = _parent._parent.variables.health - points;
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 205 MovieClip "platform_1" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_3" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_6" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 207 MovieClip "level_done" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
done = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container) && (!done)) {
done = true;
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndStop("level_six");
}
}
Instance of Symbol 205 MovieClip "platform_7" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_8" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_2" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_1" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_3" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_4" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_5" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_1" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
x_left = -700;
x_right = -354;
x_speed = 5;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_2" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
x_left = -700;
x_right = -354;
x_speed = 8;
cdir = "right";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 559 MovieClip "enemy_5" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
x_left = -235;
x_right = 100;
x_speed = 5;
cdir = "right";
max_health = 40;
health = max_health;
strength = 20;
removeMe = false;
pushed = false;
enemy_bounds = new Object();
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
enemy_bounds = getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_3" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
x_left = 320;
x_right = 580;
x_speed = 5;
cdir = "left";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_4" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
x_left = 320;
x_right = 580;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_6" in Symbol 745 MovieClip Frame 1
onClipEvent (load) {
x_left = -235;
x_right = 100;
x_speed = 5;
cdir = "left";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Symbol 747 MovieClip Frame 25
Set("variables:game_paused", false);
stop();
Instance of Symbol 745 MovieClip "level" in Symbol 748 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 748 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 748 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 748 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_five";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = true;
point = new Object();
has_key = false;
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 5;
sword_damage = 1.5;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 748 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 748 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 748 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 748 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 748 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 795 MovieClip Frame 32
_parent.controller.slashing = false;
_parent.controller.donehit = false;
Symbol 798 MovieClip Frame 9
_parent.removeMe = true;
Symbol 799 MovieClip Frame 1
stop();
Instance of Symbol 775 MovieClip "controller" in Symbol 799 MovieClip Frame 1
onClipEvent (load) {
x_left = "x";
x_right = "x";
x_speed = 5;
cdir = "left";
dead = false;
slashing = false;
donehit = false;
frame_walk_left = 1;
frame_walk_right = 2;
frame_hit_left = 3;
frame_hit_right = 4;
frame_die_left = 5;
frame_die_right = 6;
frame_dead = 7;
_parent.enemy.stop();
started = false;
}
onClipEvent (enterFrame) {
if (dead) {
return(undefined);
}
if (variables:game_paused) {
return(undefined);
}
if (!started) {
started = true;
_parent.enemy.play();
}
if ((x_left == "x") || (x_right == "x")) {
x_left = _parent.x_left;
x_right = _parent.x_right;
cdir = _parent.cdir;
x_speed = _parent.x_speed;
}
if (_parent.removeMe) {
dead = true;
_parent.gotoAndStop(frame_dead);
}
if (_parent.health <= 0) {
if (cdir == "left") {
_parent.gotoAndStop(frame_die_left);
} else {
_parent.gotoAndStop(frame_die_right);
}
return(undefined);
}
if (_parent.hitTest(_parent._parent._parent.character_container.character.sword)) {
_parent.health = _parent.health - variables:sword_damage;
}
if (_parent.enemy.sword.hitTest(_parent._parent._parent.character_container.character) && (!donehit)) {
_parent._parent._parent.variables.health = _parent._parent._parent.variables.health - _parent.strength;
_parent._parent._parent.character_container.injury = true;
donehit = true;
}
if (slashing) {
return(undefined);
}
if (_parent.enemy.locator.hitTest(_parent._parent._parent.character_container)) {
slashing = true;
if (cdir == "left") {
_parent.gotoAndStop(frame_hit_left);
cdir = "right";
} else {
_parent.gotoAndStop(frame_hit_right);
cdir = "left";
}
return(undefined);
}
if (cdir == "left") {
_parent.gotoAndStop(frame_walk_left);
_parent._x = _parent._x - x_speed;
if (_parent._x < x_left) {
_parent._x = x_left;
cdir = "right";
}
}
if (cdir == "right") {
_parent.gotoAndStop(frame_walk_right);
_parent._x = _parent._x + x_speed;
if (_parent._x > x_right) {
_parent._x = x_right;
cdir = "left";
}
}
}
Instance of Symbol 277 MovieClip "health_bar" in Symbol 799 MovieClip Frame 1
onClipEvent (enterFrame) {
percent = Math.ceil((_parent.health / _parent.max_health) * 100);
this.fill._xscale = percent;
}
Symbol 799 MovieClip Frame 2
stop();
Symbol 799 MovieClip Frame 3
stop();
Symbol 799 MovieClip Frame 4
stop();
Symbol 799 MovieClip Frame 5
stop();
Symbol 799 MovieClip Frame 6
stop();
Symbol 799 MovieClip Frame 7
stop();
Symbol 800 MovieClip Frame 2
stop();
Symbol 801 MovieClip Frame 1
stop();
Instance of Symbol 249 MovieClip "health_3" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_5" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_1" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_2" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 205 MovieClip "platform_1" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_3" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_6" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 207 MovieClip "level_done" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
done = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container) && (!done)) {
_parent._parent.levelcompleted.gotoAndPlay(2);
_parent._parent.character_container.character.stop();
Set("variables:game_paused", true);
done = true;
}
}
Instance of Symbol 205 MovieClip "platform_7" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_8" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_1" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_1" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
x_left = -690;
x_right = -470;
x_speed = 4;
cdir = "right";
max_health = 30;
health = max_health;
strength = 10;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 559 MovieClip "enemy_5" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
x_left = -330;
x_right = -130;
x_speed = 5;
cdir = "right";
max_health = 40;
health = max_health;
strength = 20;
removeMe = false;
pushed = false;
enemy_bounds = new Object();
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
enemy_bounds = getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_3" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
x_left = 120;
x_right = 600;
x_speed = 5;
cdir = "left";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_4" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
x_left = 120;
x_right = 600;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 799 MovieClip "enemy_6" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
x_left = -690;
x_right = -470;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 799 MovieClip "enemy_7" in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
x_left = -330;
x_right = -130;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Symbol 802 MovieClip Frame 1
stop();
Symbol 802 MovieClip Frame 2
Set("variables:game_paused", true);
Symbol 802 MovieClip Frame 31
stopAllSounds();
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndPlay("cutscene_five");
stop();
Symbol 803 MovieClip Frame 1
stop();
Instance of Symbol 801 MovieClip "level" in Symbol 803 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 803 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 803 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 803 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_five";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = false;
point = new Object();
has_key = false;
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 5;
sword_damage = 1.5;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 803 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 803 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 803 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 803 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 803 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 837 MovieClip Frame 1
stop();
Symbol 837 MovieClip Frame 2
stop();
Symbol 837 MovieClip Frame 3
stop();
Symbol 837 MovieClip Frame 4
stop();
Symbol 837 MovieClip Frame 5
stop();
Symbol 837 MovieClip Frame 6
stop();
Symbol 837 MovieClip Frame 7
stop();
Symbol 837 MovieClip Frame 8
stop();
Symbol 837 MovieClip Frame 9
stop();
Symbol 837 MovieClip Frame 10
stop();
Symbol 837 MovieClip Frame 11
stop();
Symbol 837 MovieClip Frame 12
stop();
Symbol 837 MovieClip Frame 13
stop();
Instance of Symbol 837 MovieClip in Symbol 838 MovieClip Frame 8
onClipEvent (load) {
curFrame = 2;
direction = 1;
gotoAndStop(curFrame - direction);
}
onClipEvent (enterFrame) {
if ((curFrame > 0) && (curFrame < 14)) {
curFrame = curFrame + direction;
gotoAndStop(curFrame);
} else {
stop();
}
}
Instance of Symbol 837 MovieClip in Symbol 838 MovieClip Frame 102
onClipEvent (load) {
curFrame = 12;
direction = -1;
gotoAndStop(curFrame - direction);
}
onClipEvent (enterFrame) {
if ((curFrame > 0) && (curFrame < 14)) {
curFrame = curFrame + direction;
gotoAndStop(curFrame);
} else {
stop();
}
}
Instance of Symbol 837 MovieClip in Symbol 838 MovieClip Frame 116
onClipEvent (load) {
curFrame = 2;
direction = 1;
gotoAndStop(curFrame - direction);
}
onClipEvent (enterFrame) {
if ((curFrame > 0) && (curFrame < 14)) {
curFrame = curFrame + direction;
gotoAndStop(curFrame);
} else {
stop();
}
}
Instance of Symbol 837 MovieClip in Symbol 838 MovieClip Frame 190
onClipEvent (load) {
curFrame = 12;
direction = -1;
gotoAndStop(curFrame - direction);
}
onClipEvent (enterFrame) {
if ((curFrame > 0) && (curFrame < 14)) {
curFrame = curFrame + direction;
gotoAndStop(curFrame);
} else {
stop();
}
}
Instance of Symbol 837 MovieClip in Symbol 838 MovieClip Frame 201
onClipEvent (load) {
curFrame = 2;
direction = 1;
gotoAndStop(curFrame - direction);
}
onClipEvent (enterFrame) {
if ((curFrame > 0) && (curFrame < 14)) {
curFrame = curFrame + direction;
gotoAndStop(curFrame);
} else {
stop();
}
}
Instance of Symbol 837 MovieClip in Symbol 838 MovieClip Frame 240
onClipEvent (load) {
curFrame = 12;
direction = -1;
gotoAndStop(curFrame - direction);
}
onClipEvent (enterFrame) {
if ((curFrame > 0) && (curFrame < 14)) {
curFrame = curFrame + direction;
gotoAndStop(curFrame);
} else {
stop();
}
}
Symbol 838 MovieClip Frame 320
stop();
Symbol 841 MovieClip Frame 455
stopAllSounds();
_root.gotoAndPlay("level_seven");
Symbol 846 MovieClip Frame 1
stop();
Symbol 846 MovieClip Frame 11
stop();
Symbol 863 MovieClip Frame 1
stop();
Symbol 863 MovieClip Frame 7
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndStop("level_eight");
stop();
Instance of Symbol 863 MovieClip "door" in Symbol 865 MovieClip Frame 1
onClipEvent (load) {
hasOpened = false;
}
onClipEvent (enterFrame) {
if ((this.hitTest(_parent._parent._parent.character_container.character) && (!hasOpened)) && (variables:has_key)) {
hasOpened = true;
Set("variables:game_paused", true);
this.gotoAndPlay(2);
}
}
Symbol 876 MovieClip Frame 2
stop();
Symbol 877 MovieClip Frame 1
stop();
Instance of Symbol 251 MovieClip "shurikens_1" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 251 MovieClip "shurikens_2" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 846 MovieClip in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
picked_up = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.character) && (!picked_up)) {
picked_up = true;
Set("variables:has_key", true);
gotoAndPlay (2);
}
}
Instance of Symbol 856 MovieClip in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
damage = 3;
started = false;
startpos = random(50) + 25;
this.gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!variables:game_paused) && (!started)) {
started = true;
this.play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if ((this.rock_01.hitTest(_parent._parent.character_container.character) || (this.rock_02.hitTest(_parent._parent.character_container.character))) || (this.rock_03.hitTest(_parent._parent.character_container.character))) {
Set("variables:health", variables:health - damage);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 856 MovieClip in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
damage = 3;
started = false;
startpos = random(50) + 25;
this.gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!variables:game_paused) && (!started)) {
started = true;
this.play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if ((this.rock_01.hitTest(_parent._parent.character_container.character) || (this.rock_02.hitTest(_parent._parent.character_container.character))) || (this.rock_03.hitTest(_parent._parent.character_container.character))) {
Set("variables:health", variables:health - damage);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 860 MovieClip in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 869 MovieClip in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 869 MovieClip in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 249 MovieClip "health_3" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_5" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 860 MovieClip in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 875 MovieClip in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
started = false;
this.stop();
damage = 3;
}
onClipEvent (enterFrame) {
if ((!variables:game_paused) && (!started)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - damage);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 205 MovieClip "platform_1" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_2" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 799 MovieClip "enemy_1" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
x_left = -600;
x_right = 320;
x_speed = 5;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_2" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
x_left = -600;
x_right = 320;
x_speed = 9;
cdir = "right";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_3" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
x_left = 260;
x_right = 620;
x_speed = 6;
cdir = "left";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 799 MovieClip "enemy_4" in Symbol 877 MovieClip Frame 1
onClipEvent (load) {
x_left = 260;
x_right = 620;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Symbol 879 MovieClip Frame 1
stop();
Symbol 879 MovieClip Frame 2
Set("variables:game_paused", true);
Symbol 879 MovieClip Frame 31
stopAllSounds();
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndPlay("cutscene_four");
stop();
Symbol 881 MovieClip Frame 25
Set("variables:game_paused", false);
stop();
Instance of Symbol 877 MovieClip "level" in Symbol 882 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 882 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 882 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 882 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_seven";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = true;
point = new Object();
has_key = false;
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 7;
sword_damage = 2;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 882 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 882 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 882 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 882 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 882 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 885 MovieClip Frame 1
stop();
Symbol 885 MovieClip Frame 11
stop();
Symbol 905 MovieClip Frame 1
stop();
Symbol 905 MovieClip Frame 7
_root.shurikens = variables:shurikens;
_root.health = variables:health;
_root.gotoAndStop("level_nine");
stop();
Instance of Symbol 905 MovieClip "door" in Symbol 907 MovieClip Frame 1
onClipEvent (load) {
hasOpened = false;
}
onClipEvent (enterFrame) {
if ((this.hitTest(_parent._parent._parent.character_container.character) && (!hasOpened)) && (variables:has_key)) {
hasOpened = true;
Set("variables:game_paused", true);
this.gotoAndPlay(2);
}
}
Symbol 908 MovieClip Frame 2
stop();
Symbol 909 MovieClip Frame 1
stop();
Instance of Symbol 251 MovieClip "shurikens_1" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
addon = 25;
}
Instance of Symbol 251 MovieClip "shurikens_2" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 885 MovieClip in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
picked_up = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.character) && (!picked_up)) {
picked_up = true;
Set("variables:has_key", true);
gotoAndPlay (2);
}
}
Instance of Symbol 892 MovieClip in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 249 MovieClip "health_3" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
addon = 10;
}
Instance of Symbol 249 MovieClip "health_5" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
addon = 25;
}
Instance of Symbol 894 MovieClip in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 892 MovieClip in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 894 MovieClip in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 894 MovieClip in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 892 MovieClip in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 249 MovieClip "health_1" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
addon = 25;
}
Instance of Symbol 205 MovieClip "platform_1" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_6" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_7" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_8" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_9" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_10" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_11" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "blocker_01" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_12" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_13" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_14" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "blocker_02" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "blocker_03" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "blocker_04" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "blocker_05" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_2" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_4" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_3" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_5" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_1" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_8" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_6" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_9" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_7" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_1" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
x_left = 10;
x_right = 600;
x_speed = 5;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 799 MovieClip "enemy_2" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
x_left = 10;
x_right = 600;
x_speed = 9;
cdir = "right";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_3" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
x_left = -660;
x_right = -290;
x_speed = 6;
cdir = "left";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 799 MovieClip "enemy_4" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
x_left = -470;
x_right = -230;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 799 MovieClip "enemy_5" in Symbol 909 MovieClip Frame 1
onClipEvent (load) {
x_left = -670;
x_right = -410;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 909 MovieClip "level" in Symbol 910 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 910 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 910 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 910 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_eight";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = false;
point = new Object();
has_key = false;
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 7;
sword_damage = 2;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 910 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 910 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 910 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 910 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 910 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 917 MovieClip Frame 1
stop();
Symbol 917 MovieClip Frame 11
stop();
Symbol 940 MovieClip Frame 1
stop();
Symbol 947 MovieClip Frame 1
stop();
Instance of Symbol 949 MovieClip "controller" in Symbol 950 MovieClip Frame 1
onClipEvent (load) {
if (!_root.debug) {
_parent._alpha = 0;
}
}
onClipEvent (enterFrame) {
function platformMoveNinjai(dir, speed) {
if (_parent.hitTest(_parent._parent._parent.character_container.feet_mask)) {
if (dir == "up") {
if ((_parent._parent._parent.character_container._y <= variables:scroll_up) && (_parent._parent._y < (_parent._parent._height - 20))) {
_parent._parent._y = _parent._parent._y + speed;
} else {
_parent._parent._parent.character_container._y = _parent._parent._parent.character_container._y - speed;
}
} else if (dir == "down") {
if ((_parent._parent._parent.character_container._y >= variables:scroll_down) && (_parent._parent._y > _parent._parent.startY)) {
_parent._parent._parent.character_container._y = _parent._parent._parent.character_container._y - speed;
_parent._parent._y = _parent._parent._y - speed;
}
}
}
}
if (_parent.cdir == "up") {
_parent._y = _parent._y - _parent.y_speed;
platformMoveNinjai(_parent.cdir, _parent.y_speed);
if (_parent._y < _parent.y_top) {
_parent._y = _parent.y_top;
_parent.cdir = "down";
}
}
if (_parent.cdir == "down") {
if (_parent.hitTest(_parent._parent._parent.character_container.feet_mask)) {
_parent._parent._parent.character_container._y = _parent._parent._parent.character_container._y + _parent.y_speed;
}
_parent._y = _parent._y + _parent.y_speed;
platformMoveNinjai(_parent.cdir, _parent.y_speed);
if (_parent._y > _parent.y_bottom) {
_parent._y = _parent.y_bottom;
_parent.cdir = "up";
}
}
}
Instance of Symbol 952 MovieClip "controller" in Symbol 953 MovieClip Frame 1
onClipEvent (load) {
if (!_root.debug) {
_parent._alpha = 0;
}
}
onClipEvent (enterFrame) {
function platformMoveNinjai(dir, speed) {
if (_parent.hitTest(_parent._parent._parent.character_container.feet_mask)) {
if (dir == "up") {
if ((_parent._parent._parent.character_container._y <= variables:scroll_up) && (_parent._parent._y < (_parent._parent._height - 20))) {
_parent._parent._y = _parent._parent._y + speed;
} else {
_parent._parent._parent.character_container._y = _parent._parent._parent.character_container._y - speed;
}
} else if (dir == "down") {
if ((_parent._parent._parent.character_container._y >= variables:scroll_down) && (_parent._parent._y > _parent._parent.startY)) {
_parent._parent._parent.character_container._y = _parent._parent._parent.character_container._y - speed;
_parent._parent._y = _parent._parent._y - speed;
}
}
}
}
if (((_parent.cdir == "stop") || (_parent.cdir == "up")) && (_parent.hitTest(_parent._parent._parent.character_container.feet_mask))) {
_parent.cdir = "down";
}
if (_parent.cdir == "up") {
_parent._y = _parent._y - _parent.y_speed;
platformMoveNinjai(_parent.cdir, _parent.y_speed);
if (_parent._y < _parent.y_top) {
_parent._y = _parent.y_top;
_parent.cdir = "stop";
}
}
if (_parent.cdir == "down") {
if (_parent.hitTest(_parent._parent._parent.character_container.feet_mask)) {
_parent._parent._parent.character_container._y = _parent._parent._parent.character_container._y + _parent.y_speed;
}
_parent._y = _parent._y + _parent.y_speed;
platformMoveNinjai(_parent.cdir, _parent.y_speed);
if (_parent._y > _parent.y_bottom) {
_parent._y = _parent.y_bottom;
_parent.cdir = "up";
}
}
}
Symbol 956 MovieClip Frame 1
stop();
Instance of Symbol 955 MovieClip "controller" in Symbol 956 MovieClip Frame 1
onClipEvent (load) {
if (!_root.debug) {
_parent._alpha = 0;
}
crumbling = false;
counter = 1;
}
onClipEvent (enterFrame) {
if (_parent.hitTest(_parent._parent._parent.character_container.feet_mask) && (!crumbling)) {
crumbling = true;
}
vanishPoint = _parent.FrameOn + 2;
endPoint = (_parent.FrameOn + _parent.FrameOff) + 2;
if (crumbling) {
switch (counter) {
case 1 :
_parent.gotoAndStop(2);
break;
case vanishPoint :
_parent.gotoAndStop(3);
break;
case endPoint :
_parent.gotoAndStop(1);
counter = 0;
crumbling = false;
}
counter++;
}
}
Symbol 956 MovieClip Frame 2
stop();
Symbol 956 MovieClip Frame 3
stop();
Symbol 982 MovieClip Frame 9
_parent.removeMe = true;
Symbol 983 MovieClip Frame 1
stop();
Instance of Symbol 968 MovieClip "controller" in Symbol 983 MovieClip Frame 1
onClipEvent (load) {
x_left = "x";
x_right = "x";
x_speed = 5;
cdir = "left";
dead = false;
slashing = false;
donehit = false;
frame_walk_left = 1;
frame_walk_right = 2;
frame_hit_left = 3;
frame_hit_right = 4;
frame_die_left = 5;
frame_die_right = 6;
frame_dead = 7;
_parent.enemy.stop();
started = false;
}
onClipEvent (enterFrame) {
if (dead) {
return(undefined);
}
if (variables:game_paused) {
return(undefined);
}
if (!started) {
started = true;
_parent.enemy.play();
}
if ((x_left == "x") || (x_right == "x")) {
x_left = _parent.x_left;
x_right = _parent.x_right;
cdir = _parent.cdir;
x_speed = _parent.x_speed;
}
if (_parent.removeMe) {
dead = true;
_parent.gotoAndStop(frame_dead);
}
if (_parent.health <= 0) {
_parent.dead = true;
if (cdir == "left") {
_parent.gotoAndStop(frame_die_left);
} else {
_parent.gotoAndStop(frame_die_right);
}
return(undefined);
}
if (_parent.hitTest(_parent._parent._parent.character_container.character.sword)) {
_parent.health = _parent.health - variables:sword_damage;
}
if (_parent.enemy.weapon.hitTest(_parent._parent._parent.character_container) && (!donehit)) {
_parent._parent._parent.variables.health = _parent._parent._parent.variables.health - _parent.strength;
_parent._parent._parent.character_container.injury = true;
donehit = true;
}
if (slashing) {
return(undefined);
}
if (_parent.enemy.locator.hitTest(_parent._parent._parent.character_container)) {
slashing = true;
if (cdir == "left") {
_parent.gotoAndStop(frame_hit_left);
cdir = "right";
} else {
_parent.gotoAndStop(frame_hit_right);
cdir = "left";
}
return(undefined);
}
if (cdir == "left") {
_parent.gotoAndStop(frame_walk_left);
_parent._x = _parent._x - x_speed;
if (_parent._x < x_left) {
_parent._x = x_left;
cdir = "right";
}
}
if (cdir == "right") {
_parent.gotoAndStop(frame_walk_right);
_parent._x = _parent._x + x_speed;
if (_parent._x > x_right) {
_parent._x = x_right;
cdir = "left";
}
}
}
Instance of Symbol 277 MovieClip "health_bar" in Symbol 983 MovieClip Frame 1
onClipEvent (enterFrame) {
percent = Math.ceil((_parent.health / _parent.max_health) * 100);
this.fill._xscale = percent;
}
Symbol 983 MovieClip Frame 2
stop();
Symbol 983 MovieClip Frame 3
stop();
Symbol 983 MovieClip Frame 4
stop();
Symbol 983 MovieClip Frame 5
stop();
Symbol 983 MovieClip Frame 6
stop();
Symbol 983 MovieClip Frame 7
stop();
Symbol 984 MovieClip Frame 2
stop();
Symbol 985 MovieClip Frame 1
stop();
Instance of Symbol 251 MovieClip "shurikens_1" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
addon = 20;
}
Instance of Symbol 251 MovieClip "shurikens_2" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 917 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
picked_up = false;
}
onClipEvent (enterFrame) {
if (this.hitTest(_parent._parent.character_container.character) && (!picked_up)) {
picked_up = true;
Set("variables:has_key", true);
gotoAndPlay (2);
}
}
Instance of Symbol 249 MovieClip "health_3" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
addon = 20;
}
Instance of Symbol 249 MovieClip "health_5" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
addon = 20;
}
Instance of Symbol 894 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 924 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
ydiff = _parent.updown_2._y - _y;
}
onClipEvent (enterFrame) {
_y = (_parent.updown_2._y - ydiff);
}
Instance of Symbol 925 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
ydiff = _parent.sinker_1._y - _y;
}
onClipEvent (enterFrame) {
_y = (_parent.sinker_1._y - ydiff);
}
Instance of Symbol 924 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
ydiff = _parent.updown_1._y - _y;
}
onClipEvent (enterFrame) {
_y = (_parent.updown_1._y - ydiff);
}
Instance of Symbol 940 MovieClip "crumble_1_movie" in Symbol 985 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(_parent.crumbler_1.controller.counter);
}
Instance of Symbol 892 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 892 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
strength = 5;
stop();
started = false;
startpos = random(15) + 15;
gotoAndStop(startpos);
}
onClipEvent (enterFrame) {
if ((!started) && (!variables:game_paused)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - strength);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 875 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
started = false;
this.stop();
damage = 3;
}
onClipEvent (enterFrame) {
if ((!variables:game_paused) && (!started)) {
started = true;
play();
}
if (variables:game_paused) {
stop();
return(undefined);
}
if (this.blade.hitTest(_parent._parent.character_container.character)) {
Set("variables:health", variables:health - damage);
_parent._parent.character_container.injury = true;
}
}
Instance of Symbol 947 MovieClip "trapdoor_1" in Symbol 985 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(_parent.crumbler_2.controller.counter);
}
Instance of Symbol 249 MovieClip "health_2" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
addon = 100;
}
Instance of Symbol 249 MovieClip "health_1" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
addon = 20;
}
Instance of Symbol 205 MovieClip "platform_1" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_6" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 207 MovieClip "level_done" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
done = false;
}
onClipEvent (enterFrame) {
if ((((this.hitTest(_parent._parent.character_container) && (!done)) && (variables:has_key)) && (variables:boss1_dead)) && (variables:boss2_dead)) {
_parent._parent.character_container.character.stop();
Set("variables:game_paused", true);
done = true;
_root.gotoAndStop("level_ten");
}
}
Instance of Symbol 205 MovieClip "platform_7" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_9" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_10" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 950 MovieClip "updown_1" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
y_top = _y;
y_bottom = 290;
y_speed = 2;
cdir = "down";
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 953 MovieClip "sinker_1" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
y_top = _y;
y_bottom = 290;
y_speed = 4;
cdir = "stop";
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 956 MovieClip "crumbler_1" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
FrameOn = 13;
FrameOff = 15;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_3" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_8" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 950 MovieClip "updown_2" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
y_top = _y;
y_bottom = 290;
y_speed = 2;
cdir = "down";
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 956 MovieClip "crumbler_2" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
FrameOn = 4;
FrameOff = 15;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_1" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 209 MovieClip "ladder_2" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.ladders.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 301 MovieClip "enemy_1" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
x_left = 310;
x_right = 600;
x_speed = 5;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 301 MovieClip "enemy_2" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
x_left = -340;
x_right = 50;
x_speed = 9;
cdir = "right";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 559 MovieClip "enemy_5" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
x_left = -700;
x_right = -130;
x_speed = 5;
cdir = "right";
max_health = 40;
health = max_health;
dead = false;
strength = 25;
removeMe = false;
pushed = false;
enemy_bounds = new Object();
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
enemy_bounds = getBounds(_root);
if (dead) {
Set("variables:boss1_dead", true);
}
}
Instance of Symbol 301 MovieClip "enemy_3" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
x_left = -420;
x_right = -70;
x_speed = 6;
cdir = "left";
max_health = 30;
health = max_health;
strength = 12;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 799 MovieClip "enemy_4" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
x_left = -340;
x_right = 50;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 799 MovieClip "enemy_6" in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
x_left = -190;
x_right = 260;
x_speed = 7;
cdir = "right";
max_health = 30;
health = max_health;
strength = 15;
removeMe = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
}
Instance of Symbol 983 MovieClip in Symbol 985 MovieClip Frame 1
onClipEvent (load) {
x_left = -700;
x_right = -130;
x_speed = 7;
cdir = "right";
max_health = 50;
health = max_health;
strength = 15;
removeMe = false;
dead = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
if (dead) {
Set("variables:boss2_dead", true);
}
}
Instance of Symbol 985 MovieClip "level" in Symbol 986 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 986 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 986 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 986 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_nine";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = false;
point = new Object();
has_key = false;
boss1_dead = false;
boss2_dead = false;
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 7;
sword_damage = 2;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 986 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 986 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 986 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 986 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 986 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 1002 MovieClip Frame 14
_parent.controller.drawing = false;
_parent.controller.drawn = true;
stop();
Symbol 1004 MovieClip Frame 1
stop();
Symbol 1005 MovieClip Frame 1
stop();
Symbol 1030 MovieClip Frame 1
stop();
Instance of Symbol 1029 MovieClip "taki" in Symbol 1030 MovieClip Frame 1
onClipEvent (load) {
counter = 1;
gotoAndStop(counter);
}
onClipEvent (enterFrame) {
gotoAndStop(counter);
counter++;
if (counter == 3) {
snd_1.gotoAndPlay(2);
}
if (counter >= 10) {
counter = 1;
stop();
_parent.gotoAndStop(2);
}
}
Symbol 1030 MovieClip Frame 2
stop();
Instance of Symbol 1029 MovieClip "taki" in Symbol 1030 MovieClip Frame 2
onClipEvent (load) {
counter = 9;
gotoAndStop(counter);
}
onClipEvent (enterFrame) {
gotoAndStop(counter);
counter--;
if (counter == 7) {
snd_1.gotoAndPlay(2);
}
if (counter <= 0) {
counter = 9;
stop();
_parent.gotoAndStop(3);
}
}
Symbol 1030 MovieClip Frame 3
stop();
Instance of Symbol 1029 MovieClip "taki" in Symbol 1030 MovieClip Frame 3
onClipEvent (load) {
_parent._parent.controller.slashing = false;
gotoAndStop (1);
}
Symbol 1031 MovieClip Frame 10
_parent.removeMe = true;
Symbol 1032 MovieClip Frame 1
stop();
Instance of Symbol 993 MovieClip "controller" in Symbol 1032 MovieClip Frame 1
onClipEvent (load) {
drawn = false;
drawing = false;
slashing = false;
replace_counter = 0;
replacing = false;
dead = false;
started = false;
frame_face_left = 1;
frame_face_right = 2;
frame_draw_left = 3;
frame_draw_right = 4;
frame_slash_left = 5;
frame_slash_right = 6;
frame_undraw_left = 7;
frame_undraw_right = 8;
frame_die_left = 9;
frame_die_right = 10;
frame_drawn = 14;
frame_dead = 11;
tbounds = new Object();
}
onClipEvent (enterFrame) {
if (dead) {
return(undefined);
}
tbounds = _parent.getBounds(_root.game_container);
char_x = _parent._parent._parent.character_container.my_bounds.xMin + (_parent._parent._parent.character_container._width / 2);
enemy_x = tbounds.xMin + (_parent._width / 2);
if (variables:game_paused) {
return(undefined);
}
if (!started) {
started = true;
_parent.enemy.play();
}
if (_parent.removeMe) {
dead = true;
_parent.gotoAndStop(frame_dead);
}
if (_parent.health <= 0) {
if (char_x < enemy_x) {
_parent.gotoAndStop(frame_die_left);
} else {
_parent.gotoAndStop(frame_die_right);
}
return(undefined);
}
if (((!slashing) && (!drawing)) && (!replacing)) {
if (char_x < enemy_x) {
if (!drawn) {
_parent.gotoAndStop(frame_face_left);
} else {
_parent.gotoAndStop(frame_draw_left);
_parent.enemy.gotoAndStop(frame_drawn);
}
} else if (!drawn) {
_parent.gotoAndStop(frame_face_right);
} else {
_parent.gotoAndStop(frame_draw_right);
_parent.enemy.gotoAndStop(frame_drawn);
}
}
if ((_parent.draw_zone.hitTest(_parent._parent._parent.character_container.character) && (!drawing)) && (!replacing)) {
drawing = true;
if (char_x < enemy_x) {
_parent.gotoAndStop(frame_draw_left);
} else {
_parent.gotoAndStop(frame_draw_right);
}
}
if ((_parent.hit_zone.hitTest(_parent._parent._parent.character_container.character) && (!slashing)) && (!replacing)) {
replace_counter = 0;
if (!drawn) {
drawing = true;
if (char_x < enemy_x) {
_parent.gotoAndStop(frame_draw_left);
} else {
_parent.gotoAndStop(frame_draw_right);
}
}
if (drawn) {
slashing = true;
if (char_x < enemy_x) {
_parent.gotoAndStop(frame_slash_left);
_parent.enemy.gotoAndPlay(1);
} else {
_parent.gotoAndStop(frame_slash_right);
_parent.enemy.gotoAndPlay(1);
}
}
}
if (((replace_counter > 96) && (drawn)) && (!replacing)) {
if (char_x < enemy_x) {
_parent.gotoAndStop(frame_undraw_left);
} else {
_parent.gotoAndStop(frame_undraw_right);
}
replace_counter = 0;
replacing = true;
}
if (drawn) {
replace_counter++;
}
if (_parent.hitTest(_parent._parent._parent.character_container.character.sword)) {
_parent.health = _parent.health - variables:sword_damage;
}
if (_parent.enemy.taki.sword.hitTest(_parent._parent._parent.character_container)) {
_parent._parent._parent.variables.health = _parent._parent._parent.variables.health - _parent.strength;
_parent._parent._parent.character_container.injury = true;
}
}
Instance of Symbol 277 MovieClip "health_bar" in Symbol 1032 MovieClip Frame 1
onClipEvent (enterFrame) {
percent = Math.ceil((_parent.health / _parent.max_health) * 100);
this.fill._xscale = percent;
}
Symbol 1032 MovieClip Frame 2
stop();
Symbol 1032 MovieClip Frame 3
stop();
Symbol 1032 MovieClip Frame 4
stop();
Symbol 1032 MovieClip Frame 5
stop();
Symbol 1032 MovieClip Frame 6
stop();
Symbol 1032 MovieClip Frame 7
stop();
Instance of Symbol 1002 MovieClip "enemy" in Symbol 1032 MovieClip Frame 7
onClipEvent (load) {
counter = 13;
gotoAndStop(counter);
}
onClipEvent (enterFrame) {
if (counter > 0) {
gotoAndStop(counter);
counter--;
} else {
_parent.controller.drawn = false;
_parent.controller.replacing = false;
_parent.gotoAndStop(1);
}
}
Symbol 1032 MovieClip Frame 8
stop();
Instance of Symbol 1002 MovieClip "enemy" in Symbol 1032 MovieClip Frame 8
onClipEvent (load) {
counter = 13;
gotoAndStop(counter);
}
onClipEvent (enterFrame) {
if (counter > 0) {
gotoAndStop(counter);
counter--;
} else {
_parent.controller.drawn = false;
_parent.controller.replacing = false;
_parent.gotoAndStop(2);
}
}
Symbol 1032 MovieClip Frame 9
stop();
Symbol 1032 MovieClip Frame 10
stop();
Symbol 1032 MovieClip Frame 11
stop();
Symbol 1033 MovieClip Frame 2
stop();
Symbol 1034 MovieClip Frame 1
stop();
Instance of Symbol 251 MovieClip "shurikens_2" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 249 MovieClip "health_3" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
addon = 30;
}
Instance of Symbol 249 MovieClip "health_2" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
addon = 30;
}
Instance of Symbol 249 MovieClip "health_1" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
addon = 50;
}
Instance of Symbol 251 MovieClip "shurikens_1" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
addon = 5;
}
Instance of Symbol 1032 MovieClip "taki" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
max_health = 200;
health = max_health;
strength = 10;
removeMe = false;
hasFaded = false;
pushed = false;
}
onClipEvent (enterFrame) {
if (!pushed) {
_parent._parent.variables.enemy_list.push(_name);
pushed = true;
}
if (removeMe && (!hasFaded)) {
_parent._parent.fadeOut.gotoAndPlay(2);
hasFaded = true;
}
}
Instance of Symbol 249 MovieClip "health_4" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
addon = 30;
}
Instance of Symbol 205 MovieClip "platform_1" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_2" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_3" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_4" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Instance of Symbol 205 MovieClip "platform_5" in Symbol 1034 MovieClip Frame 1
onClipEvent (load) {
hasPushed = false;
}
onClipEvent (enterFrame) {
if (!hasPushed) {
_parent.platforms.push(_name);
hasPushed = true;
}
m_bounds = new Object();
m_bounds = this.getBounds(_root);
}
Symbol 1035 MovieClip Frame 1
stop();
Symbol 1035 MovieClip Frame 25
_root.gotoAndPlay("cutscene_six");
Instance of Symbol 1034 MovieClip "level" in Symbol 1036 MovieClip Frame 1
onClipEvent (load) {
platforms = new Array();
ladders = new Array();
startY = this._y;
startX = this._x;
}
Instance of Symbol 365 MovieClip "character_container" in Symbol 1036 MovieClip Frame 1
onClipEvent (load) {
frame_run_left_sword = 1;
frame_run_right_sword = 2;
frame_run_left_shuriken = 14;
frame_run_right_shuriken = 15;
frame_face_left_sword = 4;
frame_face_right_sword = 5;
frame_face_left_shuriken = 12;
frame_face_right_shuriken = 13;
frame_climb = 6;
frame_fall = 7;
frame_jump = 3;
frame_stand_slash_left = 8;
frame_stand_slash_right = 9;
frame_stand_throw_left = 10;
frame_stand_throw_right = 11;
frame_jump_slash = 16;
freezer = 0;
var myColor;
attack_started = false;
injury = false;
injury_counter = 0;
last_frame = 0;
my_bounds = new Object();
character.stop();
current_injury_sound = 0;
sound_playing = false;
hurt_snd_1 = new Sound();
hurt_snd_1.attachSound("hurt_snd_1");
hurt_snd_1.onSoundComplete = function () {
sound_playing = false;
};
hurt_snd_2 = new Sound();
hurt_snd_2.attachSound("hurt_snd_2");
hurt_snd_2.onSoundComplete = function () {
sound_playing = false;
};
original_transform = new Object();
new_transform = new Object();
original_colour = new Color(this.character);
original_transform = original_colour.getTransform();
}
onClipEvent (enterFrame) {
if (variables:game_paused) {
return(undefined);
}
if (variables:health <= 0) {
variables.health = 0;
_root.deaths++;
stopAllSounds();
Set("variables:game_paused", true);
if ((_root.lives - _root.deaths) != 0) {
_root.death_level = variables:level_name;
} else {
_root.death_level = "game_over";
}
_root.gotoAndPlay("death_scene");
}
my_bounds = getBounds(_root);
edge_top = my_bounds.Ymin;
edge_bottom = my_bounds.Ymax;
if (_parent.variables.firing) {
freezer++;
} else {
freezer = 0;
}
if (freezer >= 20) {
_parent.variables.firing = false;
freezer = 0;
}
if ((_parent.key_listener.weapon1 == 1) && (_parent.variables.current_weapon != 1)) {
_parent.variables.current_weapon = 1;
_parent.character_container.character.sword._alpha = 100;
}
if (((_parent.key_listener.weapon2 == 1) && (_parent.variables.shurikens > 0)) && (_parent.variables.current_weapon != 2)) {
_parent.variables.current_weapon = 2;
_parent.character_container.character.sword._alpha = 0;
}
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(feet_mask)) {
if ((_parent.level[platformName].m_bounds.Ymin >= (edge_bottom - 20)) && (_parent.level[platformName].m_bounds.Ymin <= edge_bottom)) {
_y = _parent.level[platformName].m_bounds.Ymin;
_parent.variables.platform = "on";
}
}
if (this.hitTest(_parent.level[platformName])) {
_parent.variables.y_velocity = 0;
}
i++;
}
i = 0;
while (i < _parent.level.ladders.length) {
ladderName = _parent.level.ladders[i];
if (_parent.level[ladderName].hitTest(feet_mask)) {
_parent.variables.ladder = "on";
_parent.variables.gravity = "off";
_parent.variables.jumping = false;
if (_parent.variables.platform != "on") {
gotoAndStop(frame_climb);
}
}
i++;
}
if (_parent.key_listener.right == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x >= _parent.variables.scroll_right) && ((_parent.level._x + _parent.level.background._width) > ((_parent.level.startX + variables:SWFWidth) + 20))) {
_parent.level._x = _parent.level._x - _parent.variables.x_speed;
} else {
this._x = this._x + _parent.variables.x_speed;
}
_parent.variables.last_direction = "right";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "left") {
this._x = this._x + _parent.variables.x_speed;
}
}
if (_parent.key_listener.left == 1) {
hit = false;
i = 0;
while (i < _parent.level.platforms.length) {
platformName = _parent.level.platforms[i];
if (_parent.level[platformName].hitTest(side_mask)) {
hit = true;
}
i++;
}
if (!hit) {
if ((this._x <= _parent.variables.scroll_left) && (_parent.level._x < _parent.level.startX)) {
_parent.level._x = _parent.level._x + _parent.variables.x_speed;
} else {
this._x = this._x - _parent.variables.x_speed;
}
_parent.variables.last_direction = "left";
if (((!_parent.variables.jumping) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
}
if (((!variables:jumping) && (!variables:firing)) && (variables:ladder == "on")) {
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
} else if (_parent.variables.last_direction == "right") {
this._x = this._x - _parent.variables.x_speed;
}
}
if (((_parent.key_listener.up == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_speed;
} else {
this._y = this._y - _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if (((_parent.key_listener.down == 1) && (_parent.variables.ladder == "on")) && (!_parent.variables.firing)) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y - _parent.variables.y_speed;
} else {
this._y = this._y + _parent.variables.y_speed;
}
if (_parent.variables.climb_stop) {
this.gotoAndStop(frame_climb);
_parent.variables.climb_stop = false;
}
character.play();
}
if ((((_parent.key_listener.up == 1) && (!_parent.variables.jumping)) && (_parent.variables.ladder != "on")) && (!_parent.variables.firing)) {
_parent.variables.platform = "off";
_parent.variables.y_velocity = _parent.variables.jump_max;
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if ((_parent.variables.gravity == "on") && (_parent.variables.platform == "off")) {
_parent.variables.jumping = true;
if (!_parent.variables.firing) {
this.gotoAndStop(frame_fall);
}
}
if (_parent.variables.jumping) {
if (_parent.variables.platform == "on") {
_parent.variables.gravity = "on";
_parent.variables.y_velocity = 0;
_parent.variables.jumping = false;
} else {
_parent.variables.gravity = "off";
}
_parent.variables.y_velocity = _parent.variables.y_velocity - _parent.variables.acceleration;
if (_parent.variables.y_velocity < -12) {
_parent.variables.y_velocity = -12;
}
if (_parent.variables.y_velocity > 0) {
if ((this._y <= _parent.variables.scroll_up) && (_parent.level._y < (_parent.level._height - 20))) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
if (_parent.variables.y_velocity < 0) {
if ((this._y >= _parent.variables.scroll_down) && (_parent.level._y > _parent.level.startY)) {
_parent.level._y = _parent.level._y + _parent.variables.y_velocity;
} else {
this._y = this._y - _parent.variables.y_velocity;
}
}
}
if (((_parent.key_listener.space == 1) && (!_parent.variables.firing)) && ((_parent.variables.ladder != "on") || (_parent.variables.platform == "on"))) {
attack_started = true;
if (_parent.variables.jumping) {
this.gotoAndStop(frame_jump_slash);
}
if (!_parent.variables.jumping) {
if (!((_parent.variables.ladder == "on") && (_parent.variables.platform != "on"))) {
if (_parent.variables.current_weapon == 1) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_slash_left);
} else {
this.gotoAndStop(frame_stand_slash_right);
}
} else if (_parent.variables.shurikens > 0) {
if (_parent.variables.last_direction == "left") {
this.gotoAndStop(frame_stand_throw_left);
} else {
this.gotoAndStop(frame_stand_throw_right);
}
} else {
_parent.variables.current_weapon = 1;
}
}
}
}
if ((_parent.key_listener.nothing_pressed && (!_parent.variables.jumping)) && (!_parent.variables.firing)) {
if (_parent.variables.platform == "on") {
if (_parent.variables.last_direction == "left") {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_left_sword);
} else {
this.gotoAndStop(frame_face_left_shuriken);
}
} else if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_face_right_sword);
} else {
this.gotoAndStop(frame_face_right_shuriken);
}
} else {
character.stop();
_parent.variables.climb_stop = true;
}
} else if (((!_parent.variables.jumping) && (!_parent.variables.firing)) && (!attack_started)) {
if ((_parent.key_listener.left == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_left_sword);
} else {
this.gotoAndStop(frame_run_left_shuriken);
}
} else if ((_parent.key_listener.right == 1) && (variables:ladder != "on")) {
if (_parent.variables.current_weapon == 1) {
this.gotoAndStop(frame_run_right_sword);
} else {
this.gotoAndStop(frame_run_right_shuriken);
}
}
}
if (injury) {
if (!sound_playing) {
sound_playing = true;
switch (current_injury_sound) {
case 0 :
hurt_snd_1.start();
break;
case 1 :
hurt_snd_2.start();
}
}
switch (injury_counter) {
case 0 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 3 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 6 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"255", ba:"100", bb:"255", aa:"100", ab:"0"};
break;
case 9 :
new_transform = {ra:"100", rb:"255", ga:"100", gb:"000", ba:"100", bb:"000", aa:"100", ab:"0"};
break;
case 12 :
new_transform = original_transform;
}
original_colour.setTransform(new_transform);
injury_counter++;
if (injury_counter >= 13) {
current_injury_sound++;
if (current_injury_sound >= 2) {
current_injury_sound = 0;
}
injury = false;
injury_counter = 0;
_parent.variables.firing = false;
}
}
_parent.variables.ladder = "off";
_parent.variables.platform = "off";
_parent.variables.gravity = "on";
attack_started = false;
if (this._x > _parent.variables.edge_right) {
this._x = _parent.variables.edge_right;
}
if (this._x < _parent.variables.edge_left) {
this._x = _parent.variables.edge_left;
}
if (this._y > _parent.variables.edge_bottom) {
this._y = _parent.variables.edge_bottom;
_parent.variables.platform = "on";
}
}
Instance of Symbol 368 MovieClip "key_listener" in Symbol 1036 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.keyboard_listener = this;
myListener = new Object();
var left = 0;
var up = 0;
var right = 0;
var down = 0;
var space = 0;
var weapon1 = 0;
var weapon2 = 0;
var keyboard_active = true;
var nothing_pressed = true;
myListener.onKeyDown = function () {
nothing_pressed = false;
if (keyboard_active == true) {
if (Key.getCode() == 32) {
space = 1;
}
if (Key.getCode() == 37) {
left = 1;
}
if (Key.getCode() == 38) {
up = 1;
}
if (Key.getCode() == 39) {
right = 1;
}
if (Key.getCode() == 40) {
down = 1;
}
if (Key.getCode() == 49) {
weapon1 = 1;
}
if (Key.getCode() == 50) {
weapon2 = 1;
}
} else {
space = 0;
left = 0;
up = 0;
right = 0;
down = 0;
weapon1 = 0;
weapon2 = 0;
}
};
myListener.onKeyUp = function () {
if (Key.getCode() == 32) {
space = 0;
}
if (Key.getCode() == 37) {
left = 0;
}
if (Key.getCode() == 38) {
up = 0;
_parent.variables.keyUpStillPressed = false;
}
if (Key.getCode() == 39) {
right = 0;
}
if (Key.getCode() == 40) {
down = 0;
}
if (Key.getCode() == 49) {
weapon1 = 0;
}
if (Key.getCode() == 50) {
weapon2 = 0;
}
if (((((((space + left) + right) + up) + down) + weapon1) + weapon2) == 0) {
nothing_pressed = true;
}
};
Key.addListener(myListener);
}
Instance of Symbol 370 MovieClip "variables" in Symbol 1036 MovieClip Frame 1
onClipEvent (load) {
Object.prototype.variables = this;
level_name = "level_ten";
SWFHeight = 330;
SWFWidth = 432;
keyUpStillPressed = false;
gravity = "on";
platform = "off";
ladder = "off";
jumping = false;
last_direction = "left";
current_weapon = 1;
game_paused = false;
point = new Object();
has_key = false;
current_level = 100;
shuriken_min = -1;
shuriken_max = -1;
shurikens = _root.shurikens;
health = _root.health;
shuriken_damage = 7;
sword_damage = 2;
edge_top = 20;
edge_bottom = SWFHeight;
edge_left = 20;
edge_right = SWFWidth - 20;
x_speed = 7;
y_speed = 5;
y_velocity = 0;
jump_max = 35;
acceleration = 5;
scroll_up = 150;
scroll_down = 180;
scroll_left = 125;
scroll_right = 275;
climb_stop = true;
firing = false;
enemy_list = new Array();
}
Instance of Symbol 375 MovieClip "health_bar" in Symbol 1036 MovieClip Frame 1
onClipEvent (enterFrame) {
fill._xscale = _parent.variables.health;
}
Instance of Symbol 398 MovieClip in Symbol 1036 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.character_container.injury) {
play();
}
}
Instance of Symbol 401 MovieClip in Symbol 1036 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 1) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Instance of Symbol 405 MovieClip "shuriken_icon" in Symbol 1036 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.variables.current_weapon == 2) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
this.amount = _parent.variables.shurikens;
}
Instance of Symbol 413 MovieClip in Symbol 1036 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._currentframe != (_root.lives - _root.deaths)) {
gotoAndStop(_root.lives - _root.deaths);
}
}
Symbol 1059 MovieClip Frame 20
stop();
Symbol 1060 MovieClip Frame 150
stop();