Frame 173
level = 1;
limit = 90;
score = 0;
stop();
Frame 174
required = 10 * level;
required_left = required;
bonus = 0;
Instance of Symbol 81 MovieClip "timer_movie" in Frame 174
onClipEvent (load) {
timer = _level0.limit;
last = limit;
running = false;
expired = false;
activate_pulse = false;
start = 0;
trace("init timer");
}
onClipEvent (enterFrame) {
if (activate_pulse) {
_level0.hand.state = "get_dart";
activate_pulse = false;
start = getTimer();
running = true;
expired = false;
timer = _level0.limit;
trace("start timer" + start);
}
if (running) {
raw = int(((-start) / 1000) + (getTimer() / 1000));
timer = _level0.limit - raw;
if ((last != timer) and (timer < 6)) {
_level0.beep.gotoandplay(2);
last = timer;
}
}
if (timer < 1) {
expired = true;
running = false;
timer = 0;
}
}
Instance of Symbol 111 MovieClip "main" in Frame 174
onClipEvent (load) {
status = "reset";
pins_hit = false;
goes_to_get_ten = 0;
last_score = 0;
x1 = 150;
y1 = 20;
x2 = 400;
y2 = 100;
m = (y2 - y1) / (x2 - x1);
c = ((-m) * x1) + y1;
trace("m = " + m);
trace("c = " + c);
pin = new array(10);
knockon = new array(10);
count = 0;
gx2 = 75;
gy2 = 400;
gx1 = 214;
gy1 = 150;
gm = (gy2 - gy1) / (gx2 - gx1);
gc = ((-gm) * gx1) + gy1;
rgx2 = 450;
rgy2 = 400;
rgx1 = 316;
rgy1 = 150;
rgm = (rgy2 - rgy1) / (rgx2 - rgx1);
rgc = ((-rgm) * rgx1) + rgy1;
}
onClipEvent (mouseMove) {
if (status == "start_ball") {
mx = _root._xmouse;
if (mx < _x) {
ddx = _x - mx;
} else {
ddx = mx - _x;
}
moveSpeedx = ddx / 3;
if (mx < _x) {
_x = (_x - moveSpeedx);
} else {
_x = (_x + moveSpeedx);
}
if (430 < this._x) {
this._x = 430;
}
if (this._x < 95) {
this._x = 95;
}
}
}
onClipEvent (mouseDown) {
if ((status == "start_ball") and (substatus == "setspin")) {
_level0.spin.stop();
diff = 14 - _level0.spin._currentframe;
status = "rolling_init";
}
if ((status == "start_ball") and (substatus == "setarrow")) {
substatus = "setspin";
_level0.timedout = false;
_level0.spin.gotoandplay(2);
}
}
onClipEvent (enterFrame) {
function collisions_detector() {
hit_this_cycle = false;
if ((!left_gutter) and (!right_gutter)) {
if ((!checked_bomb) and (this._y < 225)) {
checked_bomb = true;
if (Math.abs(_level0.bomb._x - this._x) < 31) {
gameover = true;
}
}
if (check_state == "waiting_row1") {
if (this._y < 168) {
check_state = "checking_row1";
}
}
if (check_state == "checking_row1") {
if (pin[1]) {
if ((252 < this._x) and (this._x < 286)) {
pin[1] = false;
hit_this_cycle = true;
reduce_required();
dx = 268 - this._x;
dy = 20;
dir = (Math.atan2(dx, dy) * 180) / 3.142;
trace("dirn" + dir);
if ((-65 < dir) and (dir < -25)) {
knockon[2] = true;
}
if ((dir < 65) and (25 < dir)) {
knockon[3] = true;
}
if (268 < this._x) {
_level0.pin1.gotoandplay("fallleft");
} else {
_level0.pin1.gotoandplay("fallright");
}
}
}
check_state = "waiting_row2";
}
if (check_state == "waiting_row2") {
if (this._y < 162) {
check_state = "checking_row2";
}
}
if (check_state == "checking_row2") {
if (pin[2]) {
if (((235 < this._x) and (this._x < 270)) or knockon[2]) {
dx = 252 - this._x;
dy = 20;
dir = (Math.atan2(dx, dy) * 180) / 3.142;
trace("dirn" + dir);
if ((-65 < dir) and (dir < -25)) {
knockon[4] = true;
}
if ((dir < 65) and (25 < dir)) {
knockon[5] = true;
}
hit_this_cycle = true;
reduce_required();
pin[2] = false;
if (252 < this._x) {
_level0.pin2.gotoandplay("fallleft");
} else {
_level0.pin2.gotoandplay("fallright");
}
}
}
if (pin[3]) {
if (((268 < this._x) and (this._x < 302)) or knockon[3]) {
dx = 285 - this._x;
dy = 20;
dir = (Math.atan2(dx, dy) * 180) / 3.142;
trace("dirn" + dir);
if ((-65 < dir) and (dir < -25)) {
knockon[5] = true;
}
if ((dir < 65) and (25 < dir)) {
knockon[6] = true;
}
pin[3] = false;
hit_this_cycle = true;
reduce_required();
if (285 < this._x) {
_level0.pin3.gotoandplay("fallleft");
} else {
_level0.pin3.gotoandplay("fallright");
}
}
}
check_state = "waiting_row3";
}
if (check_state == "waiting_row3") {
if (this._y < 157) {
check_state = "checking_row3";
}
}
if (check_state == "checking_row3") {
if (pin[5]) {
if (((252 < this._x) and (this._x < 286)) or knockon[5]) {
dx = 268 - this._x;
dy = 20;
dir = (Math.atan2(dx, dy) * 180) / 3.142;
trace("dirn" + dir);
if ((-65 < dir) and (dir < -25)) {
knockon[8] = true;
}
if ((dir < 65) and (25 < dir)) {
knockon[9] = true;
}
hit_this_cycle = true;
reduce_required();
pin[5] = false;
if (268 < this._x) {
_level0.pin5.gotoandplay("fallleft");
} else {
_level0.pin5.gotoandplay("fallright");
}
}
}
if (pin[4]) {
if (((222 < this._x) and (this._x < 255)) or knockon[4]) {
dx = 248 - this._x;
dy = 20;
dir = (Math.atan2(dx, dy) * 180) / 3.142;
trace("dirn" + dir);
if ((-65 < dir) and (dir < -25)) {
knockon[7] = true;
}
if ((dir < 65) and (25 < dir)) {
knockon[8] = true;
}
hit_this_cycle = true;
reduce_required();
pin[4] = false;
if (248 < this._x) {
_level0.pin4.gotoandplay("fallleft");
} else {
_level0.pin4.gotoandplay("fallright");
}
}
}
if (pin[6]) {
if (((281 < this._x) and (this._x < 313)) or knockon[6]) {
dx = 297 - this._x;
dy = 20;
dir = (Math.atan2(dx, dy) * 180) / 3.142;
trace("dirn" + dir);
if ((-65 < dir) and (dir < -25)) {
knockon[9] = true;
}
if ((dir < 65) and (25 < dir)) {
knockon[10] = true;
}
hit_this_cycle = true;
reduce_required();
pin[6] = false;
if (297 < this._x) {
_level0.pin6.gotoandplay("fallleft");
} else {
_level0.pin6.gotoandplay("fallright");
}
}
}
check_state = "waiting_row4";
}
}
if (check_state == "waiting_row4") {
if (this._y < 153) {
check_state = "checking_row4";
}
}
if (check_state == "checking_row4") {
if (pin[8]) {
if (((235 < this._x) and (this._x < 270)) or knockon[8]) {
pin[8] = false;
hit_this_cycle = true;
reduce_required();
if (252 < this._x) {
_level0.pin8.gotoandplay("fallleft");
} else {
_level0.pin8.gotoandplay("fallright");
}
}
}
if (pin[9]) {
if (((268 < this._x) and (this._x < 302)) or knockon[9]) {
pin[9] = false;
hit_this_cycle = true;
reduce_required();
if (285 < this._x) {
_level0.pin9.gotoandplay("fallleft");
} else {
_level0.pin9.gotoandplay("fallright");
}
}
}
if (pin[10]) {
if (((296 < this._x) and (this._x < 324)) or knockon[10]) {
pin[10] = false;
hit_this_cycle = true;
reduce_required();
if (310 < this._x) {
_level0.pin10.gotoandplay("fallleft");
} else {
_level0.pin10.gotoandplay("fallright");
}
}
}
if (pin[7]) {
if (((212 < this._x) and (this._x < 240)) or knockon[7]) {
pin[7] = false;
hit_this_cycle = true;
reduce_required();
if (226 < this._x) {
_level0.pin7.gotoandplay("fallleft");
} else {
_level0.pin7.gotoandplay("fallright");
}
}
}
check_state = "waiting_row5";
}
}
function reduce_required() {
_level0.score = _level0.score + _level0.timer_movie.timer;
if (0 < _level0.required_left) {
_level0.required_left--;
}
if (_level0.required_left < 1) {
trace("_level0.timer_movie.running " + _level0.timer_movie.running);
_level0.timer_movie.running = false;
trace("_level0.timer_movie.running " + _level0.timer_movie.running);
}
}
if ((status != "done") and (_level0.timer_movie.expired or gameover)) {
trace("HERE!");
status = "done";
_level0.gotoandplay("gameover");
} else if (((_level0.required_left < 1) and (status != "done")) and (status != "rolling")) {
trace("HERE!");
status = "done";
this_score = _level0.score - last_score;
if (goes_to_get_ten == 2) {
_level0.strike.gotoandplay("spare");
_level0.cheer.gotoandplay("2");
_level0.score = _level0.score + (this_score * 2);
}
if (goes_to_get_ten == 1) {
_level0.strike.gotoandplay("strike");
_level0.cheer.gotoandplay("2");
_level0.score = _level0.score + (this_score * 3);
}
_level0.bonus = (_level0.timer_movie.timer * _level0.level) * 10;
_level0.gotoAndPlay("done");
} else {
if ((status == "start_ball") and _level0.timedout) {
status = "rolling_init";
_level0.timedout = false;
diff = -14;
}
if (status == "ready_to_reset") {
if (100 < count) {
status = "reset";
} else {
count++;
}
}
if (status == "reset") {
check_state = "waiting_row1";
left_gutter = false;
right_gutter = false;
if (1 < _level0.level) {
_level0.bomb._x = random(123) + 202;
checked_bomb = false;
} else {
_level0.bomb._x = -999;
checked_bomb = true;
}
gameover = false;
sfx_played = false;
pins_down = 0;
i = 1;
while (10 >= i) {
knockon[i] = false;
if (!pin[i]) {
pins_down++;
eval ("_level0.pin" + i)._visible = false;
} else {
eval ("_level0.pin" + i)._visible = true;
}
i++;
}
this_score = _level0.score - last_score;
trace("last score = " + this_score);
if (pins_down == 10) {
if (goes_to_get_ten == 2) {
_level0.strike.gotoandplay("spare");
_level0.score = _level0.score + (this_score * 2);
}
if (goes_to_get_ten == 1) {
_level0.strike.gotoandplay("strike");
_level0.score = _level0.score + (this_score * 3);
}
goes_to_get_ten = 0;
i = 1;
while (10 >= i) {
pin[i] = true;
eval ("_level0.pin" + i).gotoandstop(1);
eval ("_level0.pin" + i)._visible = true;
i++;
}
}
last_score = _level0.score;
substatus = "setarrow";
_level0.spin.gotoandstop(1);
this._x = 268;
this._y = 390;
dirn = 6;
adirn = 8;
this._xscale = 100;
this._yscale = 100;
this.gotoandstop(8);
this._visible = true;
status = "start_ball";
count = 0;
goes_to_get_ten++;
}
if (status == "start_ball") {
if (substatus == "setarrow") {
_level0.arrow._x = _level0.arrow._x + adirn;
if (316 < _level0.arrow._x) {
_level0.arrow._x = 316;
adirn = adirn * -1;
}
if (_level0.arrow._x < 214) {
_level0.arrow._x = 214;
adirn = adirn * -1;
}
}
}
if (status == "rolling_init") {
this.gotoandplay(2);
_root.roll_sfx.gotoandplay(2);
bx1 = this._x;
by1 = this._y;
by2 = 150;
bx2 = _level0.arrow._x;
m1 = (by2 - by1) / (bx2 - bx1);
c1 = ((-m1) * bx1) + by1;
status = "rolling";
pins_hit = false;
}
if (status == "rolling") {
this._y = this._y - 2.5;
dist_gone = 400 - this._y;
spin = (((-1.5 * diff) / 14) * Math.exp(dist_gone / 60)) - 1;
if (right_gutter) {
this._x = ((this._y - rgc) / rgm) + 10;
} else if (left_gutter) {
this._x = ((this._y - gc) / gm) - 10;
} else {
this._x = ((this._y - c1) / m1) + spin;
}
this._xscale = (this._y * m) + c;
this._yscale = this._xscale;
if (this._x < ((this._y - gc) / gm)) {
left_gutter = true;
}
if (((this._y - rgc) / rgm) < this._x) {
right_gutter = true;
}
if (this._y < 150) {
status = "ready_to_reset";
this._visible = false;
} else {
collisions_detector();
}
}
}
if (hit_this_cycle and (!sfx_played)) {
_root.hits_sfx.gotoandplay(2);
sfx_played = true;
}
}
Frame 175
trace("reset timer");
timer_movie.activate_pulse = true;
stop();
Frame 179
explode._x = 225;
explode._y = 200;
explode.gotoandplay(2);
Frame 203
gotoAndPlay (256);
Frame 209
level++;
Frame 252
gotoAndPlay (255);
Frame 255
score = score + bonus;
if (level < 11) {
level_txt = level + " of 10";
} else {
level_txt = "All levels done";
}
level_done = level - 1;
if (6 >= level_done) {
speech_text = ("Well done! You have just completed level " + level_done) + ". This is your score so far...";
}
if (level_done == 7) {
speech_text = "You have now completed level 7 - are you trying to impress me ? This is your score so far...";
}
if (level_done == 8) {
speech_text = "That's Level 8 done ! - you must be very good with your hands! This is your score so far...";
}
if (level_done == 9) {
speech_text = "Nearly there, that was Level 9 - dont let me down now ! This is your score so far...";
}
if (level_done == 10) {
speech_text = "WOW ! You HAVE impressed me - bet you cant do that again. This is your final score ...";
}
stop();
Frame 256
stop();
Symbol 16 MovieClip Frame 1
doneLoading = 0;
stop();
Instance of Symbol 15 MovieClip "bkgd" in Symbol 16 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;
if (Number(95) < Number(p)) {
_parent._parent.gotoAndPlay(Number(2));
_parent.gotoAndStop("off");
_parent.doneLoading = 1;
} else {
_parent._parent.gotoAndPlay(Number(1));
}
}
}
Symbol 18 Button
on (release) {
getURL ("http://www.mousebreaker.co.uk/index.php?cdgtid=kingpin");
}
Symbol 22 MovieClip Frame 33
gotoAndPlay (1);
Symbol 24 MovieClip Frame 7
gotoAndPlay (1);
Symbol 31 MovieClip Frame 1
Symbol 31 MovieClip Frame 19
stop();
Symbol 44 MovieClip Frame 36
gotoAndPlay (1);
Symbol 54 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?cdgtid=kingpin", "_self");
}
Symbol 56 Button
on (release) {
getURL ("http://www.mousebreaker.com/index.php?page=downloadagreement", "_blank");
}
Symbol 64 Button
on (release) {
play();
}
Symbol 68 MovieClip Frame 1
stop();
Symbol 68 MovieClip Frame 18
stop();
Symbol 68 MovieClip Frame 43
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 20
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 35
_level0.timedout = true;
stop();
Symbol 102 MovieClip Frame 1
stop();
Symbol 102 MovieClip Frame 34
gotoAndStop (1);
Symbol 102 MovieClip Frame 79
gotoAndStop (1);
Symbol 106 MovieClip Frame 1
stop();
Symbol 111 MovieClip Frame 30
gotoAndPlay (1);
Symbol 126 MovieClip Frame 4
gotoAndPlay (1);
Symbol 141 Button
on (release) {
stopAllSounds();
if (level < 11) {
gotoAndPlay (174);
} else {
gotoAndPlay (256);
}
}
Symbol 150 Button
on (release) {
gotoAndPlay (173);
}