Frame 3
function min_format(secs) {
var _local1 = secs;
minutes = int(_local1 / 60);
secondshere = _local1 - (60 * int(_local1 / 60));
if (String(minutes).length < 2) {
minutes = minutes;
}
if (String(secondshere).length < 2) {
secondshere = "0" + secondshere;
}
time = (minutes + ":") + secondshere;
return(time);
}
function tVector(x, y, z) {
var _local1 = this;
_local1.x = x;
_local1.y = y;
_local1.z = z;
}
function vector(x, y) {
this.x = x;
this.y = y;
}
function ballobject() {
var _local1 = this;
_local1.pos = new vector();
_local1.oldpos = new vector();
_local1.prevpos = new vector();
_local1.kcframe = 0;
_local1.kcrotation = 0;
_local1.f = new vector();
}
function wData(a, b, c, d) {
var _local1 = this;
_local1.x1 = a + xoffset;
_local1.y1 = b + yoffset;
_local1.x2 = c + xoffset;
_local1.y2 = d + yoffset;
_local1.bounce = 0;
}
function bounceLine() {
var _local1 = this;
_local1.normal = new vector();
_local1.d = 0;
_local1.midx = 0;
_local1.midy = 0;
_local1.l = 0;
_local1.bounce = 0;
}
function VectorLength(v) {
var _local1 = v;
return(Math.sqrt((_local1.x * _local1.x) + (_local1.y * _local1.y)));
}
function NormalizeVector(v) {
var _local1 = v;
var _local2 = VectorLength(_local1);
_local1.x = _local1.x / _local2;
_local1.y = _local1.y / _local2;
return(_local1);
}
function DotProduct(v1, v2) {
return((v1.x * v2.x) + (v1.y * v2.y));
}
function CrossProduct(v1, v2) {
var _local1 = new vector();
_local1.x = v1.y * v2.z;
_local1.y = (-v1.x) * v2.z;
return(_local1);
}
function ScaleVector(v, scale) {
var _local1 = new vector();
_local1.x = v.x * scale;
_local1.y = v.y * scale;
return(_local1);
}
function VectorSum(v1, v2) {
var _local1 = new vector();
_local1.x = v1.x + v2.x;
_local1.y = v1.y + v2.y;
return(_local1);
}
function VectorDifference(v1, v2) {
var _local1 = new vector();
_local1.x = v1.x - v2.x;
_local1.y = v1.y - v2.y;
return(_local1);
}
function SetupWalls() {
var _local1 = new Array();
_local1[0] = new wData(83.5, 152.5, 117.5, 177.5);
_local1[1] = new wData(117.5, 177.5, 383.4, 177.5);
_local1[2] = new wData(383.4, 177.5, 395.5, 144.5);
_local1[3] = new wData(407.5, 144.5, 418.4, 177.5);
_local1[4] = new wData(418.4, 177.5, 685, 177.5);
_local1[5] = new wData(685, 177.5, 719, 152.5);
_local1[6] = new wData(723, 156.5, 701.5, 191.5);
_local1[7] = new wData(701.5, 191.5, 701.5, 445.5);
_local1[8] = new wData(701.5, 445.5, 723.5, 480.5);
_local1[9] = new wData(719.5, 484.5, 685.5, 459.5);
_local1[10] = new wData(685.5, 459.5, 418.9, 459.5);
_local1[11] = new wData(418.9, 459.5, 408, 492.5);
_local1[12] = new wData(396, 492.5, 383.9, 459.5);
_local1[13] = new wData(383.9, 459.5, 118, 459.5);
_local1[14] = new wData(118, 459.5, 84, 484.5);
_local1[15] = new wData(80, 480.5, 101.5, 445.5);
_local1[16] = new wData(101.5, 445.5, 101.5, 191.5);
_local1[17] = new wData(101.5, 191.5, 79.5, 156.5);
bLine = new Array();
i = 0;
while (i <= 17) {
var _local3 = new vector(-_local1[i].x1, -_local1[i].y1);
var wx2 = new vector(-_local1[i].x2, -_local1[i].y2);
var wl = VectorDifference(wx2, _local3);
var wlz = new tVector(0, 0, 1);
var _local2 = NormalizeVector(CrossProduct(wl, wlz));
bLine[i] = new bounceLine();
bLine[i].normal = _local2;
bLine[i].d = DotProduct(_local2, _local3);
bLine[i].midx = (_local1[i].x1 + _local1[i].x2) / 2;
bLine[i].midy = (_local1[i].y1 + _local1[i].y2) / 2;
bLine[i].l = (((_local1[i].x2 - _local1[i].x1) * (_local1[i].x2 - _local1[i].x1)) + ((_local1[i].y2 - _local1[i].y1) * (_local1[i].y2 - _local1[i].y1))) / 4;
bLine[i].bounce = _local1[i].bounce;
if (bLine[i].bounce == 0) {
bLine[i].bounce = 1;
}
i++;
}
}
function slowmove() {
var _local1 = this;
_local1.speedx = _local1.speedx * damp_slowmove;
_local1.framecount = _local1.framecount + ((((_local1.speedx * -1) * 100) / 10) / 10);
_local1._x = _local1._x + _local1.speedx;
if (_local1.framecount > 2) {
_local1.framecount = 0;
if (_local1.k.c._currentframe < 2) {
_local1.k.c.gotoAndStop(19);
}
_local1.k.c.prevFrame();
}
if (_local1._x < _local1.dest_x) {
stopsound("rolling_sound");
playsound("roehre", 100);
_local1._x = _local1.dest_x;
delete _local1.onEnterFrame;
}
}
_focusrect = false;
_global.path = _root;
bounce = new Boolean();
come_from_playnow = false;
introsound_running = false;
ingamesound_running = false;
soundmute = false;
xoffset = 0;
yoffset = 0;
NORMALBOUNCE = -0.8;
DAMP = 0.965;
damp_slowmove = 0.99;
MINSPEED = 0.3;
balls_startx = 242;
balls_starty = 94;
points_valid = [0, 50, 100, 150, 200, 250, 300, 350, 400, 450];
BALL_DIAMETER = 22;
BALL_RADIUS = 11;
gamemode = 1;
curplayer = 0;
nick1 = "";
nick2 = "";
score1 = 0;
score2 = 0;
gotoAndPlay (4);
function do_start_rolling(numv, chv) {
var _local1 = this;
var _local3 = _root;
wrcount++;
_local3.createEmptyMovieClip("waitrolling" + wrcount, wrcount);
var _local2 = _local3["waitrolling" + wrcount];
_local2.numv = numv + 1;
_local2.chv = chv;
_local2.startTimer = getTimer();
_local2.onEnterFrame = function () {
var _local1 = this;
if (getTimer() > (_local1.startTimer + 1000)) {
if ((_local1.numv != 1) and (_local1.numv != path.last_sinked)) {
trace("SINKED AND START ROLLING" + _local1.numv);
path.last_sinked = _local1.numv;
path.balls_sinked++;
path.roller["rb" + _local1.numv].dest_x = -130 + (23 * _root.balls_sinked);
path.roller["rb" + _local1.numv].onEnterFrame = _root.slowmove;
path.roller["rb" + _local1.numv]._visible = true;
path.playsound("rolling_sound", 75);
}
delete _local1.onEnterFrame;
}
};
}
function stopall_moves() {
var _local1 = 0;
while (_local1 < balls.length) {
delete balls[_local1].onEnterFrame;
delete path.onEnterFrame;
_local1++;
}
}
function adapt(speedvalue, ball) {
var _local1 = speedvalue;
var _local2 = ball;
if (_local1 < 2) {
_local1 = 1;
}
path[_local2].fc++;
if ((path[_local2].fc > (2 / _local1)) and (_local1 < 15)) {
path[_local2].k.c.nextFrame();
path[_local2].fc = 0;
}
}
function check_whiteball() {
if (b0_mc._x >= RIGHT) {
b0_mc._x = RIGHT - 1;
vball[0].pos.x = RIGHT - 1;
path.sh0._x = RIGHT - 1;
}
if (b0_mc._x <= LEFT) {
b0_mc._x = LEFT + 1;
vball[0].pos.x = LEFT + 1;
path.sh0._x = LEFT + 1;
}
if (b0_mc._y <= TOP) {
b0_mc._y = TOP + 1;
vball[0].pos.y = TOP + 1;
path.sh0._y = TOP + 1;
}
if (b0_mc._y >= BOTTOM) {
b0_mc._y = BOTTOM - 1;
vball[0].pos.y = BOTTOM - 1;
path.sh0._y = BOTTOM - 1;
}
}
function newforce_bank(bank) {
var _local1 = bank;
vball[0].f.x = vball[0].f.x + ((engl_draw * -1) * vball[0].f.x);
vball[0].f.y = vball[0].f.y + ((engl_draw * -1) * vball[0].f.y);
if (_local1 == "top") {
vball[0].f.x = vball[0].f.x + (engl_side * b0_mc.speed);
} else if (_local1 == "bottom") {
vball[0].f.x = vball[0].f.x - (engl_side * b0_mc.speed);
} else if (_local1 == "left") {
vball[0].f.y = vball[0].f.y - (engl_side * b0_mc.speed);
} else if (_local1 == "right") {
vball[0].f.y = vball[0].f.y + (engl_side * b0_mc.speed);
}
engl_draw = 0;
engl_side = 0;
}
function ballMove_whiteball_cc() {
var _local1 = this;
var _local2 = _local1.num;
if (freezenow || (firsthitball_whiteball_cc == 0)) {
vball[_local2].oldpos = vball[_local2].pos;
vball[_local2].f.x = vball[_local2].f.x * (DAMP + 0.02);
vball[_local2].f.y = vball[_local2].f.y * (DAMP + 0.02);
vball[_local2].pos.x = vball[_local2].pos.x + vball[_local2].f.x;
vball[_local2].pos.y = vball[_local2].pos.y + vball[_local2].f.y;
_local1._x = vball[_local2].pos.x;
_local1._y = vball[_local2].pos.y;
path.sh0._x = _local1._x;
path.sh0._y = _local1._y;
}
if (firsthitball_whiteball_cc != 0) {
_local1.speed = Math.sqrt((vball[_local2].f.x * vball[_local2].f.x) + (vball[_local2].f.y * vball[_local2].f.y));
path.speedtest = _local1.speed;
if (_local1.speed < MINSPEED) {
vball[_local2].f.x = 0;
vball[_local2].f.y = 0;
_local1.speed = 0;
freezenow = false;
if (((_local2 == 0) and (firsthitball == 0)) and (balls_moving == true)) {
call_changeplayer();
balls_moving = false;
delete path.onEnterFrame;
}
delete _local1.onEnterFrame;
}
if (whiteball_cc(firsthitball_whiteball_cc)) {
b0_mc.through = true;
delete b0_mc.onEnterFrame;
path.onEnterFrame = cc_otherballs;
}
} else {
if ((((_local1._x > RIGHT_CR0) || (_local1._x < LEFT_CR0)) || (_local1._y > BOTTOM_CR0)) || (_local1._y < TOP_CR0)) {
if (inside_cr1(_local1._x, _local1._y)) {
cc_vectors(_local2, 0, 17);
path.onEnterFrame = cc_otherballs;
} else if (inside_cr2(_local1._x, _local1._y)) {
cc_vectors(_local2, 1, 4);
path.onEnterFrame = cc_otherballs;
} else if (inside_cr3(_local1._x, _local1._y)) {
cc_vectors(_local2, 4, 7);
path.onEnterFrame = cc_otherballs;
} else if (inside_cr4(_local1._x, _local1._y)) {
cc_vectors(_local2, 7, 10);
path.onEnterFrame = cc_otherballs;
} else if (inside_cr5(_local1._x, _local1._y)) {
cc_vectors(_local2, 10, 13);
path.onEnterFrame = cc_otherballs;
} else if (inside_cr6(_local1._x, _local1._y)) {
cc_vectors(_local2, 13, 16);
path.onEnterFrame = cc_otherballs;
} else {
if (_local1._x > RIGHT) {
_local1._x = RIGHT;
path.sh0._x = RIGHT;
vball[_local2].pos.x = RIGHT;
vball[_local2].f.x = vball[_local2].f.x * NORMALBOUNCE;
newforce_bank("right");
if (_local1.speed > 10) {
playsound("bank_hard", 100);
} else {
playsound("bank_soft", 100);
}
path.onEnterFrame = cc_otherballs;
} else if (_local1._x < LEFT) {
_local1._x = LEFT;
path.sh0._x = LEFT;
vball[_local2].pos.x = LEFT;
vball[_local2].f.x = vball[_local2].f.x * NORMALBOUNCE;
newforce_bank("left");
if (_local1.speed > 10) {
playsound("bank_hard", 100);
} else {
playsound("bank_soft", 100);
}
path.onEnterFrame = cc_otherballs;
}
if (_local1._y > BOTTOM) {
_local1._y = BOTTOM;
path.sh0._y = BOTTOM;
vball[_local2].pos.y = BOTTOM;
vball[_local2].f.y = vball[_local2].f.y * NORMALBOUNCE;
newforce_bank("bottom");
if (_local1.speed > 10) {
playsound("bank_hard", 100);
} else {
playsound("bank_soft", 100);
}
path.onEnterFrame = cc_otherballs;
} else if (_local1._y < TOP) {
_local1._y = TOP;
path.sh0._y = TOP;
vball[_local2].pos.y = TOP;
vball[_local2].f.y = vball[_local2].f.y * NORMALBOUNCE;
newforce_bank("top");
if (_local1.speed > 10) {
playsound("bank_hard", 100);
} else {
playsound("bank_soft", 100);
}
path.onEnterFrame = cc_otherballs;
}
}
}
if (holes_mc.hitTest(_local1._x, _local1._y, true)) {
if (inside_cr1(_local1._x, _local1._y)) {
var _local3 = 1;
} else if (inside_cr2(_local1._x, _local1._y)) {
var _local3 = 2;
} else if (inside_cr3(_local1._x, _local1._y)) {
var _local3 = 3;
} else if (inside_cr4(_local1._x, _local1._y)) {
var _local3 = 4;
} else if (inside_cr5(_local1._x, _local1._y)) {
var _local3 = 5;
} else if (inside_cr6(_local1._x, _local1._y)) {
var _local3 = 6;
}
if (_local2 == 0) {
ani_invalid._x = _local1._x;
ani_invalid._y = _local1._y;
_local1._x = 10000;
_local1._y = Math.random() * 10000;
vball[_local2].pos.x = 5000;
vball[_local2].pos.y = 5000;
_local1.reset = true;
}
path["pocket" + _local3].k.num = _local2 + 1;
if (_local1.speed <= 5) {
path["pocket" + _local3].k.gotoAndPlay("slow");
} else if ((_local1.speed > 5) and (_local1.speed <= 15)) {
path["pocket" + _local3].k.gotoAndPlay("normal");
} else {
path["pocket" + _local3].k.gotoAndPlay("fast");
}
path["pocket" + _local3]._visible = 1;
_local1.speed = 0;
delete _local1.onEnterFrame;
} else {
_local1.speed = Math.sqrt((vball[_local2].f.x * vball[_local2].f.x) + (vball[_local2].f.y * vball[_local2].f.y));
}
if (_local1.speed < MINSPEED) {
vball[_local2].f.x = 0;
vball[_local2].f.y = 0;
check_whiteball();
_local1.speed = 0;
freezenow = false;
if (((_local2 == 0) and (firsthitball == 0)) and (balls_moving == true)) {
call_changeplayer();
balls_moving = false;
delete path.onEnterFrame;
}
delete _local1.onEnterFrame;
}
}
}
function ballMove() {
var _local1 = this;
speedb0 = b0_mc.speed;
var _local2 = _local1.num;
vball[_local2].oldpos = vball[_local2].pos;
vball[_local2].f.x = vball[_local2].f.x * DAMP;
vball[_local2].f.y = vball[_local2].f.y * DAMP;
vball[_local2].pos.x = vball[_local2].pos.x + vball[_local2].f.x;
vball[_local2].pos.y = vball[_local2].pos.y + vball[_local2].f.y;
_local1._x = vball[_local2].pos.x;
_local1._y = vball[_local2].pos.y;
vball[_local2].shadow._x = _local1._x;
vball[_local2].shadow._y = _local1._y;
if ((((_local1._x > RIGHT_CR0) || (_local1._x < LEFT_CR0)) || (_local1._y > BOTTOM_CR0)) || (_local1._y < TOP_CR0)) {
if (inside_cr1(_local1._x, _local1._y)) {
cc_vectors(_local2, 0, 17);
} else if (inside_cr2(_local1._x, _local1._y)) {
cc_vectors(_local2, 1, 4);
} else if (inside_cr3(_local1._x, _local1._y)) {
cc_vectors(_local2, 4, 7);
} else if (inside_cr4(_local1._x, _local1._y)) {
cc_vectors(_local2, 7, 10);
} else if (inside_cr5(_local1._x, _local1._y)) {
cc_vectors(_local2, 10, 13);
} else if (inside_cr6(_local1._x, _local1._y)) {
cc_vectors(_local2, 13, 16);
} else {
if (_local1._x > RIGHT) {
_local1._x = RIGHT;
vball[_local2].shadow._x = RIGHT;
vball[_local2].pos.x = RIGHT;
vball[_local2].f.x = vball[_local2].f.x * NORMALBOUNCE;
_local1.k.c._rotation = (Math.atan2(vball[_local2].f.y, vball[_local2].f.x) / Math.PI) * 180;
if (_local1.speed > 10) {
playsound("bank_hard", 100);
} else {
playsound("bank_soft", 100);
}
} else if (_local1._x < LEFT) {
_local1._x = LEFT;
vball[_local2].shadow._x = LEFT;
vball[_local2].pos.x = LEFT;
vball[_local2].f.x = vball[_local2].f.x * NORMALBOUNCE;
_local1.k.c._rotation = (Math.atan2(vball[_local2].f.y, vball[_local2].f.x) / Math.PI) * 180;
if (_local1.speed > 10) {
playsound("bank_hard", 100);
} else {
playsound("bank_soft", 100);
}
}
if (_local1._y > BOTTOM) {
_local1._y = BOTTOM;
vball[_local2].shadow._y = BOTTOM;
vball[_local2].pos.y = BOTTOM;
vball[_local2].f.y = vball[_local2].f.y * NORMALBOUNCE;
_local1.k.c._rotation = (Math.atan2(vball[_local2].f.y, vball[_local2].f.x) / Math.PI) * 180;
if (_local1.speed > 10) {
playsound("bank_hard", 100);
} else {
playsound("bank_soft", 100);
}
} else if (_local1._y < TOP) {
_local1._y = TOP;
vball[_local2].shadow._y = TOP;
vball[_local2].pos.y = TOP;
vball[_local2].f.y = vball[_local2].f.y * NORMALBOUNCE;
_local1.k.c._rotation = (Math.atan2(vball[_local2].f.y, vball[_local2].f.x) / Math.PI) * 180;
if (_local1.speed > 10) {
playsound("bank_hard", 100);
} else {
playsound("bank_soft", 100);
}
}
}
}
if (holes_mc.hitTest(_local1._x, _local1._y, true)) {
if (inside_cr1(_local1._x, _local1._y)) {
var _local3 = 1;
} else if (inside_cr2(_local1._x, _local1._y)) {
var _local3 = 2;
} else if (inside_cr3(_local1._x, _local1._y)) {
var _local3 = 3;
} else if (inside_cr4(_local1._x, _local1._y)) {
var _local3 = 4;
} else if (inside_cr5(_local1._x, _local1._y)) {
var _local3 = 5;
} else if (inside_cr6(_local1._x, _local1._y)) {
var _local3 = 6;
}
path.last_ch = _local3;
if (_local2 == 0) {
_local1._visible = 0;
sh0._visible = 0;
vball[_local2].pos.x = 5000;
vball[_local2].pos.y = 5000;
_local1.reset = true;
} else {
do_start_rolling(_local2, _local3);
_local1._x = 10000;
_local1._y = Math.random() * 10000;
vball[_local2].shadow._x = _local1._x;
vball[_local2].shadow._y = _local1._y;
vball[_local2].pos.x = 5000;
vball[_local2].pos.y = 5000;
scored_balls.push(_local2);
ani_valid.points = path.smart_score(path.firsthitball, _local2);
if (ani_valid.points > 0) {
ani_valid._x = path["pocket" + _local3]._x;
ani_valid._y = path["pocket" + _local3]._y;
ani_valid.gotoAndPlay(2);
} else if (path["score" + curplayer] > 0) {
path["score" + curplayer] = path["score" + curplayer] - 25;
if (path["score" + curplayer] < 0) {
path["score" + curplayer] = 0;
}
pbox["win" + curplayer].score = path["score" + curplayer];
ani_invalid.points = "-25";
ani_invalid.gotoAndPlay(2);
ani_invalid._x = path["pocket" + last_ch]._x;
ani_invalid._y = path["pocket" + last_ch]._y;
}
}
if (_local2 > 0) {
path["pocket" + _local3].k.num = _local2 + 1;
}
if (_local1.speed <= 5) {
path["pocket" + _local3].k.gotoAndPlay("slow");
} else if ((_local1.speed > 5) and (_local1.speed <= 15)) {
path["pocket" + _local3].k.gotoAndPlay("normal");
} else {
path["pocket" + _local3].k.gotoAndPlay("fast");
}
path["pocket" + _local3]._visible = 1;
_local1.speed = 0;
delete _local1.onEnterFrame;
} else {
_local1.speed = Math.sqrt((vball[_local2].f.x * vball[_local2].f.x) + (vball[_local2].f.y * vball[_local2].f.y));
path.adapt(int(_local1.speed), _local1._name);
}
if (_local1.speed < MINSPEED) {
vball[_local2].f.x = 0;
vball[_local2].f.y = 0;
_local1.speed = 0;
if (_local2 == 0) {
check_whiteball();
}
if (((_local2 == 0) and (firsthitball == 0)) and (balls_moving == true)) {
call_changeplayer();
balls_moving = false;
delete path.onEnterFrame;
}
delete _local1.onEnterFrame;
}
}
function cc_otherballs() {
var len = balls.length;
var i = 0;
while (i < (len - 1)) {
var _local1 = balls[i];
var _local2 = i + 1;
while (_local2 < len) {
var _local3 = balls[_local2];
var dx = (_local1._x - _local3._x);
var dy = (_local1._y - _local3._y);
var dist_cc = Math.sqrt((dx * dx) + (dy * dy));
if (((dist_cc < BALL_DIAMETER) and (dist_cc > 0)) || ((_local1.through == true) and (_local3 == firsthitball_whiteball_cc))) {
if (_local1.through) {
_local1.through = false;
}
if ((((vball[i].f.x != 0) || (vball[i].f.y != 0)) || (vball[_local2].f.x != 0)) || (vball[_local2].f.y != 0)) {
first_fx = vball[0].f.x;
first_fy = vball[0].f.y;
first_xpos = _local1._x;
second_xpos = _local3._x;
var angle = Math.atan2(dy, dx);
var cosa = Math.cos(angle);
var sina = Math.sin(angle);
_local1._x = _local3._x + (cosa * BALL_DIAMETER);
_local1._y = _local3._y + (sina * BALL_DIAMETER);
vball[i].shadow._x = _local1._x;
vball[i].shadow._y = _local1._y;
vball[i].pos.x = _local1._x;
vball[i].pos.y = _local1._y;
var vx2 = ((cosa * vball[i].f.x) + (sina * vball[i].f.y));
var vy1 = ((cosa * vball[i].f.y) - (sina * vball[i].f.x));
var vx1 = ((cosa * vball[_local2].f.x) + (sina * vball[_local2].f.y));
var vy2 = ((cosa * vball[_local2].f.y) - (sina * vball[_local2].f.x));
vball[i].f.x = (cosa * vx1) - (sina * vy1);
vball[i].f.y = (cosa * vy1) + (sina * vx1);
vball[_local2].f.x = (cosa * vx2) - (sina * vy2);
vball[_local2].f.y = (cosa * vy2) + (sina * vx2);
second_fx = vball[_local2].f.x;
second_fy = vball[_local2].f.y;
if (_local1.num == 0) {
if (first_xpos > second_xpos) {
if (((((((first_fx < 0) && (first_fy < 0)) && (second_fx > 0)) && (second_fy < 0)) || ((((first_fx < 0) && (first_fy > 0)) && (second_fx > 0)) && (second_fy > 0))) || ((((first_fx > 0) && (first_fy > 0)) && (second_fx > 0)) && (second_fy < 0))) || ((((first_fx > 0) && (first_fy < 0)) && (second_fx > 0)) && (second_fy > 0))) {
vball[_local2].f.x = vball[_local2].f.x * -1;
vball[_local2].f.y = vball[_local2].f.y * -1;
}
} else if (first_xpos < second_xpos) {
if (((((((first_fx < 0) && (first_fy < 0)) && (second_fx < 0)) && (second_fy > 0)) || ((((first_fx < 0) && (first_fy > 0)) && (second_fx < 0)) && (second_fy < 0))) || ((((first_fx > 0) && (first_fy > 0)) && (second_fx < 0)) && (second_fy > 0))) || ((((first_fx > 0) && (first_fy < 0)) && (second_fx < 0)) && (second_fy < 0))) {
vball[_local2].f.x = vball[_local2].f.x * -1;
vball[_local2].f.y = vball[_local2].f.y * -1;
}
}
}
if (firsthitball == 0) {
if (_local1.num == 0) {
vball[0].f.x = vball[0].f.x + (engl_draw * first_fx);
vball[0].f.y = vball[0].f.y + (engl_draw * first_fy);
if (_local1._x < _local3._x) {
if (_local1._y < _local3._y) {
vball[0].f.x = vball[0].f.x - (engl_side * b0_mc.speed);
vball[0].f.y = vball[0].f.y + (engl_side * b0_mc.speed);
} else if (_local1._y > _local3._y) {
vball[0].f.x = vball[0].f.x + (engl_side * b0_mc.speed);
vball[0].f.y = vball[0].f.y + (engl_side * b0_mc.speed);
} else {
vball[0].f.y = vball[0].f.y + (engl_side * b0_mc.speed);
}
} else if (_local1._x > _local3._x) {
if (_local1._y < _local3._y) {
vball[0].f.x = vball[0].f.x - (engl_side * b0_mc.speed);
vball[0].f.y = vball[0].f.y - (engl_side * b0_mc.speed);
} else if (_local1._y > _local3._y) {
vball[0].f.x = vball[0].f.x + (engl_side * b0_mc.speed);
vball[0].f.y = vball[0].f.y - (engl_side * b0_mc.speed);
} else {
vball[0].f.y = vball[0].f.y - (engl_side * b0_mc.speed);
}
}
firsthitball = _local3.num;
if (firsthitball != kugeln[0]) {
}
}
}
_local1.k.c._rotation = (Math.atan2(vball[i].f.y, vball[i].f.x) / Math.PI) * 180;
_local3.k.c._rotation = (Math.atan2(vball[_local2].f.y, vball[_local2].f.x) / Math.PI) * 180;
_local1.onEnterFrame = ballMove;
_local3.onEnterFrame = ballMove;
if ((_local1.speed > 10) || (_local3.speed > 10)) {
playsound("ball_loud", 100);
} else {
playsound("ball_quiet", 100);
}
}
}
_local2++;
}
i++;
}
if (balls_moving and (firsthitball != 0)) {
speedsum = ((((((((balls[0].speed + balls[1].speed) + balls[2].speed) + balls[3].speed) + balls[4].speed) + balls[5].speed) + balls[6].speed) + balls[7].speed) + balls[8].speed) + balls[9].speed;
if (speedsum == 0) {
balls_moving = false;
freezenow = false;
delete path.onEnterFrame;
if (scored_balls.length > 0) {
scoring(firsthitball);
} else {
call_changeplayer();
}
}
}
}
function cc_otherballs_ghost(bc_i) {
var _local2 = bc_i;
var len = balls.length;
var i = 1;
while (i < len) {
var _local1 = balls[i];
var dx = (bc[_local2].x - _local1._x);
var dy = (bc[_local2].y - _local1._y);
var dist_cc = Math.sqrt((dx * dx) + (dy * dy));
if (dist_cc < BALL_DIAMETER) {
var dx_ccg = (b0mcx - _local1._x);
var dy_ccg = (b0mcy - _local1._y);
ccg_dist = Math.sqrt((dx_ccg * dx_ccg) + (dy_ccg * dy_ccg));
var _local3 = 0;
while (_local3 < 50) {
ccg_dist--;
bc[_local2].x = b0mcx - (Math.cos(angle) * (ccg_dist * -1));
bc[_local2].y = b0mcy - (Math.sin(angle) * (ccg_dist * -1));
var dx = (bc[_local2].x - _local1._x);
var dy = (bc[_local2].y - _local1._y);
var dist_cc = Math.sqrt((dx * dx) + (dy * dy));
if (dist_cc > BALL_DIAMETER) {
stepback = _local3;
break;
}
_local3++;
}
var angle = Math.atan2(dy, dx);
var cosa = Math.cos(angle);
var sina = Math.sin(angle);
bci_fx = bc[_local2].x - b0mcx;
bci_fy = bc[_local2].y - b0mcy;
var vx2 = ((cosa * bci_fx) + (sina * bci_fy));
var vy1 = ((cosa * bci_fy) - (sina * bci_fx));
var vx1 = ((cosa * 0) + (sina * 0));
var vy2 = ((cosa * 0) - (sina * 0));
bci_fx = (cosa * vx1) - (sina * vy1);
bci_fy = (cosa * vy1) + (sina * vx1);
blc_fx = (cosa * vx2) - (sina * vy2);
blc_fy = (cosa * vy2) + (sina * vx2);
blc_x = _local1._x;
blc_y = _local1._y;
if (_local1.num == kugeln[0]) {
nextglass.glow._visible = 1;
} else {
nextglass.glow._visible = 0;
}
firsthitball_whiteball_cc = _local1;
return(true);
}
i++;
}
return(undefined);
}
function whiteball_cc(firsthitball_whiteball_cc) {
if (freezenow != true) {
var _local2 = b0_mc._x - ghost_mc._x;
var _local1 = b0_mc._y - ghost_mc._y;
dist_fc = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
if ((vball[0].pos.x - ghost_mc._x) < 0) {
dx_start = -1;
} else {
dx_start = 1;
}
if ((vball[0].pos.y - ghost_mc._y) < 0) {
dy_start = -1;
} else {
dy_start = 1;
}
freezenow = true;
}
if ((vball[0].pos.x - ghost_mc._x) < 0) {
var _local3 = -1;
} else {
var _local3 = 1;
}
if ((vball[0].pos.y - ghost_mc._y) < 0) {
var dy_cur = -1;
} else {
var dy_cur = 1;
}
if (((_local3 != dx_start) || (dy_cur != dy_start)) || (dist_fc <= 2)) {
b0_mc._x = ghost_mc._x;
b0_mc._y = ghost_mc._y;
vball[0].pos.x = b0_mc._x;
vball[0].pos.y = b0_mc._y;
vball[0].shadow._x = b0_mc._x;
vball[0].shadow._y = b0_mc._y;
return(true);
}
return(undefined);
}
function cc_vectors(num, startloop, endloop) {
var _local1 = num;
var _local2 = endloop;
var _local3 = startloop;
bounce = false;
i = _local3;
while (i <= _local2) {
distance = ((vball[_local1].pos.x * bLine[i].normal.x) + (vball[_local1].pos.y * bLine[i].normal.y)) + bLine[i].d;
if (distance < 0) {
if (bLine[i].dis >= 0) {
scale = distance / (bLine[i].dis - distance);
x_inters = vball[_local1].pos.x + (vball[_local1].f.x * scale);
y_inters = vball[_local1].pos.y + (vball[_local1].f.y * scale);
if ((((x_inters - bLine[i].midx) * (x_inters - bLine[i].midx)) + ((y_inters - bLine[i].midy) * (y_inters - bLine[i].midy))) <= bLine[i].l) {
playsound("bank_soft", 100);
vball[_local1].pos.x = x_inters;
vball[_local1].pos.y = y_inters;
path[("b" + _local1) + "_mc"]._x = vball[_local1].pos.x;
path[("b" + _local1) + "_mc"]._y = vball[_local1].pos.y;
path["sh" + _local1]._x = vball[_local1].pos.x;
path["sh" + _local1]._y = vball[_local1].pos.y;
bounce = true;
CalculateBounce(i, _local1);
balls[_local1].k.c._rotation = (Math.atan2(vball[_local1].f.y, vball[_local1].f.x) / Math.PI) * 180;
}
}
}
bLine[i].dis = distance;
i++;
}
}
function CalculateBounce(i, num) {
var _local2 = num;
var _local3 = DotProduct(bLine[i].normal, vball[_local2].f);
var _local1 = ScaleVector(bLine[i].normal, _local3);
var Vt = VectorDifference(vball[_local2].f, _local1);
_local1 = ScaleVector(_local1, bLine[i].bounce);
vball[_local2].f = VectorDifference(Vt, _local1);
}
function inside_cr1(x, y) {
if ((((x < RIGHT_CR1) && (x > LEFT_CR1)) && (y < BOTTOM_CR1)) and (y > TOP_CR1)) {
return(true);
}
}
function inside_cr2(x, y) {
if ((((x < RIGHT_CR2) && (x > LEFT_CR2)) && (y < BOTTOM_CR2)) and (y > TOP_CR2)) {
return(true);
}
}
function inside_cr3(x, y) {
if ((((x < RIGHT_CR3) && (x > LEFT_CR3)) && (y < BOTTOM_CR3)) and (y > TOP_CR3)) {
return(true);
}
}
function inside_cr4(x, y) {
if ((((x < RIGHT_CR4) && (x > LEFT_CR4)) && (y < BOTTOM_CR4)) and (y > TOP_CR4)) {
return(true);
}
}
function inside_cr5(x, y) {
if ((((x < RIGHT_CR5) && (x > LEFT_CR5)) && (y < BOTTOM_CR5)) and (y > TOP_CR5)) {
return(true);
}
}
function inside_cr6(x, y) {
if ((((x < RIGHT_CR6) && (x > LEFT_CR6)) && (y < BOTTOM_CR6)) and (y > TOP_CR6)) {
return(true);
}
}
function start_aim() {
if (msg_popup_visible != true) {
if (kugeln.length > 0) {
engl_draw = 0;
engl_side = 0;
pbox.nextglass_english.english_mc.anspiel._x = pbox.nextglass_english.english_mc.anspiel.reset_x;
pbox.nextglass_english.english_mc.anspiel._y = pbox.nextglass_english.english_mc.anspiel.reset_y;
if (b0_mc.reset) {
b0_mc.reset = false;
b0_mc._x = posline._x;
b0_mc._y = balls_starty + 225;
var _local1 = 0;
while (_local1 <= 9) {
vball[_local1].pos.x = vball[_local1].prevpos.x;
vball[_local1].pos.y = vball[_local1].prevpos.y;
var _local2 = path[("b" + _local1) + "_mc"];
_local2._x = vball[_local1].pos.x;
_local2._y = vball[_local1].pos.y;
_local2.k.c.gotoAndStop(vball[_local1].kcframe);
_local2.k.c._rotation = vball[_local1].kcrotation;
vball[_local1].shadow._x = vball[_local1].pos.x;
vball[_local1].shadow._y = vball[_local1].pos.y;
_local1++;
}
var _local3 = 0;
while (_local3 < scored_balls.length) {
var _local2 = path.roller["rb" + (Number(scored_balls[_local3]) + 1)];
_local2.speedx = -4;
_local2._x = 122;
_local2.framecount = 0;
_local2.kreuz.gotoAndStop(1);
path.roller[("rb" + (Number(scored_balls[_local3]) + 1)) + "invalid"] = false;
delete _local2.onEnterFrame;
balls_sinked--;
_local3++;
}
}
vball[0].pos.x = b0_mc._x;
vball[0].pos.y = b0_mc._y;
vball[0].shadow._x = b0_mc._x;
vball[0].shadow._y = b0_mc._y;
b0_mc._visible = 1;
sh0._visible = 1;
scored_balls = [];
var _local1 = 0;
while (_local1 <= 9) {
vball[_local1].prevpos.x = vball[_local1].pos.x;
vball[_local1].prevpos.y = vball[_local1].pos.y;
vball[_local1].kcframe = path[("b" + _local1) + "_mc"].k.c._currentframe;
vball[_local1].kcrotation = path[("b" + _local1) + "_mc"].k.c._rotation;
_local1++;
}
b0mcx = b0_mc._x;
b0mcy = b0_mc._y;
engl_draw = 0;
engl_side = 0;
nextglass_english.english_mc.anspiel._x = 0;
nextglass_english.english_mc.anspiel._y = 0;
stick_mc._visible = 1;
stick_mc.onEnterFrame = aim;
wl._visible = 1;
wl_bounce._visible = 1;
ghost_mc._visible = 1;
mark_currentball();
mark_crosshair();
}
}
}
function newposition() {
var _local1 = this;
if (white_pressed) {
_local1._y = _ymouse;
vball[0].shadow._y = _local1._y;
if (_local1._y < (TOP + 1)) {
_local1._y = TOP + 1;
vball[0].pos.y = TOP + 1;
vball[0].shadow._y = _local1._y;
}
if (_local1._y > (BOTTOM - 1)) {
_local1._y = BOTTOM - 1;
vball[0].pos.y = BOTTOM - 1;
vball[0].shadow._y = _local1._y;
}
}
whiteaura._x = b0_mc._x;
whiteaura._y = b0_mc._y;
}
function sortballs() {
var _local2 = -8 + random(16);
vball = new Array();
balls_pos = [[0, 0], [322, 225], [360, 253], [360, 197], [398, 225], [341, 239], [341, 211], [379, 239], [379, 211], [360, 225]];
var _local1 = 0;
while (_local1 < balls_pos.length) {
vball[_local1] = new ballobject();
vball[_local1].pos.x = (balls_startx + balls_pos[_local1][0]) + _local2;
vball[_local1].pos.y = balls_starty + balls_pos[_local1][1];
vball[_local1].prevpos.x = vball[_local1].pos.x;
vball[_local1].prevpos.y = vball[_local1].pos.y;
vball[_local1].f.x = 0;
vball[_local1].f.y = 0;
path[("b" + _local1) + "_mc"]._x = vball[_local1].pos.x;
path[("b" + _local1) + "_mc"]._y = vball[_local1].pos.y;
path[("b" + _local1) + "_mc"].gotoAndStop(_local1);
path[("b" + _local1) + "_mc"].k.c.gotoAndStop(10);
vball[_local1].kcframe = path[("b" + _local1) + "_mc"].k.c._currentframe;
path[("b" + _local1) + "_mc"].k.c._rotation = 0;
vball[_local1].kcrotation = path[("b" + _local1) + "_mc"].k.c._rotation;
path[("b" + _local1) + "_mc"].num = _local1;
_local1++;
}
vball[0].pos.x = posline._x;
vball[0].pos.y = balls_starty + 225;
b0_mc._x = posline._x;
b0_mc._y = balls_starty + 225;
_local1 = 0;
while (_local1 < 10) {
vball[_local1].shadow = shadows[_local1];
shadows[_local1]._x = vball[_local1].pos.x;
shadows[_local1]._y = vball[_local1].pos.y;
_local1++;
}
_local1 = 1;
while (_local1 <= 6) {
path["pocket" + _local1]._visible = 0;
_local1++;
}
bc = [];
_local1 = 0;
while (_local1 <= 150) {
bc[_local1] = [];
bc[_local1].x = 0;
bc[_local1].y = 0;
_local1++;
}
}
function mark_currentball() {
kugelnroot = kugeln;
trace("MARK CURRENTBALL " + kugeln[0]);
if (pbox.nextglass.nextkugel.kugelcurrent != kugeln[0]) {
pbox.nextglass.nextkugel.kugelcurrent = kugeln[0];
pbox.nextglass.nextkugel.gotoAndPlay(2);
}
}
function mark_crosshair() {
crosshair._x = path[("b" + kugeln[0]) + "_mc"]._x;
crosshair._y = path[("b" + kugeln[0]) + "_mc"]._y;
crosshair.gotoAndPlay(2);
}
function aim() {
var _local3 = this;
if ((_ymouse > 100) or ((_xmouse < 350) or (_xmouse > 450))) {
if (whiteball_roll != true) {
stick_mc._visible = 1;
wl._visible = 1;
wl_bounce._visible = 1;
ghost_mc._visible = 1;
var _local2 = b0_mc._x - _xmouse;
var _local1 = b0_mc._y - _ymouse;
angle = Math.atan2(_local1, _local2);
_local3._x = b0_mc._x;
_local3._y = b0_mc._y;
_local3._rotation = (angle * 180) / Math.PI;
update_wl();
}
} else {
stick_mc._visible = 0;
wl._visible = 0;
wl_bounce._visible = 0;
ghost_mc._visible = 0;
wl_bounce_n._visible = 0;
}
}
function shoot() {
var _local1 = this;
var _local3 = b0_mc._x - _xmouse;
var _local2 = b0_mc._y - _ymouse;
dist = Math.sqrt((_local3 * _local3) + (_local2 * _local2)) - distance_now;
pbox["win" + curplayer].powerbar.gotoAndStop(int(dist) / 2);
if (dist > 100) {
dist = 100;
pbox["win" + curplayer].powerbar.gotoAndStop(50);
}
if (dist < 0) {
dist = 0;
pbox["win" + curplayer].powerbar.gotoAndStop(1);
}
_local1._x = b0_mc._x - (Math.cos(angle) * dist);
_local1._y = b0_mc._y - (Math.sin(angle) * dist);
_local1.vx = _local1._x - oldx;
_local1.vy = _local1._y - oldy;
}
function update_wl() {
if (angle_old != angle) {
angle_old = angle;
var _local1 = 1;
while (_local1 <= 150) {
bc[_local1].x = b0mcx - (Math.cos(angle) * ((_local1 * 5.5) * -1));
bc[_local1].y = b0mcy - (Math.sin(angle) * ((_local1 * 5.5) * -1));
if (cc_otherballs_ghost(_local1)) {
break;
}
if (bc[_local1].y > BOTTOM) {
bc[_local1].y = BOTTOM;
bc[_local1].x = b0mcx + ((bc[1].x - b0mcx) * ((BOTTOM - b0mcy) / (bc[1].y - b0mcy)));
break;
}
if (bc[_local1].y < TOP) {
bc[_local1].y = TOP;
bc[_local1].x = b0mcx + ((bc[1].x - b0mcx) * ((TOP - b0mcy) / (bc[1].y - b0mcy)));
break;
}
if (bc[_local1].x > RIGHT) {
bc[_local1].x = RIGHT;
bc[_local1].y = b0mcy + ((bc[1].y - b0mcy) * ((RIGHT - b0mcx) / (bc[1].x - b0mcx)));
break;
}
if (bc[_local1].x < LEFT) {
bc[_local1].x = LEFT;
bc[_local1].y = b0mcy + ((bc[1].y - b0mcy) * ((LEFT - b0mcx) / (bc[1].x - b0mcx)));
break;
}
nextglass.glow._visible = 0;
firsthitball_whiteball_cc = 0;
_local1++;
}
steps = _local1;
ghost_mc._x = bc[_local1].x;
ghost_mc._y = bc[_local1].y;
ghost_mc._visible = 1;
wl._x = b0_mc._x;
wl._y = b0_mc._y;
wl._xscale = ghost_mc._x - b0_mc._x;
wl._yscale = ghost_mc._y - b0_mc._y;
wl._visible = 1;
wl_bounce._x = ghost_mc._x;
wl_bounce._y = ghost_mc._y;
if ((ghost_mc._x == RIGHT) || (ghost_mc._x == LEFT)) {
if ((((((!inside_cr1(ghost_mc._x, ghost_mc._y)) && (!inside_cr2(ghost_mc._x, ghost_mc._y))) && (!inside_cr3(ghost_mc._x, ghost_mc._y))) && (!inside_cr4(ghost_mc._x, ghost_mc._y))) && (!inside_cr5(ghost_mc._x, ghost_mc._y))) && (!inside_cr6(ghost_mc._x, ghost_mc._y))) {
wl_bounce._rotation = (Math.atan2(bc[1].y - b0mcy, (bc[1].x - b0mcx) * -1) / Math.PI) * 180;
wl_bounce._visible = 1;
} else {
wl_bounce._visible = 0;
}
wl_bounce_n._visible = 0;
} else if ((ghost_mc._y == BOTTOM) || (ghost_mc._y == TOP)) {
if ((((((!inside_cr1(ghost_mc._x, ghost_mc._y)) && (!inside_cr2(ghost_mc._x, ghost_mc._y))) && (!inside_cr3(ghost_mc._x, ghost_mc._y))) && (!inside_cr4(ghost_mc._x, ghost_mc._y))) && (!inside_cr5(ghost_mc._x, ghost_mc._y))) && (!inside_cr6(ghost_mc._x, ghost_mc._y))) {
wl_bounce._rotation = (Math.atan2((bc[1].y - b0mcy) * -1, bc[1].x - b0mcx) / Math.PI) * 180;
wl_bounce._visible = 1;
} else {
wl_bounce._visible = 0;
}
wl_bounce_n._visible = 0;
} else {
wl_bounce._rotation = (Math.atan2(bci_fy, bci_fx) / Math.PI) * 180;
wl_bounce._visible = 1;
wl_bounce_n._x = blc_x;
wl_bounce_n._y = blc_y;
wl_bounce_n._visible = 1;
wl_bounce_n._rotation = (Math.atan2(blc_fy, blc_fx) / Math.PI) * 180;
}
}
}
function smart_score(first, second) {
if ((first == kugeln[0]) and (b0_mc.reset != true)) {
return(path.points_valid[second]);
}
}
function scoring(first) {
trace("scored balls:" + scored_balls);
if ((first == kugeln[0]) and (b0_mc.reset != true)) {
var _local3 = 0;
while (_local3 < scored_balls.length) {
var _local1 = 0;
while (_local1 < kugeln.length) {
if ((scored_balls[_local3] == kugeln[_local1]) && (scored_balls[_local3] != 9)) {
kugeln.splice(_local1, 1);
path["score" + curplayer] = path["score" + curplayer] + path.points_valid[scored_balls[_local3]];
pbox["win" + curplayer].score = path["score" + curplayer];
}
_local1++;
}
_local3++;
}
var scored_balls_9_valid = false;
_local3 = 0;
while (_local3 < scored_balls.length) {
if ((scored_balls[_local3] == 9) and (b0_mc.reset != true)) {
scored_balls_9_valid = true;
path["score" + curplayer] = path["score" + curplayer] + path.points_valid[scored_balls[_local3]];
pbox["win" + curplayer].score = path["score" + curplayer];
delete path.onEnterFrame;
stopall_moves();
path.playertimer1.running = false;
path.playertimer2.running = false;
trace("9 regelgerecht eingelocht");
if (gamemode == 1) {
trace("ende 1-spielermodus --> highscore");
msg_stats.gotoAndStop(3);
msg_stats._visible = true;
} else if (gamemode == 2) {
trace("ende 2-spielermodus");
if (curplayer == 1) {
msg_stats.gotoAndStop(5);
msg_stats._visible = true;
} else if (curplayer == 2) {
msg_stats.gotoAndStop(6);
msg_stats._visible = true;
}
}
}
_local3++;
}
if (scored_balls_9_valid == false) {
start_aim();
}
} else {
var _local3 = 0;
while (_local3 < scored_balls.length) {
var _local1 = 0;
while (_local1 < kugeln.length) {
if (((scored_balls[_local3] == kugeln[_local1]) and (scored_balls[_local3] != 9)) and (kugeln[_local1] != 9)) {
kugeln.splice(_local1, 1);
roller[("rb" + (Number(scored_balls[_local3]) + 1)) + "invalid"] = true;
}
_local1++;
}
_local3++;
}
var scored_balls_9_invalid = false;
_local3 = 0;
while (_local3 < scored_balls.length) {
if (scored_balls[_local3] == 9) {
scored_balls_9_invalid = true;
trace("9 nicht regelgerecht!");
delete path.onEnterFrame;
stopall_moves();
path.playertimer1.running = false;
path.playertimer2.running = false;
if (gamemode == 1) {
trace("ende 1-spielermodus --> ende des spieles kein highscore");
msg_stats.gotoAndStop(4);
msg_stats._visible = true;
} else if (gamemode == 2) {
trace("ende 2-spielermodus");
if (curplayer == 1) {
msg_stats.gotoAndStop(6);
msg_stats._visible = true;
} else if (curplayer == 2) {
msg_stats.gotoAndStop(5);
msg_stats._visible = true;
}
}
}
_local3++;
}
if (scored_balls_9_invalid == false) {
if (b0_mc.reset != true) {
playsound("buzzer", 100);
call_changeplayer();
} else {
var tiltx = (balls_startx + 0);
var _local2 = balls_starty + 225;
t = 0;
while (t < 50) {
var hitany = 0;
var _local1 = 1;
while (_local1 <= 9) {
if (balls[_local1].hitTest(tiltx, _local2, true)) {
hitany = 1;
}
_local1++;
}
if (hitany) {
_local2 = _local2 - (BALL_DIAMETER + 5);
if (_local2 < TOP) {
_local2 = balls_starty + 225;
tiltx = tiltx + (BALL_DIAMETER + 5);
}
} else {
break;
}
t++;
}
b0_mc._x = tiltx;
b0_mc._y = _local2;
vball[0].pos.x = tiltx;
vball[0].pos.y = _local2;
b0_mc.reset = false;
b0_mc._visible = true;
playsound("buzzer", 100);
call_changeplayer();
}
}
}
roller.update_crosses();
}
function playsoundloop(son, vol) {
path[son].start(0, 1000);
path[son].setVolume(vol);
}
function playsound(son, vol) {
path[son].start(0, 1);
path[son].setVolume(vol);
}
function stopsound(son) {
path[son].stop();
}
onMouseDown = function () {
if ((stick_mc._visible == true) && (button_rollover != true)) {
firsthitball = 0;
var _local2 = b0_mc._x - _xmouse;
var _local1 = b0_mc._y - _ymouse;
distance_now = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
if (distance_now > 10) {
oldx = b0_mc._x;
oldy = b0_mc._y;
stick_mc.onEnterFrame = shoot;
shooting = true;
wl._visible = 0;
wl_bounce._visible = 0;
wl_bounce_n._visible = 0;
ghost_mc._visible = 0;
posline._visible = 0;
b0_mc.wb_con._visible = 0;
}
}
};
onMouseUp = function () {
if (((stick_mc._visible == true) && (shooting == true)) && (button_rollover != true)) {
if (dist > 0) {
balls_moving = true;
vball[0].f.x = (stick_mc.vx * -1) / 3.5;
vball[0].f.y = (stick_mc.vy * -1) / 3.5;
b0_mc.onEnterFrame = ballMove_whiteball_cc;
shooting = false;
pbox["win" + curplayer].powerbar.gotoAndStop(1);
delete stick_mc.onEnterFrame;
stick_mc._visible = 0;
if (dist < 20) {
playsound("queue_soft", 100);
} else {
playsound("queue_hard", 100);
}
starttimea = getTimer();
} else {
stick_mc.onEnterFrame = aim;
wl._visible = 1;
wl_bounce._visible = 1;
ghost_mc._visible = 1;
}
}
};
path.createEmptyMovieClip("s1", 10001);
applause = new Sound(s1);
applause.attachSound("applause.wav");
path.createEmptyMovieClip("s2", 10002);
ball_loud = new Sound(s2);
ball_loud.attachSound("ball_loud.wav");
path.createEmptyMovieClip("s3", 10003);
ball_quiet = new Sound(s3);
ball_quiet.attachSound("ball_quiet.wav");
path.createEmptyMovieClip("s4", 10004);
bank_hard = new Sound(s4);
bank_hard.attachSound("bank_hard.wav");
path.createEmptyMovieClip("s5", 10005);
bank_soft = new Sound(s5);
bank_soft.attachSound("bank_soft.wav");
path.createEmptyMovieClip("s6", 10006);
bell = new Sound(s6);
bell.attachSound("bell.wav");
path.createEmptyMovieClip("s7", 10007);
final = new Sound(s7);
final.attachSound("final.wav");
path.createEmptyMovieClip("s8", 10008);
pocket = new Sound(s8);
pocket.attachSound("pocket.wav");
path.createEmptyMovieClip("s9", 10009);
queue_hard = new Sound(s9);
queue_hard.attachSound("queue_hard.wav");
path.createEmptyMovieClip("s10", 10010);
queue_soft = new Sound(s10);
queue_soft.attachSound("queue_soft.wav");
path.createEmptyMovieClip("s11", 10011);
roehre = new Sound(s11);
roehre.attachSound("roehre.wav");
path.createEmptyMovieClip("s12", 10012);
rolling_sound = new Sound(s12);
rolling_sound.attachSound("rolling_sound.wav");
path.createEmptyMovieClip("s13", 10013);
strafe = new Sound(s13);
strafe.attachSound("strafe.wav");
path.createEmptyMovieClip("s14", 10014);
tick = new Sound(s14);
tick.attachSound("tick.wav");
path.createEmptyMovieClip("s15", 10015);
buzzer = new Sound(s15);
buzzer.attachSound("buzzer.wav");
path.createEmptyMovieClip("s16", 10016);
blip = new Sound(s16);
blip.attachSound("blip.wav");
path.createEmptyMovieClip("s17", 10017);
ingamesound = new Sound(s17);
ingamesound.attachSound("ingamesound.wav");
path.createEmptyMovieClip("s18", 10018);
introsound = new Sound(s18);
introsound.attachSound("introsound.wav");
Frame 4
SetupWalls();
Frame 5
wl.removeMovieClip();
wl_bounce_n.removeMovieClip();
wl_bounce.removeMovieClip();
path.attachMovie("msg_stats", "msg_stats", 1000);
msg_stats._x = 405;
msg_stats._y = 250;
msg_stats._visible = false;
path.attachMovie("msg_popup", "msg_popup", 1001);
msg_popup._x = 270;
msg_popup._y = 180;
msg_popup._visible = false;
path.attachMovie("msg_turn", "msg_turn", 1002);
msg_turn._x = 270;
msg_turn._y = 265;
msg_turn._visible = true;
pbox._visible = false;
stopsound("ingamesound");
ingamesound_running = false;
if (!soundmute) {
if (introsound_running == false) {
introsound_running = true;
playsoundloop("introsound", 60);
}
}
stop();
Instance of Symbol 193 MovieClip in Frame 5
onClipEvent (load) {
function exec() {
_root.gotoAndPlay("help");
}
textv = "TUTORIAL";
}
Instance of Symbol 193 MovieClip in Frame 5
onClipEvent (load) {
function exec() {
path.gamemode = 1;
path.msg_stats._visible = true;
path.msg_stats.gotoAndStop(2);
path.gotoAndStop("clear");
}
textv = "1-PLAYER";
if (path.come_from_playnow) {
path.come_from_playnow = false;
exec();
}
}
Instance of Symbol 193 MovieClip in Frame 5
onClipEvent (load) {
function exec() {
path.gotoAndStop("hs_show");
}
textv = "HIGHSCORES";
}
Instance of Symbol 193 MovieClip in Frame 5
onClipEvent (load) {
function exec() {
path.gamemode = 2;
trace(path.gamemode);
path.msg_stats._visible = true;
path.msg_stats.gotoAndStop(2);
path.gotoAndStop("clear");
}
textv = "2-PLAYER";
}
Instance of Symbol 285 MovieClip "playertimer1" in Frame 5
onClipEvent (load) {
function reset() {
starttime = getTimer();
timeold = starttime;
running = true;
path.pbox.win1.timetxt = path.min_format(time_elapsed);
}
function checksec() {
if ((timeold + 1000) < getTimer()) {
timeold = getTimer();
time_elapsed++;
path.pbox.win1.timetxt = path.min_format(time_elapsed);
}
}
running = false;
time_elapsed = 0;
path.pbox.win1.timetxt = path.min_format(time_elapsed);
}
onClipEvent (enterFrame) {
if (running) {
checksec();
}
}
Instance of Symbol 285 MovieClip "playertimer2" in Frame 5
onClipEvent (load) {
function reset() {
starttime = getTimer();
timeold = starttime;
running = true;
path.pbox.win2.timetxt = path.min_format(time_elapsed);
}
function checksec() {
if ((timeold + 1000) < getTimer()) {
timeold = getTimer();
time_elapsed++;
path.pbox.win2.timetxt = path.min_format(time_elapsed);
}
}
running = false;
time_elapsed = 0;
path.pbox.win2.timetxt = path.min_format(time_elapsed);
}
onClipEvent (enterFrame) {
if (running) {
checksec();
}
}
Frame 10
stop();
Frame 15
function call_changeplayer() {
if (gamemode == 1) {
start_aim();
} else if (gamemode == 2) {
if (curplayer == 1) {
curplayer = 2;
msg_turn.textv = nick2 + "'s turn";
msg_turn.gotoAndPlay(2);
pbox.win1.glow.gotoAndStop(1);
pbox.win2.glow.gotoAndPlay(2);
playertimer2.reset();
playertimer1.running = false;
playsound("bell", 50);
} else {
curplayer = 1;
msg_turn.textv = nick1 + "'s turn";
msg_turn.gotoAndPlay(2);
pbox.win2.glow.gotoAndStop(1);
pbox.win1.glow.gotoAndPlay(2);
playertimer1.reset();
playertimer2.running = false;
playsound("bell", 50);
}
start_aim();
}
}
function start_round() {
if (location_v == "club") {
bg_location.gotoAndStop(1);
} else {
bg_location.gotoAndStop(2);
}
wl._visible = false;
wl_bounce_n._visible = false;
wl_bounce._visible = false;
msg_popup._visible = false;
msg_info._visible = false;
msg_stats._visible = false;
stick_mc.queue.onPress = nothing;
stick_mc.queue.useHandCursor = false;
kugeln = [1, 2, 3, 4, 5, 6, 7, 8, 9];
scored_balls = [];
balls_sinked = 0;
fault_start = 0;
last_sinked = 0;
roll_current = 0;
firsthitball = 0;
sortballs();
b0_mc.wb_con._visible = 1;
mark_currentball();
white_pressed = false;
stick_mc._visible = 1;
posline._visible = 1;
whiteaura._x = b0_mc._x;
whiteaura._y = b0_mc._y;
playertimer1.time_elapsed = 0;
playertimer2.time_elapsed = 0;
playertimer1.running = false;
playertimer2.running = false;
pbox.win1.timetxt = min_format(playertimer1.time_elapsed);
pbox.win2.timetxt = min_format(playertimer2.time_elapsed);
if (gamemode == 1) {
playertimer1.reset();
pbox.win1.nick = nick1;
pbox.win1.score = 0;
pbox.win1._visible = true;
pbox.win2._visible = false;
curplayer = 1;
score1 = 0;
pbox.win1.glow.gotoAndStop(1);
pbox.win2.glow.gotoAndStop(1);
} else if (gamemode == 2) {
pbox.win1._visible = true;
pbox.win2._visible = true;
playertimer1.reset();
pbox.win1.nick = nick1;
pbox.win2.nick = nick2;
pbox.win1.score = 0;
pbox.win2.score = 0;
curplayer = 1;
score1 = 0;
score2 = 0;
pbox.win1.glow.gotoAndPlay(2);
pbox.win2.glow.gotoAndStop(1);
msg_turn.textv = nick1 + " begins!";
msg_turn.gotoAndPlay(2);
}
start_aim();
}
function do_final() {
stopall_moves();
playsound("final", 100);
b0_mc.wb_con._visible = 0;
delete path.stick_mc.onEnterFrame;
delete path.onEnterFrame;
stick_mc._visible = 0;
button_beenden_pressed = true;
wl._visible = 0;
wl_bounce._visible = 0;
wl_bounce_n._visible = 0;
ghost_mc._visible = 0;
}
stopsound("introsound");
introsound_running = false;
if (!soundmute) {
ingamesound_running = true;
playsoundloop("ingamesound", 50);
}
pbox._visible = true;
pointstotal = 0;
balls_moving = false;
wrcount = 20000;
TOP = (table_mc._y - (table_mc._height / 2)) + BALL_RADIUS;
BOTTOM = (table_mc._y + (table_mc._height / 2)) - BALL_RADIUS;
LEFT = (table_mc._x - (table_mc._width / 2)) + BALL_RADIUS;
RIGHT = (table_mc._x + (table_mc._width / 2)) - BALL_RADIUS;
i = 0;
while (i <= 6) {
path["TOP_CR" + i] = (path[("cr" + i) + "_mc"]._y - (path[("cr" + i) + "_mc"]._height / 2)) + BALL_RADIUS;
path["BOTTOM_CR" + i] = (path[("cr" + i) + "_mc"]._y + (path[("cr" + i) + "_mc"]._height / 2)) - BALL_RADIUS;
path["LEFT_CR" + i] = (path[("cr" + i) + "_mc"]._x - (path[("cr" + i) + "_mc"]._width / 2)) + BALL_RADIUS;
path["RIGHT_CR" + i] = (path[("cr" + i) + "_mc"]._x + (path[("cr" + i) + "_mc"]._width / 2)) - BALL_RADIUS;
i++;
}
shadows = [sh0, sh1, sh2, sh3, sh4, sh5, sh6, sh7, sh8, sh9];
balls = [b0_mc, b1_mc, b2_mc, b3_mc, b4_mc, b5_mc, b6_mc, b7_mc, b8_mc, b9_mc];
table_complete = 0;
sounds_mute = false;
path.attachMovie("whiteline", "wl", 100);
path.attachMovie("whiteline_bounce_normal", "wl_bounce_n", 200);
path.attachMovie("whiteline_bounce", "wl_bounce", 300);
start_round();
stop();
Instance of Symbol 338 MovieClip "pocket1" in Frame 15
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 338 MovieClip "pocket2" in Frame 15
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 338 MovieClip "pocket3" in Frame 15
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 338 MovieClip "pocket4" in Frame 15
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 338 MovieClip "pocket5" in Frame 15
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 338 MovieClip "pocket6" in Frame 15
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 350 MovieClip "crosshair" in Frame 15
/* no clip actions */
Instance of Symbol 370 MovieClip in Frame 15
/* no clip actions */
Frame 24
function winhelp_move(dir) {
trace(chp);
chp = chp + dir;
if (chp >= chp_max) {
playnow._visible = true;
chp = chp_max;
tut_header.help_forward.gotoAndStop(2);
} else {
tut_header.help_forward.gotoAndStop(1);
}
if (chp <= 0) {
chp = 0;
tut_header.help_back.gotoAndStop(2);
} else {
tut_header.help_back.gotoAndStop(1);
}
winhelp.textv = tuttxt[chp];
winhelp.gotoAndStop(infoStates[chp]);
path.gotoAndStop(thisframe + chp);
winhelp.counter = 0;
winhelp.startx = winhelp._x;
winhelp.starty = winhelp._y;
winhelp.deltax = xPositions[chp] - winhelp._x;
winhelp.deltay = yPositions[chp] - winhelp._y;
winhelp.winhelp_animate(10);
if (chp == 0) {
}
if (chp == 1) {
}
if (chp == 2) {
}
if (chp == 3) {
}
if (chp == 4) {
}
if (chp == 5) {
}
}
xPositions = [375, 325, 325, 411, 115, 115, 300, 410, 470];
yPositions = [145, 165, 165, 170, 180, 180, 110, 90, 90];
infoStates = ["RD", "RD", "RD", "MD", "LD", "LD", "MU", "RU", "RU"];
tuttxt = [];
tuttxt[0] = "The goal of the game is to sink all colored balls in the correct order.";
tuttxt[1] = "Using the white ball you have to aim at the lowest ball on the table.";
tuttxt[2] = "You are allowed to sink further balls with your first ball. You will get a penalty sinking balls in the wrong order.";
tuttxt[3] = "The aiming aid shows you the direction of the white and the targeted ball.";
tuttxt[4] = "Drag the cue by moving the mouse.";
tuttxt[5] = "Press the left mouse button and drag to back or front to adjust the power.";
tuttxt[6] = "Click here to change the spin applied to the cue ball.";
tuttxt[7] = "With every correct shot you collect points.";
tuttxt[8] = "Hurry up - the elapsed time will be subtracted from the total score. Press <p> to pause the game.";
easeOutQuad = function (t, b, c, d) {
return((((-c) * ((t = t / d))) * (t - 2)) + b);
};
MovieClip.prototype.winhelp_animate = function (speed) {
var _local1 = this;
_local1.onEnterFrame = function () {
var _local1 = this;
_local1.counter++;
_local1._x = easeOutQuad(_local1.counter, _local1.startx, _local1.deltax, speed);
_local1._y = easeOutQuad(_local1.counter, _local1.starty, _local1.deltay, speed);
if (_local1.counter >= speed) {
delete _local1.onEnterFrame;
}
};
};
chp = 0;
chp_max = 8;
thisframe = 24;
winhelp._x = xPositions[chp];
winhelp._y = yPositions[chp];
winhelp.textv = tuttxt[chp];
winhelp.gotoAndStop(infoStates[chp]);
stop();
Instance of Symbol 284 MovieClip "pbox_demo" in Frame 24
onClipEvent (load) {
win1.nick = "JOHN";
win1.score = "0";
win1.timetxt = "0:12";
win2.nick = "MARY";
win2.score = "0";
win2.timetxt = "0:54";
}
Instance of Symbol 193 MovieClip in Frame 24
onClipEvent (load) {
function exec() {
delete path.winhelp.onEnterFrame;
path.gotoAndStop("intro");
}
textv = "BACK";
}
Instance of Symbol 193 MovieClip "playnow" in Frame 24
onClipEvent (load) {
function exec() {
path.come_from_playnow = true;
delete path.winhelp.onEnterFrame;
path.gotoAndStop("intro");
}
_visible = false;
textv = "PLAY NOW!";
}
Frame 36
stopsound("ingamesound");
ingamesound_running = false;
stop();
Instance of Symbol 193 MovieClip in Frame 36
onClipEvent (load) {
function exec() {
path.gotoAndStop("intro");
}
textv = "BACK";
}
Instance of Symbol 463 MovieClip "comHighscores" in Frame 36
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.totalscore";
gamename = "deluxepool";
saveScore = true;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}
Frame 40
stopsound("ingamesound");
ingamesound_running = false;
stop();
Instance of Symbol 193 MovieClip in Frame 40
onClipEvent (load) {
function exec() {
path.gotoAndStop("intro");
}
textv = "BACK";
}
Instance of Symbol 463 MovieClip "comHighscores" in Frame 40
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.totalscore";
gamename = "deluxepool";
saveScore = false;
scoreIsTime = false;
scoreReversed = false;
negativeScoreAllowed = false;
}
Symbol 35 Button
on (release) {
execute();
}
Symbol 40 MovieClip [msg_popup] Frame 1
function exec() {
if (path.stick_mc._visible == true) {
delete path.stick_mc.onEnterFrame;
path.stick_mc._visible = 0;
path.wl._visible = 0;
path.wl_bounce._visible = 0;
path.wl_bounce_n._visible = 0;
path.ghost_mc._visible = 0;
}
}
stop();
msg = "Really want to quit?";
Instance of Symbol 36 MovieClip "cancel" in Symbol 40 MovieClip [msg_popup] Frame 1
onClipEvent (load) {
function execute() {
path.msg_popup_visible = false;
if (path.balls_moving == false) {
path.start_aim();
}
_parent._visible = 0;
}
buttontext = "CONTINUE";
}
Instance of Symbol 36 MovieClip "apply" in Symbol 40 MovieClip [msg_popup] Frame 1
onClipEvent (load) {
function execute() {
_parent._visible = 0;
path.stopall_moves();
path.b0_mc.wb_con._visible = 0;
path.playertimer1.running = false;
path.playertimer2.running = false;
delete path.stick_mc.onEnterFrame;
delete path.onEnterFrame;
path.stick_mc._visible = 0;
path.wl._visible = 0;
path.wl_bounce._visible = 0;
path.wl_bounce_n._visible = 0;
path.ghost_mc._visible = 0;
path.msg_popup_visible = false;
path.gotoAndStop("intro");
}
buttontext = "QUIT";
}
Symbol 40 MovieClip [msg_popup] Frame 2
msg = "<Pause>";
stop();
Instance of Symbol 36 MovieClip "cancel" in Symbol 40 MovieClip [msg_popup] Frame 2
onClipEvent (load) {
function execute() {
path["playertimer" + path.curplayer].running = true;
path.msg_popup_visible = false;
if (path.balls_moving == false) {
path.start_aim();
}
_parent._visible = 0;
}
buttontext = "CONTINUE";
}
Symbol 49 MovieClip Frame 39
gotoAndPlay (1);
Symbol 49 MovieClip Frame 40
stop();
Symbol 54 Button
on (release) {
if ((path.gamemode == 1) && (String(input1.nick).length < 2)) {
errormsg = "PLEASE ENTER PLAYER NAME";
} else if ((path.gamemode == 2) && ((String(input1.nick).length < 2) || (String(input2.nick).length < 2))) {
errormsg = "PLEASE ENTER PLAYER NAMES";
} else {
path.nick1 = input1.nick;
path.nick2 = input2.nick;
path.gotoAndStop("game");
}
}
Symbol 55 Button
on (release) {
this.gotoAndStop(1);
path.gotoAndStop("intro");
}
Symbol 59 Button
on (rollOver) {
gotoAndStop ("over");
}
on (rollOut) {
gotoAndStop ("unset");
}
on (press) {
if (this._name == "club") {
_parent.salon.gotoAndStop("unset");
path.location_v = "club";
} else if (this._name == "salon") {
path.location_v = "salon";
_parent.club.gotoAndStop("unset");
}
gotoAndStop ("set");
}
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 10
stop();
Symbol 62 MovieClip Frame 20
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 78 Button
on (release) {
this.gotoAndStop(1);
path.gotoAndStop("hs");
}
Symbol 93 Button
on (release) {
this.gotoAndStop(1);
path.gotoAndStop("intro");
}
Symbol 102 MovieClip [msg_stats] Frame 1
stop();
Symbol 102 MovieClip [msg_stats] Frame 2
errormsg = "";
input1.nick = "";
input2.nick = "";
Selection.setFocus("input1.nickinput");
if (path.gamemode == 1) {
header = "1-PLAYER MODE";
input1.gotoAndStop(1);
input2.gotoAndStop(2);
nicklabel1 = "NAME PLAYER 1";
nicklabel2 = "";
} else {
header = "2-PLAYER DUEL";
input1.gotoAndStop(1);
input2.gotoAndStop(1);
nicklabel1 = "NAME PLAYER 1";
nicklabel2 = "NAME PLAYER 2";
}
placelabel = "CHOOSE PLACE";
apply = "START GAME";
buttontext = "CANCEL";
salon.gotoAndStop("set");
club.gotoAndStop("unset");
path.location_v = "salon";
stop();
Symbol 102 MovieClip [msg_stats] Frame 3
apply = "CONTINUE";
header = "TABLE COMPLETED!";
timetxt = path.min_format(path.playertimer1.time_elapsed);
scoretxt = path.score1;
path.totalscore = path.score1 - path.playertimer1.time_elapsed;
if (path.totalscore < 0) {
path.totalscore = 0;
}
totaltxt = path.totalscore;
secondstxt = "-" + path.playertimer1.time_elapsed;
stop();
Symbol 102 MovieClip [msg_stats] Frame 4
_root.playsound("buzzer", 100);
apply = "CONTINUE";
header = "INCORRECT FINISH!";
stop();
Symbol 102 MovieClip [msg_stats] Frame 5
apply = "CONTINUE";
header = (path.nick1 + newline) + "has won!";
Symbol 102 MovieClip [msg_stats] Frame 6
apply = "CONTINUE";
header = (path.nick2 + newline) + "has won!";
Symbol 107 MovieClip [msg_turn] Frame 1
stop();
Symbol 107 MovieClip [msg_turn] Frame 2
tclip.textv = textv;
play();
Symbol 107 MovieClip [msg_turn] Frame 50
gotoAndStop (1);
Symbol 114 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 115 MovieClip Frame 2
_parent.mcAnimation.play();
stop();
Symbol 115 MovieClip Frame 13
_parent.gotoAndPlay("preload");
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 60
Symbol 131 MovieClip Frame 121
_parent.mcBackground.play();
stop();
Symbol 136 MovieClip Frame 1
this._visible = false;
Symbol 142 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 147 MovieClip Frame 2
if (_url.indexOf("http") > -1) {
if (_parent._parent._parent.loadAdNow) {
cacheBuster = getTimer() + random(999999);
showAd = "http://www.miniclip.com/swfcontent/push/didyouknow.swf?cacheBuster" + cacheBuster;
trace("Loading ad: " + showAd);
mcAd.loadMovie(showAd);
} else {
gotoAndPlay(_currentframe - 1);
}
}
Symbol 147 MovieClip Frame 4
if ((mcAd.getBytesTotal() != 0) && (mcAd.getBytesLoaded() == mcAd.getBytesTotal())) {
gotoAndStop ("showAd");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 147 MovieClip Frame 12
stop();
Symbol 157 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 100
stop();
Symbol 159 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 12
_root.play();
_root.isFinished = true;
_parent.stop();
stop();
Symbol 160 MovieClip Frame 1
loadAdNow = false;
_root.stop();
play();
Instance of Symbol 136 MovieClip "mcIntro" in Symbol 160 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 160 MovieClip Frame 2
xPos = _x;
yPos = _y;
mcBackground._x = mcBackground._x - xPos;
mcBackground._y = mcBackground._y - yPos;
mcAnimation._x = mcAnimation._x - xPos;
mcAnimation._y = mcAnimation._y - yPos;
var stageWidth = Stage.width;
var stageHeight = Stage.height;
var centerStageX = (stageWidth / 2);
var centerStageY = (stageHeight / 2);
mcBackground._width = stageWidth;
mcBackground._height = stageHeight;
mcAnimation._x = mcAnimation._x + centerStageX;
mcAnimation._y = mcAnimation._y + (centerStageY - (stageHeight / 10));
stop();
Instance of Symbol 159 MovieClip "mcLoadingAnimated" in Symbol 160 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 160 MovieClip Frame 3
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent == 100) {
_root.play();
stop();
} else {
loadAdNow = true;
mcLoadingAnimated._visible = true;
}
Symbol 160 MovieClip Frame 5
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent < 100) {
mcLoadingAnimated.mcLoading.gotoAndStop(loadedPercent);
mcLoadingAnimated.mcLoading.txtPercentLoaded1 = ("The game is loading (" + loadedPercent) + "%)";
mcLoadingAnimated.mcLoading.txtPercentLoaded2 = ("The game is loading (" + loadedPercent) + "%)";
gotoAndPlay(_currentframe - 1);
} else {
mcLoadingAnimated.play();
stop();
}
Symbol 173 MovieClip Frame 1
stop();
Symbol 173 MovieClip Frame 30
stop();
Symbol 178 Button
on (release) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 185 MovieClip Frame 39
gotoAndPlay (1);
Symbol 185 MovieClip Frame 40
stop();
Symbol 189 Button
on (rollOver) {
_root.playsound("blip", 50);
gotoAndStop ("over");
}
on (rollOut, releaseOutside) {
gotoAndStop ("out");
}
on (press) {
gotoAndStop ("down");
}
on (release) {
exec();
gotoAndStop ("out");
}
Symbol 193 MovieClip Frame 1
stop();
Instance of Symbol 185 MovieClip in Symbol 193 MovieClip Frame 1
onClipEvent (load) {
if (_parent._name == "start") {
gotoAndPlay (2);
} else {
gotoAndStop (40);
}
}
Symbol 198 Button
on (rollOver) {
if ((path.crosshair._currentframe == 1) and (path.balls_moving != true)) {
path.mark_crosshair();
}
}
Symbol 206 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 23
gotoAndStop (1);
Symbol 212 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 23
gotoAndStop (1);
Symbol 218 MovieClip Frame 1
stop();
Symbol 218 MovieClip Frame 23
gotoAndStop (1);
Symbol 224 MovieClip Frame 1
stop();
Symbol 224 MovieClip Frame 23
gotoAndStop (1);
Symbol 230 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 23
gotoAndStop (1);
Symbol 236 MovieClip Frame 1
stop();
Symbol 236 MovieClip Frame 23
gotoAndStop (1);
Symbol 242 MovieClip Frame 1
stop();
Symbol 242 MovieClip Frame 23
gotoAndStop (1);
Symbol 248 MovieClip Frame 1
stop();
Symbol 248 MovieClip Frame 23
gotoAndStop (1);
Symbol 254 MovieClip Frame 1
stop();
Symbol 254 MovieClip Frame 23
gotoAndStop (1);
Symbol 257 MovieClip Frame 1
stop();
Symbol 258 MovieClip Frame 1
k.gotoAndStop(_root.kugeln[0]);
k.k.c.gotoAndStop(10);
Symbol 258 MovieClip Frame 2
k.gotoAndStop(_root.kugeln[0]);
k.k.c.gotoAndStop(10);
Symbol 258 MovieClip Frame 10
k.gotoAndStop(_root.kugeln[0]);
k.k.c.gotoAndStop(10);
stop();
Symbol 258 MovieClip Frame 20
k.gotoAndStop(_root.kugeln[0]);
k.k.c.gotoAndStop(10);
Symbol 262 Button
on (press) {
if (path.balls_moving == false) {
path.drag_pressed = true;
}
}
on (release, releaseOutside) {
path.drag_pressed = false;
path.engl_draw = (anspiel._y / 50) * -1;
path.engl_side = anspiel._x / 50;
if ((((anspiel.dragX < 12) && (anspiel.dragX > -12)) && (anspiel.dragY < 12)) && (anspiel.dragY > -12)) {
anspiel._x = 0;
anspiel._y = 0;
path.engl_draw = 0;
path.engl_side = 0;
}
}
Instance of Symbol 265 MovieClip "anspiel" in Symbol 266 MovieClip Frame 1
onClipEvent (load) {
reset_x = this._x;
reset_y = this._y;
}
onClipEvent (enterFrame) {
if (path.drag_pressed) {
dragX = _parent._xmouse;
dragY = _parent._ymouse;
radian = Math.atan2(dragY, dragX);
xDistance = dragX / math.cos(radian);
if (dragX > 30) {
dragX = 30;
} else if (dragX < -30) {
dragX = -30;
}
if (dragY > 27.5) {
dragY = 27.5;
} else if (dragY < -27.5) {
dragY = -27.5;
}
if (xDistance > 28) {
_x = (28 * math.cos(radian));
_y = (28 * math.sin(radian));
} else {
_x = dragX;
_y = dragY;
path.engl_draw = (_y / 50) * -1;
path.engl_side = _x / 50;
}
}
}
Symbol 267 MovieClip Frame 1
glow._visible = false;
path.engl_draw = 0;
path.engl_side = 0;
stop();
Instance of Symbol 258 MovieClip "nextkugel" in Symbol 267 MovieClip Frame 1
onClipEvent (load) {
if (_parent._parent._name == "pbox_demo") {
play();
} else {
stop();
}
}
Symbol 271 MovieClip Frame 1
stop();
Symbol 271 MovieClip Frame 2
play();
Symbol 271 MovieClip Frame 14
stop();
Symbol 276 MovieClip Frame 1
stop();
Symbol 276 MovieClip Frame 2
stop();
Symbol 276 MovieClip Frame 50
stop();
Symbol 284 MovieClip Frame 1
stop();
Instance of Symbol 267 MovieClip "nextglass_english" in Symbol 284 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (2);
}
Instance of Symbol 283 MovieClip "win1" in Symbol 284 MovieClip Frame 1
onClipEvent (load) {
label = "PLAYER 1";
}
Instance of Symbol 283 MovieClip "win2" in Symbol 284 MovieClip Frame 1
onClipEvent (load) {
label = "PLAYER 2";
}
Symbol 290 MovieClip Frame 1
stop();
Symbol 290 MovieClip Frame 2
points_mc.points = points;
play();
Instance of Symbol 289 MovieClip "points_mc" in Symbol 290 MovieClip Frame 2
onClipEvent (load) {
points = _parent.points;
}
Symbol 290 MovieClip Frame 6
points_mc.points = points;
Symbol 290 MovieClip Frame 10
points_mc.points = points;
Symbol 290 MovieClip Frame 25
points_mc.points = points;
Symbol 290 MovieClip Frame 51
gotoAndStop (1);
Symbol 294 MovieClip Frame 1
stop();
Symbol 294 MovieClip Frame 2
points_mc.points = "+" + points;
play();
Symbol 294 MovieClip Frame 6
points_mc.points = "+" + points;
Symbol 294 MovieClip Frame 10
points_mc.points = "+" + points;
Symbol 294 MovieClip Frame 25
points_mc.points = "+" + points;
Symbol 294 MovieClip Frame 51
gotoAndStop (1);
Symbol 297 Button
on (press) {
nextFrame();
path.soundmute = true;
path.introsound.setVolume(0);
path.ingamesound.setVolume(0);
}
Symbol 300 Button
on (press) {
prevFrame();
path.soundmute = false;
if ((path.ingamesound_running == false) and (path._currentframe == 15)) {
path.playsoundloop("ingamesound", 50);
path.ingamesound_running = true;
}
if ((path.introsound_running == false) and (path._currentframe != 15)) {
path.playsoundloop("introsound", 60);
path.introsound_running = true;
}
path.introsound.setVolume(60);
path.ingamesound.setVolume(50);
}
Symbol 301 MovieClip Frame 1
stop();
Symbol 304 MovieClip Frame 1
stop();
Symbol 319 MovieClip Frame 1
stop();
Symbol 320 MovieClip Frame 1
stop();
Symbol 321 MovieClip Frame 1
function reset_rollerballs() {
var _local1 = this;
i = 2;
while (i <= 10) {
_local1["rb" + i].gotoAndStop(i - 1);
_local1["rb" + i]._x = 122;
_local1["rb" + i].framecount = 0;
_local1["rb" + i].speedx = -4;
_local1["rb" + i].kreuz.gotoAndStop(1);
_local1[("rb" + i) + "invalid"] = false;
_local1["rb" + i]._visible = false;
i++;
}
}
function update_crosses() {
var _local1 = this;
trace("update crosses");
i = 2;
while (i <= 10) {
if (_local1[("rb" + i) + "invalid"] == true) {
_local1["rb" + i].kreuz.gotoAndStop(2);
}
i++;
}
}
reset_rollerballs();
Symbol 324 Button
on (press) {
path.white_pressed = true;
delete path.stick_mc.onEnterFrame;
path.stick_mc._visible = 0;
path.b0_mc.onEnterFrame = path.newposition;
path.wl._visible = 0;
path.wl_bounce._visible = 0;
path.ghost_mc._visible = 0;
path.wl_bounce_n._visible = 0;
path.whiteball_roll = false;
path.use_keys = false;
path.whiteaura.gotoAndStop(1);
}
on (release, releaseOutside) {
path.stick_mc._visible = 1;
path.newround_start = false;
path.white_pressed = false;
this._visible = 0;
path.start_aim();
path.posline._visible = 0;
path.wl._visible = 1;
path.wl_bounce._visible = 1;
path.ghost_mc._visible = 1;
}
on (rollOver) {
path.whiteaura.gotoAndStop(2);
path.whiteball_roll = true;
}
on (rollOut) {
path.whiteaura.gotoAndStop(1);
path.whiteball_roll = false;
}
Symbol 334 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 1
stop();
Symbol 337 MovieClip Frame 2
ball_state.gotoAndStop(num);
play();
Symbol 337 MovieClip Frame 4
path.playsound("pocket", 50);
Instance of Symbol 335 MovieClip "ball_state" in Symbol 337 MovieClip Frame 6
onClipEvent (load) {
gotoAndStop(_parent.num);
}
Instance of Symbol 335 MovieClip "ball_state" in Symbol 337 MovieClip Frame 10
onClipEvent (load) {
gotoAndStop(_parent.num);
}
Symbol 337 MovieClip Frame 15
_parent._visible = 0;
Symbol 337 MovieClip Frame 20
stop();
Symbol 337 MovieClip Frame 32
ball_state.gotoAndStop(num);
play();
Instance of Symbol 335 MovieClip "ball_state" in Symbol 337 MovieClip Frame 32
onClipEvent (load) {
gotoAndStop(_parent.num);
}
Symbol 337 MovieClip Frame 33
path.playsound("pocket", 75);
Instance of Symbol 335 MovieClip "ball_state" in Symbol 337 MovieClip Frame 35
onClipEvent (load) {
gotoAndStop(_parent.num);
}
Symbol 337 MovieClip Frame 42
_parent._visible = 0;
Instance of Symbol 335 MovieClip "ball_state" in Symbol 337 MovieClip Frame 42
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 337 MovieClip Frame 47
stop();
Instance of Symbol 335 MovieClip "ball_state" in Symbol 337 MovieClip Frame 55
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 337 MovieClip Frame 56
ball_state.gotoAndStop(num);
play();
Instance of Symbol 335 MovieClip "ball_state" in Symbol 337 MovieClip Frame 56
onClipEvent (load) {
gotoAndStop(_parent.num);
}
Symbol 337 MovieClip Frame 57
path.playsound("pocket", 100);
Instance of Symbol 335 MovieClip "ball_state" in Symbol 337 MovieClip Frame 57
onClipEvent (load) {
gotoAndStop(_parent.num);
}
Symbol 337 MovieClip Frame 70
_parent._visible = 0;
Symbol 337 MovieClip Frame 75
stop();
Instance of Symbol 337 MovieClip "k" in Symbol 338 MovieClip Frame 1
/* no clip actions */
Symbol 350 MovieClip Frame 1
durchlauf = 0;
stop();
Symbol 350 MovieClip Frame 2
durchlauf++;
play();
Symbol 350 MovieClip Frame 15
if (durchlauf > 3) {
gotoAndStop (1);
} else {
gotoAndPlay (2);
}
Symbol 358 MovieClip Frame 1
stop();
Symbol 358 MovieClip Frame 15
gotoAndPlay (2);
Symbol 365 Button
on (rollOver) {
button_rollover = true;
}
on (rollOut, release, releaseOutside) {
button_rollover = false;
}
on (press) {
msg_popup._visible = true;
msg_popup_visible = true;
msg_popup.gotoAndStop(1);
msg_popup.exec();
}
on (keyPress "p") {
if (path.balls_moving == false) {
if (msg_popup_visible != true) {
path["playertimer" + path.curplayer].running = false;
msg_popup._visible = true;
msg_popup_visible = true;
msg_popup.gotoAndStop(2);
msg_popup.exec();
}
}
}
Symbol 372 Button
on (press) {
winhelp_move(1);
}
Symbol 389 MovieClip Frame 1
stop();
Symbol 389 MovieClip Frame 23
setProperty(_root.shothelp, _visible , 1);
Instance of Symbol 378 MovieClip in Symbol 389 MovieClip Frame 23
onClipEvent (enterFrame) {
_root.power.gotoAndStop(_root.power._currentframe + 2);
}
Symbol 389 MovieClip Frame 54
if ((_parent.step == "5") || (loop == true)) {
play();
} else {
stop();
}
Symbol 389 MovieClip Frame 55
setProperty(_root.shothelp, _visible , 0);
_root.power.gotoAndStop(1);
Symbol 389 MovieClip Frame 78
gotoAndPlay ("step5");
loop = true;
Symbol 389 MovieClip Frame 191
stop();
Symbol 389 MovieClip Frame 192
_root.power.gotoAndStop(1);
Symbol 419 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 9
stop();
Symbol 419 MovieClip Frame 20
stop();
Symbol 419 MovieClip Frame 30
stop();
Symbol 421 Button
on (keyPress "<Left>") {
gamepath.winhelp_move(-1);
}
Symbol 422 Button
on (keyPress "<Right>") {
gamepath.winhelp_move(1);
}
Symbol 434 Button
on (rollOver) {
_root.playsound("blip", 50);
}
on (press) {
path.winhelp_move(dir);
}
Symbol 436 MovieClip Frame 1
stop();
Symbol 437 MovieClip Frame 1
stop();
Instance of Symbol 436 MovieClip "help_back" in Symbol 437 MovieClip Frame 1
onClipEvent (load) {
dir = -1;
}
Instance of Symbol 436 MovieClip "help_forward" in Symbol 437 MovieClip Frame 1
onClipEvent (load) {
dir = 1;
}
Symbol 448 MovieClip Frame 2
play();
Symbol 448 MovieClip Frame 15
gotoAndPlay (2);
Symbol 452 MovieClip Frame 1
this._visible = false;
Symbol 461 Button
on (release) {
gameURL = ("http://www.miniclip.com/" + gamename) + ".htm";
getURL (gameURL, "_blank");
}
Symbol 463 MovieClip Frame 1
System.security.allowDomain("www.miniclip.com");
Instance of Symbol 452 MovieClip "mcHighscores" in Symbol 463 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 463 MovieClip Frame 2
if ((((_url.indexOf("miniclip.com") == -1) && (_url.indexOf("miniclip.net") == -1)) && (_url.indexOf("miniclip.co.uk") == -1)) && (_url.indexOf("miniclips.com"))) {
gotoAndStop(_currentframe + 1);
} else {
var noCache = (getTimer() + random(100000));
mcTarget.loadMovie("http://www.miniclip.com/swfcontent/highscore.swf?noCache=" + noCache);
stop();
}
Symbol 463 MovieClip Frame 3
stop();