Frame 1
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
_root.menu = myMenu;
Frame 2
stop();
Frame 3
function ballMove() {
this.vx = this.vx * DAMP;
this.vy = this.vy * DAMP;
this._x = this._x + this.vx;
this._y = this._y + this.vy;
if (this._x > RIGHT) {
this._x = RIGHT;
this.vx = this.vx * BOUNCE;
} else if (this._x < LEFT) {
this._x = LEFT;
this.vx = this.vx * BOUNCE;
}
if (this._y > BOTTOM) {
this._y = BOTTOM;
this.vy = this.vy * BOUNCE;
} else if (this._y < TOP) {
this._y = TOP;
this.vy = this.vy * BOUNCE;
}
if (holes_mc.hitTest(this._x, this._y, true)) {
_root.tacosound.gotoAndStop(4);
b_metida++;
_root.suma++;
bandc = 1;
this.p = _root.currentn;
this.vx = 0;
this.vy = 0;
if (_root.players > 1) {
switch (_root.currentn) {
case 1 :
b_1++;
do {
band1 = 0;
s = 0;
while (s < 17) {
if ((b_1 == balls[s].dentro) && (balls[s].p == 1)) {
b_1++;
band1 = 1;
}
s++;
}
if (b_1 > 17) {
b_1 = 1;
}
} while (band1 == 1);
if (b_1 < 10) {
this._x = 25 + ((b_1 - 1) * 20);
this._y = 22;
} else {
this._x = 25 + ((b_1 - 10) * 20);
this._y = 48;
}
this.dentro = b_1;
if (balls[0].dentro != 0) {
estado = 1;
}
break;
case 2 :
b_2++;
do {
band2 = 0;
s = 0;
while (s < 17) {
if ((b_2 == balls[s].dentro) && (balls[s].p == 2)) {
b_2++;
band2 = 1;
}
s++;
}
if (b_2 > 17) {
b_2 = 1;
}
} while (band2 == 1);
if (b_2 < 10) {
this._x = 710 + ((b_2 - 1) * 20);
this._y = 27;
} else {
this._x = 710 + ((b_2 - 10) * 20);
this._y = 52;
}
this.dentro = b_2;
if (balls[0].dentro != 0) {
estado = 1;
}
break;
case 3 :
b_3++;
do {
band3 = 0;
s = 0;
while (s < 17) {
if ((b_3 == balls[s].dentro) && (balls[s].p == 3)) {
b_3++;
band3 = 1;
}
s++;
}
if (b_3 > 17) {
b_3 = 1;
}
} while (band3 == 1);
if (b_3 < 10) {
this._x = 28 + ((b_3 - 1) * 20);
this._y = 550;
} else {
this._x = 28 + ((b_3 - 10) * 20);
this._y = 576;
}
this.dentro = b_3;
if (balls[0].dentro != 0) {
estado = 1;
}
break;
case 4 :
b_4++;
do {
band4 = 0;
s = 0;
while (s < 17) {
if ((b_4 == balls[s].dentro) && (balls[s].p == 4)) {
b_4++;
band4 = 1;
}
s++;
}
if (b_4 > 17) {
b_4 = 1;
}
} while (band4 == 1);
if (b_4 < 10) {
this._x = 707 + ((b_4 - 1) * 20);
this._y = 550;
} else {
this._x = 707 + ((b_4 - 10) * 20);
this._y = 576;
}
this.dentro = b_4;
if (balls[0].dentro == 0) {
break;
}
estado = 1;
}
} else {
do {
band = 0;
s = 0;
while (s < 17) {
if (b_metida == balls[s].dentro) {
b_metida++;
band = 1;
}
s++;
}
if (b_metida > 17) {
b_metida = 1;
}
} while (band == 1);
if (b_metida < 10) {
this._x = 25 + ((b_metida - 1) * 20);
this._y = 22;
} else {
this._x = 25 + ((b_metida - 10) * 20);
this._y = 48;
}
this.dentro = b_metida;
if (balls[0].dentro != 0) {
estado = 1;
}
}
}
this.shadow._x = this._x;
this.shadow._y = this._y;
this.speed = Math.sqrt((this.vx * this.vx) + (this.vy * this.vy));
if (this.speed < MINSPEED) {
this.vx = 0;
this.vy = 0;
delete this.onEnterFrame;
}
}
function aim() {
var _local3 = whiteBall_mc._x - _xmouse;
var _local2 = whiteBall_mc._y - _ymouse;
angle = Math.atan2(_local2, _local3);
this._rotation = (angle * 180) / Math.PI;
this._x = _xmouse;
this._y = _ymouse;
tableShadow_mc._x = this._x - 5;
tableShadow_mc._y = this._y + 5;
tableShadow_mc._rotation = this._rotation;
floorShadow_mc._x = this._x - 20;
floorShadow_mc._y = this._y + 20;
floorShadow_mc._rotation = this._rotation;
}
function shoot() {
var _local4 = whiteBall_mc._x - _xmouse;
var _local3 = whiteBall_mc._y - _ymouse;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
this._x = whiteBall_mc._x - (Math.cos(angle) * _local5);
this._y = whiteBall_mc._y - (Math.sin(angle) * _local5);
this.vx = this._x - this.oldx;
this.vy = this._y - this.oldy;
this.oldx = this._x;
this.oldy = this._y;
_local4 = whiteBall_mc._x - this._x;
_local3 = whiteBall_mc._y - this._y;
_local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 < 110) {
whiteBall_mc.vx = this.vx;
whiteBall_mc.vy = this.vy;
tiro++;
whiteBall_mc.onEnterFrame = ballMove;
this.onEnterFrame = aim;
_root.tacosound.gotoAndStop(2);
}
tableShadow_mc._x = this._x - 5;
tableShadow_mc._y = this._y + 5;
tableShadow_mc._rotation = this._rotation;
floorShadow_mc._x = this._x - 20;
floorShadow_mc._y = this._y + 20;
floorShadow_mc._rotation = this._rotation;
}
function checkCollision() {
tiempo++;
movx = 0;
movy = 0;
k = 0;
while (k < 16) {
movx = movx + Math.sqrt(Math.pow(balls[k].vx, 2));
movy = movy + Math.sqrt(Math.pow(balls[k].vy, 2));
k++;
}
if (((movx != 0) || (movy != 0)) || (estado != 0)) {
_root.stick_mc.gotoAndStop(2);
_root.floorShadow_mc.gotoAndStop(2);
_root.tableShadow_mc.gotoAndStop(2);
cont = 0;
} else {
_root.stick_mc.gotoAndStop(1);
_root.floorShadow_mc.gotoAndStop(1);
_root.tableShadow_mc.gotoAndStop(1);
if (cont == 0) {
_root.currentn++;
if (bandc == 1) {
_root.currentn--;
bandc = 0;
}
if (_root.currentn > _root.players) {
_root.currentn = 1;
}
switch (_root.currentn) {
case 1 :
_root.current = _root.p1;
break;
case 2 :
_root.current = _root.p2;
break;
case 3 :
_root.current = _root.p3;
break;
case 4 :
_root.current = _root.p4;
}
}
cont = 1;
}
if (((movx == 0) && (movy == 0)) && (estado == 1)) {
if (_root.mensaje._currentframe != 3) {
_root.stick_mc.gotoAndStop(3);
_root.mensaje.gotoAndStop(2);
} else {
_root.stick_mc.gotoAndStop(4);
}
cont = 0;
}
var _local14 = balls.length;
var _local13 = 0;
while (_local13 < (_local14 - 1)) {
ball1_mc = balls[_local13];
var _local6 = _local13 + 1;
while (_local6 < _local14) {
ball2_mc = balls[_local6];
var _local5 = ball1_mc._x - ball2_mc._x;
var _local4 = ball1_mc._y - ball2_mc._y;
var _local11 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local11 < BALL_DIAMETER) {
if (_local11 < (BALL_DIAMETER - 1)) {
_root.tacosound.gotoAndStop(3);
}
var _local7 = Math.atan2(_local4, _local5);
var _local3 = Math.cos(_local7);
var _local2 = Math.sin(_local7);
ball1_mc._x = ball2_mc._x + (_local3 * BALL_DIAMETER);
ball1_mc._y = ball2_mc._y + (_local2 * BALL_DIAMETER);
var _local9 = (_local3 * ball1_mc.vx) + (_local2 * ball1_mc.vy);
var _local10 = (_local3 * ball1_mc.vy) - (_local2 * ball1_mc.vx);
var _local12 = (_local3 * ball2_mc.vx) + (_local2 * ball2_mc.vy);
var _local8 = (_local3 * ball2_mc.vy) - (_local2 * ball2_mc.vx);
ball1_mc.vx = (_local3 * _local12) - (_local2 * _local10);
ball1_mc.vy = (_local3 * _local10) + (_local2 * _local12);
ball2_mc.vx = (_local3 * _local9) - (_local2 * _local8);
ball2_mc.vy = (_local3 * _local8) + (_local2 * _local9);
ball1_mc.onEnterFrame = ballMove;
ball2_mc.onEnterFrame = ballMove;
}
_local6++;
}
_local13++;
}
}
balls = [whiteBall_mc, b1_mc, b2_mc, b3_mc, b4_mc, b5_mc, b6_mc, b7_mc, b8_mc, b9_mc, b10_mc, b11_mc, b12_mc, b13_mc, b14_mc, b15_mc];
for (i in balls) {
balls[i].vx = (balls[i].vy = (balls[i].dentro = 0));
}
shadows = [sh01, sh02, sh03, sh04, sh05, sh06, sh07, sh08, sh09, sh10, sh11, sh12, sh13, sh14, sh15, sh16];
i = 0;
while (i < 17) {
balls[i].shadow = shadows[i];
shadows[i]._x = balls[i]._x;
shadows[i]._y = balls[i]._y;
balls[i].p = 0;
i++;
}
_root.ahog = 0;
cont = 1;
b_1 = 0;
b_2 = 0;
b_3 = 0;
b_4 = 0;
_root.current = _root.p1;
_root.currentn = 1;
tiempo = 0;
bandc = 0;
adentro = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
estado = 0;
tiro = 0;
b_metida = 0;
BALL_DIAMETER = 20;
BALL_RADIUS = BALL_DIAMETER / 2;
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;
BOUNCE = -0.6;
DAMP = 0.98;
MINSPEED = 0.1;
onEnterFrame = checkCollision;
stick_mc.onEnterFrame = aim;
onMouseDown = function () {
var _local3 = whiteBall_mc._x - _xmouse;
var _local2 = whiteBall_mc._y - _ymouse;
var _local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (_local4 > 110) {
movx = 0;
movy = 0;
k = 0;
while (k < 16) {
movx = movx + Math.sqrt(Math.pow(balls[k].vx, 2));
movy = movy + Math.sqrt(Math.pow(balls[k].vy, 2));
k++;
}
if (((movx == 0) && (movy == 0)) && (estado == 0)) {
l = 0;
while (l < 17) {
adentro[l] = balls[l].dentro;
l++;
}
stick_mc.onEnterFrame = shoot;
} else if (((movx == 0) && (movy == 0)) && (estado == 1)) {
l = 1;
while (l < 17) {
if (balls[l].dentro != adentro[l]) {
switch (_root.currentn) {
case 1 :
b_1--;
break;
case 2 :
b_2--;
break;
case 3 :
b_3--;
break;
case 4 :
b_4--;
}
b_metida--;
_root.suma--;
balls[l]._x = 230;
balls[l]._y = 290;
shadows[l]._x = balls[l]._x;
shadows[l]._y = balls[l]._y;
balls[l].dentro = 0;
}
l++;
}
if (((((560 < _xmouse) && (_xmouse < 675)) && (185 < _ymouse)) && (_ymouse < 415)) && (_root.mensaje._currentframe == 3)) {
balls[0]._x = _xmouse;
balls[0]._y = _ymouse;
shadows[0]._x = balls[0]._x;
shadows[0]._y = balls[0]._y;
balls[0].dentro = 0;
b_metida--;
_root.suma--;
switch (_root.currentn - 1) {
case 0 :
switch (_root.players) {
case 2 :
b_2--;
break;
case 3 :
b_3--;
break;
case 4 :
b_4--;
}
break;
case 1 :
b_1--;
break;
case 2 :
b_2--;
break;
case 3 :
b_3--;
}
estado = 0;
_root.mensaje.gotoAndStop(1);
}
}
}
};
onMouseUp = function () {
stick_mc.onEnterFrame = aim;
};
stop();
Instance of Symbol 57 MovieClip "table_mc" in Frame 3
onClipEvent (load) {
this.gotoAndStop(_root.col);
}
Instance of Symbol 198 MovieClip in Frame 3
onClipEvent (load) {
if (_root.players > 1) {
this.gotoAndStop(2);
}
}
Instance of Symbol 210 MovieClip in Frame 3
onClipEvent (load) {
if (_root.players > 1) {
this.gotoAndStop(2);
}
}
Instance of Symbol 213 MovieClip in Frame 3
onClipEvent (load) {
_root.seg = 0;
_root.min = 0;
_root.hor = 0;
_root.suma = 0;
}
onClipEvent (load) {
if (_root.players > 2) {
this.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (_root.tiempo == 80) {
_root.seg++;
_root.tiempo = 0;
}
if (_root.seg == 60) {
_root.min++;
_root.seg = 0;
}
if (((_root.suma == 15) && (_root.estado == 0)) && (_root.rules == 1)) {
_root.tir_total = _root.tiro;
_root.seg_total = _root.seg;
_root.min_total = _root.min;
_root.ahog2 = _root.ahog;
_root.popup.gotoAndStop(2);
_root.suma = 16;
}
}
Instance of Symbol 216 MovieClip in Frame 3
onClipEvent (load) {
if (_root.players > 3) {
this.gotoAndStop(2);
}
}
Instance of Symbol 65 MovieClip "b3_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh04._x = _x;
_root.sh04._y = _y;
}
}
Instance of Symbol 68 MovieClip "b2_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh03._x = _x;
_root.sh03._y = _y;
}
}
Instance of Symbol 71 MovieClip "b4_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh05._x = _x;
_root.sh05._y = _y;
}
}
Instance of Symbol 44 MovieClip "b1_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh02._x = _x;
_root.sh02._y = _y;
}
}
Instance of Symbol 35 MovieClip "b8_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh09._x = _x;
_root.sh09._y = _y;
}
}
Instance of Symbol 74 MovieClip "b6_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh07._x = _x;
_root.sh07._y = _y;
}
}
Instance of Symbol 77 MovieClip "b7_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh08._x = _x;
_root.sh08._y = _y;
}
}
Instance of Symbol 80 MovieClip "b5_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh06._x = _x;
_root.sh06._y = _y;
}
}
Instance of Symbol 38 MovieClip "b10_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh11._x = _x;
_root.sh11._y = _y;
}
}
Instance of Symbol 83 MovieClip "b11_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh12._x = _x;
_root.sh12._y = _y;
}
}
Instance of Symbol 86 MovieClip "b12_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh13._x = _x;
_root.sh13._y = _y;
}
}
Instance of Symbol 89 MovieClip "b13_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh14._x = _x;
_root.sh14._y = _y;
}
}
Instance of Symbol 92 MovieClip "b14_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh15._x = _x;
_root.sh15._y = _y;
}
}
Instance of Symbol 41 MovieClip "b15_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh16._x = _x;
_root.sh16._y = _y;
}
}
Instance of Symbol 95 MovieClip "b9_mc" in Frame 3
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh10._x = _x;
_root.sh10._y = _y;
}
}
Instance of Symbol 256 MovieClip "popup" in Frame 3
onClipEvent (load) {
if (_root.players > 1) {
this.gotoAndStop(3);
}
}
Frame 4
gotoAndStop (3);
Frame 5
function ballMove() {
this.vx = this.vx * DAMP;
this.vy = this.vy * DAMP;
this._x = this._x + this.vx;
this._y = this._y + this.vy;
if (this._x > RIGHT) {
this._x = RIGHT;
this.vx = this.vx * BOUNCE;
} else if (this._x < LEFT) {
this._x = LEFT;
this.vx = this.vx * BOUNCE;
}
if (this._y > BOTTOM) {
this._y = BOTTOM;
this.vy = this.vy * BOUNCE;
} else if (this._y < TOP) {
this._y = TOP;
this.vy = this.vy * BOUNCE;
}
if (holes_mc.hitTest(this._x, this._y, true)) {
_root.tacosound.gotoAndStop(4);
b_metida++;
_root.suma++;
bandc = 1;
this.p = _root.currentn;
this.vx = 0;
this.vy = 0;
if (_root.players > 1) {
switch (_root.currentn) {
case 1 :
b_1++;
do {
band1 = 0;
s = 0;
while (s < 17) {
if ((b_1 == balls[s].dentro) && (balls[s].p == 1)) {
b_1++;
band1 = 1;
}
s++;
}
if (b_1 > 17) {
b_1 = 1;
}
} while (band1 == 1);
if (b_1 < 10) {
this._x = 25 + ((b_1 - 1) * 20);
this._y = 22;
} else {
this._x = 25 + ((b_1 - 10) * 20);
this._y = 48;
}
this.dentro = b_1;
if (balls[0].dentro != 0) {
estado = 1;
}
break;
case 2 :
b_2++;
do {
band2 = 0;
s = 0;
while (s < 17) {
if ((b_2 == balls[s].dentro) && (balls[s].p == 2)) {
b_2++;
band2 = 1;
}
s++;
}
if (b_2 > 17) {
b_2 = 1;
}
} while (band2 == 1);
if (b_2 < 10) {
this._x = 710 + ((b_2 - 1) * 20);
this._y = 27;
} else {
this._x = 710 + ((b_2 - 10) * 20);
this._y = 52;
}
this.dentro = b_2;
if (balls[0].dentro != 0) {
estado = 1;
}
break;
case 3 :
b_3++;
do {
band3 = 0;
s = 0;
while (s < 17) {
if ((b_3 == balls[s].dentro) && (balls[s].p == 3)) {
b_3++;
band3 = 1;
}
s++;
}
if (b_3 > 17) {
b_3 = 1;
}
} while (band3 == 1);
if (b_3 < 10) {
this._x = 28 + ((b_3 - 1) * 20);
this._y = 550;
} else {
this._x = 28 + ((b_3 - 10) * 20);
this._y = 576;
}
this.dentro = b_3;
if (balls[0].dentro != 0) {
estado = 1;
}
break;
case 4 :
b_4++;
do {
band4 = 0;
s = 0;
while (s < 17) {
if ((b_4 == balls[s].dentro) && (balls[s].p == 4)) {
b_4++;
band4 = 1;
}
s++;
}
if (b_4 > 17) {
b_4 = 1;
}
} while (band4 == 1);
if (b_4 < 10) {
this._x = 707 + ((b_4 - 1) * 20);
this._y = 550;
} else {
this._x = 707 + ((b_4 - 10) * 20);
this._y = 576;
}
this.dentro = b_4;
if (balls[0].dentro == 0) {
break;
}
estado = 1;
}
} else {
do {
band = 0;
s = 0;
while (s < 17) {
if (b_metida == balls[s].dentro) {
b_metida++;
band = 1;
}
s++;
}
if (b_metida > 17) {
b_metida = 1;
}
} while (band == 1);
if (b_metida < 10) {
this._x = 25 + ((b_metida - 1) * 20);
this._y = 22;
} else {
this._x = 25 + ((b_metida - 10) * 20);
this._y = 48;
}
this.dentro = b_metida;
if (balls[0].dentro != 0) {
estado = 1;
}
}
}
this.shadow._x = this._x;
this.shadow._y = this._y;
this.speed = Math.sqrt((this.vx * this.vx) + (this.vy * this.vy));
if (this.speed < MINSPEED) {
this.vx = 0;
this.vy = 0;
delete this.onEnterFrame;
}
}
function aim() {
var _local3 = whiteBall_mc._x - _xmouse;
var _local2 = whiteBall_mc._y - _ymouse;
angle = Math.atan2(_local2, _local3);
this._rotation = (angle * 180) / Math.PI;
this._x = _xmouse;
this._y = _ymouse;
tableShadow_mc._x = this._x - 5;
tableShadow_mc._y = this._y + 5;
tableShadow_mc._rotation = this._rotation;
floorShadow_mc._x = this._x - 20;
floorShadow_mc._y = this._y + 20;
floorShadow_mc._rotation = this._rotation;
}
function shoot() {
var _local4 = whiteBall_mc._x - _xmouse;
var _local3 = whiteBall_mc._y - _ymouse;
var _local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
this._x = whiteBall_mc._x - (Math.cos(angle) * _local5);
this._y = whiteBall_mc._y - (Math.sin(angle) * _local5);
this.vx = this._x - this.oldx;
this.vy = this._y - this.oldy;
this.oldx = this._x;
this.oldy = this._y;
_local4 = whiteBall_mc._x - this._x;
_local3 = whiteBall_mc._y - this._y;
_local5 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local5 < 110) {
whiteBall_mc.vx = this.vx;
whiteBall_mc.vy = this.vy;
tiro++;
whiteBall_mc.onEnterFrame = ballMove;
this.onEnterFrame = aim;
_root.tacosound.gotoAndStop(2);
}
tableShadow_mc._x = this._x - 5;
tableShadow_mc._y = this._y + 5;
tableShadow_mc._rotation = this._rotation;
floorShadow_mc._x = this._x - 20;
floorShadow_mc._y = this._y + 20;
floorShadow_mc._rotation = this._rotation;
}
function checkCollision() {
tiempo++;
movx = 0;
movy = 0;
k = 0;
while (k < 16) {
movx = movx + Math.sqrt(Math.pow(balls[k].vx, 2));
movy = movy + Math.sqrt(Math.pow(balls[k].vy, 2));
k++;
}
if (((movx != 0) || (movy != 0)) || (estado != 0)) {
_root.stick_mc.gotoAndStop(2);
_root.floorShadow_mc.gotoAndStop(2);
_root.tableShadow_mc.gotoAndStop(2);
cont = 0;
} else {
_root.stick_mc.gotoAndStop(1);
_root.floorShadow_mc.gotoAndStop(1);
_root.tableShadow_mc.gotoAndStop(1);
if (cont == 0) {
_root.currentn++;
if (bandc == 1) {
_root.currentn--;
bandc = 0;
}
if (_root.currentn > _root.players) {
_root.currentn = 1;
}
switch (_root.currentn) {
case 1 :
_root.current = _root.p1;
break;
case 2 :
_root.current = _root.p2;
break;
case 3 :
_root.current = _root.p3;
break;
case 4 :
_root.current = _root.p4;
}
}
cont = 1;
}
if (((movx == 0) && (movy == 0)) && (estado == 1)) {
if (_root.mensaje._currentframe != 3) {
_root.stick_mc.gotoAndStop(3);
_root.mensaje.gotoAndStop(2);
} else {
_root.stick_mc.gotoAndStop(4);
}
cont = 0;
}
var _local14 = balls.length;
var _local13 = 0;
while (_local13 < (_local14 - 1)) {
ball1_mc = balls[_local13];
var _local6 = _local13 + 1;
while (_local6 < _local14) {
ball2_mc = balls[_local6];
var _local5 = ball1_mc._x - ball2_mc._x;
var _local4 = ball1_mc._y - ball2_mc._y;
var _local11 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local11 < BALL_DIAMETER) {
if (_local11 < (BALL_DIAMETER - 1)) {
_root.tacosound.gotoAndStop(3);
}
var _local7 = Math.atan2(_local4, _local5);
var _local3 = Math.cos(_local7);
var _local2 = Math.sin(_local7);
ball1_mc._x = ball2_mc._x + (_local3 * BALL_DIAMETER);
ball1_mc._y = ball2_mc._y + (_local2 * BALL_DIAMETER);
var _local9 = (_local3 * ball1_mc.vx) + (_local2 * ball1_mc.vy);
var _local10 = (_local3 * ball1_mc.vy) - (_local2 * ball1_mc.vx);
var _local12 = (_local3 * ball2_mc.vx) + (_local2 * ball2_mc.vy);
var _local8 = (_local3 * ball2_mc.vy) - (_local2 * ball2_mc.vx);
ball1_mc.vx = (_local3 * _local12) - (_local2 * _local10);
ball1_mc.vy = (_local3 * _local10) + (_local2 * _local12);
ball2_mc.vx = (_local3 * _local9) - (_local2 * _local8);
ball2_mc.vy = (_local3 * _local8) + (_local2 * _local9);
ball1_mc.onEnterFrame = ballMove;
ball2_mc.onEnterFrame = ballMove;
}
_local6++;
}
_local13++;
}
}
balls = [whiteBall_mc, b1_mc, b2_mc, b3_mc, b4_mc, b5_mc, b6_mc, b7_mc, b8_mc, b9_mc, b10_mc, b11_mc, b12_mc, b13_mc, b14_mc, b15_mc];
for (i in balls) {
balls[i].vx = (balls[i].vy = (balls[i].dentro = 0));
}
shadows = [sh01, sh02, sh03, sh04, sh05, sh06, sh07, sh08, sh09, sh10, sh11, sh12, sh13, sh14, sh15, sh16];
i = 0;
while (i < 17) {
balls[i].shadow = shadows[i];
shadows[i]._x = balls[i]._x;
shadows[i]._y = balls[i]._y;
balls[i].p = 0;
i++;
}
_root.ahog = 0;
cont = 1;
b_1 = 0;
b_2 = 0;
b_3 = 0;
b_4 = 0;
_root.current = _root.p1;
_root.currentn = 1;
tiempo = 0;
bandc = 0;
adentro = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
estado = 0;
tiro = 0;
b_metida = 0;
BALL_DIAMETER = 20;
BALL_RADIUS = BALL_DIAMETER / 2;
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;
BOUNCE = -0.6;
DAMP = 0.98;
MINSPEED = 0.1;
onEnterFrame = checkCollision;
stick_mc.onEnterFrame = aim;
onMouseDown = function () {
var _local3 = whiteBall_mc._x - _xmouse;
var _local2 = whiteBall_mc._y - _ymouse;
var _local4 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
if (_local4 > 110) {
movx = 0;
movy = 0;
k = 0;
while (k < 16) {
movx = movx + Math.sqrt(Math.pow(balls[k].vx, 2));
movy = movy + Math.sqrt(Math.pow(balls[k].vy, 2));
k++;
}
if (((movx == 0) && (movy == 0)) && (estado == 0)) {
l = 0;
while (l < 17) {
adentro[l] = balls[l].dentro;
l++;
}
stick_mc.onEnterFrame = shoot;
} else if (((movx == 0) && (movy == 0)) && (estado == 1)) {
l = 1;
while (l < 17) {
if (balls[l].dentro != adentro[l]) {
switch (_root.currentn) {
case 1 :
b_1--;
break;
case 2 :
b_2--;
break;
case 3 :
b_3--;
break;
case 4 :
b_4--;
}
b_metida--;
_root.suma--;
balls[l]._x = 230;
balls[l]._y = 290;
shadows[l]._x = balls[l]._x;
shadows[l]._y = balls[l]._y;
balls[l].dentro = 0;
}
l++;
}
if (((((560 < _xmouse) && (_xmouse < 675)) && (185 < _ymouse)) && (_ymouse < 415)) && (_root.mensaje._currentframe == 3)) {
balls[0]._x = _xmouse;
balls[0]._y = _ymouse;
shadows[0]._x = balls[0]._x;
shadows[0]._y = balls[0]._y;
balls[0].dentro = 0;
b_metida--;
_root.suma--;
switch (_root.currentn - 1) {
case 0 :
switch (_root.players) {
case 2 :
b_2--;
break;
case 3 :
b_3--;
break;
case 4 :
b_4--;
}
break;
case 1 :
b_1--;
break;
case 2 :
b_2--;
break;
case 3 :
b_3--;
}
estado = 0;
_root.mensaje.gotoAndStop(1);
}
}
}
};
onMouseUp = function () {
stick_mc.onEnterFrame = aim;
};
Instance of Symbol 57 MovieClip "table_mc" in Frame 5
onClipEvent (load) {
this.gotoAndStop(_root.col);
}
Instance of Symbol 198 MovieClip in Frame 5
onClipEvent (load) {
if (_root.players > 1) {
this.gotoAndStop(2);
}
}
Instance of Symbol 210 MovieClip in Frame 5
onClipEvent (load) {
if (_root.players > 1) {
this.gotoAndStop(2);
}
}
Instance of Symbol 213 MovieClip in Frame 5
onClipEvent (load) {
_root.seg = 0;
_root.min = 0;
_root.hor = 0;
_root.suma = 0;
}
onClipEvent (load) {
if (_root.players > 2) {
this.gotoAndStop(2);
}
}
onClipEvent (enterFrame) {
if (_root.tiempo == 80) {
_root.seg++;
_root.tiempo = 0;
}
if (_root.seg == 60) {
_root.min++;
_root.seg = 0;
}
if (((_root.suma == 15) && (_root.estado == 0)) && (_root.rules == 1)) {
_root.tir_total = _root.tiro;
_root.seg_total = _root.seg;
_root.min_total = _root.min;
_root.ahog2 = _root.ahog;
_root.popup.gotoAndStop(2);
_root.suma = 16;
}
}
Instance of Symbol 216 MovieClip in Frame 5
onClipEvent (load) {
if (_root.players > 3) {
this.gotoAndStop(2);
}
}
Instance of Symbol 65 MovieClip "b3_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh04._x = _x;
_root.sh04._y = _y;
}
}
Instance of Symbol 68 MovieClip "b2_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh03._x = _x;
_root.sh03._y = _y;
}
}
Instance of Symbol 71 MovieClip "b4_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh05._x = _x;
_root.sh05._y = _y;
}
}
Instance of Symbol 44 MovieClip "b1_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh02._x = _x;
_root.sh02._y = _y;
}
}
Instance of Symbol 35 MovieClip "b8_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh09._x = _x;
_root.sh09._y = _y;
}
}
Instance of Symbol 74 MovieClip "b6_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh07._x = _x;
_root.sh07._y = _y;
}
}
Instance of Symbol 77 MovieClip "b7_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh08._x = _x;
_root.sh08._y = _y;
}
}
Instance of Symbol 80 MovieClip "b5_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh06._x = _x;
_root.sh06._y = _y;
}
}
Instance of Symbol 38 MovieClip "b10_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh11._x = _x;
_root.sh11._y = _y;
}
}
Instance of Symbol 83 MovieClip "b11_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh12._x = _x;
_root.sh12._y = _y;
}
}
Instance of Symbol 86 MovieClip "b12_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh13._x = _x;
_root.sh13._y = _y;
}
}
Instance of Symbol 89 MovieClip "b13_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh14._x = _x;
_root.sh14._y = _y;
}
}
Instance of Symbol 92 MovieClip "b14_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh15._x = _x;
_root.sh15._y = _y;
}
}
Instance of Symbol 41 MovieClip "b15_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh16._x = _x;
_root.sh16._y = _y;
}
}
Instance of Symbol 95 MovieClip "b9_mc" in Frame 5
on (release) {
if (((this.dentro > 0) && (_root.rules == 2)) && (_root.estado == 0)) {
_root.suma--;
_root.b_metida--;
this.dentro = 0;
this._x = 230;
this._y = 290;
_root.sh10._x = _x;
_root.sh10._y = _y;
}
}
Instance of Symbol 256 MovieClip "popup" in Frame 5
onClipEvent (load) {
if (_root.players > 1) {
this.gotoAndStop(3);
}
}
Frame 6
gotoAndStop (5);
Symbol 4 MovieClip Frame 1
stop();
Instance of Symbol 4 MovieClip in Symbol 5 MovieClip Frame 1
onClipEvent (enterFrame) {
if (Key.isDown(1)) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
}
Symbol 9 MovieClip [stickSound] Frame 1
stop();
Symbol 28 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 28 MovieClip Frame 2
gotoAndPlay (1);
Symbol 28 MovieClip Frame 3
_root.play();
Symbol 49 Button
on (release) {
_root.players = 1;
_root.menu1.gotoAndStop(2);
}
Symbol 53 Button
on (release) {
_root.players = 1;
_root.menu1.gotoAndStop(3);
}
Symbol 57 MovieClip Frame 1
stop();
Symbol 96 Button
on (release) {
_root.game = 3;
}
Symbol 97 Button
on (release) {
_root.game = 5;
}
Symbol 101 Button
on (release) {
_root.rules = 1;
}
Symbol 104 Button
on (release) {
_root.rules = 2;
}
Symbol 105 Button
on (release) {
_root.col = 1;
}
Symbol 106 Button
on (release) {
_root.col = 2;
}
Symbol 107 Button
on (release) {
_root.col = 3;
}
Symbol 125 Button
on (release) {
_root.gotoAndStop(_root.game);
}
Symbol 129 Button
on (release) {
_root.players = 3;
_root.menu1.gotoAndStop(5);
}
Symbol 132 Button
on (release) {
_root.players = 2;
_root.menu1.gotoAndStop(4);
}
Symbol 135 Button
on (release) {
_root.players = 4;
_root.menu1.gotoAndStop(6);
}
Symbol 143 Button
on (release) {
_root.menu1.gotoAndStop(2);
}
Symbol 155 MovieClip Frame 1
_root.tut.gotoAndStop(1);
stop();
Symbol 155 MovieClip Frame 2
_root.tut.gotoAndStop("fin");
Instance of Symbol 59 MovieClip in Symbol 155 MovieClip Frame 2
onClipEvent (load) {
_root.game = 3;
_root.puta = 25;
}
onClipEvent (enterFrame) {
if (_root.game == 3) {
_x = (-229 + _root.puta);
_y = (70 + _root.puta);
} else if (_root.game == 5) {
_x = (-229 + _root.puta);
_y = (230 + _root.puta);
}
}
Instance of Symbol 59 MovieClip in Symbol 155 MovieClip Frame 2
onClipEvent (load) {
_root.col = 1;
}
onClipEvent (enterFrame) {
if (_root.col == 1) {
_x = 86;
_y = 97;
} else if (_root.col == 2) {
_x = 86;
_y = 196;
} else if (_root.col == 3) {
_x = 86;
_y = 299;
}
}
Instance of Symbol 59 MovieClip in Symbol 155 MovieClip Frame 2
onClipEvent (load) {
_root.rules = 1;
}
onClipEvent (enterFrame) {
if (_root.rules == 1) {
_x = 334;
_y = (65 + _root.puta);
} else if (_root.rules == 2) {
_x = 334;
_y = (235 + _root.puta);
}
}
Symbol 155 MovieClip Frame 3
_root.tut.gotoAndStop("fin");
Symbol 155 MovieClip Frame 4
_root.tut.gotoAndStop("fin");
Symbol 155 MovieClip Frame 5
_root.tut.gotoAndStop("fin");
Symbol 155 MovieClip Frame 6
_root.tut.gotoAndStop("fin");
Symbol 166 Button
on (release) {
_root.tut.play();
_root.menu1.gotoAndStop(7);
}
Symbol 171 Button
on (release) {
_root.tut.gotoAndStop(1);
_root.menu1.gotoAndStop(1);
}
Symbol 177 MovieClip Frame 1
stop();
Symbol 184 Button
on (release) {
_root.tut.gotoAndPlay("p2");
}
Symbol 186 Button
on (release) {
_root.tut.gotoAndPlay("p3");
}
Symbol 188 Button
on (release) {
_root.tut.gotoAndStop(1);
_root.menu1.gotoAndStop(1);
}
Symbol 189 MovieClip Frame 2
_root.menu1.gotoAndStop(7);
stop();
Instance of Symbol 179 MovieClip in Symbol 189 MovieClip Frame 2
onClipEvent (load) {
cont = 0;
}
onClipEvent (enterFrame) {
cont++;
if (cont == 80) {
_root.tut.play();
cont = 0;
}
}
Symbol 189 MovieClip Frame 65
gotoAndPlay (4);
Instance of Symbol 179 MovieClip in Symbol 189 MovieClip Frame 65
onClipEvent (load) {
cont = 0;
}
onClipEvent (enterFrame) {
cont++;
if (cont == 240) {
_root.tut.play();
cont = 0;
}
}
Instance of Symbol 177 MovieClip in Symbol 189 MovieClip Frame 66
onClipEvent (load) {
this.gotoAndStop(2);
}
Symbol 189 MovieClip Frame 141
gotoAndPlay ("p2");
Symbol 189 MovieClip Frame 350
gotoAndPlay ("p3");
Symbol 193 MovieClip Frame 1
stop();
Symbol 198 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 1
stop();
Symbol 213 MovieClip Frame 1
stop();
Symbol 216 MovieClip Frame 1
stop();
Symbol 224 Button
on (release) {
_root.mensaje.gotoAndStop(3);
}
Symbol 229 MovieClip Frame 1
stop();
Instance of Symbol 228 MovieClip in Symbol 229 MovieClip Frame 3
onClipEvent (load) {
_root.ahog++;
_root.currentn++;
if (_root.currentn > _root.players) {
_root.currentn = 1;
}
switch (_root.currentn) {
case 1 :
_root.current = _root.p1;
break;
case 2 :
_root.current = _root.p2;
break;
case 3 :
_root.current = _root.p3;
break;
case 4 :
_root.current = _root.p4;
}
}
Symbol 233 Button
on (release) {
gotoAndStop (2);
}
Symbol 237 Button
on (release) {
gotoAndStop (4);
}
Symbol 244 MovieClip Frame 40
stop();
Symbol 251 Button
on (release) {
if (_root.rules == 2) {
_root.currentn++;
if (_root.currentn > _root.players) {
_root.currentn = 1;
}
switch (_root.currentn) {
case 1 :
_root.current = _root.p1;
break;
case 2 :
_root.current = _root.p2;
break;
case 3 :
_root.current = _root.p3;
break;
case 4 :
_root.current = _root.p4;
}
}
}
Symbol 255 MovieClip Frame 40
stop();
Symbol 256 MovieClip Frame 1
stop();
Symbol 256 MovieClip Frame 2
if ((_root.rules == 1) && (_root.players > 1)) {
_root.popup.gotoAndStop(4);
}
Instance of Symbol 255 MovieClip in Symbol 256 MovieClip Frame 4
onClipEvent (load) {
switch (_root.players) {
case 2 :
if (_root.b_1 > _root.b_2) {
_root.win = _root.p1;
} else {
_root.win = _root.p2;
}
case 3 :
if ((_root.b_1 > _root.b_2) && (_root.b_1 > _root.b_3)) {
_root.win = _root.p1;
} else if ((_root.b_2 > _root.b_1) && (_root.b_2 > _root.b_3)) {
_root.win = _root.p2;
} else if ((_root.b_3 > _root.b_1) && (_root.b_3 > _root.b_2)) {
_root.win = _root.p3;
} else {
_root.win = "XD nadie";
}
break;
case 4 :
if (((_root.b_1 > _root.b_2) && (_root.b_1 > _root.b_3)) && (_root.b_1 > _root.b_4)) {
_root.win = _root.p1;
} else if (((_root.b_2 > _root.b_1) && (_root.b_2 > _root.b_3)) && (_root.b_2 > _root.b_4)) {
_root.win = _root.p2;
} else if (((_root.b_3 > _root.b_1) && (_root.b_3 > _root.b_2)) && (_root.b_3 > _root.b_4)) {
_root.win = _root.p3;
} else {
_root.win = _root.p4;
}
}
}
Symbol 261 MovieClip Frame 1
stop();
Symbol 261 MovieClip Frame 2
gotoAndStop (1);
Symbol 261 MovieClip Frame 3
gotoAndStop (1);
Symbol 261 MovieClip Frame 4
gotoAndStop (1);
Symbol 265 MovieClip Frame 1
stop();
Instance of Symbol 265 MovieClip in Symbol 266 MovieClip Frame 1
on (release) {
if (this._currentframe == 1) {
_root.music.stop();
this.gotoAndStop(2);
} else {
_root.music.play();
this.gotoAndStop(1);
}
}
Symbol 269 Button
on (release) {
gotoAndStop (6);
}