Combined Code
movieClip 3 {
}
movieClip 5 {
}
movieClip 7 leg {
}
movieClip 9 {
}
movieClip 12 {
}
movieClip 15 {
frame 1 {
stop();
}
frame 2 {
play();
}
frame 3 {
gotoAndPlay(2);
}
}
movieClip 16 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 17 two_legsD {
}
movieClip 22 xtra_parts {
}
movieClip 25 {
frame 1 {
stop();
}
frame 4 {
gotoAndPlay(2);
}
}
movieClip 27 {
}
movieClip 30 {
}
movieClip 32 {
}
movieClip 33 {
}
movieClip 34 enemy_mine {
frame 1 {
var setup = 0;
}
frame 6 {
setup = 1;
stop();
}
frame 7 {
setup = 0;
play();
}
frame 11 {
_parent.kill_mine(this);
}
}
movieClip 38 {
}
movieClip 39 score_mine {
frame 36 {
removeMovieClip(this);
}
}
movieClip 52 explosion {
frame 8 {
removeMovieClip(this);
}
}
movieClip 54 xtra_batteries {
}
movieClip 56 xtra_shells {
}
movieClip 58 {
}
movieClip 61 {
}
movieClip 64 {
frame 1 {
stop();
}
frame 2 {
play();
}
frame 3 {
gotoAndPlay(2);
}
}
movieClip 65 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 66 two_legsC {
}
movieClip 68 {
}
movieClip 71 {
}
movieClip 73 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 74 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 75 two_legsB {
}
movieClip 77 {
}
movieClip 79 {
}
movieClip 82 {
frame 1 {
stop();
}
frame 2 {
play();
}
frame 3 {
gotoAndPlay(2);
}
}
movieClip 83 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 84 two_legsA {
}
movieClip 86 shell {
}
movieClip 88 laser {
}
movieClip 102 {
frame 99 {
stop();
}
}
frame 98 {
gotoAndStop(99);
}
frame 99 {
fscommand('allowscale', 'false');
_quality = 'medium';
stop();
}
button 104 {
on (release) {
_root.nextFrame();
}
}
movieClip 105 {
}
instance bigbutton of movieClip 105 {
onClipEvent (load) {
this._visible = 0;
}
}
movieClip 112 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
instance loader of movieClip 112 {
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;
}
}
}
button 114 {
on (release) {
getURL('http://www.miniclip.com/Homepage.htm', '_blank');
}
}
movieClip 116 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 118 {
}
frame 100 {
stop();
}
movieClip 127 {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
frame 4 {
stop();
}
}
movieClip 129 {
}
movieClip 131 {
}
movieClip 135 {
}
movieClip 136 {
}
movieClip 138 {
frame 1 {
stop();
}
}
movieClip 140 {
frame 1 {
stop();
}
}
movieClip 141 {
}
movieClip 142 {
}
instance bots of movieClip 142 {
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 += Math.PI;
}
angle *= 57.29577951308232;
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 += sd;
_root.controls.step_distance = main_bot.step_distance;
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 += 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 += 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 += 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 += 1;
} else {
if (level_control.level == 15) {
enemy_mine.interval_seconds = 6;
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.angle_increment;
} else {
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.angle_increment;
} else {
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 %= 360;
angle = -angle;
radians = angle * Math.PI / 180;
this.turret._x += Math.cos(radians) * this.step_increment;
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 += shadow_increment;
this.turret._yscale += shadow_increment;
} else {
this.turret._xscale -= shadow_increment;
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 += scale_increment;
this.claw[i + i_add]._yscale += scale_increment;
} else {
this.claw[i + i_add]._xscale -= scale_increment;
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_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 / 16;
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 += 1;
}
if (weapon == this.shell) {
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 += 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 += 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 += Math.cos(this.fire_radians) * speed;
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 += 20;
_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 += 20;
_root.controls.energy_level.gotoAndStop(Math.ceil(this.energy_level));
}
}
}
removeMovieClip(xtras[i]);
xtras.splice(i, 1);
break;
}
++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 %= 360;
angle = -angle;
radians = angle * Math.PI / 180;
this.turret._x += Math.cos(radians) * 10;
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 -= 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 *= -1;
}
this.total_angle = 0;
this.rotate = mine_rotate;
this.rotate();
}
function mine_rotate() {
this.total_angle += this.angle_speed;
if (Math.abs(this.total_angle) >= 360) {
this.n.play();
return undefined;
}
this.angle += this.angle_speed;
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 += 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;
}
}
}
}
}
movieClip 146 {
frame 1 {
stop();
}
frame 2 {
_root.gotoAndStop('gamemid');
play();
}
frame 35 {
stop();
_root.miniclip.gotoAndStop('live');
_root.controls.admin_buttons._visible = 1;
}
}
movieClip 150 {
frame 1 {
stop();
}
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();
}
frame 50 {
_root.bots.level_control();
gotoAndStop(1);
}
}
movieClip 153 {
frame 1 {
stop();
}
frame 2 {
_root.gotoAndStop('gamemid');
play();
}
frame 80 {
stop();
_root.miniclip.gotoAndStop('live');
_root.controls.admin_buttons._visible = 1;
}
}
button 155 {
on (release) {
_root.gameover.gotoAndStop(1);
_root.you_win.gotoAndStop(1);
_root.admin.gotoAndStop('how_to');
_root.splash._visible = 0;
}
}
button 157 {
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');
}
}
button 160 {
on (release) {
getURL('http://www.adrianlafond.com/', '_blank');
}
}
button 161 {
on (release) {
getURL('http://www.miniclip.com/Homepage.htm', '');
}
}
button 162 {
on (release) {
getURL('http://www.miniclip.com/signup.htm', '');
}
}
button 163 {
on (release) {
getURL('http://www.miniclip.com/download_bots.htm', '');
}
}
movieClip 167 {
}
movieClip 173 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
movieClip 177 {
}
movieClip 178 {
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;
}
}
}
instance controls of movieClip 178 {
onClipEvent (load) {
score = 0;
reset._visible = 1;
}
}
movieClip 183 {
}
movieClip 186 {
}
movieClip 187 {
frame 1 {
stop();
}
frame 2 {
stop();
}
instance of movieClip 183 {
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);
}
}
frame 3 {
stop();
}
instance of movieClip 186 {
onClipEvent (load) {
function display_scores(xml, num) {
names += xml.firstChild.childNodes[num].attributes.name + '<br>';
scores += xml.firstChild.childNodes[num].attributes.pts + '<br>';
if (num == 19) {
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;
}
}
}
}
frame 102 {
gotoAndStop(100);
}