Frame 15
stop();
Frame 16
stop();
Frame 17
shotstarted = false;
score = 0;
timer = 100;
level = 1;
ballstop = 0.5;
ball = 1;
while (balls >= ball) {
thisball = eval ("ball" + ball);
trace((("startballx[" + ball) + "] = ") + thisball._x);
trace((("startbally[" + ball) + "] = ") + thisball._y);
ball++;
}
Instance of Symbol 41 MovieClip "ball1" in Frame 17
onClipEvent (mouseDown) {
if (!_level0.shotstarted) {
powstart = getTimer();
moused = true;
}
}
onClipEvent (mouseUp) {
if ((!_level0.shotstarted) and moused) {
moused = false;
powstop = getTimer();
_level0.pwr = powstop - powstart;
_level0.cuex = _xmouse;
_level0.cuey = _ymouse;
_level0.shotstarted = true;
}
}
onClipEvent (enterFrame) {
cuex = _xmouse;
cuey = _ymouse;
ncuey = (10 * (-cuey)) / (math.abs(cuex) + math.abs(cuey));
ncuex = (10 * cuex) / (math.abs(cuex) + math.abs(cuey));
rot = (Math.atan2(ncuex, ncuey) * 180) / 3.142;
temppwr = getTimer() - powstart;
if (!_level0.shotstarted) {
if (moused) {
pb = int(temppwr / 50);
_level0.powerbar.gotoandstop(pb);
}
_level0.cue._x = _level0.ball1._x;
_level0.cue._y = _level0.ball1._y;
_level0.cue._rotation = ROT;
}
}
Instance of Symbol 44 MovieClip "t2" in Frame 17
onClipEvent (load) {
rtime = _level0.timer;
running = true;
}
onClipEvent (enterFrame) {
if (running) {
rtime = rtime - 0.05;
if (rtime < 0) {
rtime = 0;
_level0.gameover = true;
_root.gotoandplay("explode");
running = false;
}
time = int(rtime);
}
}
Instance of Symbol 44 MovieClip "t5" in Frame 17
onClipEvent (load) {
rtime = _level0.timer;
running = true;
}
onClipEvent (enterFrame) {
if (running) {
rtime = rtime - 0.05;
if (rtime < 0) {
rtime = 0;
_level0.gameover = true;
_root.gotoandplay("explode");
running = false;
}
time = int(rtime);
}
}
Instance of Symbol 44 MovieClip "t4" in Frame 17
onClipEvent (load) {
rtime = _level0.timer;
running = true;
}
onClipEvent (enterFrame) {
if (running) {
rtime = rtime - 0.05;
if (rtime < 0) {
rtime = 0;
_level0.gameover = true;
_root.gotoandplay("explode");
running = false;
}
time = int(rtime);
}
}
Instance of Symbol 45 MovieClip "t7" in Frame 17
onClipEvent (load) {
rtime = _level0.timer;
running = true;
}
onClipEvent (enterFrame) {
if (running) {
rtime = rtime - 0.05;
if (rtime < 0) {
rtime = 0;
_level0.gameover = true;
_root.gotoandplay("explode");
running = false;
}
time = int(rtime);
}
}
Instance of Symbol 46 MovieClip "t6" in Frame 17
onClipEvent (load) {
rtime = _level0.timer;
running = true;
}
onClipEvent (enterFrame) {
if (running) {
rtime = rtime - 0.05;
if (rtime < 0) {
rtime = 0;
_level0.gameover = true;
_root.gotoandplay("explode");
running = false;
}
time = int(rtime);
}
}
Instance of Symbol 47 MovieClip "t3" in Frame 17
onClipEvent (load) {
rtime = _level0.timer;
running = true;
}
onClipEvent (enterFrame) {
if (running) {
rtime = rtime - 0.05;
if (rtime < 0) {
rtime = 0;
_level0.gameover = true;
_root.gotoandplay("explode");
running = false;
}
}
time = int(rtime);
}
Frame 18
function init_balls() {
leveltext = level_text[level];
if (level_dynamite[level]) {
dynamite._x = 400;
dynamite._y = 300;
} else {
dynamite._x = -300;
dynamite._y = -300;
}
trace(level);
if (level_balls[level] == 1) {
trace("init");
startballx[1] = 249.7;
startbally[1] = 238.35;
startballx[2] = 179.05;
startbally[2] = 300.6;
startballx[3] = 179.8;
startbally[3] = 176.5;
startballx[4] = 179.05;
startbally[4] = 234.6;
startballx[5] = 326;
startbally[5] = 233.3;
startballx[6] = 419;
startbally[6] = 234.6;
startballx[7] = 525;
startbally[7] = 234.6;
} else {
startballx[1] = 77.7;
startbally[1] = 229.35;
startballx[2] = 373.05;
startbally[2] = 255.6;
startballx[3] = 446.55;
startbally[3] = 158.5;
startballx[4] = 370.05;
startbally[4] = 202.6;
startballx[5] = 446.55;
startbally[5] = 292.3;
startballx[6] = 517;
startbally[6] = 202.6;
startballx[7] = 521;
startbally[7] = 255.6;
}
ball = 1;
while (balls >= ball) {
thisball = eval ("ball" + ball);
thisball._x = startballx[ball];
thisball._y = startbally[ball];
realx[ball] = thisball._x;
realy[ball] = _level0.starty - thisball._y;
eval ("t" + ball)._x = thisball._x;
eval ("t" + ball)._y = thisball._y;
eval ("t" + ball).rtime = Level_timer[level];
eval ("t" + ball).running = true;
potted[ball] = false;
trace((("startballx[" + ball) + "] = ") + thisball._x);
trace((("startbally[" + ball) + "] = ") + thisball._y);
ball++;
}
}
hit = 0;
gameover = false;
u = 30;
t = 0;
radius = 28;
a = -1;
startx = white._x;
balls = 7;
ballspotted = 0;
starty = 400;
friction = 0.1;
explode._x = -999;
explode._y = -999;
explode.gotoandstop(1);
vx = new array(0, 0, 0);
vy = new array(0, 0, 0);
realx = new array(0, 200, 200);
realy = new array(0, 300, 300);
potted = new array();
startballx = new array();
startbally = new array();
level_text = new Array();
level_balls = new Array();
level_dynamite = new Array();
level_timer = new Array();
level_text[1] = "LEVEL ONE: CLEAR THE BOMBS IN 100 SECONDS !";
level_text[2] = "LEVEL TWO: CLEAR THE CIRCLE OF BOMBS !";
level_text[3] = "LEVEL THREE: DON'T DISTURB THE DYNAMITE !";
level_text[4] = "LEVEL FOUR: DON'T DISTURB THE DYNAMITE !";
level_text[5] = "LEVEL FIVE: DON'T DISTURB THE DYNAMITE !";
level_text[6] = "LEVEL SIX: DON'T DISTURB THE DYNAMITE !";
level_text[7] = "LEVEL SEVEN: DON'T DISTURB THE DYNAMITE !";
level_text[8] = "LEVEL EIGHT: DON'T DISTURB THE DYNAMITE !";
level_text[9] = "LEVEL NINE: DON'T DISTURB THE DYNAMITE !";
level_text[10] = "FINAL LEVEL: DON'T DISTURB THE DYNAMITE !";
Level_balls[1] = 1;
Level_balls[2] = 2;
Level_balls[3] = 1;
Level_balls[4] = 1;
Level_balls[5] = 1;
Level_balls[6] = 1;
Level_balls[7] = 1;
Level_balls[8] = 1;
Level_balls[9] = 1;
Level_balls[10] = 1;
level_dynamite[1] = false;
level_dynamite[2] = false;
level_dynamite[3] = true;
level_dynamite[4] = true;
level_dynamite[5] = true;
level_dynamite[6] = true;
level_dynamite[7] = true;
level_dynamite[8] = true;
level_dynamite[9] = true;
level_dynamite[10] = true;
Level_timer[1] = 100;
Level_timer[2] = 95;
Level_timer[3] = 90;
Level_timer[4] = 80;
Level_timer[5] = 70;
Level_timer[6] = 60;
Level_timer[7] = 50;
Level_timer[8] = 40;
Level_timer[9] = 30;
Level_timer[10] = 20;
ball = 1;
while (balls >= ball) {
thisball = eval ("ball" + ball);
trace((("startballx[" + ball) + "] = ") + thisball._x);
trace((("startbally[" + ball) + "] = ") + thisball._y);
ball++;
}
init_balls();
Frame 19
shotstarted = false;
Frame 20
cue.gotoandstop(1);
powerbar.gotoandstop(1);
Frame 21
if (gameover) {
gotoAndPlay (45);
}
Frame 22
if (!shotstarted) {
gotoAndPlay (21);
}
Frame 23
power = pwr / 50;
if (15 < power) {
power = 15;
}
ncuey = (power * (-cuey)) / (math.abs(cuex) + math.abs(cuey));
ncuex = (power * cuex) / (math.abs(cuex) + math.abs(cuey));
vx[1] = ncuex;
vy[1] = ncuey;
shotstarted = true;
cue.gotoandplay(2);
Frame 32
allstillc = 0;
ii = 1;
while (balls >= ii) {
if ((vx[ii] == 0) and (vy[ii] == 0)) {
allstillc++;
}
jj = ii + 1;
while (balls >= jj) {
white = eval ("_level0.ball" + ii);
red = eval ("_level0.ball" + jj);
why = starty - white._y;
rey = starty - red._y;
dby = (-why) + rey;
dbx = (-white._x) + red._x;
delta = Math.sqrt((dby * dby) + (dbx * dbx));
if (delta < radius) {
white._x = white._x - (vx[ii] / 2);
white._y = white._y + (vy[ii] / 2);
realx[ii] = realx[ii] - (vx[ii] / 2);
realy[ii] = realy[ii] - (vy[ii] / 2);
red._x = red._x - (vx[jj] / 2);
red._y = red._y + (vy[jj] / 2);
realx[jj] = realx[jj] - (vx[jj] / 2);
realy[jj] = realy[jj] - (vy[jj] / 2);
x1 = white._x;
y1 = starty - white._y;
x2 = red._x;
y2 = starty - red._y;
angle = Math.atan2(y2 - y1, x2 - x1);
x1 = vx[ii];
y1 = vy[ii];
x2 = vx[jj];
y2 = vy[jj];
if (3 < (((Math.abs(x1) + Math.abs(x2)) + Math.abs(y1)) + Math.abs(y2))) {
shotsound.gotoandplay(2);
}
cma = Math.cos(-angle);
sma = Math.sin(-angle);
sa = Math.sin(angle);
ca = Math.cos(angle);
nx1 = (x1 * cma) - (y1 * sma);
ny1 = (x1 * sma) + (y1 * cma);
nx2 = (x2 * cma) - (y2 * sma);
ny2 = (x2 * sma) + (y2 * cma);
nx1 = nx2;
x1 = (nx1 * ca) - (ny1 * sa);
y1 = (nx1 * sa) + (ny1 * ca);
next1x = x1;
next1y = y1;
x2 = white._x;
y2 = starty - white._y;
x1 = red._x;
y1 = starty - red._y;
angle = Math.atan2(y2 - y1, x2 - x1);
x2 = vx[ii];
y2 = vy[ii];
x1 = vx[jj];
y1 = vy[jj];
nx1 = (x1 * Math.cos(-angle)) - (y1 * Math.sin(-angle));
ny1 = (x1 * Math.sin(-angle)) + (y1 * Math.cos(-angle));
nx2 = (x2 * Math.cos(-angle)) - (y2 * Math.sin(-angle));
ny2 = (x2 * Math.sin(-angle)) + (y2 * Math.cos(-angle));
nx1 = nx2;
x1 = (nx1 * Math.cos(angle)) - (ny1 * Math.sin(angle));
y1 = (nx1 * Math.sin(angle)) + (ny1 * Math.cos(angle));
next2x = x1;
next2y = y1;
vx[ii] = next1x;
vy[ii] = next1y;
vx[jj] = next2x;
vy[jj] = next2y;
}
jj++;
}
ii++;
}
Frame 33
function update_balls() {
ball = 1;
while (balls >= ball) {
in_the_hole = check_pockets();
if (!potted[ball]) {
if (_level0.shotstarted) {
if ((Math.ABS(vx[ball]) + Math.ABS(vy[ball])) == 0) {
lessy = 0;
lessx = 0;
} else {
lessy = Math.ABS(vy[ball]) / (Math.ABS(vx[ball]) + Math.ABS(vy[ball]));
lessx = Math.ABS(vx[ball]) / (Math.ABS(vx[ball]) + Math.ABS(vy[ball]));
}
if (0 < Vx[ball]) {
vx[ball] = vx[ball] - (_level0.friction * lessx);
} else {
vx[ball] = vx[ball] + (_level0.friction * lessx);
}
if (0 < Vy[ball]) {
vy[ball] = vy[ball] - (_level0.friction * lessy);
} else {
vy[ball] = vy[ball] + (_level0.friction * lessy);
}
if ((Math.abs(vx[ball]) < ballstop) and (Math.abs(vy[ball]) < ballstop)) {
vy[ball] = 0;
vx[ball] = 0;
}
realx[ball] = realx[ball] + vx[ball];
realy[ball] = realy[ball] + vy[ball];
thisball = eval ("ball" + ball);
thisball._x = realx[ball];
thisball._y = _level0.starty - realy[ball];
eval ("t" + ball)._x = thisball._x;
eval ("t" + ball)._y = thisball._y;
check_wall(ball);
}
}
ball++;
}
}
function check_pockets() {
pocketed = false;
bamc = eval ("ball" + ball);
if (dynamite.hit.hittest(bamc._x, bamc._y, true)) {
_level0.gameover = true;
_root.gotoandplay("explode");
}
p = 1;
while (6 >= p) {
pomc = eval ("pocket" + p);
if (pomc.hittest(bamc._x, bamc._y, true)) {
down.gotoandplay(2);
pocketed = true;
score = score + eval ("t" + ball).time;
bamc._visible = false;
vx[ball] = 0;
vy[ball] = 0;
bamc._x = 100;
bamc._y = 0;
realx[ball] = 130 + (ballspotted * 30);
realy[ball] = 350;
bamc._y = _level0.starty - realy[ball];
bamc._x = realx[ball];
bamc._visible = true;
potted[ball] = true;
if (1 < ball) {
ballspotted++;
} else {
_level0.gameover = true;
_root.gotoandplay("explode");
}
eval ("t" + ball).running = false;
eval ("t" + ball)._y = bamc._y;
eval ("t" + ball)._x = bamc._x;
}
p++;
}
return(pocketed);
}
function check_wall(index) {
if (realx[index] < 50) {
realx[index] = 50;
vx[index] = -vx[index];
}
if (280 < realy[index]) {
realy[index] = 280;
vy[index] = -vy[index];
}
if (realy[index] < 50) {
realy[index] = 50;
vy[index] = -vy[index];
}
if (600 < realx[index]) {
realx[index] = 600;
vx[index] = -vx[index];
}
}
update_balls();
if ((allstillc < balls) and (!gameover)) {
gotoAndPlay (32);
}
Frame 34
if (gameover) {
gotoAndPlay (44);
}
Frame 35
if (ballspotted == (balls - 1)) {
gotoAndPlay (72);
}
Frame 41
gotoAndPlay (19);
Frame 44
explode._x = 300;
explode._y = 200;
explode.gotoandplay(2);
Frame 56
stop();
Frame 71
stop();
Frame 72
level++;
Frame 73
stop();
Symbol 6 MovieClip Frame 4
gotoAndPlay (1);
Symbol 16 Button
on (release) {
gotoAndPlay (16);
}
Symbol 17 Button
on (release) {
gotoAndPlay (17);
}
Symbol 42 MovieClip Frame 4
gotoAndPlay (1);
Symbol 49 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 1
stop();
Symbol 59 MovieClip Frame 45
stop();
Symbol 63 MovieClip Frame 1
stop();
Symbol 63 MovieClip Frame 20
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 69 MovieClip Frame 1
stop();
Symbol 72 Button
on (release) {
init_balls();
score = 0;
level = 1;
gotoAndPlay (18);
}
Symbol 75 Button
on (release) {
getURL ("http://www.mousebreaker.co.uk", "_blank");
}
Symbol 78 Button
on (release) {
gotoAndPlay (18);
}