Frame 161
stop();
Frame 162
function create_maggot(id) {
duplicateMovieClip ("mag_temp", "mag" + id, id);
}
function remove_mags() {
i = 1;
while (i <= 20) {
removeMovieClip("mag" + i);
i++;
}
}
function remove_clips() {
i = 1;
while (i <= 20) {
removeMovieClip("mag" + i);
i++;
}
removeMovieClip("fly");
removeMovieClip("levelup");
removeMovieClip("alldone_sign");
removeMovieClip("gameover_sign");
}
function start_add_in(scin) {
thescore = scin;
whas = scin * whas2006;
}
function add_in(scin) {
thescore = thescore + scin;
whas = whas + (scin * whas2006);
}
level = 1;
levelup.swapDepths(1000);
gameover_sign.swapDepths(1001);
alldone_sign.swapDepths(1002);
fly.swapDepths(900);
whas2006 = random(7) + 2;
start_add_in(0);
Instance of Symbol 54 MovieClip "wheel" in Frame 162
onClipEvent (load) {
function find_spot() {
found = false;
while (!found) {
found = true;
rad = 170;
x = random(rad - 40) + 40;
maxy = int(Math.sqrt((rad * rad) - (x * x)));
starty = random(maxy - 40) + 40;
startx = x;
if (random(100) > 50) {
startx = -startx;
}
if (random(100) > 50) {
starty = -starty;
}
starty = _level0.wheel._y + starty;
startx = _level0.wheel._x + startx;
h = 1;
while (h <= 4) {
hm = eval ("_level0.wheel.hole0" + h);
if (hm.hitTest(startx, starty, false)) {
found = false;
trace("HIT a hole!");
}
h++;
}
hm = _level0.speedbonus;
if (hm.hitTest(startx, starty, false)) {
found = false;
trace("HIT a speedo!");
}
}
rety = starty;
retx = startx;
}
function generate_mag_data(id) {
dead[id] = 0;
_level0.create_maggot(id);
found = false;
start[id] = ((id * 10) + random(50)) + counter;
done_steps[id] = 0;
while (!found) {
steps[id] = max_steps + random(max_steps);
found = true;
angle = random(10) * 9;
rad = 186;
y = rad * Math.sin((angle * 3.142) / 180);
starty = y;
startx = Math.sqrt((rad * rad) - (starty * starty));
quad = random(4) + 1;
if (taken[((quad - 1) * 90) + angle] == 1) {
found = false;
trace("DUPLICATE!");
}
}
taken[((quad - 1) * 90) + angle] = 1;
slot[id] = ((quad - 1) * 90) + angle;
mag = id;
if (quad == 1) {
_level0["mag" + mag]._x = _level0.wheel._x + startx;
_level0["mag" + mag]._y = _level0.wheel._y - starty;
ang = (Math.atan2(starty, startx) * 180) / 3.142;
_level0["mag" + mag]._rotation = -ang;
trace("an = " + ang);
dx = startx / steps[id];
dy = (-starty) / steps[id];
}
if (quad == 2) {
_level0["mag" + mag]._x = _level0.wheel._x - startx;
_level0["mag" + mag]._y = _level0.wheel._y - starty;
ang = (Math.atan2(-starty, startx) * 180) / 3.142;
_level0["mag" + mag]._rotation = -ang;
trace("an = " + ang);
dx = (-startx) / steps[id];
dy = (-starty) / steps[id];
}
if (quad == 3) {
_level0["mag" + mag]._x = _level0.wheel._x - startx;
_level0["mag" + mag]._y = _level0.wheel._y + starty;
ang = (Math.atan2(starty, startx) * 180) / 3.142;
_level0["mag" + mag]._rotation = -ang;
trace("an = " + ang);
dx = (-startx) / steps[id];
dy = starty / steps[id];
}
if (quad == 4) {
_level0["mag" + mag]._x = _level0.wheel._x + startx;
_level0["mag" + mag]._y = _level0.wheel._y + starty;
ang = (Math.atan2(-starty, startx) * 180) / 3.142;
_level0["mag" + mag]._rotation = -ang;
trace("an = " + ang);
dx = startx / steps[id];
dy = starty / steps[id];
}
deltax[id] = dx;
deltay[id] = dy;
}
function restart() {
if (_level0.level > 1) {
fly_active = true;
} else {
fly_active = false;
}
fly_state = "init";
fly_stops = 0;
max_fly_stops = 5;
i = 1;
while (i <= 8) {
eval ("_level0.fly" + i)._visible = false;
i++;
}
_level0.fly._visible = false;
_level0.fly._x = -999;
speed_boost_on_show = true;
speed_boost = false;
reverse_boost_on_show = true;
reverse_boost = false;
_level0.speedbonus._visible = true;
_level0.reversebonus._visible = true;
find_spot();
_level0.speedbonus._x = rety;
_level0.speedbonus._y = retx;
find_spot();
_level0.reversebonus._x = rety;
_level0.reversebonus._y = retx;
max_levels = 10;
max_on_the_screen = new array(0, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15);
max_mag_steps = new array(0, 500, 480, 450, 410, 350, 340, 330, 320, 310, 300);
max_speed = new array(0, 0.5, 0.55, 0.6, 0.65, 0.7, 0.8, 0.8, 0.8, 0.8, 0.8);
frames_target = new array(0, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 10000);
dead = new array(tot_mags);
mag_list = new Array(tot_mags);
deltax = new Array(tot_mags);
deltay = new Array(tot_mags);
start = new Array(tot_mags);
steps = new Array(tot_mags);
slot = new Array(tot_mags);
done_steps = new Array(tot_mags);
taken = new Array();
level = _level0.level;
counter = 0;
speed = 0;
tot_mags = max_on_the_screen[level];
max_steps = max_mag_steps[level];
maxs = max_speed[level];
acc = 0.05;
j = 1;
while (j <= tot_mags) {
generate_mag_data(j);
j++;
}
}
state = "play";
_level0.caught = 0;
restart();
tot = 0;
a = 1;
while (a <= 360) {
tot = tot + taken[a];
a++;
}
trace("tot = " + tot);
}
onClipEvent (enterFrame) {
counter++;
_level0.diag = (((counter + " ") + state) + " ") + wait;
if (state == "all_levels_done") {
_level0.win = true;
_level0.play();
state = "thread_dead";
}
if (state == "gameover") {
_level0.win = false;
_level0.play();
state = "thread_dead";
}
if (state == "thread_dead") {
}
if (state == "level_up") {
wait++;
if (wait > 100) {
_level0.level++;
if (_level0.level > max_levels) {
state = "all_levels_done";
_level0.level = max_levels;
} else {
restart();
state = "play";
}
}
}
if (state == "play") {
if (fly_active) {
if (fly_state == "init") {
fly_state = "circle";
flyc = 0;
place = random(7) + 1;
next_place = random(7) + 1;
if (next_place == place) {
next_place = 1;
if (next_place == place) {
next_place = 2;
}
}
_level0.fly._visible = true;
_level0.fly._x = eval ("_level0.fly" + place)._x;
_level0.fly._y = eval ("_level0.fly" + place)._y;
}
if (fly_state == "flying") {
flying_step++;
_level0.fly._x = _level0.fly._x - fly_dx;
_level0.fly._y = _level0.fly._y - fly_dy;
if (flying_step >= flying_steps) {
fly_state = "circle";
}
}
if (fly_state == "circle") {
flyc++;
fly_delay = 100;
denom = fly_delay / 10;
eval ("_level0.fly" + next_place).text = int((fly_delay - flyc) / denom);
eval ("_level0.fly" + next_place)._visible = true;
if (flyc > fly_delay) {
fly_state = "flying";
flying_step = 0;
flying_steps = 10;
fly_dx = eval ("_level0.fly" + place)._x - eval ("_level0.fly" + next_place)._x;
fly_dy = eval ("_level0.fly" + place)._y - eval ("_level0.fly" + next_place)._y;
fly_dx = fly_dx / flying_steps;
fly_dy = fly_dy / flying_steps;
eval ("_level0.fly" + next_place).text = 200 - flyc;
eval ("_level0.fly" + next_place)._visible = false;
place = next_place;
fly_stops++;
if (fly_stops >= max_fly_stops) {
next_place = 8;
} else {
next_place = random(7) + 1;
if (next_place == place) {
next_place = 1;
if (next_place == place) {
next_place = 2;
}
}
}
flyc = 0;
_level0.fly._visible = true;
_level0.flysound.gotoandplay(2);
if (place == 8) {
state = "gameover";
_level0.fly._x = eval ("_level0.fly" + place)._x;
_level0.fly._y = eval ("_level0.fly" + place)._y;
}
}
h = 1;
while (h <= 4) {
hm = eval ("_level0.wheel.hole0" + h);
if (hm.hitTest(_level0.fly._x, _level0.fly._y, true)) {
_level0.fly._visible = false;
fly_active = false;
_level0.caught = _level0.caught + 50;
_level0.fdie.gotoAndPlay(2);
_level0.add_in(50);
eval ("_level0.fly" + next_place)._visible = false;
}
h++;
}
}
}
_level0.levelup._visible = false;
time_left = frames_target[level] - counter;
time_left_frame = 100 - int((time_left / frames_target[level]) * 100);
_level0.timer.gotoAndStop(time_left_frame);
if (counter > frames_target[level]) {
state = "level_up";
_level0.levelupsound.gotoandplay(2);
_level0.levelup._visible = true;
_level0.remove_mags();
wait = 0;
} else {
down = false;
if (Key.isDown(37)) {
speed = speed - acc;
down = true;
}
if (Key.isDown(39)) {
speed = speed + acc;
down = true;
}
if (speed > maxs) {
speed = maxs;
}
if (speed < (-maxs)) {
speed = -maxs;
}
if (down == false) {
speed = speed * 0.95;
}
_rotation = (_rotation + speed);
if (speed_boost_on_show) {
h = 1;
while (h <= 4) {
hm = eval ("_level0.wheel.hole0" + h);
if (hm.hitTest(_level0.speedbonus._x, _level0.speedbonus._y, false)) {
_level0.speedbonus._visible = 0;
trace("HIT!");
speed_boost_on_show = false;
speed_boost = true;
sb_count = 0;
saved_maxs = maxs;
saved_acc = acc;
maxs = 3;
acc = 1;
}
h++;
}
}
if (speed_boost) {
sb_count++;
if (sb_count > 150) {
speed_boost = false;
maxs = saved_maxs;
acc = saved_acc;
}
}
if (reverse_boost_on_show) {
h = 1;
while (h <= 4) {
hm = eval ("_level0.wheel.hole0" + h);
trace(hm._name);
if (hm.hitTest(_level0.reversebonus._x, _level0.reversebonus._y, false)) {
_level0.reversebonus._visible = 0;
trace("HIT!");
reverse_boost_on_show = false;
reverse_boost = true;
rb_count = 0;
speed = -speed;
acc = -acc;
}
h++;
}
}
if (reverse_boost) {
rb_count++;
if (rb_count > 150) {
reverse_boost = false;
speed = -speed;
acc = -acc;
}
}
i = 1;
while (i <= tot_mags) {
if ((dead[i] == 0) and (counter > start[i])) {
done_steps[i]++;
diffx = _level0["mag" + i]._x - _level0.cheese._x;
diffy = _level0["mag" + i]._y - _level0.cheese._y;
diff = Math.sqrt((diffy * diffy) + (diffx * diffx));
on_cheese = diff < 40;
if ((done_steps[i] <= steps[i]) and (!on_cheese)) {
_level0["mag" + i]._visible = true;
_level0["mag" + i]._x = _level0["mag" + i]._x - deltax[i];
_level0["mag" + i]._y = _level0["mag" + i]._y - deltay[i];
if (_level0.wheel.hole01.hitTest(_level0["mag" + i]._x, _level0["mag" + i]._y, false)) {
_level0["mag" + i]._visible = 0;
dead[i] = 1;
_level0.wheel.hole01.gotoAndPlay(2);
}
if (_level0.wheel.hole02.hitTest(_level0["mag" + i]._x, _level0["mag" + i]._y, false)) {
_level0["mag" + i]._visible = 0;
dead[i] = 1;
_level0.wheel.hole02.gotoAndPlay(2);
}
if (_level0.wheel.hole03.hitTest(_level0["mag" + i]._x, _level0["mag" + i]._y, false)) {
_level0["mag" + i]._visible = 0;
dead[i] = 1;
_level0.wheel.hole03.gotoAndPlay(2);
}
if (_level0.wheel.hole04.hitTest(_level0["mag" + i]._x, _level0["mag" + i]._y, false)) {
_level0["mag" + i]._visible = 0;
dead[i] = 1;
_level0.wheel.hole04.gotoAndPlay(2);
}
if (dead[i] == 1) {
_level0.caught = _level0.caught + 10;
taken[slot[i]] = 0;
generate_mag_data(i);
_level0.add_in(10);
}
} else {
state = "gameover";
}
} else {
_level0["mag" + i]._visible = false;
}
i++;
}
}
}
}
Instance of Symbol 109 MovieClip "levelup" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 111 MovieClip "alldone_sign" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 117 MovieClip "gameover_sign" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 82 MovieClip "fly5" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 82 MovieClip "fly6" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 82 MovieClip "fly4" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 82 MovieClip "fly1" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 82 MovieClip "fly3" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 82 MovieClip "fly2" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 82 MovieClip "fly7" in Frame 162
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 82 MovieClip "fly8" in Frame 162
onClipEvent (load) {
_visible = false;
}
Frame 163
stop();
Frame 164
if (_level0.win) {
gotoAndPlay (215);
}
Frame 165
gameover_sign._visible = true;
remove_mags();
Frame 214
gotoAndPlay (252);
Frame 215
remove_clips();
alldone_sign._visible = true;
Frame 252
remove_clips();
stop();
Symbol 8 MovieClip Frame 1
doneLoading = 0;
stop();
Instance of Symbol 4 MovieClip "bkgd" in Symbol 8 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.doneLoading == 0) {
total = _parent._parent.getBytesTotal();
isloaded = _parent._parent.getBytesLoaded();
p = 100 * (isLoaded / total);
_parent.bytes = ((int(isloaded / 1000) add " KB of ") add int(total / 1000)) add " KB";
_parent.percent = int(p) add "% LOADED";
_parent.bar._xscale = p;
trace("....." + Number(p));
if (Number(p) >= Number(100)) {
_parent._parent.gotoAndPlay(Number(2));
_parent.gotoAndStop("off");
_parent.doneLoading = 1;
} else {
_parent._parent.gotoAndPlay(Number(1));
}
}
}
Symbol 14 MovieClip Frame 7
gotoAndPlay (1);
Symbol 17 MovieClip Frame 32
gotoAndPlay (1);
Symbol 19 MovieClip Frame 7
gotoAndPlay (1);
Symbol 25 MovieClip Frame 1
Symbol 25 MovieClip Frame 19
stop();
Symbol 39 MovieClip Frame 36
gotoAndPlay (1);
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 2
a = random(10) + 1;
if (a == 1) {
_level0.mdie.gotoAndPlay("sound2");
} else if (a == 2) {
_level0.mdie.gotoAndPlay("sound3");
} else if (a == 3) {
_level0.mdie.gotoAndPlay("sound4");
} else {
_level0.mdie.gotoAndPlay("sound1");
}
Symbol 60 MovieClip Frame 14
gotoAndPlay (1);
Symbol 60 MovieClip Frame 45
stop();
Symbol 66 Button
on (release) {
play();
}
Symbol 97 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?cdgtid=maggotz", "_blank");
}
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 100
stop();
Symbol 105 MovieClip Frame 1
stop();
Symbol 105 MovieClip Frame 42
gotoAndStop (1);
Symbol 109 MovieClip Frame 9
gotoAndPlay (1);
Symbol 115 MovieClip Frame 8
gotoAndPlay (1);
Symbol 126 MovieClip Frame 1
stop();
Symbol 126 MovieClip Frame 65
gotoAndStop (1);
Symbol 130 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 13
gotoAndStop (1);
Symbol 130 MovieClip Frame 42
gotoAndStop (1);
Symbol 130 MovieClip Frame 54
gotoAndStop (1);
Symbol 130 MovieClip Frame 81
gotoAndStop (1);
Symbol 132 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 13
gotoAndStop (1);
Symbol 141 Button
on (release) {
gotoAndPlay (161);
}
Symbol 145 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?page=downloadagreement");
}
Symbol 147 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?page=freestuff", "_blank");
}