Frame 98
gotoAndStop (99);
Frame 99
fscommand ("allowscale", "false");
_quality = "medium";
stop();
Instance of Symbol 105 MovieClip "bigbutton" in Frame 99
onClipEvent (load) {
this._visible = 0;
}
Instance of Symbol 112 MovieClip "loader" in Frame 99
onClipEvent (load) {
function return_k(bytes) {
return(Math.round(bytes / 1024));
}
loading_k = "0 K";
total_k = return_k(_root.getBytesTotal()) + " K";
}
onClipEvent (enterFrame) {
loading_k = return_k(_root.getBytesLoaded());
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
this.nextFrame();
_parent.bigbutton._visible = 1;
}
}
Frame 100
stop();
Instance of Symbol 142 MovieClip "bots" in Frame 100
onClipEvent (load) {
function game_over() {
pause = 1;
_root.gameover.gotoAndPlay(2);
}
function you_win() {
pause = 1;
_root.you_win.gotoAndPlay(2);
}
function angle_between_two_points(x1, y1, x2, y2) {
if (x1 == 0) {
return(undefined);
}
angle = Math.atan((y2 - y1) / (x2 - x1));
if (x1 < x2) {
angle = angle + Math.PI;
}
angle = angle * 57.2957795130823;
return(angle);
}
function add_mine_score(name, score_level, x, y, score) {
this.attachMovie("score_mine", name, score_level);
this[name]._x = x;
this[name]._y = y;
this[name].score.score_black = score;
this[name].score.score_white = score;
}
function add_explode(x, y) {
explode_num++;
explosions.attachMovie("explosion", "explosion" + explode_num, explode_num);
var e = explosions["explosion" + explode_num];
e._rotation = Math.round(Math.random() * 360);
e._x = explosions._x + x;
e._y = explosions._y + y;
}
function faster(sd, ss) {
main_bot.step_distance = main_bot.step_distance + sd;
_root.controls.step_distance = main_bot.step_distance;
main_bot.step_speed = main_bot.step_speed + ss;
_root.controls.step_speed = main_bot.step_speed;
main_bot.step_increment = main_bot.step_distance / main_bot.step_speed;
}
function level_control() {
bad_guy_control();
bad_guy_control();
if (((((level_control.level == 1) || (level_control.level == 5)) || (level_control.level == 9)) || (level_control.level == 13)) || (level_control.level == 17)) {
_root.bg.gotoAndStop(1);
level_control.global_light_angle = 45;
} else if (((((level_control.level == 2) || (level_control.level == 6)) || (level_control.level == 10)) || (level_control.level == 14)) || (level_control.level == 18)) {
_root.bg.gotoAndStop(2);
level_control.global_light_angle = 135;
} else if (((((level_control.level == 3) || (level_control.level == 7)) || (level_control.level == 11)) || (level_control.level == 15)) || (level_control.level == 19)) {
_root.bg.gotoAndStop(3);
level_control.global_light_angle = 225;
} else if (((((level_control.level == 4) || (level_control.level == 8)) || (level_control.level == 12)) || (level_control.level == 16)) || (level_control.level == 20)) {
_root.bg.gotoAndStop(4);
level_control.global_light_angle = 300;
}
level_control.global_light_radians = (level_control.global_light_angle * Math.PI) / 180;
if (level_control.level == 1) {
main_bot.n._visible = 1;
} else if (level_control.level == 2) {
faster(2, -1);
} else if (level_control.level == 3) {
faster(4, -1);
} else if (level_control.level == 4) {
faster(4, -1);
} else if (level_control.level == 5) {
faster(1, 0);
enemy_mine.mine_speed = enemy_mine.mine_speed + 0.5;
} else if (level_control.level == 6) {
faster(1, 0);
} else if (level_control.level == 7) {
faster(1, 0);
} else if (level_control.level == 8) {
faster(1, 0);
enemy_mine.mine_speed = enemy_mine.mine_speed + 0.5;
} else if (level_control.level == 9) {
faster(1, 0);
} else if (level_control.level == 10) {
faster(2, -1);
} else if (level_control.level == 11) {
faster(1, 0);
enemy_mine.interval_seconds = 18;
enemy_mine.mine_speed = enemy_mine.mine_speed + 0.5;
} else if (level_control.level == 12) {
enemy_mine.interval_seconds = 16;
} else if (level_control.level == 13) {
_root.bg.gotoAndStop(2);
enemy_mine.interval_seconds = 14;
} else if (level_control.level == 14) {
enemy_mine.interval_seconds = 10;
enemy_mine.mine_speed = enemy_mine.mine_speed + 1;
} else if (level_control.level == 15) {
enemy_mine.interval_seconds = 6;
enemy_mine.mine_speed = enemy_mine.mine_speed + 1;
}
if ((1 < level_control.level) && (level_control.level < 11)) {
xtra_time();
} else if ((level_control.level >= 11) && (level_control.level < 16)) {
xtra_time();
xtra_time();
} else if (level_control.level >= 16) {
xtra_time();
xtra_time();
xtra_time();
}
pause = 0;
}
function next_level() {
main_bot.kills = 0;
pause = 1;
attach_bad_guy.count = 100;
level_control.level++;
if (level_control.level < 21) {
_root.level_txt.gotoAndPlay(2);
} else {
you_win();
}
}
function xtra_time() {
xtra_set_down("xtra_shells");
xtra_set_down("xtra_batteries");
}
function xtra_set_down(what) {
xtra_set_down.xtra_num++;
this.attachMovie(what, what + xtra_set_down.xtra_num, xtra_set_down.xtra_num);
this[what + xtra_set_down.xtra_num]._x = random(500) + 50;
this[what + xtra_set_down.xtra_num]._y = random(500) + 10;
xtras[xtra_set_down.xtra_num - 1] = this[what + xtra_set_down.xtra_num];
if (20 < xtra_set_down.xtra_num) {
xtra_set_down.xtra_num = 0;
}
}
function Bot_Object(n, claw_num, targetX, targetY, height, step_distance, step_speed) {
this.n = n;
this.turret = this.n.turret;
this.barrell = this.n.turret.barrell;
this.claw = new Array();
this.claw_shadow = new Array();
this.leg = new Array();
i = 0;
while (i < claw_num) {
this.claw[i] = this.n["claw" + i];
this.claw_shadow[i] = this.n["claw_shadow" + i];
this.leg[i] = this.n["leg" + i];
i++;
}
this.barrell = this.n.turret.barrell;
this.shadow = this.n.turret.shadow;
this.height = height;
this.leg_length = this.height * 3;
this.step_distance = step_distance;
this.step_speed = step_speed;
this.step = "left";
this.step_increment = this.step_distance / this.step_speed;
this.angle_increment = this.step_increment * 2;
this.step_count = 0;
this.targetX = targetX;
this.targetY = targetY;
this.init_bot = init_bot;
this.point_barrell = point_barrell;
this.draw_legs = draw_legs;
this.draw_shadow = draw_shadow;
this.angle_left = angle_left;
this.angle_right = angle_right;
this.move_turret = move_turret;
this.turret_height = turret_height;
this.scale_claws = scale_claws;
this.scale_claws_back = scale_claws_back;
this.init_bot();
}
function draw_legs() {
i = 0;
while (i < this.leg.length) {
L = this.leg[i];
C = this.claw[i];
T = this.turret;
L._x = (C._x + T._x) / 2;
L._y = (C._y + T._y) / 2;
L._xscale = C._x - T._x;
L._yscale = C._y - T._y;
i++;
}
}
function draw_shadow() {
this.shadow._x = Math.cos(global_light_angle) * this.height;
this.shadow._y = Math.sin(global_light_angle) * this.height;
}
function point_barrell() {
this.barrell._rotation = angle_between_two_points(this.targetX(), this.targetY(), this.turret._x, this.turret._y);
}
function angle_left() {
ideal_angle = this.barrell._rotation - (this.claw_degrees / 2);
if (ideal_angle < this.left_start) {
this.left_start = this.left_start - this.angle_increment;
} else {
this.left_start = this.left_start + this.angle_increment;
}
i = 0;
while (i < (this.claw.length / 2)) {
this.claw[i]._x = (Math.cos(((this.left_start - (this.claw_degrees * i)) * Math.PI) / 180) * this.leg_length) + this.turret._x;
this.claw[i]._y = (Math.sin(((this.left_start - (this.claw_degrees * i)) * Math.PI) / 180) * this.leg_length) + this.turret._y;
i++;
}
}
function angle_right() {
ideal_angle = (180 + this.barrell._rotation) + (this.claw_degrees / 2);
if (ideal_angle < this.right_start) {
this.right_start = this.right_start - this.angle_increment;
} else {
this.right_start = this.right_start + this.angle_increment;
}
i = this.claw.length / 2;
while (i < this.claw.length) {
this.claw[i]._x = (Math.cos(((this.right_start + (this.claw_degrees * i)) * Math.PI) / 180) * this.leg_length) + this.turret._x;
this.claw[i]._y = (Math.sin(((this.right_start + (this.claw_degrees * i)) * Math.PI) / 180) * this.leg_length) + this.turret._y;
i++;
}
}
function move_turret() {
angle = this.barrell._rotation;
angle = angle % 360;
angle = -angle;
radians = (angle * Math.PI) / 180;
this.turret._x = this.turret._x + (Math.cos(radians) * this.step_increment);
this.turret._y = this.turret._y + (Math.sin(radians) * (-this.step_increment));
}
function turret_height() {
shadow_increment = (this.height / this.step_speed) * 4;
if (this.step_count == 0) {
this.turret._xscale = 100;
this.turret._yscale = 100;
} else if (this.step_count < (this.step_speed / 2)) {
this.turret._xscale = this.turret._xscale + shadow_increment;
this.turret._yscale = this.turret._yscale + shadow_increment;
} else {
this.turret._xscale = this.turret._xscale - shadow_increment;
this.turret._yscale = this.turret._yscale - shadow_increment;
}
this.shadow._x = Math.cos(level_control.global_light_radians) * (((this.turret._xscale - 100) / 4) + this.height);
this.shadow._y = Math.sin(level_control.global_light_radians) * (((this.turret._yscale - 100) / 4) + this.height);
}
function scale_claws() {
scale_increment = (10 / this.step_speed) * 2;
if (this.step == "left") {
i_add = 0;
} else {
i_add = this.claw.length / 2;
}
i = 0;
while (i < (this.claw.length / 2)) {
if (this.step_count < (this.step_speed / 2)) {
this.claw[i + i_add]._xscale = this.claw[i + i_add]._xscale + scale_increment;
this.claw[i + i_add]._yscale = this.claw[i + i_add]._yscale + scale_increment;
} else {
this.claw[i + i_add]._xscale = this.claw[i + i_add]._xscale - scale_increment;
this.claw[i + i_add]._yscale = this.claw[i + i_add]._yscale - scale_increment;
}
this.claw_shadow[i + i_add]._x = this.claw[i + i_add]._x + ((Math.cos(level_control.global_light_radians) * (this.claw[i + i_add]._xscale - 100)) * 2);
this.claw_shadow[i + i_add]._y = this.claw[i + i_add]._y + ((Math.sin(level_control.global_light_radians) * (this.claw[i + i_add]._yscale - 100)) * 2);
i++;
}
}
function scale_claws_back() {
i = 0;
while (i < this.claw.length) {
this.claw[i]._xscale = 100;
this.claw[i]._yscale = 100;
this.claw_shadow[i]._x = this.claw[i]._x;
this.claw_shadow[i]._y = this.claw[i]._y;
i++;
}
}
function init_bot() {
this.point_barrell();
this.claw_degrees = 360 / this.claw.length;
this.left_start = this.claw_degrees / 2;
this.right_start = 360 - this.left_start;
i = 0;
while (i < this.claw.length) {
this.claw[i]._x = this.turret._x;
this.claw[i]._y = this.turret._y;
this.claw_shadow[i]._x = this.claw[i]._x;
this.claw_shadow[i]._y = this.claw[i]._y;
i++;
}
this.draw_legs();
this.draw_shadow();
this.scale_claws_back();
}
function main_bot_xmouse() {
return(this.n._xmouse);
}
function main_bot_ymouse() {
return(this.n._ymouse);
}
function energy_spin() {
this.energy._rotation = this.energy._rotation + (this.energy_level / 2);
}
function fire_gun() {
if (main_bot.weapon_choice == main_bot.shell) {
if (0 >= main_bot.shells) {
main_bot.weapon_choice = main_bot.laser;
_root.controls.weapon.gotoAndStop(1);
} else {
main_bot.shells--;
_root.controls.shells--;
}
}
if (main_bot.weapon_choice == main_bot.shell) {
cannon_sound.gotoAndPlay(2);
} else {
laser_sound.gotoAndPlay(2);
}
radians = (this.barrell._rotation * Math.PI) / 180;
this.barrell._x = Math.cos(radians) * -6;
this.barrell._y = Math.sin(radians) * -6;
this.weapon_choice._rotation = this.barrell._rotation;
this.fired = this.weapon_choice;
this.fire_radians = radians;
this.fire = 1;
}
function reset_gun() {
this.barrell._x = this.barrell._x + ((-this.barrell._x) / 16);
this.barrell._y = this.barrell._y + ((-this.barrell._y) / 16);
}
function shot_travel(weapon, speed) {
hit = 0;
i = 0;
while (i < bad_guys.length) {
if (weapon.hitTest(bad_guys[i].turret)) {
if (weapon == this.laser) {
bad_guys[i].hits = bad_guys[i].hits + 1;
}
if (weapon == this.shell) {
bad_guys[i].hits = bad_guys[i].hits + 2;
}
if (bad_guys[i].hits == 1) {
bad_guys[i].turret.gotoAndStop(2);
} else if (bad_guys[i].hits >= 2) {
add_explode(bad_guys[i].turret._x, bad_guys[i].turret._y);
_root.controls.score = _root.controls.score + bad_guys[i].score;
removeMovieClip(bad_guys[i].n);
bad_guys.splice(i, 1);
main_bot.kills++;
bad_guy_control(i);
}
hit = 1;
break;
}
i++;
}
i = 0;
while (i < enemy_mine_obj.length) {
if (weapon.hitTest(enemy_mine_obj[i].n.mine.turret)) {
add_score = Math.round(10 * Math.sqrt(((this.turret._x - enemy_mine_obj[i].n._x) * (this.turret._x - enemy_mine_obj[i].n._x)) + ((this.turret._y - enemy_mine_obj[i].n._y) * (this.turret._y - enemy_mine_obj[i].n._y))));
_root.controls.score = _root.controls.score + add_score;
old_name = enemy_mine_obj[i].n._name;
add_mine_score(enemy_mine_obj[i].n._name + "score", enemy_mine_obj[i].score_level, Math.round(enemy_mine_obj[i].n._x), Math.round(enemy_mine_obj[i].n._y), add_score);
removeMovieClip(enemy_mine_obj[i].n);
enemy_mine_obj.splice(i, 1);
hit = 1;
break;
}
i++;
}
weapon._x = weapon._x + (Math.cos(this.fire_radians) * speed);
weapon._y = weapon._y + (Math.sin(this.fire_radians) * speed);
if (hit || (300 < Math.sqrt((weapon._x * weapon._x) + (weapon._y * weapon._y)))) {
weapon._x = 0;
weapon._y = 0;
this.fire = 0;
}
}
function xtras_check() {
i = 0;
while (i < xtras.length) {
if (this.barrell.hitTest(xtras[i])) {
if (-1 < xtras[i]._name.indexOf("shells")) {
this.shells = this.shells + 20;
_root.controls.shells = _root.controls.shells + 20;
} else if (-1 < xtras[i]._name.indexOf("batteries")) {
if (100 < (this.energy_level + 20)) {
this.energy_level = 100;
_root.controls.energy_level.gotoAndStop(100);
} else {
this.energy_level = this.energy_level + 20;
_root.controls.energy_level.gotoAndStop(Math.ceil(this.energy_level));
}
}
removeMovieClip(xtras[i]);
xtras.splice(i, 1);
return;
}
i++;
}
}
function target_main_botX() {
return(main_bot.n._x + main_bot.turret._x);
}
function target_main_botY() {
return(main_bot.n._y + main_bot.turret._y);
}
function collision_test() {
i = 0;
while (bad_guys.length >= i) {
if (i == bad_guys.length) {
bg = main_bot;
} else {
bg = bad_guys[i];
}
if (bg != this) {
if (this.turret.hitTest(bg.turret)) {
angle = angle_between_two_points(this.turret._x, this.turret._y, bg.turret._x, bg.turret._y);
angle = angle % 360;
angle = -angle;
radians = (angle * Math.PI) / 180;
this.turret._x = this.turret._x + (Math.cos(radians) * 10);
this.turret._y = this.turret._y + (Math.sin(radians) * 10);
return(undefined);
}
}
i++;
}
}
function bad_buzz() {
pt1x = (main_bot.n._x + main_bot.turret._x) - this.turret._x;
pt1y = (main_bot.n._y + main_bot.turret._y) - this.turret._y;
pt2x = this.barrell._x;
pt2y = this.barrell._y;
this.buzz._x = (pt1x + pt2x) / 2;
this.buzz._y = (pt1y + pt2y) / 2;
this.buzz._xscale = pt1x - pt2x;
this.buzz._yscale = pt1y - pt2y;
main_bot.energy_level = main_bot.energy_level - this.buzz_rate;
adjust_mainbot_energy();
}
function adjust_mainbot_energy() {
if (100 < Math.ceiling(main_bot.energy_level)) {
_root.controls.energy_level.gotoAndStop(100);
} else {
_root.controls.energy_level.gotoAndStop(Math.ceil(main_bot.energy_level));
}
if (0 >= main_bot.energy_level) {
main_bot.energy_level = 0;
_root.controls.energy_level.gotoAndStop(1);
game_over();
}
}
function bad_guy_control() {
if (main_bot.kills == level_stats[level_control.level][7]) {
next_level();
} else if (main_bot.kills < (level_stats[level_control.level][7] - 1)) {
attach_bad_guy(level_stats[level_control.level][0], level_stats[level_control.level][1], level_stats[level_control.level][2], level_stats[level_control.level][3], level_stats[level_control.level][4], level_stats[level_control.level][5], level_stats[level_control.level][6]);
}
}
function attach_bad_guy(mc, height, step_distance, step_speed, buzz_rate, bad_score, buzz_distance) {
bad = null;
bad_claw.length = 0;
bad_claw_shadow.length = 0;
bad_legs.length = 0;
attach_bad_guy.count++;
this.attachMovie(mc, "two_legs" + attach_bad_guy.count, attach_bad_guy.count);
bad = this["two_legs" + attach_bad_guy.count];
bad._x = 0;
bad._y = 0;
random_spot = (random(360) * Math.PI) / 180;
bad.turret._x = (Math.cos(random_spot) * 360) + 300;
bad.turret._y = (Math.sin(random_spot) * 360) + 300;
bad_guys.push(new Bot_Object(bad, 2, target_main_botX, target_main_botY, height, step_distance, step_speed));
bad_guys[bad_guys.length - 1].hits = 0;
bad_guys[bad_guys.length - 1].collision_test = collision_test;
bad_guys[bad_guys.length - 1].buzz = bad_guys[bad_guys.length - 1].turret.buzz;
bad_guys[bad_guys.length - 1].buzz_rate = buzz_rate;
bad_guys[bad_guys.length - 1].score = bad_score;
bad_guys[bad_guys.length - 1].buzz_distance = buzz_distance;
bad_guys[bad_guys.length - 1].bad_buzz = bad_buzz;
}
function EnemyMine_Object(n) {
this.n = n;
this.radius = random(150) + 100;
this.angle = random(360);
this.angle_speed = enemy_mine.mine_speed;
direction = random(2);
if (!direction) {
this.angle_speed = this.angle_speed * -1;
}
this.total_angle = 0;
this.rotate = mine_rotate;
this.rotate();
}
function mine_rotate() {
this.total_angle = this.total_angle + this.angle_speed;
if (Math.abs(this.total_angle) >= 360) {
this.n.play();
return(undefined);
}
this.angle = this.angle + this.angle_speed;
this.angle = this.angle % 360;
this.radians = (this.angle * Math.PI) / 180;
this.x = Math.cos(this.radians) * this.radius;
this.y = Math.sin(this.radians) * this.radius;
this.n._x = Math.round(this.x) + 300;
this.n._y = Math.round(this.y) + 270;
}
function mine_cycle_spin() {
this.cycle._rotation = this.cycle._rotation + 50;
}
function kill_mine(mc) {
i = 0;
while (i < enemy_mine_obj.length) {
if (enemy_mine_obj[i].n == mc) {
enemy_mine_obj.splice(i, 1);
removeMovieClip(mc);
}
i++;
}
}
function enemy_mine() {
this.attachMovie("enemy_mine", "enemy_mine" + enemy_mine.mine_count, enemy_mine.mine_count);
enemy_mine_obj.push(new EnemyMine_Object(this["enemy_mine" + enemy_mine.mine_count]));
enemy_mine_obj[enemy_mine_obj.length - 1].cycle = enemy_mine_obj[enemy_mine_obj.length - 1].n.mine.cycle;
enemy_mine_obj[enemy_mine_obj.length - 1].cycle_spin = mine_cycle_spin;
enemy_mine_obj[enemy_mine_obj.length - 1].turret = enemy_mine_obj[enemy_mine_obj.length - 1].n;
enemy_mine_obj[enemy_mine_obj.length - 1].barrell = enemy_mine_obj[enemy_mine_obj.length - 1].n.mine;
enemy_mine_obj[enemy_mine_obj.length - 1].buzz = enemy_mine_obj[enemy_mine_obj.length - 1].n.mine.buzz;
enemy_mine_obj[enemy_mine_obj.length - 1].buzz_rate = 0.05;
enemy_mine_obj[enemy_mine_obj.length - 1].bad_buzz = bad_buzz;
enemy_mine_obj[enemy_mine_obj.length - 1].score_level = (3000 + enemy_mine_obj.length) - 1;
enemy_mine.mine_count++;
if (99 < enemy_mine.mine_count) {
enemy_mine.mine_count = 50;
}
}
_quality = "MEDIUM";
var pause = 1;
var explode_num = 0;
var level = 1;
var level_stats = new Array();
level_stats[1] = new Array("two_legsA", 6, 22, 8, 0.1, 50, 100, 20);
level_stats[2] = new Array("two_legsB", 6, 24, 7, 0.1, 50, 100, 20);
level_stats[3] = new Array("two_legsC", 6, 26, 6, 0.15, 50, 100, 25);
level_stats[4] = new Array("two_legsD", 6, 28, 5, 0.15, 50, 100, 25);
level_stats[5] = new Array("two_legsA", 6, 24, 6, 0.2, 60, 110, 25);
level_stats[6] = new Array("two_legsB", 6, 26, 6, 0.2, 60, 110, 30);
level_stats[7] = new Array("two_legsC", 6, 28, 5, 0.25, 60, 110, 35);
level_stats[8] = new Array("two_legsD", 6, 30, 5, 0.25, 60, 110, 35);
level_stats[9] = new Array("two_legsA", 8, 26, 6, 0.3, 70, 120, 35);
level_stats[10] = new Array("two_legsB", 8, 28, 5, 0.3, 70, 120, 35);
level_stats[11] = new Array("two_legsC", 8, 30, 4, 0.4, 70, 120, 40);
level_stats[12] = new Array("two_legsD", 8, 32, 4, 0.4, 70, 120, 40);
level_stats[13] = new Array("two_legsA", 6, 30, 4, 0.4, 80, 130, 40);
level_stats[14] = new Array("two_legsB", 6, 30, 4, 0.4, 80, 130, 40);
level_stats[15] = new Array("two_legsC", 6, 32, 4, 0.4, 80, 130, 40);
level_stats[16] = new Array("two_legsD", 6, 32, 4, 0.4, 80, 130, 40);
level_stats[17] = new Array("two_legsA", 6, 32, 4, 0.5, 100, 150, 40);
level_stats[18] = new Array("two_legsB", 6, 32, 4, 0.5, 100, 150, 45);
level_stats[19] = new Array("two_legsC", 6, 32, 4, 0.8, 100, 150, 45);
level_stats[20] = new Array("two_legsD", 6, 36, 4, 0.8, 100, 150, 50);
level_control.level = 1;
level_control.global_light_angle = 45;
level_control.global_light_radians = (level_control.global_light_angle * Math.PI) / 180;
var xtras = new Array();
xtra_set_down.xtra_num = 0;
this.main_bot._visible = 0;
var n = this.main_bot;
var t = n.turret;
var b = t.barrell;
var s = t.shadow;
var height = 12;
var step_distance = 24;
var step_speed = 12;
t._x = 300;
t._y = 250;
var main_bot = new Bot_Object(n, 4, main_bot_xmouse, main_bot_ymouse, height, step_distance, step_speed);
main_bot._x = 0;
main_bot._y = 0;
main_bot.energy = t.energy;
main_bot.energy_level = 100;
main_bot.energy_spin = energy_spin;
main_bot.laser = main_bot.turret.laser;
main_bot.shell = main_bot.turret.shell;
main_bot.weapon_choice = main_bot.laser;
main_bot.fire_laser = 0;
main_bot.fire_shell = 0;
main_bot.fire = 0;
main_bot.fire_gun = fire_gun;
main_bot.reset_gun = reset_gun;
main_bot.shot_travel = shot_travel;
main_bot.kills = 0;
main_bot.shells = 0;
main_bot.xtras_check = xtras_check;
main_bot.n.swapDepths(2000);
_root.controls.energy_level.gotoAndStop(100);
_root.controls.shells = main_bot.shells;
_root.controls.score = 0;
var bad_guys = new Array();
var bad = null;
attach_bad_guy.count = 100;
var mine_time = getTimer();
var elapsed_mine_time = 0;
enemy_mine.interval_seconds = 20;
var cue_mine_time = (enemy_mine.interval_seconds * 1000);
var enemy_mine_obj = new Array();
enemy_mine.mine_count = 50;
enemy_mine.mine_speed = 2;
}
onClipEvent (enterFrame) {
if (!pause) {
if (1 < Math.sqrt((main_bot.turret._xmouse * main_bot.turret._xmouse) + (main_bot.turret._ymouse * main_bot.turret._ymouse))) {
main_bot.point_barrell();
main_bot.move_turret();
}
main_bot.turret_height();
main_bot.step_count++;
if (main_bot.step == "left") {
if (main_bot.step_speed < main_bot.step_count) {
main_bot.scale_claws_back();
main_bot.step = "right";
main_bot.step_count = 0;
} else {
main_bot.angle_left();
}
} else if (main_bot.step_speed < main_bot.step_count) {
main_bot.scale_claws_back();
main_bot.step = "left";
main_bot.step_count = 0;
} else {
main_bot.angle_right();
}
main_bot.scale_claws();
main_bot.draw_legs();
main_bot.energy_spin();
main_bot.xtras_check();
b = 0;
while (b < bad_guys.length) {
bad_guys[b].collision_test();
dis_to_target = Math.sqrt(((bad_guys[b].targetX() - bad_guys[b].turret._x) * (bad_guys[b].targetX() - bad_guys[b].turret._x)) + ((bad_guys[b].targetY() - bad_guys[b].turret._y) * (bad_guys[b].targetY() - bad_guys[b].turret._y)));
if (bad_guys[b].buzz_distance < dis_to_target) {
bad_guys[b].move_turret();
bad_guys[b].buzz.gotoAndStop(1);
} else {
if (bad_guys[b].buzz._currentframe == 1) {
bad_guys[b].buzz.gotoAndPlay(2);
}
bad_guys[b].bad_buzz();
}
bad_guys[b].point_barrell();
bad_guys[b].turret_height();
bad_guys[b].step_count++;
if (bad_guys[b].step == "left") {
if (bad_guys[b].step_speed < bad_guys[b].step_count) {
bad_guys[b].scale_claws_back();
bad_guys[b].step = "right";
bad_guys[b].step_count = 0;
} else {
bad_guys[b].angle_left();
}
} else if (bad_guys[b].step_speed < bad_guys[b].step_count) {
bad_guys[b].scale_claws_back();
bad_guys[b].step = "left";
bad_guys[b].step_count = 0;
} else {
bad_guys[b].angle_right();
}
bad_guys[b].scale_claws();
bad_guys[b].draw_legs();
b++;
}
if (main_bot.fire) {
if (main_bot.fired == main_bot.laser) {
main_bot.shot_travel(main_bot.laser, 30);
} else if (main_bot.fired == main_bot.shell) {
main_bot.shot_travel(main_bot.shell, 20);
}
}
if ((main_bot.barrell._x != 0) || (main_bot.barrell._y != 0)) {
main_bot.reset_gun();
}
elapsed_mine_time = getTimer();
if (cue_mine_time < (elapsed_mine_time - mine_time)) {
mine_time = getTimer();
enemy_mine();
}
m = 0;
while (m < enemy_mine_obj.length) {
if (enemy_mine_obj[m].n.setup) {
if (enemy_mine_obj[m].buzz._currentframe == 1) {
enemy_mine_obj[m].buzz.gotoAndPlay(2);
}
enemy_mine_obj[m].bad_buzz();
enemy_mine_obj[m].cycle_spin();
enemy_mine_obj[m].rotate();
}
m++;
}
}
}
onClipEvent (mouseUp) {
if ((!main_bot.fire) && (!pause)) {
main_bot.fire_gun();
}
}
onClipEvent (keyUp) {
if (Key.getCode() == 32) {
if (main_bot.weapon_choice == main_bot.laser) {
if (0 < main_bot.shells) {
main_bot.weapon_choice = main_bot.shell;
_root.controls.weapon.gotoAndStop(2);
}
} else {
main_bot.weapon_choice = main_bot.laser;
_root.controls.weapon.gotoAndStop(1);
}
} else if (Key.getCode() == 80) {
if (pause) {
pause = 0;
} else {
pause = 1;
}
}
}
Instance of Symbol 178 MovieClip "controls" in Frame 100
onClipEvent (load) {
score = 0;
reset._visible = 1;
}
Frame 102
gotoAndStop (100);
Symbol 15 MovieClip Frame 1
stop();
Symbol 15 MovieClip Frame 2
play();
Symbol 15 MovieClip Frame 3
gotoAndPlay (2);
Symbol 16 MovieClip Frame 1
stop();
Symbol 16 MovieClip Frame 2
stop();
Symbol 25 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 4
gotoAndPlay (2);
Symbol 34 MovieClip [enemy_mine] Frame 1
var setup = 0;
Symbol 34 MovieClip [enemy_mine] Frame 6
setup = 1;
stop();
Symbol 34 MovieClip [enemy_mine] Frame 7
setup = 0;
play();
Symbol 34 MovieClip [enemy_mine] Frame 11
_parent.kill_mine(this);
Symbol 39 MovieClip [score_mine] Frame 36
removeMovieClip(this);
Symbol 52 MovieClip [explosion] Frame 8
removeMovieClip(this);
Symbol 64 MovieClip Frame 1
stop();
Symbol 64 MovieClip Frame 2
play();
Symbol 64 MovieClip Frame 3
gotoAndPlay (2);
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 2
stop();
Symbol 73 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 2
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 2
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 2
play();
Symbol 82 MovieClip Frame 3
gotoAndPlay (2);
Symbol 83 MovieClip Frame 1
stop();
Symbol 83 MovieClip Frame 2
stop();
Symbol 102 MovieClip Frame 99
stop();
Symbol 104 Button
on (release) {
_root.nextFrame();
}
Symbol 112 MovieClip Frame 1
stop();
Symbol 112 MovieClip Frame 2
stop();
Symbol 114 Button
on (release) {
getURL ("http://www.miniclip.com/Homepage.htm", "_blank");
}
Symbol 116 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 2
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 2
stop();
Symbol 127 MovieClip Frame 3
stop();
Symbol 127 MovieClip Frame 4
stop();
Symbol 138 MovieClip Frame 1
stop();
Symbol 140 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 1
stop();
Symbol 146 MovieClip Frame 2
_root.gotoAndStop("gamemid");
play();
Symbol 146 MovieClip Frame 35
stop();
_root.miniclip.gotoAndStop("live");
_root.controls.admin_buttons._visible = 1;
Symbol 150 MovieClip Frame 1
stop();
Symbol 150 MovieClip Frame 2
level_output = "";
level_output = _root.bots.level_control.level.toString();
if (level_output == undefined) {
level_output = "01";
}
if (level_output.length < 2) {
level_output = "0" + level_output;
}
play();
Symbol 150 MovieClip Frame 50
_root.bots.level_control();
gotoAndStop (1);
Symbol 153 MovieClip Frame 1
stop();
Symbol 153 MovieClip Frame 2
_root.gotoAndStop("gamemid");
play();
Symbol 153 MovieClip Frame 80
stop();
_root.miniclip.gotoAndStop("live");
_root.controls.admin_buttons._visible = 1;
Symbol 155 Button
on (release) {
_root.gameover.gotoAndStop(1);
_root.you_win.gotoAndStop(1);
_root.admin.gotoAndStop("how_to");
_root.splash._visible = 0;
}
Symbol 157 Button
on (release) {
_root.splash._visible = 0;
_root.admin.gotoAndStop(1);
_root.gameover.gotoAndStop(1);
_root.you_win.gotoAndStop(1);
_root.bots.level_control.level = 1;
_root.level_txt.gotoAndPlay(2);
_root.miniclip.gotoAndStop("dead");
this._visible = 0;
_root.gotoAndStop("gameend");
}
Symbol 160 Button
on (release) {
getURL ("http://www.adrianlafond.com/", "_blank");
}
Symbol 161 Button
on (release) {
getURL ("http://www.miniclip.com/Homepage.htm");
}
Symbol 162 Button
on (release) {
getURL ("http://www.miniclip.com/signup.htm");
}
Symbol 163 Button
on (release) {
getURL ("http://www.miniclip.com/download_bots.htm");
}
Symbol 173 MovieClip Frame 1
stop();
Symbol 173 MovieClip Frame 2
stop();
Symbol 178 MovieClip Frame 1
function configure_main_bot() {
m = _parent.bots.main_bot;
m.step_increment = m.step_distance / m.step_speed;
m.angle_increment = m.step_increment * 2;
m.leg_length = m.height * 3;
}
Symbol 187 MovieClip Frame 1
stop();
Symbol 187 MovieClip Frame 2
stop();
Instance of Symbol 183 MovieClip in Symbol 187 MovieClip Frame 2
onClipEvent (load) {
function display(bot, legs) {
var i = 0;
while (i < legs) {
L = bot["leg" + i];
C = bot["claw" + i];
T = bot.turret;
L._x = (C._x + T._x) / 2;
L._y = (C._y + T._y) / 2;
L._xscale = C._x - T._x;
L._yscale = C._y - T._y;
i++;
}
bot.turret.barrell._rotation = -90;
}
function set_claws(bot, claws) {
var i = 0;
while (i < claws) {
bot["claw" + i]._y = 0;
i++;
}
}
display(good, 4);
set_claws(bad1, 2);
set_claws(bad2, 2);
set_claws(bad3, 2);
display(bad1, 2);
display(bad2, 2);
display(bad3, 2);
}
Symbol 187 MovieClip Frame 3
stop();
Instance of Symbol 186 MovieClip in Symbol 187 MovieClip Frame 3
onClipEvent (load) {
function display_scores(xml, num) {
names = names + (xml.firstChild.childNodes[num].attributes.name + "<br>");
scores = scores + (xml.firstChild.childNodes[num].attributes.pts + "<br>");
if (num == 19) {
scores = scores + "</p>";
}
}
names = "";
scores = "<p align='right'>";
_root.hi_scores_xml.gotoAndPlay(2);
var scores_count = 0;
}
onClipEvent (enterFrame) {
if ((scores_count < 20) && (_root.hi_scores_xml.xml_check)) {
display_scores(_root.hi_scores_xml.scoresXML, scores_count);
scores_count++;
}
}