Frame 1
function bearing(a, b) {
var _local3 = b.x - a.x;
var _local2 = b.y - a.y;
var _local1 = Math.atan2(_local2, _local3);
_local1 = _local1 * 57.2957795130823;
_local1 = _local1 + 90;
return(_local1);
}
_root.kongregateServices.connect();
var debug_mode = false;
var frame_rate = 24;
var depth = 0;
var world_gravity = (new flash.geom.Point(0, 500));
var gmad_target = (new flash.geom.Point(0, 0));
var gmad_release = (new flash.geom.Point(0, 0));
var gmad_min_drag = 25;
var orb_speed = 500;
var ammo = 0;
var orb_trail = [];
var orb_trail_distance = 10;
var orb_trail_movement_factor = 0.2;
var firing = false;
var lives = 0;
var starting_lives = 5;
var score = 0;
var par_time = 30;
var ghost_mode = false;
var selected_anomaly = null;
var anomaly_radius = 100;
var anomaly_removed = false;
var easy_levels = ["mc_level_1_1", "mc_level_1_2", "mc_level_1_3", "mc_level_1_4", "mc_level_1_5", "mc_level_1_6", "mc_level_1_7", "mc_level_1_8", "mc_level_1_9", "mc_level_1_10"];
var uneasy_levels = ["mc_level_2_1", "mc_level_2_2", "mc_level_2_4", "mc_level_2_5", "mc_level_2_3", "mc_level_2_6", "mc_level_2_7", "mc_level_2_8", "mc_level_2_9", "mc_level_2_10"];
var dpuneasy_levels = ["mc_level_3_3", "mc_level_3_1", "mc_level_3_2", "mc_level_3_4", "mc_level_3_5", "mc_level_3_6", "mc_level_3_7", "mc_level_3_8", "mc_level_3_9", "mc_level_3_10"];
var avatar = null;
var active_level = null;
var level_complete_screen = null;
var game_is_paused = true;
var f_already_triggered = false;
var p_already_triggered = false;
var r_already_triggered = false;
var space_already_triggered = false;
var jump_already_triggered = false;
var esc_already_triggered = false;
var is_prepared = false;
this.onEnterFrame = function () {
if (this.is_prepared == false) {
background_mc.set_random_colour();
this.attachMovie("mc_level_name_label", "level_name_label_mc", 100000000);
this.level_name_label_mc._x = Stage.width / 2;
this.level_name_label_mc._y = 0;
this.level_name_label_mc.gotoAndStop(1);
this.attachMovie("mc_lives_counter", "lives_counter_mc", 100000001);
this.lives_counter_mc._x = 696;
this.lives_counter_mc._y = 17;
this.lives_counter_mc._visible = false;
Mouse.hide();
this.attachMovie("mc_cursor", "cursor_mc", 100000004);
this.attachMovie("mc_gravity_target", "gravity_target_mc", 100000003);
this.attachMovie("mc_target", "target_mc", 100000002);
this.gravity_target_mc._visible = false;
this.target_mc._visible = false;
Stage.showMenu = false;
this.is_prepared = true;
}
if (active_level) {
if (active_level.is_prepared == false) {
this.prepare_active_level();
}
}
this.update_surface_states();
this.handle_player_input();
if (this.game_is_paused == false) {
this.update_orbs();
avatar.update_gravitation(this.world_gravity, active_level.anomalies);
avatar.update_linear_velocity();
avatar.update_rotational_velocity();
avatar.update_position();
avatar.update_rotation();
this.update_orb_trail();
this.exit_detection();
this.killzone_detection();
avatar.collision_detection(active_level.surfaces);
}
};
this.onMouseDown = function () {
if (this.game_is_paused == false) {
this.firing = true;
this.gmad_target.x = active_level._xmouse;
this.gmad_target.y = active_level._ymouse;
target_mc._x = this._xmouse;
target_mc._y = this._ymouse;
target_mc._visible = true;
gravity_target_mc._x = this._xmouse;
gravity_target_mc._y = this._ymouse;
}
};
this.onMouseUp = function () {
if (this.game_is_paused == false) {
this.firing = false;
target_mc._visible = false;
gravity_target_mc._visible = false;
this.gmad_release.x = active_level._xmouse;
this.gmad_release.y = active_level._ymouse;
this.gmad_fire();
}
};
this.onMouseMove = function () {
this.update_anomaly_selection();
cursor_mc._x = this._xmouse;
cursor_mc._y = this._ymouse;
if (firing) {
var _local2 = new flash.geom.Point(active_level._xmouse, active_level._ymouse);
gravity_target_mc._rotation = bearing(this.gmad_target, _local2);
if (flash.geom.Point.distance(_local2, gmad_target) >= gmad_min_drag) {
gravity_target_mc._visible = true;
} else {
gravity_target_mc._visible = false;
}
}
updateAfterEvent();
};
this.handle_player_input = function () {
if (this.pause_screen) {
if (Key.isDown(27)) {
if (this.esc_already_triggered) {
} else {
this.stop_game();
this.esc_already_triggered = true;
}
} else {
this.esc_already_triggered = false;
}
if (Key.isDown(80)) {
if (this.p_already_triggered) {
} else {
this.unpause_game();
this.unload_pause_screen();
this.p_already_triggered = true;
}
} else {
this.p_already_triggered = false;
}
}
if (this.game_is_paused == false) {
if (Key.isDown(27)) {
if (this.esc_already_triggered) {
} else {
this.pause_game();
this.load_pause_screen();
this.esc_already_triggered = true;
}
} else {
this.esc_already_triggered = false;
}
if (Key.isDown(80)) {
if (this.p_already_triggered) {
} else {
this.pause_game();
this.load_pause_screen();
this.p_already_triggered = true;
}
} else {
this.p_already_triggered = false;
}
if (avatar.is_upright()) {
if (Key.isDown(37) || (Key.isDown(65))) {
avatar.walk_left();
} else {
avatar.is_walking_left = false;
}
if (Key.isDown(39) || (Key.isDown(68))) {
avatar.walk_right();
} else {
avatar.is_walking_right = false;
}
} else {
if (Key.isDown(37) || (Key.isDown(65))) {
avatar.walk_right();
} else {
avatar.is_walking_right = false;
}
if (Key.isDown(39) || (Key.isDown(68))) {
avatar.walk_left();
} else {
avatar.is_walking_left = false;
}
}
if ((((Key.isDown(37) || (Key.isDown(39))) || (Key.isDown(65))) || (Key.isDown(68))) == false) {
avatar.stop_walking();
}
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.jump_already_triggered) {
} else {
avatar.jump();
this.jump_already_triggered = true;
}
} else {
this.jump_already_triggered = false;
}
if (Key.isDown(82)) {
if (this.r_already_triggered) {
} else {
this.reload_active_level();
this.r_already_triggered = true;
}
} else {
this.r_already_triggered = false;
}
if (Key.isDown(32)) {
if (this.space_already_triggered) {
} else {
this.retrieve_anomaly();
this.space_already_triggered = true;
}
} else {
this.anomaly_removed = false;
this.space_already_triggered = false;
}
if (this.debug_mode) {
if (Key.isDown(70)) {
if (this.f_already_triggered) {
} else {
this.exit_level();
this.f_already_triggered = true;
}
} else {
this.f_already_triggered = false;
}
}
}
};
this.update_surface_states = function () {
avatar_pos = new flash.geom.Point(avatar._x, avatar._y);
var _local2 = active_level.surfaces.length;
var _local1 = 0;
while (_local1 < _local2) {
active_level.surfaces[_local1].facing_avatar_in_prev_frame = active_level.surfaces[_local1].is_facing(avatar_pos);
_local1++;
}
};
this.update_orbs = function () {
var _local10 = active_level.surfaces.length;
var _local3 = 0;
while (_local3 < active_level.orbs.length) {
active_level.orbs[_local3]._x = active_level.orbs[_local3]._x + (active_level.orbs[_local3].velocity.x / frame_rate);
active_level.orbs[_local3]._y = active_level.orbs[_local3]._y + (active_level.orbs[_local3].velocity.y / frame_rate);
var _local7 = active_level.orbs[_local3]._x;
var _local6 = active_level.orbs[_local3]._y;
_local7 = _local7 + active_level._x;
_local6 = _local6 + active_level._y;
if ((((_local7 < -50) || (_local7 > (Stage.width + 50))) || (_local6 < -50)) || (_local6 > (Stage.height + 50))) {
active_level.orbs[_local3].removeMovieClip();
active_level.orbs.splice(_local3, 1);
this.increment_orb_trail();
}
var _local4 = 0;
while (_local4 < _local10) {
if (active_level.surfaces[_local4].hitTest(_local7, _local6, true)) {
var _local2 = active_level.attachMovie("mc_anomaly", ("anomaly" + depth) + "_mc", depth);
depth++;
_local2._x = active_level.orbs[_local3]._x;
_local2._y = active_level.orbs[_local3]._y;
_local2.gravitation = active_level.orbs[_local3].gravitation.clone();
_local2._rotation = (Math.atan2(_local2.gravitation.y, _local2.gravitation.x) * 180) / Math.PI;
_local2._rotation = _local2._rotation + 90;
_local2.radius = this.anomaly_radius;
var _local9 = new mx.transitions.Tween(_local2, "_xscale", mx.transitions.easing.Back.easeOut, 1, 100, 0.5, true);
var _local8 = new mx.transitions.Tween(_local2, "_yscale", mx.transitions.easing.Back.easeOut, 1, 100, 0.5, true);
active_level.anomalies.push(_local2);
var _local5 = new Sound(this);
_local5.attachSound("snd_anomaly_up");
_local5.start();
active_level.orbs[_local3].removeMovieClip();
active_level.orbs.splice(_local3, 1);
break;
}
_local4++;
}
_local3++;
}
};
this.update_anomaly_selection = function () {
selected_anomaly.gotoAndStop("unselected");
selected_anomaly = null;
var _local4;
var _local7 = active_level.anomalies.length;
var _local2 = 0;
while (_local2 < _local7) {
var _local6 = new flash.geom.Point(active_level._xmouse, active_level._ymouse);
var _local5 = new flash.geom.Point(active_level.anomalies[_local2]._x, active_level.anomalies[_local2]._y);
var _local3 = flash.geom.Point.distance(_local6, _local5);
if (_local2 == 0) {
_local4 = _local3;
if (_local3 <= this.anomaly_radius) {
selected_anomaly = active_level.anomalies[_local2];
selected_anomaly.gotoAndStop("selected");
}
}
if (_local3 <= this.anomaly_radius) {
if (_local3 < _local4) {
_local4 = _local3;
selected_anomaly.gotoAndStop("unselected");
selected_anomaly = active_level.anomalies[_local2];
selected_anomaly.gotoAndStop("selected");
}
}
_local2++;
}
};
this.gmad_fire = function () {
var _local5 = flash.geom.Point.distance(gmad_target, gmad_release);
if (_local5 > gmad_min_drag) {
if (this.orb_trail.length > 0) {
var _local2 = active_level.attachMovie("mc_orb", ("orb" + depth) + "_mc", depth);
depth++;
var _local3 = avatar.get_centre();
_local2._x = _local3.x;
_local2._y = _local3.y;
_local2.gravitation = gmad_release.subtract(gmad_target);
_local2.gravitation.normalize(world_gravity.length);
_local2.velocity = gmad_target.subtract(_local3);
_local2.velocity.normalize(this.orb_speed);
active_level.orbs.push(_local2);
this.decrement_orb_trail();
var _local4 = new Sound(this);
_local4.attachSound("snd_fire");
_local4.start();
} else {
var _local4 = new Sound(this);
_local4.attachSound("snd_no_ammo");
_local4.start();
}
}
};
this.retrieve_anomaly = function () {
if (this.anomaly_removed == false) {
if (selected_anomaly) {
var _local2 = 0;
while (_local2 < active_level.anomalies.length) {
if (selected_anomaly == active_level.anomalies[_local2]) {
active_level.anomalies.splice(_local2, 1);
break;
}
_local2++;
}
this.removed_anomaly = selected_anomaly;
var _local5 = new mx.transitions.Tween(this.removed_anomaly, "_xscale", mx.transitions.easing.Back.easeIn, 100, 0, 0.5, true);
var _local4 = new mx.transitions.Tween(this.removed_anomaly, "_yscale", mx.transitions.easing.Back.easeIn, 100, 0, 0.5, true);
_local4.onMotionFinished = function () {
this.removed_anomaly._visible = false;
this.removed_anomaly.removeMovieClip();
};
selected_anomaly = null;
this.increment_orb_trail();
var _local3 = new Sound(this);
_local3.attachSound("snd_anomaly_down");
_local3.start();
}
this.anomaly.removed = true;
}
};
this.increment_orb_trail = function () {
var _local2 = active_level.attachMovie("mc_orb", ("orb" + depth) + "_mc", depth);
depth++;
if (this.orb_trail.length == 0) {
_local2._x = avatar._x - orb_trail_distance;
_local2._y = avatar._y;
} else {
var _local3 = this.orb_trail[this.orb_trail.length - 1];
_local2._x = _local3._x - orb_trail_distance;
_local2._y = avatar._y;
}
this.orb_trail.push(_local2);
};
this.decrement_orb_trail = function () {
this.orb_trail[this.orb_trail.length - 1].removeMovieClip();
this.orb_trail.pop();
};
this.update_orb_trail = function () {
var _local8 = this.orb_trail.length;
var _local3 = 0;
while (_local3 < _local8) {
var _local4 = this.orb_trail[_local3];
var _local6 = new flash.geom.Point(_local4._x, _local4._y);
var _local2 = new flash.geom.Point(0, 0);
if (_local3) {
_local2.x = this.orb_trail[_local3 - 1]._x;
_local2.y = this.orb_trail[_local3 - 1]._y;
} else {
_local2.x = avatar._x;
_local2.y = avatar._y;
}
var _local7 = flash.geom.Point.distance(_local6, _local2);
if (_local7 > orb_trail_distance) {
var _local5 = _local2.subtract(_local6);
_local5.normalize(orb_trail_movement_factor * _local7);
_local4._x = _local4._x + _local5.x;
_local4._y = _local4._y + _local5.y;
}
_local3++;
}
};
this.load_level = function (level) {
this.active_level = this.attachMovie(level, "level_mc", depth);
depth++;
this.active_level._visible = true;
active_level._x = Stage.width / 2;
active_level._y = Stage.height * 1.5;
var _local2 = Stage.height / 2;
var _local4 = new mx.transitions.Tween(active_level, "_y", mx.transitions.easing.Regular.easeInOut, active_level._y, _local2, 1, true);
background_mc.shift_to_random_colour();
active_level.is_prepared = false;
};
this.unload_active_level = function () {
if (this.active_level) {
this.game_is_paused = true;
if (this.active_episode == "easy") {
} else if (this.active_episode == "uneasy") {
} else if (this.active_episode == "dpuneasy") {
}
var _local2 = 0;
while (_local2 < active_level.movers.length) {
active_level.movers[_local2].disable();
_local2++;
}
var old_level = active_level;
active_level = null;
avatar = null;
this.selected_anomaly = null;
while (this.orb_trail.length > 0) {
this.decrement_orb_trail();
}
var _local4 = Stage.height / -2;
var _local3 = new mx.transitions.Tween(old_level, "_y", mx.transitions.easing.Regular.easeInOut, old_level._y, _local4, 1, true);
_local3.onMotionFinished = function () {
old_level.removeMovieClip();
};
}
};
this.reload_active_level = function () {
if (this.active_episode == "easy") {
} else if (this.active_episode == "uneasy") {
} else if (this.active_episode == "dpuneasy") {
}
if (this.active_level) {
this.unload_active_level();
if (this.active_episode == "easy") {
this.load_level(easy_levels[active_level_index]);
} else if (this.active_episode == "uneasy") {
this.load_level(uneasy_levels[active_level_index]);
} else if (this.active_episode == "dpuneasy") {
this.load_level(dpuneasy_levels[active_level_index]);
}
}
};
this.prepare_active_level = function () {
if (this.active_episode == "easy") {
} else if (this.active_episode == "uneasy") {
} else if (this.active_episode == "dpuneasy") {
}
avatar = active_level.avatar_mc;
if (avatar == false) {
}
var _local3 = 0;
while (_local3 < active_level.anomalies.length) {
var _local4 = (active_level.anomalies[_local3]._rotation * Math.PI) / 180;
active_level.anomalies[_local3].gravitation = new flash.geom.Point(Math.sin(_local4), Math.cos(_local4) * -1);
active_level.anomalies[_local3].gravitation.normalize(world_gravity.length);
active_level.anomalies[_local3].radius = this.anomaly_radius;
_local3++;
}
_local3 = 0;
while (_local3 < active_level.movers.length) {
var _local2 = active_level.movers[_local3];
_local2._x = _local2.path[0].x;
_local2._y = _local2.path[0].y;
_local2.update_path();
_local3++;
}
_local3 = 0;
while (_local3 < active_level.surfaces.length) {
active_level.surfaces[_local3].precalculate_normal();
_local3++;
}
while (this.orb_trail.length < active_level.starting_ammo) {
this.increment_orb_trail();
}
while (this.orb_trail.length > active_level.starting_ammo) {
this.decrement_orb_trail();
}
this.level_name_label_mc.text = active_level.level_name;
this.level_name_label_mc.gotoAndPlay(1);
this.update_lives_counter();
this.level_start_time = getTimer();
this.active_level.is_prepared = true;
this.game_is_paused = false;
};
this.update_lives_counter = function () {
if (this.lives > 1) {
this.lives_counter_mc.gotoAndStop(this.lives - 1);
} else {
this.lives_counter_mc._visible = false;
}
};
this.load_level_complete_screen = function () {
this.level_complete_screen = this.attachMovie("mc_level_complete_screen", "level_complete_screen_mc", depth);
depth++;
level_complete_screen._x = Stage.width / 2;
level_complete_screen._y = Stage.height * 1.5;
var _local5 = Stage.height / 2;
var _local6 = new mx.transitions.Tween(level_complete_screen, "_y", mx.transitions.easing.Regular.easeInOut, level_complete_screen._y, _local5, 1, true);
var _local2 = false;
if (this.active_episode == "easy") {
if ((active_level_index + 1) >= easy_levels.length) {
_local2 = true;
}
} else if (this.active_episode == "uneasy") {
if ((active_level_index + 1) >= uneasy_levels.length) {
_local2 = true;
}
} else if (this.active_episode == "dpuneasy") {
if ((active_level_index + 1) >= dpuneasy_levels.length) {
_local2 = true;
}
}
if (_local2) {
this.level_complete_screen.episode_complete_title_mc._visible = true;
this.level_complete_screen.level_complete_title_mc._visible = false;
this.level_complete_screen.kong_cog_mc._visible = true;
this.level_complete_screen.cog_label_kong_mc._visible = true;
this.level_complete_screen.next_level_cog_mc._visible = false;
this.level_complete_screen.next_level_cog2_mc._visible = false;
this.level_complete_screen.next_level_label_mc._visible = false;
} else {
this.level_complete_screen.episode_complete_title_mc._visible = false;
this.level_complete_screen.level_complete_title_mc._visible = true;
this.level_complete_screen.kong_cog_mc._visible = false;
this.level_complete_screen.cog_label_kong_mc._visible = false;
this.level_complete_screen.next_level_cog_mc._visible = true;
this.level_complete_screen.next_level_cog2_mc._visible = true;
this.level_complete_screen.next_level_label_mc._visible = true;
}
var _local3 = this.level_completion_time / 100;
_local3 = Math.round(_local3);
_local3 = _local3 / 10;
this.level_complete_screen.your_time_display = _local3 + " seconds";
if (this.ghost_mode) {
this.level_complete_screen.level_score_label_mc._visible = false;
this.level_complete_screen.total_score_label_mc._visible = false;
this.level_complete_screen.final_score_label_mc._visible = false;
this.level_complete_screen.level_score_display = "";
this.level_complete_screen.score_display = "";
this.level_complete_screen.final_score_display = "";
this.level_complete_screen.scoring_disabled_label_mc._visible = true;
} else {
var _local4 = (this.par_time - _local3) * 100;
if (_local4 < 0) {
_local4 = 0;
}
this.score = this.score + _local4;
this.level_complete_screen.level_score_display = _local4;
this.level_complete_screen.level_score_label_mc._visible = true;
if (_local2) {
this.level_complete_screen.total_score_label_mc._visible = false;
this.level_complete_screen.score_display = "";
this.level_complete_screen.final_score_label_mc._visible = true;
this.level_complete_screen.final_score_display = this.score;
this.kong_submit_score();
} else {
this.level_complete_screen.total_score_label_mc._visible = true;
this.level_complete_screen.score_display = this.score;
this.level_complete_screen.final_score_label_mc._visible = false;
this.level_complete_screen.final_score_display = "";
}
this.level_complete_screen.scoring_disabled_label_mc._visible = false;
}
if (_local2) {
this.kong_submit_episode_complete();
}
};
this.unload_level_complete_screen = function () {
if (this.level_complete_screen) {
var unloaded_screen = this.level_complete_screen;
this.level_complete_screen = null;
var _local3 = Stage.height / -2;
var _local2 = new mx.transitions.Tween(unloaded_screen, "_y", mx.transitions.easing.Regular.easeInOut, unloaded_screen._y, _local3, 1, true);
_local2.onMotionFinished = function () {
unloaded_screen.removeMovieClip();
};
}
};
this.continue_in_ghost_mode = function () {
this.ghost_mode = true;
if (this.active_episode == "easy") {
this.load_level(easy_levels[active_level_index]);
} else if (this.active_episode == "uneasy") {
this.load_level(uneasy_levels[active_level_index]);
} else if (this.active_episode == "dpuneasy") {
this.load_level(dpuneasy_levels[active_level_index]);
}
this.unload_game_over_screen();
};
this.load_next_level = function () {
if (this.active_episode == "easy") {
if ((active_level_index + 1) < easy_levels.length) {
this.load_level(easy_levels[++active_level_index]);
} else {
this.stop_game();
}
} else if (this.active_episode == "uneasy") {
if ((active_level_index + 1) < uneasy_levels.length) {
this.load_level(uneasy_levels[++active_level_index]);
} else {
this.stop_game();
}
} else if (this.active_episode == "dpuneasy") {
if ((active_level_index + 1) < dpuneasy_levels.length) {
this.load_level(dpuneasy_levels[++active_level_index]);
} else {
this.stop_game();
}
}
this.unload_level_complete_screen();
};
this.load_game_over_screen = function () {
this.game_over_screen = this.attachMovie("mc_game_over_screen", "game_over_screen_mc", depth);
depth++;
game_over_screen._x = Stage.width / 2;
game_over_screen._y = Stage.height * 1.5;
var _local3 = Stage.height / 2;
var _local4 = new mx.transitions.Tween(game_over_screen, "_y", mx.transitions.easing.Regular.easeInOut, game_over_screen._y, _local3, 1, true);
this.game_over_screen.final_score_display = this.score;
var _local2 = Math.floor(Math.random() * 5) + 1;
this.game_over_screen.flavour_text_mc.gotoAndStop(_local2);
};
this.unload_game_over_screen = function () {
if (this.game_over_screen) {
var unloaded_screen = this.game_over_screen;
this.game_over_screen = null;
var _local3 = Stage.height / -2;
var _local2 = new mx.transitions.Tween(unloaded_screen, "_y", mx.transitions.easing.Regular.easeInOut, unloaded_screen._y, _local3, 1, true);
_local2.onMotionFinished = function () {
unloaded_screen.removeMovieClip();
};
}
};
this.load_pause_screen = function () {
this.pause_screen = this.attachMovie("mc_pause_screen", "pause_screen_mc", depth);
depth++;
this.pause_screen._x = Stage.width / 2;
this.pause_screen._y = Stage.height / 2;
};
this.unload_pause_screen = function () {
if (this.pause_screen) {
this.pause_screen.removeMovieClip();
this.pause_screen = null;
}
};
this.start_game = function (episode) {
if (episode == "easy") {
this.load_level(easy_levels[0]);
this.active_level_index = 0;
this.active_episode = "easy";
} else if (episode == "uneasy") {
this.load_level(uneasy_levels[0]);
this.active_level_index = 0;
this.active_episode = "uneasy";
} else if (episode == "dpuneasy") {
this.load_level(dpuneasy_levels[0]);
this.active_level_index = 0;
this.active_episode = "dpuneasy";
}
this.lives = this.starting_lives;
this.lives_counter_mc._visible = true;
this.ghost_mode = false;
this.score = 0;
this.main_menu_mc._visible = false;
};
this.end_game = function () {
this.kong_submit_score();
this.unload_active_level();
this.level_name_label_mc.gotoAndStop(1);
this.load_game_over_screen();
};
this.stop_game = function () {
this.unload_active_level();
this.unload_level_complete_screen();
this.unload_game_over_screen();
this.unload_pause_screen();
this.level_name_label_mc.gotoAndStop(1);
this.lives_counter_mc._visible = false;
this.game_is_paused = true;
main_menu_mc._visible = true;
};
this.pause_game = function () {
this.game_is_paused = true;
var _local2 = 0;
while (_local2 < active_level.movers.length) {
active_level.movers[_local2].disable();
_local2++;
}
};
this.unpause_game = function () {
this.game_is_paused = false;
var _local2 = 0;
while (_local2 < active_level.movers.length) {
active_level.movers[_local2].enable();
_local2++;
}
};
this.exit_detection = function () {
var _local2 = avatar.get_centre();
_local2.x = _local2.x + active_level._x;
_local2.y = _local2.y + active_level._y;
if (active_level.exit_mc.hitTest(_local2.x, _local2.y, true)) {
this.exit_level();
}
};
this.exit_level = function () {
this.game_is_paused = true;
this.level_completion_time = getTimer() - this.level_start_time;
this.unload_active_level();
this.load_level_complete_screen();
};
this.killzone_detection = function () {
var _local3 = avatar.get_centre();
_local3.x = _local3.x + active_level._x;
_local3.y = _local3.y + active_level._y;
var _local5 = Stage.width / 2;
if (Math.abs(avatar._x) > (_local5 + 50)) {
this.reload_active_level();
}
var _local6 = Stage.height / 2;
if (Math.abs(avatar._y) > (_local6 + 50)) {
this.reload_active_level();
}
var _local4 = active_level.killzones.length;
var _local2 = 0;
while (_local2 < _local4) {
if (active_level.killzones[_local2].hitTest(_local3.x, _local3.y, true)) {
this.kill_avatar();
}
_local2++;
}
};
this.kill_avatar = function () {
var _local2 = new Sound(this);
_local2.attachSound("snd_squish");
_local2.start();
if (this.ghost_mode) {
this.reload_active_level();
} else {
this.lives--;
if (this.lives <= 0) {
this.end_game();
} else {
this.reload_active_level();
}
}
};
this.kong_submit_score = function () {
if (this.active_episode == "easy") {
_root.kongregateStats.submit("easy_high_score", this.score);
}
if (this.active_episode == "uneasy") {
_root.kongregateStats.submit("uneasy_high_score", this.score);
}
if (this.active_episode == "dpuneasy") {
_root.kongregateStats.submit("dpuneasy_high_score", this.score);
}
};
this.kong_submit_episode_complete = function () {
if (this.active_episode == "easy") {
_root.kongregateStats.submit("easy_completed", 1);
}
if (this.active_episode == "uneasy") {
_root.kongregateStats.submit("uneasy_completed", 1);
}
if (this.active_episode == "dpuneasy") {
_root.kongregateStats.submit("dpuneasy_completed", 1);
}
if (this.ghost_mode) {
if (this.active_episode == "easy") {
_root.kongregateStats.submit("easy_completed_ghost", 1);
}
if (this.active_episode == "uneasy") {
_root.kongregateStats.submit("uneasy_completed_ghost", 1);
}
if (this.active_episode == "dpuneasy") {
_root.kongregateStats.submit("dpuneasy_completed_ghost", 1);
}
} else {
if (this.active_episode == "easy") {
_root.kongregateStats.submit("easy_completed_normal", 1);
}
if (this.active_episode == "uneasy") {
_root.kongregateStats.submit("uneasy_completed_normal", 1);
}
if (this.active_episode == "dpuneasy") {
_root.kongregateStats.submit("dpuneasy_completed_normal", 1);
}
}
};
Symbol 15 MovieClip Frame 1
this._visible = false;
Symbol 126 MovieClip Frame 22
this._parent.set_graphic(_parent.avatar_fall_mc);
Symbol 176 MovieClip Frame 1
var frame_rate = _parent._parent.frame_rate;
var original_height = 50;
var gravitation = (new flash.geom.Point(0, 0));
var target_rotation = 0;
var linear_velocity = (new flash.geom.Point(0, 0));
var jump_velocity = 250;
var max_walk_velocity = 160;
var collision_death_speed = 600;
var walk_acceleration = 1200;
var air_walk_acceleration = 120;
var max_walk_inclination = 45;
var rotational_velocity = 360;
var is_airborne = true;
var contact_surface = null;
var is_walking_left = false;
var is_walking_right = false;
var surface_buffer = 0.5;
this.avatar_idle_mc._visible = true;
this.avatar_jump_mc._visible = false;
this.avatar_walk_mc._visible = false;
this.avatar_fall_mc._visible = false;
update_gravitation = function (world_gravity, anomalies) {
this.gravitation.x = 0;
this.gravitation.y = 0;
var _local7 = false;
var _local8 = anomalies.length;
var _local2 = 0;
while (_local2 < _local8) {
var _local5 = this.get_centre();
var _local6 = new flash.geom.Point(anomalies[_local2]._x, anomalies[_local2]._y);
var _local4 = flash.geom.Point.distance(_local5, _local6);
if (_local4 <= anomalies[_local2].radius) {
this.gravitation.offset(anomalies[_local2].gravitation.x, anomalies[_local2].gravitation.y);
_local7 = true;
}
_local2++;
}
if (_local7 == false) {
this.gravitation = world_gravity.clone();
}
if (_local7) {
var _local12 = new flash.filters.BlurFilter(4, 4, 3);
this.filters = [_local12];
} else {
this.filters = [];
}
this.target_rotation = (Math.atan2(this.gravitation.y, this.gravitation.x) * 180) / Math.PI;
this.target_rotation = this.target_rotation - 90;
if (this.target_rotation < -180) {
this.target_rotation = this.target_rotation + 360;
}
if (this.is_airborne == false) {
var _local9 = this.get_up();
var _local10 = contact_surface.normal;
var _local13 = (_local9.x * _local10.x) + (_local9.y * _local10.y);
var _local11 = Math.acos(_local13 / (_local9.length * _local10.length));
_local11 = _local11 * 57.2957795130823;
if (_local11 > (90 - max_walk_inclination)) {
this.is_airborne = true;
this.contact_surface = null;
}
}
};
update_linear_velocity = function () {
if (this.is_airborne) {
this.linear_velocity.offset(this.gravitation.x / frame_rate, this.gravitation.y / frame_rate);
}
};
update_rotational_velocity = function () {
if (this.is_airborne) {
}
};
update_position = function () {
this._x = this._x + (this.linear_velocity.x / frame_rate);
this._y = this._y + (this.linear_velocity.y / frame_rate);
if ((this.is_airborne == false) && (this.linear_velocity.length > 0)) {
this.align_to_surface(contact_surface);
}
};
update_rotation = function () {
if (this.is_airborne) {
if (Math.abs(this.target_rotation - this._rotation) < (rotational_velocity / frame_rate)) {
this.set_rotation_about_centre(this.target_rotation);
} else {
theta = this.target_rotation - this._rotation;
if (((theta > 0) && (theta < 180)) || (theta < -180)) {
this.rotate_about_centre(rotational_velocity / frame_rate);
} else {
this.rotate_about_centre((-rotational_velocity) / frame_rate);
}
}
}
};
collision_detection = function (surfaces) {
var _local4 = surfaces.length;
if (this.is_airborne) {
var _local2 = 0;
while (_local2 < _local4) {
this.airborne_collision_with_surface(surfaces[_local2]);
_local2++;
}
} else {
var _local2 = 0;
while (_local2 < _local4) {
if (surfaces[_local2] == this.contact_surface) {
} else {
this.grounded_collision_with_surface(surfaces[_local2]);
}
_local2++;
}
if (this.is_over_surface(this.contact_surface) == false) {
this.is_airborne = true;
this.contact_surface = null;
}
}
};
airborne_collision_with_surface = function (surface) {
if (this.is_over_surface(surface)) {
var _local9 = new flash.geom.Point(this._x, this._y);
var _local4 = this.get_target_rotation_mapping_matrix();
var _local11 = _local4.transformPoint(_local9);
var _local5 = _local4.transformPoint(surface.left_endpoint());
var _local8 = _local4.transformPoint(surface.right_endpoint());
var _local13 = Math.abs(_local5.x - _local11.x) / Math.abs(_local5.x - _local8.x);
var _local14 = flash.geom.Point.interpolate(_local8, _local5, _local13);
if ((surface.is_facing(_local9) == false) && (surface.facing_avatar_in_prev_frame)) {
if (this.linear_velocity.length > this.collision_death_speed) {
_parent._parent.kill_avatar();
return(undefined);
}
this.align_to_surface(surface);
var _local6 = this.get_up();
var _local7 = surface.normal;
var _local12 = (_local6.x * _local7.x) + (_local6.y * _local7.y);
var _local10 = Math.acos(_local12 / (_local6.length * _local7.length));
_local10 = _local10 * 57.2957795130823;
if (_local10 <= (90 - max_walk_inclination)) {
this.land_on_surface(surface);
} else {
this.deflect_from_surface(surface);
}
}
}
};
grounded_collision_with_surface = function (surface) {
if (this.is_over_surface(surface)) {
avatar_pos = new flash.geom.Point(this._x, this._y);
rot_matrix = this.get_target_rotation_mapping_matrix();
rot_avatar_pos = rot_matrix.transformPoint(avatar_pos);
rot_left_endpoint = rot_matrix.transformPoint(surface.left_endpoint());
rot_right_endpoint = rot_matrix.transformPoint(surface.right_endpoint());
f = Math.abs(rot_left_endpoint.x - rot_avatar_pos.x) / Math.abs(rot_left_endpoint.x - rot_right_endpoint.x);
intersect = flash.geom.Point.interpolate(rot_right_endpoint, rot_left_endpoint, f);
if ((surface.is_facing(avatar_pos) == false) && (surface.facing_avatar_in_prev_frame)) {
up = this.get_up();
normal = surface.normal;
dp = (up.x * normal.x) + (up.y * normal.y);
normal_angle_from_vertical = Math.acos(dp / (up.length * normal.length));
normal_angle_from_vertical = normal_angle_from_vertical * 57.2957795130823;
if (normal_angle_from_vertical <= (90 - max_walk_inclination)) {
this.align_to_surface(surface);
this.land_on_surface(surface);
} else {
this.deflect_from_surface(surface);
}
}
}
};
land_on_surface = function (surface) {
this.is_airborne = false;
this.contact_surface = surface;
this._rotation = surface._rotation;
this.apply_surface_buffer(surface);
surface_left = this.contact_surface.left_vector();
surface_right = this.contact_surface.right_vector();
if (((linear_velocity.x * surface_left.x) + (linear_velocity.y * surface_left.y)) > 0) {
dp = (linear_velocity.x * surface_left.x) + (linear_velocity.y * surface_left.y);
momentum = dp / surface_left.length;
surface_left.normalize(momentum);
this.linear_velocity.x = surface_left.x;
this.linear_velocity.y = surface_left.y;
} else {
dp = (linear_velocity.x * surface_right.x) + (linear_velocity.y * surface_right.y);
momentum = dp / surface_right.length;
surface_right.normalize(momentum);
this.linear_velocity.x = surface_right.x;
this.linear_velocity.y = surface_right.y;
}
this.set_graphic(this.avatar_idle_mc);
};
deflect_from_surface = function (surface) {
if (this.is_airborne) {
surface_left = surface.left_vector();
surface_right = surface.right_vector();
if (((linear_velocity.x * surface_left.x) + (linear_velocity.y * surface_left.y)) > 0) {
dp = (linear_velocity.x * surface_left.x) + (linear_velocity.y * surface_left.y);
momentum = dp / surface_left.length;
surface_left.normalize(momentum);
this.linear_velocity.x = surface_left.x;
this.linear_velocity.y = surface_left.y;
} else {
dp = (linear_velocity.x * surface_right.x) + (linear_velocity.y * surface_right.y);
momentum = dp / surface_right.length;
surface_right.normalize(momentum);
this.linear_velocity.x = surface_right.x;
this.linear_velocity.y = surface_right.y;
}
this.apply_surface_buffer(surface);
} else {
rot_matrix = new flash.geom.Matrix();
rot_matrix.rotate((((contact_surface._rotation + 90) * -1) * Math.PI) / 180);
avatar_pos = new flash.geom.Point(this._x, this._y);
rot_avatar_pos = rot_matrix.transformPoint(avatar_pos);
rot_left_endpoint = rot_matrix.transformPoint(surface.left_endpoint());
rot_right_endpoint = rot_matrix.transformPoint(surface.right_endpoint());
f = Math.abs(rot_left_endpoint.x - rot_avatar_pos.x) / Math.abs(rot_left_endpoint.x - rot_right_endpoint.x);
intersect = flash.geom.Point.interpolate(rot_right_endpoint, rot_left_endpoint, f);
overlap = Math.abs(rot_avatar_pos.y - intersect.y);
correction = new flash.geom.Point(linear_velocity.x * -1, linear_velocity.y * -1);
correction.normalize(overlap + surface_buffer);
this._x = this._x + correction.x;
this._y = this._y + correction.y;
this.linear_velocity.x = 0;
this.linear_velocity.y = 0;
}
};
align_to_surface = function (surface) {
left_endpoint = surface.left_endpoint();
right_endpoint = surface.right_endpoint();
avatar_pos = new flash.geom.Point(this._x, this._y);
contact_pos = new flash.geom.Point(0, 0);
dist_to_left = flash.geom.Point.distance(avatar_pos, left_endpoint);
dist_to_right = flash.geom.Point.distance(avatar_pos, right_endpoint);
surface_length = flash.geom.Point.distance(left_endpoint, right_endpoint);
if (dist_to_left < dist_to_right) {
f = dist_to_right / surface_length;
contact_pos = flash.geom.Point.interpolate(left_endpoint, right_endpoint, f);
} else {
f = dist_to_left / surface_length;
contact_pos = flash.geom.Point.interpolate(right_endpoint, left_endpoint, f);
}
this._x = contact_pos.x;
this._y = contact_pos.y;
};
apply_surface_buffer = function (surface) {
var _local2 = surface.normal;
_local2.normalize(this.surface_buffer);
this._x = this._x + _local2.x;
this._y = this._y + _local2.y;
};
get_up = function () {
up = new flash.geom.Point(this.gravitation.x * -1, this.gravitation.y * -1);
return(up);
};
is_upright = function () {
if (contact_surface) {
return(contact_surface.normal.y < 0);
}
return(this.gravitation.y > 0);
};
get_left = function () {
left = new flash.geom.Point(this.gravitation.y * -1, this.gravitation.x);
return(left);
};
get_right = function () {
right = new flash.geom.Point(this.gravitation.y, this.gravitation.x * -1);
return(right);
};
is_over_surface = function (surface) {
var _local5 = new flash.geom.Point(this._x, this._y);
var _local8 = new flash.geom.Point(surface._x, surface._y);
var _local2 = surface.get_rotation_mapping_matrix();
var _local6 = _local2.transformPoint(_local5);
var _local9 = _local2.transformPoint(_local8);
var _local4 = Math.abs(_local6.x - _local9.x);
var _local7 = surface._xscale;
return(_local4 <= (_local7 / 2));
};
is_touching_surface = function (surface) {
avatar_pos = new flash.geom.Point(this._x, this._y);
surface_pos = new flash.geom.Point(surface._x, surface._y);
rot_matrix = this.get_target_rotation_mapping_matrix();
rot_avatar_pos = rot_matrix.transformPoint(avatar_pos);
rot_surface_pos = rot_matrix.transformPoint(surface_pos);
rot_left_endpoint = rot_matrix.transformPoint(surface.left_endpoint());
rot_right_endpoint = rot_matrix.transformPoint(surface.right_endpoint());
feet_y = rot_avatar_pos.y + (this.original_height / 2);
f = Math.abs(rot_left_endpoint.x - rot_avatar_pos.x) / Math.abs(rot_left_endpoint.x - rot_right_endpoint.x);
intersect = flash.geom.Point.interpolate(rot_right_endpoint, rot_left_endpoint, f);
return((feet_y >= intersect.y) && (rot_avatar_pos.y < intersect.y));
};
get_target_rotation_mapping_matrix = function () {
var _local2 = new flash.geom.Matrix();
_local2.rotate(((this.target_rotation * -1) * Math.PI) / 180);
return(_local2);
};
get_centre = function () {
var _local2 = new flash.geom.Point(0, this.original_height / -2);
r = new flash.geom.Matrix();
r.rotate((this._rotation * Math.PI) / 180);
_local2 = r.transformPoint(_local2);
_local2.offset(this._x, this._y);
return(_local2);
};
rotate_about_centre = function (delta_angle) {
prev_centre = this.get_centre();
this._rotation = this._rotation + delta_angle;
correction = prev_centre.subtract(this.get_centre());
this._x = this._x + correction.x;
this._y = this._y + correction.y;
};
set_rotation_about_centre = function (angle) {
prev_centre = this.get_centre();
this._rotation = angle;
correction = prev_centre.subtract(this.get_centre());
this._x = this._x + correction.x;
this._y = this._y + correction.y;
};
walk_left = function () {
if (this.is_walking_right == false) {
this.is_walking_left = true;
if (this.is_airborne) {
left = this.get_left();
left.normalize(this.air_walk_acceleration / frame_rate);
this.linear_velocity.offset(left.x, left.y);
} else {
left = contact_surface.left_vector();
left.normalize(this.walk_acceleration / frame_rate);
this.linear_velocity.offset(left.x, left.y);
if (this.linear_velocity.length > max_walk_velocity) {
this.linear_velocity.normalize(max_walk_velocity);
}
this.set_graphic(this.avatar_walk_mc);
}
this._xscale = -100;
}
};
walk_right = function () {
if (this.is_walking_left == false) {
this.is_walking_right = true;
if (this.is_airborne) {
right = this.get_right();
right.normalize(this.air_walk_acceleration / frame_rate);
this.linear_velocity.offset(right.x, right.y);
} else {
right = contact_surface.right_vector();
right.normalize(this.walk_acceleration / frame_rate);
this.linear_velocity.offset(right.x, right.y);
if (this.linear_velocity.length > max_walk_velocity) {
this.linear_velocity.normalize(max_walk_velocity);
}
this.set_graphic(this.avatar_walk_mc);
}
this._xscale = 100;
}
};
stop_walking = function () {
if (this.is_airborne == false) {
deceleration = walk_acceleration / frame_rate;
if (this.linear_velocity.length < deceleration) {
this.linear_velocity.x = 0;
this.linear_velocity.y = 0;
} else {
this.linear_velocity.normalize(this.linear_velocity.length - deceleration);
}
this.set_graphic(this.avatar_idle_mc);
}
};
jump = function () {
if (this.is_airborne == false) {
if (this.linear_velocity.y > 0) {
this.linear_velocity.y = 0;
}
u = this.get_up();
u.normalize(jump_velocity);
this.linear_velocity.offset(u.x, u.y);
this.is_airborne = true;
this.contact_surface = null;
this.set_graphic(this.avatar_jump_mc);
}
};
set_graphic = function (graphic) {
if (graphic._visible == false) {
graphic.gotoAndPlay(1);
}
this.avatar_idle_mc._visible = false;
this.avatar_jump_mc._visible = false;
this.avatar_walk_mc._visible = false;
this.avatar_fall_mc._visible = false;
graphic._visible = true;
};
Symbol 180 MovieClip Frame 1
this.surface_graphic_mc.gotoAndStop("game");
facing_avatar_in_prev_frame = false;
precalculate_normal = function () {
this.normal = this.get_normal();
};
get_normal = function () {
n = new flash.geom.Point(0, -1);
r = new flash.geom.Matrix();
r.rotate((this._rotation * Math.PI) / 180);
n = r.transformPoint(n);
return(n);
};
is_facing = function (point) {
n = this.normal;
offset = point.clone();
offset.x = offset.x - this._x;
offset.y = offset.y - this._y;
return(((n.x * offset.x) + (n.y * offset.y)) > 0);
};
is_facing_up = function (up) {
n = this.normal;
return(((n.x * up.x) + (n.y * up.y)) > 0);
};
left_vector = function () {
p = new flash.geom.Point(this._xscale / -2, 0);
r = new flash.geom.Matrix();
r.rotate((this._rotation * Math.PI) / 180);
p = r.transformPoint(p);
return(p);
};
right_vector = function () {
p = new flash.geom.Point(this._xscale / 2, 0);
r = new flash.geom.Matrix();
r.rotate((this._rotation * Math.PI) / 180);
p = r.transformPoint(p);
return(p);
};
left_endpoint = function () {
p = this.left_vector();
p.offset(this._x, this._y);
return(p);
};
right_endpoint = function () {
p = this.right_vector();
p.offset(this._x, this._y);
return(p);
};
get_rotation_mapping_matrix = function () {
var _local2 = new flash.geom.Matrix();
_local2.rotate(((this._rotation * -1) * Math.PI) / 180);
return(_local2);
};
Symbol 181 MovieClip [mc_level_1_9] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc];
var killzones = [];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "An inconvenient exit";
Symbol 199 MovieClip Frame 1
this._visible = false;
Symbol 200 MovieClip [mc_level_2_9] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc, this.surface11_mc, this.surface12_mc];
var killzones = [killzone1_mc, killzone2_mc, killzone3_mc, killzone4_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "Archipelago";
Symbol 202 MovieClip Frame 1
var frame_rate = 24;
var current_target = 0;
this.update_path = function () {
var _local2;
if (this.current_target == (this.path.length - 1)) {
_local2 = 0;
} else {
_local2 = this.current_target + 1;
}
var _local3 = this.path[_local2];
this.x_tw = new mx.transitions.Tween(this, "_x", this.tween_type, this._x, _local3.x, this.move_time * this.frame_rate, false);
this.y_tw = new mx.transitions.Tween(this, "_y", this.tween_type, this._y, _local3.y, this.move_time * this.frame_rate, false);
this.current_target = _local2;
this.y_tw.onMotionFinished = function () {
this.obj.update_path();
};
};
this.disable = function () {
this.x_tw.stop();
this.y_tw.stop();
};
this.enable = function () {
this.x_tw.resume();
this.y_tw.resume();
};
Symbol 203 MovieClip [mc_level_2_1] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc];
var killzones = [mover1_mc.killzone_mc, mover2_mc.killzone_mc, mover3_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc, mover3_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Lemon squeezy";
mover1_mc.path = [new flash.geom.Point(-184, -133), new flash.geom.Point(-184, -63)];
mover1_mc.move_time = 3;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover2_mc.path = [new flash.geom.Point(-21, -138), new flash.geom.Point(-21, -68)];
mover2_mc.move_time = 1.5;
mover2_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover3_mc.path = [new flash.geom.Point(144, -141), new flash.geom.Point(144, -71)];
mover3_mc.move_time = 0.75;
mover3_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 211 MovieClip [mc_anomaly] Frame 1
stop();
Symbol 217 MovieClip [mc_level_1_1] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc];
var killzones = [];
var anomalies = [pre_anomaly_mc];
var movers = [];
var orbs = [];
var starting_ammo = 0;
var level_name = "Roadblock";
Symbol 219 MovieClip [mc_level_2_4] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc];
var killzones = [mover1_mc.killzone_mc, mover2_mc.killzone_mc, mover3_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc, mover3_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Unstable flooring";
mover1_mc.path = [new flash.geom.Point(-228, 0), new flash.geom.Point(328, -10)];
mover1_mc.move_time = 1.5;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover2_mc.path = [new flash.geom.Point(328, -10), new flash.geom.Point(-228, 0)];
mover2_mc.move_time = 2.05;
mover2_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover3_mc.path = [new flash.geom.Point(-228, 0), new flash.geom.Point(328, -10)];
mover3_mc.move_time = 2.8;
mover3_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 221 MovieClip [mc_level_2_7] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc, this.surface11_mc, this.surface12_mc, this.surface13_mc];
var killzones = [mover1_mc.killzone_mc, mover2_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "The upward spiral";
mover1_mc.path = [new flash.geom.Point(-136, 243), new flash.geom.Point(-136, -257)];
mover1_mc.move_time = 2;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover2_mc.path = [new flash.geom.Point(162, -155), new flash.geom.Point(319, 1), new flash.geom.Point(187, 133), new flash.geom.Point(277, 223), new flash.geom.Point(187, 133), new flash.geom.Point(319, 1)];
mover2_mc.move_time = 1;
mover2_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 223 MovieClip [mc_level_3_1] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc];
var killzones = [mover1_mc.killzone_mc, mover2_mc.killzone_mc, mover3_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc, mover3_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Pentagon of doom";
mover1_mc.path = [new flash.geom.Point(-326, 0), new flash.geom.Point(-189, 256), new flash.geom.Point(241, 220), new flash.geom.Point(319, -73), new flash.geom.Point(-74, -256)];
mover1_mc.move_time = 1.9;
mover1_mc.tween_type = mx.transitions.easing.None.easeIn;
mover2_mc.path = [new flash.geom.Point(-18, -129), new flash.geom.Point(164, -18), new flash.geom.Point(104, 139), new flash.geom.Point(-118, 133), new flash.geom.Point(-174, -3)];
mover2_mc.move_time = 1.5;
mover2_mc.tween_type = mx.transitions.easing.None.easeIn;
mover3_mc.path = [new flash.geom.Point(319, -73), new flash.geom.Point(-74, -256), new flash.geom.Point(-326, 0), new flash.geom.Point(-189, 256), new flash.geom.Point(241, 220)];
mover3_mc.move_time = 1.9;
mover3_mc.tween_type = mx.transitions.easing.None.easeIn;
Symbol 248 MovieClip [mc_level_2_3] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [killzone1_mc, killzone2_mc, mover1_mc.killzone_mc, mover2_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Fred Astaire-case";
mover1_mc.path = [new flash.geom.Point(325, 232), new flash.geom.Point(340, -263), new flash.geom.Point(-358, -236), new flash.geom.Point(-347, 250)];
mover1_mc.move_time = 3;
mover1_mc.tween_type = mx.transitions.easing.None.easeIn;
mover2_mc.path = [new flash.geom.Point(-358, -236), new flash.geom.Point(-347, 250), new flash.geom.Point(325, 232), new flash.geom.Point(340, -263)];
mover2_mc.move_time = 3;
mover2_mc.tween_type = mx.transitions.easing.None.easeIn;
Symbol 251 MovieClip [mc_level_2_10] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc];
var killzones = [killzone1_mc, killzone2_mc, killzone3_mc, killzone4_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "Lumber mill";
Symbol 253 MovieClip Frame 1
var frame_rate = 24;
var current_target = 0;
this.update_path = function () {
var _local2;
if (this.current_target == (this.path.length - 1)) {
_local2 = 0;
} else {
_local2 = this.current_target + 1;
}
var _local3 = this.path[_local2];
this.x_tw = new mx.transitions.Tween(this, "_x", this.tween_type, this._x, _local3.x, this.move_time * this.frame_rate, false);
this.y_tw = new mx.transitions.Tween(this, "_y", this.tween_type, this._y, _local3.y, this.move_time * this.frame_rate, false);
this.current_target = _local2;
this.y_tw.onMotionFinished = function () {
this.obj.update_path();
};
};
this.disable = function () {
this.x_tw.stop();
this.y_tw.stop();
};
this.enable = function () {
this.x_tw.resume();
this.y_tw.resume();
};
Symbol 254 MovieClip [mc_level_2_8] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [mover1_mc.killzone_mc, mover2_mc.killzone_mc, mover3_mc.killzone_mc, mover4_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc, mover3_mc, mover4_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Chimney escape";
mover1_mc.path = [new flash.geom.Point(93, -128), new flash.geom.Point(143, -128)];
mover1_mc.move_time = 1.5;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover2_mc.path = [new flash.geom.Point(1, -129), new flash.geom.Point(-49, -129)];
mover2_mc.move_time = 1.5;
mover2_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover3_mc.path = [new flash.geom.Point(94, -9), new flash.geom.Point(144, -9)];
mover3_mc.move_time = 1;
mover3_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover4_mc.path = [new flash.geom.Point(2, -10), new flash.geom.Point(-48, -10)];
mover4_mc.move_time = 1;
mover4_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 257 MovieClip Frame 1
this._visible = false;
Symbol 258 MovieClip [mc_level_3_8] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc, this.surface11_mc, this.surface12_mc];
var killzones = [killzone1_mc, mover1_mc.killzone_mc, mover2_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Putting the fun back in funnel";
mover1_mc.path = [new flash.geom.Point(41, 89), new flash.geom.Point(202, -141)];
mover1_mc.move_time = 2;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover2_mc.path = [new flash.geom.Point(-49, 84), new flash.geom.Point(-212, -140)];
mover2_mc.move_time = 2;
mover2_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 260 MovieClip [mc_level_3_9] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [killzone1_mc, killzone2_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "Message in a bottle";
Symbol 262 MovieClip [mc_level_3_10] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [killzone1_mc, killzone2_mc];
var anomalies = [pre_anomaly_mc];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "U-turn";
Symbol 264 MovieClip [mc_level_3_6] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [mover1_mc.killzone_mc, mover2_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Hole in the roof";
mover1_mc.path = [new flash.geom.Point(-141, -69), new flash.geom.Point(169, -57)];
mover1_mc.move_time = 3;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover2_mc.path = [new flash.geom.Point(-142, 52), new flash.geom.Point(168, 64)];
mover2_mc.move_time = 3;
mover2_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 266 MovieClip [mc_level_2_6] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc];
var killzones = [mover1_mc.killzone_mc, mover2_mc.killzone_mc, mover3_mc.killzone_mc, mover4_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc, mover3_mc, mover4_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Missing gorilla";
mover1_mc.path = [new flash.geom.Point(341, 220), new flash.geom.Point(346, 1), new flash.geom.Point(-147, -76), new flash.geom.Point(-147, -127), new flash.geom.Point(349, -170), new flash.geom.Point(350, -251), new flash.geom.Point(-367, -208), new flash.geom.Point(-364, -28), new flash.geom.Point(159, 81), new flash.geom.Point(160, 136), new flash.geom.Point(-362, 167), new flash.geom.Point(-360, 266)];
mover1_mc.move_time = 2;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover2_mc.path = [new flash.geom.Point(160, 136), new flash.geom.Point(-362, 167), new flash.geom.Point(-360, 266), new flash.geom.Point(341, 220), new flash.geom.Point(346, 1), new flash.geom.Point(-147, -76), new flash.geom.Point(-147, -127), new flash.geom.Point(349, -170), new flash.geom.Point(350, -251), new flash.geom.Point(-367, -208), new flash.geom.Point(-364, -28), new flash.geom.Point(159, 81)];
mover2_mc.move_time = 2;
mover2_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover3_mc.path = [new flash.geom.Point(-367, -208), new flash.geom.Point(-364, -28), new flash.geom.Point(159, 81), new flash.geom.Point(160, 136), new flash.geom.Point(-362, 167), new flash.geom.Point(-360, 266), new flash.geom.Point(341, 220), new flash.geom.Point(346, 1), new flash.geom.Point(-147, -76), new flash.geom.Point(-147, -127), new flash.geom.Point(349, -170), new flash.geom.Point(350, -251)];
mover3_mc.move_time = 2;
mover3_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover4_mc.path = [new flash.geom.Point(-147, -127), new flash.geom.Point(349, -170), new flash.geom.Point(350, -251), new flash.geom.Point(-367, -208), new flash.geom.Point(-364, -28), new flash.geom.Point(159, 81), new flash.geom.Point(160, 136), new flash.geom.Point(-362, 167), new flash.geom.Point(-360, 266), new flash.geom.Point(341, 220), new flash.geom.Point(346, 1), new flash.geom.Point(-147, -76)];
mover4_mc.move_time = 2;
mover4_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 268 MovieClip [mc_level_3_7] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc];
var killzones = [killzone1_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "Hexagon of doom";
Symbol 270 MovieClip [mc_level_3_5] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [mover1_mc.killzone_mc, mover2_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc, mover2_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Going up";
mover1_mc.path = [new flash.geom.Point(96, -154), new flash.geom.Point(94, 259)];
mover1_mc.move_time = 1.5;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
mover2_mc.path = [new flash.geom.Point(-102, 258), new flash.geom.Point(-103, -151)];
mover2_mc.move_time = 1.5;
mover2_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 272 MovieClip [mc_level_3_4] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc];
var killzones = [killzone1_mc, killzone2_mc, killzone3_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "Island in the stream";
Symbol 274 MovieClip [mc_level_3_3] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc, this.surface11_mc, this.surface12_mc];
var killzones = [killzone1_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "J";
Symbol 276 MovieClip [mc_level_3_2] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc];
var killzones = [killzone1_mc, killzone2_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "Pole vault";
Symbol 278 MovieClip [mc_level_2_2] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc];
var killzones = [mover1_mc.killzone_mc];
var anomalies = [];
var movers = [mover1_mc];
var orbs = [];
var starting_ammo = 2;
var level_name = "Speed bump";
mover1_mc.path = [new flash.geom.Point(23, -192), new flash.geom.Point(23, -102)];
mover1_mc.move_time = 1;
mover1_mc.tween_type = mx.transitions.easing.Regular.easeInOut;
Symbol 283 MovieClip [mc_level_1_2] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc];
var killzones = [];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 1;
var level_name = "Time for a booster";
Symbol 285 MovieClip [mc_level_1_7] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc];
var killzones = [this.killzone1_mc, this.killzone2_mc, this.killzone3_mc, this.killzone4_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 1;
var level_name = "Diamond in the rough";
Symbol 288 MovieClip [mc_level_1_6] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc];
var killzones = [this.killzone1_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 1;
var level_name = "S-bend";
Symbol 290 MovieClip [mc_level_1_5] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 1;
var level_name = "Baby steps";
Symbol 292 MovieClip [mc_level_1_10] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc];
var killzones = [this.killzone1_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "Cliffhanger's revenge";
Symbol 294 MovieClip [mc_level_1_8] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc];
var killzones = [];
var anomalies = [this.pre_anomaly_mc];
var movers = [];
var orbs = [];
var starting_ammo = 1;
var level_name = "Cliffhanger";
Symbol 296 MovieClip [mc_level_2_5] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc, this.surface9_mc, this.surface10_mc];
var killzones = [this.killzone1_mc, this.killzone2_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 2;
var level_name = "Super fun happy slide";
Symbol 299 MovieClip [mc_level_1_3] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [this.killzone1_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 1;
var level_name = "Leap of faith";
Symbol 301 MovieClip [mc_level_1_4] Frame 1
var surfaces = [this.surface1_mc, this.surface2_mc, this.surface3_mc, this.surface4_mc, this.surface5_mc, this.surface6_mc, this.surface7_mc, this.surface8_mc];
var killzones = [this.killzone1_mc];
var anomalies = [];
var movers = [];
var orbs = [];
var starting_ammo = 1;
var level_name = "Paratrooper";
Symbol 307 MovieClip [mc_flake] Frame 1
var frame_rate = this._parent.frame_rate;
var gravitation = (new flash.geom.Point(0, 0));
var linear_velocity = (new flash.geom.Point(0, 0));
var max_velocity = 25;
update_gravitation = function (world_gravity, anomalies) {
this.gravitation.x = 0;
this.gravitation.y = 0;
var _local8 = false;
var _local3 = 0;
while (_local3 < anomalies.length) {
var _local7 = new flash.geom.Point(this._x, this._y);
var _local5 = new flash.geom.Point(anomalies[_local3]._x, anomalies[_local3]._y);
_local5.offset(Stage.width / 2, Stage.height / 2);
var _local6 = flash.geom.Point.distance(_local7, _local5);
if (_local6 <= _root.anomaly_radius) {
this.gravitation.offset(anomalies[_local3].gravitation.x, anomalies[_local3].gravitation.y);
_local8 = true;
}
_local3++;
}
if (_local8 == false) {
this.gravitation = world_gravity.clone();
}
};
update_linear_velocity = function () {
this.linear_velocity.offset(this.gravitation.x / frame_rate, this.gravitation.y / frame_rate);
if (this.linear_velocity.length > this.max_velocity) {
this.linear_velocity.normalize(this.max_velocity);
}
};
update_position = function () {
this._y = this._y + (this.max_velocity / frame_rate);
};
Symbol 385 MovieClip [mc_level_complete_screen] Frame 1
var suppress_clicks = false;
this.main_menu_cog_mc.onRelease = function () {
this._parent._parent.stop_game();
};
this.next_level_cog_mc.onRelease = function () {
if (this.suppress_clicks) {
} else {
this._parent._parent.load_next_level();
this.suppress_clicks = true;
}
};
this.kong_cog_mc.onRelease = function () {
getURL ("http://www.kongregate.com/?gamereferral=manifold", "_blank");
};
Symbol 389 MovieClip [mc_level_name_label] Frame 49
stop();
Symbol 403 MovieClip [mc_game_over_screen] Frame 1
var suppress_clicks = false;
this.kong_cog_mc.onRelease = function () {
getURL ("http://www.kongregate.com/?gamereferral=manifold", "_blank");
};
this.main_menu_cog_mc.onRelease = function () {
if (this.suppress_clicks) {
} else {
this._parent._parent.stop_game();
this.suppress_clicks = true;
}
};
this.ghost_mode_cog_mc.onRelease = function () {
if (this.suppress_clicks) {
} else {
this._parent._parent.continue_in_ghost_mode();
this.suppress_clicks = true;
}
};
Symbol 410 MovieClip Frame 1
var frame_rate = this._parent.frame_rate;
var flakes = [];
var max_flakes = 20;
var depth = 0;
var original_width = this._width;
var original_height = this._height;
var colour_shift_duration = 1;
this.onEnterFrame = function () {
this.update_flakes();
};
this.update_flakes = function () {
this.create_flakes();
if (_parent.active_level.is_prepared || (_parent.active_level == null)) {
var _local3 = this.flakes.length - 1;
while (_local3 >= 0) {
flakes[_local3].update_position();
if (flakes[_local3]._y > this.original_height) {
flakes[_local3].removeMovieClip();
flakes.splice(_local3, 1);
}
_local3--;
}
}
};
this.create_flakes = function () {
var _local4 = false;
if (flakes.length == 0) {
_local4 = true;
}
var _local5 = this.max_flakes - this.flakes.length;
var _local3 = 0;
while (_local3 < _local5) {
var _local2 = this.attachMovie("mc_flake", ("flake" + this.depth) + "_mc", this.depth);
this.depth++;
_local2._y = 0;
_local2._x = Math.random() * this.original_width;
if (_local4) {
_local2._y = Math.random() * this.original_height;
} else {
_local2._y = 0;
}
new_flake_mc.blendMode = "screen";
this.flakes.push(_local2);
_local3++;
}
};
this.update_colour = function () {
var _local3 = [1, 0, 0, 0, this.red, 0, 1, 0, 0, this.green, 0, 0, 1, 0, this.blue, 0, 0, 0, 1, 0];
var _local2 = new flash.filters.ColorMatrixFilter(_local3);
this.filters = [_local2];
};
this.set_random_colour = function () {
this.red = (Math.random() * 96) - 64;
this.green = (Math.random() * 96) - 64;
this.blue = (Math.random() * 96) - 64;
this.update_colour();
};
this.shift_to_random_colour = function () {
var _local3 = (Math.random() * 96) - 64;
var _local5 = (Math.random() * 96) - 64;
var _local4 = (Math.random() * 96) - 64;
var _local8 = new mx.transitions.Tween(this, "red", mx.transitions.easing.Regular.easeInOut, this.red, _local3, colour_shift_duration, true);
var _local7 = new mx.transitions.Tween(this, "green", mx.transitions.easing.Regular.easeInOut, this.green, _local5, colour_shift_duration, true);
var _local6 = new mx.transitions.Tween(this, "blue", mx.transitions.easing.Regular.easeInOut, this.blue, _local4, colour_shift_duration, true);
_local6.onMotionChanged = function () {
_parent.background_mc.update_colour();
};
};
Symbol 412 MovieClip Frame 1
stop();
Symbol 414 MovieClip Frame 1
stop();
Symbol 443 MovieClip Frame 1
var menu_state = "main";
this.label_choose_episode_mc._visible = false;
this.label_episode_clarity_mc._visible = false;
this.easy_cog_mc._visible = false;
this.uneasy_cog_mc._visible = false;
this.dpuneasy_cog_mc._visible = false;
this.cog_label_easy_mc._visible = false;
this.cog_label_uneasy_mc._visible = false;
this.cog_label_dpuneasy_mc._visible = false;
this.back_cog_mc._visible = false;
this.label_back_mc._visible = false;
this.credits_mc._visible = false;
this.play_cog_mc.onRelease = function () {
this._parent.open_episode_select();
};
this.kong_cog_mc.onRelease = function () {
getURL ("http://www.kongregate.com/?gamereferral=manifold", "_blank");
};
this.credits_cog_mc.onRelease = function () {
this._parent.open_credits();
};
this.easy_cog_mc.onRelease = function () {
this._parent._parent.start_game("easy");
};
this.uneasy_cog_mc.onRelease = function () {
this._parent._parent.start_game("uneasy");
};
this.dpuneasy_cog_mc.onRelease = function () {
this._parent._parent.start_game("dpuneasy");
};
this.back_cog_mc.onRelease = function () {
if (this._parent.menu_state == "episode_select") {
this._parent.open_main();
} else if (this._parent.menu_state == "credits") {
this._parent.open_main();
}
};
this.open_main = function () {
this.title_razor_blade_mc._visible = true;
this.title_text_mc._visible = true;
this.play_cog_mc._visible = true;
this.cog_label_play_mc._visible = true;
this.credits_cog_mc._visible = true;
this.cog_label_credits_mc._visible = true;
this.kong_cog_mc._visible = true;
this.cog_label_kong_mc._visible = true;
this.credits_mc._visible = false;
this.label_choose_episode_mc._visible = false;
this.label_episode_clarity_mc._visible = false;
this.easy_cog_mc._visible = false;
this.uneasy_cog_mc._visible = false;
this.dpuneasy_cog_mc._visible = false;
this.cog_label_easy_mc._visible = false;
this.cog_label_uneasy_mc._visible = false;
this.cog_label_dpuneasy_mc._visible = false;
this.back_cog_mc._visible = false;
this.label_back_mc._visible = false;
};
this.open_credits = function () {
this.menu_state = "credits";
this.title_razor_blade_mc._visible = false;
this.title_text_mc._visible = false;
this.play_cog_mc._visible = false;
this.cog_label_play_mc._visible = false;
this.credits_cog_mc._visible = false;
this.cog_label_credits_mc._visible = false;
this.kong_cog_mc._visible = false;
this.cog_label_kong_mc._visible = false;
this.credits_mc._visible = true;
this.back_cog_mc._visible = true;
this.label_back_mc._visible = true;
};
this.open_episode_select = function () {
this.menu_state = "episode_select";
this.title_razor_blade_mc._visible = false;
this.title_text_mc._visible = false;
this.play_cog_mc._visible = false;
this.cog_label_play_mc._visible = false;
this.credits_cog_mc._visible = false;
this.cog_label_credits_mc._visible = false;
this.kong_cog_mc._visible = false;
this.cog_label_kong_mc._visible = false;
this.label_choose_episode_mc._visible = true;
this.label_episode_clarity_mc._visible = true;
this.easy_cog_mc._visible = true;
this.uneasy_cog_mc._visible = true;
this.dpuneasy_cog_mc._visible = true;
this.cog_label_easy_mc._visible = true;
this.cog_label_uneasy_mc._visible = true;
this.cog_label_dpuneasy_mc._visible = true;
this.back_cog_mc._visible = true;
this.label_back_mc._visible = true;
};
Symbol 444 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 445 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 446 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 447 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 448 MovieClip [__Packages.mx.transitions.easing.None] Frame 0
class mx.transitions.easing.None
{
function None () {
}
static function easeNone(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeIn(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static function easeInOut(t, b, c, d) {
return(((c * t) / d) + b);
}
static var version = "1.1.0.52";
}
Symbol 449 MovieClip [__Packages.mx.transitions.easing.Back] Frame 0
class mx.transitions.easing.Back
{
function Back () {
}
static function easeIn(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / d;
return((((c * t) * t) * (((s + 1) * t) - s)) + b);
}
static function easeOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = (t / d) - 1;
return((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b);
}
static function easeInOut(t, b, c, d, s) {
if (s == undefined) {
s = 1.70158;
}
t = t / (d / 2);
if (t < 1) {
s = s * 1.525;
return(((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b);
}
t = t - 2;
s = s * 1.525;
return(((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b);
}
static var version = "1.1.0.52";
}