Frame 1
function getScores() {
if (gProxyObj == undefined) {
listScores();
} else {
gProxyObj.getScores(myCB);
}
}
function submitScore() {
gProxyObj.submitScore(_root.finalScore, myCB);
}
function initHiScores() {
var _local1 = "sb_bc_bowling";
gProxyObj.setGame_Id(_local1);
btnSend._visible = hiScoreEnabled;
}
function detectProxyObj() {
if (gProxyObj == undefined) {
return(false);
}
return(gProxyObj.getIsLoggedIn());
}
function getScoreString() {
var _local2 = _root;
var str = "The high score list is empty.";
_local2.HS_listA1 = "";
_local2.HS_listB1 = "";
_local2.HS_listA2 = "";
_local2.HS_listB2 = "";
_local2.HS_listA3 = "";
_local2.HS_listB3 = "";
_local2.HS_listA4 = "";
_local2.HS_listB4 = "";
if (gProxyObj != undefined) {
var numScores = gProxyObj.getScoreCount();
if (numScores > 0) {
var _local1;
var thisPlayer;
var _local3;
var thisScore;
str = "";
_local1 = 0;
while (_local1 < numScores) {
thisPlayer = gProxyObj.getScoreItem(_local1);
_local3 = thisPlayer[0];
thisScore = thisPlayer[1];
if (_local1 < 26) {
_local2.HS_listA1 = _local2.HS_listA1 + ((((_local1 + 1) + "- ") + _local3) + newline);
_local2.HS_listB1 = _local2.HS_listB1 + (thisScore + newline);
} else if (_local1 < 51) {
_local2.HS_listA2 = _local2.HS_listA2 + ((((_local1 + 1) + "- ") + _local3) + newline);
_local2.HS_listB2 = _local2.HS_listB2 + (thisScore + newline);
} else if (_local1 < 76) {
_local2.HS_listA3 = _local2.HS_listA3 + ((((_local1 + 1) + "- ") + _local3) + newline);
_local2.HS_listB3 = _local2.HS_listB3 + (thisScore + newline);
} else {
_local2.HS_listA4 = _local2.HS_listA4 + ((((_local1 + 1) + "- ") + _local3) + newline);
_local2.HS_listB4 = _local2.HS_listB4 + (thisScore + newline);
}
gotoAndStop ("highScore");
_local1++;
}
}
}
return(str);
}
function listScores() {
getScoreString();
}
function myCB(thisBool) {
listScores();
}
function cbGetScore() {
var _local1 = _root;
_local1.HS_listA1 = "";
_local1.HS_listB1 = "";
_local1.HS_listA2 = "";
_local1.HS_listB2 = "";
_local1.HS_listA3 = "";
_local1.HS_listB3 = "";
_local1.HS_listA4 = "";
_local1.HS_listB4 = "";
nbScore = gProxyObj.getScoreCount();
i = 0;
while (i < nbScore) {
thisPlayer = gProxyObj.getScoreItem(i);
thisName = thisPlayer[0];
thisScore = thisPlayer[1];
if (i < 26) {
_local1.HS_listA1 = _local1.HS_listA1 + ((((i + 1) + "- ") + thisName) + newline);
_local1.HS_listB1 = _local1.HS_listB1 + (thisScore + newline);
} else if (i < 51) {
_local1.HS_listA2 = _local1.HS_listA2 + ((((i + 1) + "- ") + thisName) + newline);
_local1.HS_listB2 = _local1.HS_listB2 + (thisScore + newline);
} else if (i < 76) {
_local1.HS_listA3 = _local1.HS_listA3 + ((((i + 1) + "- ") + thisName) + newline);
_local1.HS_listB3 = _local1.HS_listB3 + (thisScore + newline);
} else {
_local1.HS_listA4 = _local1.HS_listA4 + ((((i + 1) + "- ") + thisName) + newline);
_local1.HS_listB4 = _local1.HS_listB4 + (thisScore + newline);
}
i++;
}
gotoAndStop ("highScore");
}
function myQuit() {
gotoAndStop ("title");
}
Frame 3
var temp = new String(this._url);
var lslash = temp.lastIndexOf("/");
configPath = temp.slice(0, lslash + 1);
sounds.loadMovie(configPath + "Sound.swf", _level1);
Frame 4
if (sounds.getBytesTotal() > 10) {
loading = _root.getBytesLoaded() + sounds.getBytesLoaded();
total = _root.getBytesTotal() + sounds.getBytesTotal();
percent = percent - (percent - ((loading / total) * 100));
PercentDisplay = Math.floor(percent) + "%";
loadbar.gotoAndStop(Math.floor(percent) / 10);
if (loading >= total) {
gotoAndPlay ("title");
}
}
trace(total);
Frame 5
gotoAndPlay (4);
Frame 15
sounds.startsound("music1", 999);
stop();
Frame 19
stop();
Frame 22
stop();
Frame 25
gotoAndStop ("MainLoop");
c.ballStartPosX = 0;
Instance of Symbol 288 MovieClip "c" in Frame 26
onClipEvent (load) {
_global.c = this;
_visible = false;
}
Instance of Symbol 290 MovieClip "direction" in Frame 26
onClipEvent (load) {
_visible = false;
}
Frame 30
c.level++;
if (c.gameover == true) {
trace("gameover");
} else {
play();
}
Instance of Symbol 768 MovieClip "Scoring" in Frame 30
onClipEvent (load) {
c.scoringBar = this;
}
Frame 38
MouseMove = new Array();
MouseMouvement = function () {
DateObject = new Date();
first = new Object();
first.time = DateObject.getTime();
first.x = _level0._xmouse;
first.y = _level0._ymouse;
bob.EndingX = Math.floor(first.x);
if ((MouseMove[MouseMove.length - 1].y > first.y) || (MouseMove.length == 0)) {
MouseMove.push(first);
} else {
MouseMove = new Array();
}
if (first.y < 100) {
MouseTracker.onMouseUp();
}
};
_global.MouseTracker = new Object();
MouseTracker.onMouseDown = function () {
if (bob.inPlace) {
FirstX = undefined;
FirstY = undefined;
CreateTimeout();
}
};
MouseTracker.onMouseUp = function () {
if (((MouseMove.length > 1) && (!c.gamePaused)) && (bob.inPlace == true)) {
DateObject = new Date();
temps2 = DateObject.getTime();
final = new Object();
ObjectInMouseMove = MouseMove.length - 1;
final.x = MouseMove[ObjectInMouseMove].x;
final.y = MouseMove[ObjectInMouseMove].y;
first.y = MouseMove[0].y;
first.x = MouseMove[0].x;
temps1 = MouseMove[0].time;
xdiff = first.x - final.x;
ydiff = first.y - final.y;
angle = Math.atan2(ydiff, xdiff);
angle = (angle * 180) / Math.PI;
if (angle > 90) {
angle = 90 - (angle - 90);
} else if (angle < 90) {
angle = 90 + (90 - angle);
}
Temps = temps2 - temps1;
speed = 5 * (ydiff / temps);
if (speed < 12) {
speed = 12;
}
startPosX = first.x - 300;
if (startPosX > 90) {
startPosX = 90;
} else if (startPosX < -90) {
startPosX = -90;
}
angle = angle - (startPosX / 5);
c.ballStartPosX = startPosX;
c.activateNewTry();
bob.angle = angle;
bob.speed = speed;
if (first.x > 450) {
BobEnd = 450;
} else if (first.x < 150) {
BobEnd = 150;
} else {
BobEnd = first.x;
}
bob.EndingX = Math.floor(BobEnd);
bob.gotoAndPlay("turnAround");
removeMovieClip(timeoutMouse);
MouseMove = new Array();
}
};
CreateTimeout = function () {
this.createEmptyMovieClip("timeoutMouse", 100);
timeoutMouse.onEnterFrame = function () {
MouseMouvement();
};
};
Mouse.addListener(MouseTracker);
holder.ball._visible = false;
stop();
if (c.level == 1) {
c.processLevel(c.level);
}
stop();
Frame 45
_root.finalScore = (_root.score + c.JellyfishScore) * c.starfishScore;
if ((_root.enableHS == false) or (_root.enableHS == undefined)) {
btnSend._visible = false;
} else {
btnSend._visible = true;
}
stop();
Symbol 16 MovieClip Frame 1
stop();
Symbol 56 Button
on (press) {
gotoAndPlay ("play");
}
Symbol 61 Button
on (press) {
gotoAndPlay ("instruct");
}
Symbol 157 Button
on (release) {
gotoAndStop ("instruc2");
}
Symbol 198 Button
on (release) {
gotoAndStop ("instruct");
}
Symbol 207 MovieClip Frame 1
stop();
if (pf == undefined) {
APE(this, 2);
}
Symbol 207 MovieClip Frame 6
e = 0;
while (e < c.tabQuille.length) {
if (c.tabQuille[e][0] == _parent.tag) {
break;
}
e++;
}
c.tabQuille.splice(e, 1);
Symbol 207 MovieClip Frame 17
_parent.swapDepths(10000);
_parent.removeMovieClip();
stop();
Symbol 211 MovieClip Frame 1
Symbol 213 MovieClip [obs_quille] Frame 1
if (pf == undefined) {
APE(this, 0);
}
Instance of Symbol 212 MovieClip "puck" in Symbol 213 MovieClip [obs_quille] Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 213 MovieClip [obs_quille] Frame 2
if (!c.gamePaused) {
if (speed > 0) {
puck._rotation = rotation;
if (speed > 35) {
speed = 35;
}
collided = false;
moveTempX = Math.cos((Math.PI/180) * rotation) * speed;
moveTempY = Math.sin((Math.PI/180) * rotation) * speed;
x1 = x;
y1 = z;
x2 = x1 + moveTempX;
y2 = y1 + moveTempY;
m = (y2 - y1) / (x2 - x1);
b = -((m * x1) - y1);
a = 0;
while (a < c.tabQuille.length) {
if (c.tabQuille[a][0] != tag) {
h = c.tabQuille[a][1];
k = c.tabQuille[a][3];
d = Math.abs(((m * h) - k) + b) / Math.sqrt((m * m) + 1);
d2 = Math.sqrt(((h - x1) * (h - x1)) + ((k - y1) * (k - y1)));
d22 = Math.sqrt(((h - x2) * (h - x2)) + ((k - y2) * (k - y2)));
if ((d22 < r) and (_parent["quille_" + c.tabQuille[a][0]].lastCollision != tag)) {
_parent["quille_" + c.tabQuille[a][0]].quille.gotoAndPlay("hit");
collided = true;
f = d / (2 * r);
w = Math.acos(f);
w = (w / (Math.PI/180)) - 90;
d4 = Math.sqrt(((2 * r) * (2 * r)) - (d * d));
d5 = Math.sqrt((d2 * d2) - (d * d));
d6 = d5 - d4;
moveTempX = Math.cos((Math.PI/180) * rotation) * d6;
moveTempY = Math.sin((Math.PI/180) * rotation) * d6;
x = x + moveTempX;
z = z + moveTempY;
c.tabQuille[a][1] = c.tabQuille[a][1] + moveTempX;
c.tabQuille[a][3] = c.tabQuille[a][3] + moveTempY;
_parent["quille_" + c.tabQuille[a][0]].lastCollision = tag;
newSpeed = (Math.abs(w) / 90) * speed;
_parent["quille_" + c.tabQuille[a][0]].speed = _parent["quille_" + c.tabQuille[a][0]].speed + (speed - newSpeed);
speed = newSpeed * 0.8;
if (puck.hitR.hitTest(_parent["quille_" + c.tabQuille[a][0]].puck.hitZone)) {
_parent["quille_" + c.tabQuille[a][0]].rotation = rotation - w;
modRot = Math.abs(Math.abs(Math.abs(w) - 45) - 45);
rotation = rotation - modRot;
} else {
_parent["quille_" + c.tabQuille[a][0]].rotation = rotation + w;
modRot = Math.abs(Math.abs(Math.abs(w) - 45) - 45);
rotation = rotation + modRot;
}
moveTempDefX = Math.cos((Math.PI/180) * _parent["quille_" + c.tabQuille[a][0]].rotation) * 4;
moveTempDefY = Math.sin((Math.PI/180) * _parent["quille_" + c.tabQuille[a][0]].rotation) * 4;
_parent["quille_" + c.tabQuille[a][0]].x = _parent["quille_" + c.tabQuille[a][0]].x + moveTempDefX;
_parent["quille_" + c.tabQuille[a][0]].z = _parent["quille_" + c.tabQuille[a][0]].z + moveTempDefY;
c.tabQuille[a][1] = c.tabQuille[a][1] + moveTempDefX;
c.tabQuille[a][3] = c.tabQuille[a][3] + moveTempDefY;
_parent["quille_" + c.tabQuille[a][0]].play();
}
}
a++;
}
if (!collided) {
x = x2;
z = y2;
c.tabQuille[a][1] = x2;
c.tabQuille[a][3] = y2;
} else {
x = x - moveTempDefX;
z = z - moveTempDefY;
c.tabQuille[a][1] = c.tabQuille[a][1] - moveTempDefX;
c.tabQuille[a][3] = c.tabQuille[a][3] - moveTempDefY;
}
speed = speed - decel;
curProp = c.extractTruePos(x, y, z);
this.swapDepths(curProp[2]);
this._x = curProp[0];
this._y = curProp[1];
this._xscale = (this._yscale = 100 * curProp[3]);
} else {
speed = 0;
lastCollision = -1;
gotoAndStop (1);
}
}
Symbol 213 MovieClip [obs_quille] Frame 3
call(2);
Symbol 213 MovieClip [obs_quille] Frame 4
gotoAndPlay (3);
Symbol 221 MovieClip Frame 57
stop();
Symbol 222 MovieClip Frame 55
stop();
Symbol 223 MovieClip [obs_axe] Frame 1
stop();
Symbol 223 MovieClip [obs_axe] Frame 83
this.swapDepths(10003);
this.removeMovieClip();
Symbol 257 MovieClip Frame 28
c.JellyfishScore = c.JellyfishScore + 5;
stop();
Symbol 260 MovieClip Frame 28
c.JellyfishScore = c.JellyfishScore + 10;
stop();
Symbol 263 MovieClip Frame 28
c.JellyfishScore = c.JellyfishScore + 15;
stop();
Symbol 264 MovieClip Frame 1
this.gotoAndStop(Math.floor(Math.random() * 3) + 2);
Symbol 266 MovieClip [obs_JellyFish] Frame 1
stop();
Symbol 266 MovieClip [obs_JellyFish] Frame 121
stop();
Symbol 273 MovieClip Frame 55
stop();
Symbol 274 MovieClip [obs_fire] Frame 1
stop();
Symbol 274 MovieClip [obs_fire] Frame 31
stop();
Symbol 278 MovieClip Frame 28
c.starfishScore = c.starfishScore + 0.2;
stop();
Symbol 281 MovieClip Frame 28
c.starfishScore = c.starfishScore + 0.4;
stop();
Symbol 282 MovieClip Frame 1
this.gotoAndStop(Math.floor(Math.random() * 2) + 2);
Symbol 284 MovieClip [obs_StarFish] Frame 1
stop();
Symbol 284 MovieClip [obs_StarFish] Frame 85
stop();
Symbol 288 MovieClip Frame 1
if (pf == undefined) {
APE(this, 0);
}
Array.prototype.deleteOne = function (element) {
var _local1 = this;
var _local2 = element;
thisLength = _local1.length;
i = 0;
while (i < thisLength) {
if (_local1[i] == _local2) {
_local1.splice(i, 1);
return;
}
i++;
}
};
make3DPoint = function (x, y, z) {
var _local1 = new Object();
_local1.x = x;
_local1.y = y;
_local1.z = z;
return(_local1);
};
make2DPoint = function (x, y, depth, scaleFactor) {
var _local1 = new Object();
_local1.x = x;
_local1.y = y;
_local1.depth = depth;
_local1.scaleFactor = scaleFactor;
return(_local1);
};
playerWait = true;
gamePaused = false;
gameOver = false;
level = 1;
maxlevel = 10;
strikeSound = false;
CleanFirePlace = false;
nbTry = 2;
_root.score = 0;
starfishScore = 1;
JellyfishScore = 0;
alleWidth = 280;
alleDepth = 900;
focalLength = 345;
cubeAxisRotations = new Object();
cubeAxisRotations.x = (changeX = 0.25);
cubeAxisRotations.y = (changeY = 0);
cubeAxisRotations.z = (changeZ = 0);
oScore = new Object();
i = 0;
while (i < 12) {
Set("oScore.level" + i, new Object());
j = 0;
while (j < 3) {
Set((("oScore.level" + i) + ".score") + j, undefined);
j++;
}
i++;
}
oScore.level9.score3 = undefined;
tabObs = new Array();
curProp = new Array();
tabQuille = new Array();
ballStartPosX = 0;
ball = new Object();
ball.x = 0;
ball.y = 0;
ball.z = 0;
ball.isInPain = false;
ball.enableControl = false;
ball.suckedIn = false;
ball.drifting = false;
ball.shield = false;
ball.atomic = false;
ball.spread = false;
ball.slideX = 0;
ball.slideZ = 0;
ball.r = 22;
ball.rotation = 90;
ball.speed = 0;
ball.maxRotation = 70;
ball.normRotation = 90;
ball.maxSpeed = 14;
ball.normSpeed = 6;
ball.minSpeed = 3;
ball.accelSpeed = 0.2;
ball.accelRot = 0.25;
ball.speedX = 0;
ball.speedY = 0;
ball.speedZ = 0;
ball.accelX = 0.3;
ball.accelZ = 0.2;
ball.maxSpeedX = 4;
ball.maxSpeedY = 0;
ball.maxSpeedZ = 6;
ball.minSpeedZ = -1;
addObs = function (obsRef) {
var _local1 = obsRef;
tabObs.push([_local1._name, _local1.x, _local1.y, _local1.z, _local1.r, _local1.obsType]);
var _local2 = extractTruePos(_local1.x, _local1.y, _local1.z);
_local1._x = _local2[0];
_local1._y = _local2[1];
if (_local1.obsType == "blackHole") {
_local1.swapDepths(_local2[2] - 100);
} else {
_local1.swapDepths(_local2[2]);
}
_local1._xscale = (_local1._yscale = 100 * _local2[3]);
};
extractTruePos = function (objX, objY, objZ) {
var sx = 0.266731436688831;
var cx = 0.963770896365891;
var _local3;
var _local1;
var z;
var xy;
var xz;
var _local2;
_local3 = objX;
_local1 = objY + 100;
z = objZ - 100;
xy = (cx * _local1) - (sx * z);
xz = (sx * _local1) + (cx * z);
_local2 = focalLength / (focalLength + xz);
_local3 = _local3 * _local2;
_local1 = xy * _local2;
return([_local3, _local1, -xz, _local2]);
};
affect3D = function (points, axisRotations) {
var TransformedPointsArray = [];
var sx = Math.sin(axisRotations.x);
var cx = Math.cos(axisRotations.x);
var sy = Math.sin(axisRotations.y);
var cy = Math.cos(axisRotations.y);
var sz = Math.sin(axisRotations.z);
var cz = Math.cos(axisRotations.z);
var x;
var _local3;
var _local2;
var xy;
var xz;
var yx;
var yz;
var zx;
var zy;
var scaleFactor;
var _local1 = points.length;
while (_local1--) {
x = points[_local1].x;
_local3 = points[_local1].y + 100;
_local2 = points[_local1].z - 100;
xy = (cx * _local3) - (sx * _local2);
xz = (sx * _local3) + (cx * _local2);
yz = (cy * xz) - (sy * x);
yx = (sy * xz) + (cy * x);
zx = (cz * yx) - (sz * xy);
zy = (sz * yx) + (cz * xy);
scaleFactor = focalLength / (focalLength + yz);
x = zx * scaleFactor;
_local3 = zy * scaleFactor;
_local2 = yz;
TransformedPointsArray[_local1] = make2DPoint(x, _local3, -_local2, scaleFactor);
}
return(TransformedPointsArray);
};
update3DView = function () {
var _local2 = _parent;
cubeAxisRotations.x = changeX;
cubeAxisRotations.y = changeY;
cubeAxisRotations.z = changeZ;
var _local1 = affect3D(pointsArray, cubeAxisRotations);
i = 0;
while (i < pointsArray.length) {
currBalloon = _local2.holder["greenBall" + i];
currBalloon._x = _local1[i].x;
currBalloon._y = _local1[i].y;
currBalloon._xscale = (currBalloon._yscale = 100 * _local1[i].scaleFactor);
currBalloon.swapDepths(_local1[i].depth + 100);
i++;
}
updateAfterEvent();
};
_global.PlaySound = function (theSound, loop) {
_parent.sounds.startsound(theSound, loop);
};
_global.StopSound = function (theSound) {
_parent.sounds.stopsound(theSound, loop);
};
throwBall = function (angle, speed) {
var _local1 = speed;
Playsound("ball_rolling", 999);
ball.rotation = angle;
ball.slideX = 0;
_parent.holder.ball._visible = true;
_parent.holder.ballShade._visible = true;
playerWait = false;
ball.enableControl = true;
if (_local1 > 16) {
_local1 = 16;
}
ball.speed = _local1;
};
resetBall = function () {
var _local1 = _parent;
if (((level != 10) && (tabQuille.length > 0)) && (nbtry != 0)) {
_local1.tries.gotoAndStop(3 - nbtry);
} else if ((level == 10) && (oScore.level9.score0 == 2)) {
_local1.tries.gotoAndStop(1);
}
_local1.holder.ball.gotoAndPlay("normal");
ball.isInPain = false;
strikeSound = false;
ball.lastCollision = "";
ball.fire = false;
ball.spread = false;
ball.rotation = 90;
ball.speed = 0;
ball.daloR = false;
ball.daloL = false;
ball.x = 0;
ball.y = 0;
ball.z = 0;
ball.suckedIn = false;
ball.drifting = false;
ball.enableControl = false;
_local1.holder.ball._visible = false;
_local1.holder.ballShade._visible = false;
playerWait = true;
CalculateScore();
nbTry--;
affectTries();
};
activateNewTry = function () {
ball.x = ballStartPosX;
};
affectTries = function () {
var _local1 = _parent;
switch (nbTry) {
case 2 :
_local1.try_1.gotoAndStop(1);
_local1.try_2.gotoAndStop(1);
return;
case 1 :
_local1.try_1.gotoAndStop(1);
_local1.try_2.gotoAndStop(2);
return;
case 0 :
_local1.try_1.gotoAndStop(2);
_local1.try_2.gotoAndStop(2);
}
};
CalculateScore = function () {
if (nbtry != 2) {
if (level != 10) {
if (c.tabQuille.length <= 0) {
if ((nbTry >= 0) && (eval (("oScore.level" + (level - 1)) + ".score0") == undefined)) {
PatrickSculpting(10);
nbStrike++;
Set(("oScore.level" + (level - 1)) + ".score0", "strike");
eval (("scoringBar.score" + level) + ".score2").gotoAndStop(3);
PlaySound("scoreAppears");
if ((eval (("oScore.level" + (level - 2)) + ".score0") == "strike") && (eval (("oScore.level" + (level - 3)) + ".score0") == "strike")) {
Set(("oScore.level" + (level - 3)) + ".score2", 30);
}
if (eval (("oScore.level" + (level - 2)) + ".score1") == "spare") {
Set(("oScore.level" + (level - 2)) + ".score2", 20);
}
} else if (eval (("oScore.level" + (level - 1)) + ".score1") == undefined) {
PatrickSculpting(10);
nbStrike = 0;
eval (("scoringBar.score" + level) + ".score2").gotoAndStop(2);
PlaySound("scoreAppears");
Set(("oScore.level" + (level - 1)) + ".score1", "spare");
if (eval (("oScore.level" + (level - 2)) + ".score0") == "strike") {
Set(("oScore.level" + (level - 2)) + ".score2", 20);
}
}
} else {
nbStrike = 0;
if (nbTry == 1) {
var ShotScore = (10 - tabQuille.length);
Set(("oScore.level" + (level - 1)) + ".score0", ShotScore);
if (eval (("oScore.level" + (level - 2)) + ".score1") == "spare") {
Set(("oScore.level" + (level - 2)) + ".score2", 10 + ShotScore);
}
if ((eval (("oScore.level" + (level - 3)) + ".score0") == "strike") && (eval (("oScore.level" + (level - 2)) + ".score0") == "strike")) {
Set(("oScore.level" + (level - 3)) + ".score2", 20 + ShotScore);
}
Set(("scoringBar.score" + level) + ".score1.score1", ShotScore);
PlaySound("scoreAppears");
PatrickSculpting(eval (("oScore.level" + (level - 1)) + ".score0"));
} else {
var ShotScore = ((10 - tabQuille.length) - eval (("oScore.level" + (level - 1)) + ".score0"));
Set(("oScore.level" + (level - 1)) + ".score1", ShotScore);
Set(("oScore.level" + (level - 1)) + ".score2", eval (("oScore.level" + (level - 1)) + ".score0") + eval (("oScore.level" + (level - 1)) + ".score1"));
if (eval (("oScore.level" + (level - 2)) + ".score0") == "strike") {
Set(("oScore.level" + (level - 2)) + ".score2", (10 + eval (("oScore.level" + (level - 1)) + ".score0")) + eval (("oScore.level" + (level - 1)) + ".score1"));
}
Set(("scoringBar.score" + level) + ".score2.score2", ShotScore);
PlaySound("scoreAppears");
PatrickSculpting(eval (("oScore.level" + (level - 1)) + ".score1"));
}
}
} else if (oScore.level9.score0 == undefined) {
_parent.tries.gotoAndStop(2);
if (c.tabQuille.length <= 0) {
nbTry = nbTry + 1;
oScore.level9.score0 = "strike";
scoringBar.score10.score1.gotoAndStop(3);
PlaySound("scoreAppears");
if ((eval (("oScore.level" + (level - 2)) + ".score0") == "strike") && (eval (("oScore.level" + (level - 3)) + ".score0") == "strike")) {
Set(("oScore.level" + (level - 3)) + ".score2", 30);
}
if (eval (("oScore.level" + (level - 2)) + ".score1") == "spare") {
Set(("oScore.level" + (level - 2)) + ".score2", 20);
}
PatrickSculpting(10);
LevelTenContinue = true;
} else {
var ShotScore = (10 - tabQuille.length);
oScore.level9.score0 = ShotScore;
if (eval (("oScore.level" + (level - 2)) + ".score1") == "spare") {
Set(("oScore.level" + (level - 2)) + ".score2", 10 + ShotScore);
}
if ((eval (("oScore.level" + (level - 3)) + ".score0") == "strike") && (eval (("oScore.level" + (level - 2)) + ".score0") == "strike")) {
Set(("oScore.level" + (level - 3)) + ".score2", 20 + ShotScore);
}
scoringBar.score10.score1.score1 = ShotScore;
PlaySound("scoreAppears");
PatrickSculpting(oScore.level9.score0);
}
} else if (oScore.level9.score1 == undefined) {
if ((c.tabQuille.length <= 0) && (oScore.level9.score0 == "strike")) {
_parent.tries.gotoAndStop(3);
oScore.level9.score1 = "strike";
scoringBar.score10.score2.gotoAndStop(3);
PlaySound("scoreAppears");
if ((eval (("oScore.level" + (level - 2)) + ".score0") == "strike") && (oScore.level9.score0 == "strike")) {
Set(("oScore.level" + (level - 2)) + ".score2", 30);
}
LevelTenContinue = true;
PatrickSculpting(10);
} else if ((c.tabQuille.length <= 0) && (oScore.level9.score0 != "strike")) {
_parent.tries.gotoAndStop(3);
nbTry = nbTry + 1;
oScore.level9.score1 = "spare";
scoringBar.score10.score2.gotoAndStop(2);
PlaySound("scoreAppears");
if (eval (("oScore.level" + (level - 2)) + ".score0") == "strike") {
Set(("oScore.level" + (level - 2)) + ".score2", 20);
}
LevelTenContinue = true;
PatrickSculpting(10);
} else {
var ShotScore = (10 - tabQuille.length);
trace("here " + ShotScore);
oScore.level9.score1 = ShotScore;
LevelTenContinue = false;
if (eval (("oScore.level" + (level - 2)) + ".score0") == "strike") {
if (oScore.level9.score0 != "strike") {
Set(("oScore.level" + (level - 2)) + ".score2", (10 + oScore.level9.score0) + ShotScore);
} else {
Set(("oScore.level" + (level - 2)) + ".score2", 20 + ShotScore);
}
}
scoringBar.score10.score2.score2 = ShotScore;
PlaySound("scoreAppears");
if (oScore.level9.score0 != "strike") {
oScore.level9.score2 = oScore.level9.score0 + shotScore;
gameOver = true;
} else {
nbtry = nbtry + 1;
_parent.tries.gotoAndStop(3);
}
PatrickSculpting(ShotScore);
}
} else if (oScore.level9.score3 == undefined) {
if (((c.tabQuille.length <= 0) && (oScore.level9.score0 == "strike")) && (oScore.level9.score1 == "strike")) {
nbTry = -5;
gameOver = true;
LevelTenContinue = false;
oScore.level9.score3 = "strike";
oScore.level9.score2 = 30;
scoringBar.score10.score3.gotoAndStop(3);
PlaySound("scoreAppears");
PatrickSculpting(10);
} else if ((c.tabQuille.length <= 0) && (oScore.level9.score1 == "spare")) {
nbTry = -5;
gameOver = true;
LevelTenContinue = false;
oScore.level9.score3 = "strike";
oScore.level9.score2 = 20;
scoringBar.score10.score3.gotoAndStop(3);
PlaySound("scoreAppears");
PatrickSculpting(10);
} else if ((oScore.level9.score1 == "strike") && (oScore.level9.score0 == "strike")) {
nbTry = -5;
gameOver = true;
LevelTenContinue = false;
var ShotScore = (10 - tabQuille.length);
oScore.level9.score3 = ShotScore;
oScore.level9.score2 = 20 + ShotScore;
scoringBar.score10.score3.score3 = ShotScore;
PlaySound("scoreAppears");
PatrickSculpting(ShotScore);
} else if (oScore.level9.score1 == "spare") {
nbTry = -5;
gameOver = true;
LevelTenContinue = false;
var ShotScore = (10 - tabQuille.length);
oScore.level9.score3 = ShotScore;
oScore.level9.score2 = 10 + ShotScore;
scoringBar.score10.score3.score3 = ShotScore;
PlaySound("scoreAppears");
PatrickSculpting(ShotScore);
} else if (oScore.level9.score0 == "strike") {
nbTry = -5;
gameOver = true;
LevelTenContinue = false;
var ShotScore = ((10 - tabQuille.length) - oScore.level9.score1);
oScore.level9.score3 = ShotScore;
oScore.level9.score2 = (10 + oScore.level9.score1) + ShotScore;
scoringBar.score10.score3.score3 = ShotScore;
PlaySound("scoreAppears");
PatrickSculpting(ShotScore);
}
}
_root.score = 0;
i = 0;
while (i < 12) {
var tempScore = eval (("oScore.level" + i) + ".score2");
_root.score = _root.score + tempScore;
if (tempScore != undefined) {
Set(("scoringBar.score" + (i + 1)) + ".total", _root.score);
}
i++;
}
}
};
PatrickSculpting = function (points) {
var _local1 = _parent;
var _local2 = points;
if (_local2 != 0) {
_local1.patrick.score = _local2;
_local1.patrick.gotoAndPlay("grave");
} else {
_local1.patrick.gotoAndPlay("gratte");
BobReaction(_local2);
}
};
BobReaction = function (point) {
var _local1 = _parent;
var _local2 = point;
if (_local2 == 10) {
_local1.bob.gotoAndPlay("veryHappy");
playsound("SB_flexing");
} else if ((_local2 < 10) && (_local2 > 0)) {
_local1.bob.gotoAndPlay("Happy");
playsound("SB_laugh_short");
} else {
_local1.bob.gotoAndPlay("sad");
}
};
WhatsNext = function () {
var _local1 = _parent;
if (LevelTenContinue == true) {
_local1.armRemove.gotoAndPlay("play");
_local1.patrick.score = 0;
_local1.patrick.gotoAndPlay("grave");
} else if ((nbTry <= -1) or ((tabQuille.length <= 0) && (level != 10))) {
if (nbtry != -6) {
_local1.gotoAndStop("NextLevel");
_local1.armRemove.gotoAndPlay("play");
if (tabQuille.length != 10) {
_local1.patrick.score = 0;
_local1.patrick.gotoAndPlay("grave");
}
} else {
_local1.gotoAndStop("NextLevel");
}
}
};
PlacePinsOnPanel = function () {
a = 0;
while (a < 10) {
eval ("_parent.quille" + a).gotoAndStop(1);
a++;
}
};
removePinsOnPanel = function () {
var tempPinArray = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
a = 0;
while (a < 10) {
if (tabQuille[a][0] != undefined) {
tempPinArray.deleteOne(tabQuille[a][0]);
}
a++;
}
i = 0;
while (i < tempPinArray.length) {
eval ("_parent.quille" + tempPinArray[i]).gotoAndStop(2);
i++;
}
};
pause = function () {
gamePaused = true;
_global.b.broadcastMessage("onPause");
_parent.popHelp.gotoAndStop("show");
};
unpause = function () {
_parent.popHelp.gotoAndStop("idle");
gamePaused = false;
_global.b.broadcastMessage("onPlay");
};
tabLevel = new Array();
RandomXpos = function (modifier) {
return(Math.floor(Math.random() * 80) + modifier);
};
RandomZpos = function (modifier) {
return(Math.floor(Math.random() * 600) + 150);
};
tabLevel[0] = new Array();
tabLevel[0].push(["starfish_1", RandomXpos(0), 0, RandomZpos(), 18, "starfish"]);
tabLevel[0].push(["jellyfish_2", RandomXpos(-80), 0, RandomZpos(), 18, "jellyfish"]);
tabLevel[1] = new Array();
tabLevel[1].push(["fire_1", 0, 0, RandomZpos(), 18, "fire"]);
tabLevel[1].push(["starfish_2", RandomXpos(-80), 0, RandomZpos(), 18, "starfish"]);
tabLevel[2] = new Array();
tabLevel[2].push(["starfish_1", RandomXpos(0), 0, RandomZpos(), 18, "starfish"]);
tabLevel[2].push(["starfish_2", RandomXpos(-80), 0, RandomZpos(), 18, "starfish"]);
tabLevel[3] = new Array();
tabLevel[3].push(["jellyfish_1", RandomXpos(0), 0, RandomZpos(), 18, "jellyfish"]);
tabLevel[3].push(["axe_2", 0, 0, RandomZpos(), 18, "axe"]);
tabLevel[4] = new Array();
tabLevel[4].push(["starfish_1", RandomXpos(0), 0, RandomZpos(), 18, "starfish"]);
tabLevel[4].push(["jellyfish_2", RandomXpos(-80), 0, RandomZpos(), 18, "jellyfish"]);
tabLevel[5] = new Array();
tabLevel[5].push(["axe_1", 0, 0, RandomZpos(), 18, "axe"]);
tabLevel[5].push(["jellyfish_2", RandomXpos(-80), 0, RandomZpos(), 18, "jellyfish"]);
tabLevel[6] = new Array();
tabLevel[6].push(["starfish_1", RandomXpos(0), 0, RandomZpos(), 18, "starfish"]);
tabLevel[6].push(["starfish_2", RandomXpos(-80), 0, RandomZpos(), 18, "starfish"]);
tabLevel[7] = new Array();
tabLevel[7].push(["jellyfish_1", RandomXpos(0), 0, RandomZpos(), 18, "jellyfish"]);
tabLevel[8] = new Array();
tabLevel[8].push(["starfish_1", RandomXpos(-80), 0, RandomZpos(), 18, "starfish"]);
tabLevel[8].push(["fire_2", 0, 0, RandomZpos(), 18, "fire"]);
tabLevel[9] = new Array();
tabLevel[9].push(["starfish_1", RandomXpos(0), 0, RandomZpos(), 18, "starfish"]);
tabLevel[9].push(["starfish_2", RandomXpos(-80), 0, RandomZpos(), 18, "starfish"]);
tabLevel[9].push(["jellyfish_3", RandomXpos(0), 0, RandomZpos(), 18, "jellyfish"]);
clearLevel = function (theLevel) {
var _local1 = _parent;
nbTry = 2;
affectTries();
indexLevel = theLevel - 2;
if (!LevelTenContinue) {
a = 0;
while (a < tabLevel[indexLevel].length) {
_local1.holder[tabLevel[indexLevel][a][0]].swapDepths(10001);
_local1.holder[tabLevel[indexLevel][a][0]].removeMovieClip();
a++;
}
tabObs.splice(0);
}
a = 0;
while (a < tabQuille.length) {
_local1.holder["quille_" + tabQuille[a][0]].swapDepths(10001);
_local1.holder["quille_" + tabQuille[a][0]].removeMovieClip();
a++;
}
tabQuille.splice(0);
};
processLevel = function (theLevel) {
var _local1 = _parent;
var _local2 = theLevel;
_local1.theround.gotoAndStop(_local2);
if (_local2 <= 10) {
indexLevel = _local2 - 1;
level = _local2;
nbTry = 2;
if (!LevelTenContinue) {
a = 0;
while (a < tabLevel[indexLevel].length) {
_local1.holder.attachMovie("obs_" + tabLevel[indexLevel][a][5], tabLevel[indexLevel][a][0], tabLevel[indexLevel][a][3]);
_local1.holder[tabLevel[indexLevel][a][0]].x = tabLevel[indexLevel][a][1];
_local1.holder[tabLevel[indexLevel][a][0]].y = tabLevel[indexLevel][a][2];
_local1.holder[tabLevel[indexLevel][a][0]].z = tabLevel[indexLevel][a][3];
_local1.holder[tabLevel[indexLevel][a][0]].r = tabLevel[indexLevel][a][4];
_local1.holder[tabLevel[indexLevel][a][0]].obsType = tabLevel[indexLevel][a][5];
addObs(_local1.holder[tabLevel[indexLevel][a][0]]);
a++;
}
}
pF = 0;
tabQuille.push([0, 0 + pF, 0, 800]);
tabQuille.push([1, -25 + pF, 0, 861]);
tabQuille.push([2, 25 + pF, 0, 862]);
tabQuille.push([3, -50 + pF, 0, 921]);
tabQuille.push([4, 1 + pF, 0, 922]);
tabQuille.push([5, 50 + pF, 0, 923]);
tabQuille.push([7, -25 + pF, 0, 981]);
tabQuille.push([8, 25 + pF, 0, 982]);
tabQuille.push([6, -75 + pF, 0, 983]);
tabQuille.push([9, 75 + pF, 0, 984]);
resetBall();
if (level == 1) {
placePins();
}
}
};
placePins = function () {
var _local1 = _parent;
a = 0;
while (a < tabQuille.length) {
_local1.holder.attachMovie("obs_quille", "quille_" + tabQuille[a][0], tabQuille[a][3]);
_local1.holder["quille_" + tabQuille[a][0]].x = tabQuille[a][1];
_local1.holder["quille_" + tabQuille[a][0]].y = tabQuille[a][2];
_local1.holder["quille_" + tabQuille[a][0]].z = tabQuille[a][3];
_local1.holder["quille_" + tabQuille[a][0]].tag = tabQuille[a][0];
_local1.holder["quille_" + tabQuille[a][0]].rotation = 0;
_local1.holder["quille_" + tabQuille[a][0]].collided = false;
_local1.holder["quille_" + tabQuille[a][0]].r = 20;
curProp = extractTruePos(tabQuille[a][1], tabQuille[a][2], tabQuille[a][3]);
_local1.holder["quille_" + tabQuille[a][0]].swapDepths(curProp[2]);
_local1.holder["quille_" + tabQuille[a][0]]._x = curProp[0];
_local1.holder["quille_" + tabQuille[a][0]]._y = curProp[1];
_local1.holder["quille_" + tabQuille[a][0]]._xscale = (_local1.holder["quille_" + tabQuille[a][0]]._yscale = 100 * curProp[3]);
a++;
}
};
BrunswickPinsFall = function () {
var _local1 = _parent;
if (CleanFirePlace) {
_local1.fire.gotoAndStop(1);
CleanFirePlace = false;
} else {
playSound("reset_pins");
a = 0;
while (a < tabQuille.length) {
if (!_local1.holder["quille_" + tabQuille[a][0]].falling) {
_local1.holder["quille_" + tabQuille[a][0]].speed = 5;
_local1.holder["quille_" + tabQuille[a][0]].falling = true;
_local1.holder["quille_" + tabQuille[a][0]].quille.gotoAndPlay("hit");
_local1.holder["quille_" + tabQuille[a][0]].rotation = 90;
_local1.holder["quille_" + tabQuille[a][0]].play();
}
a++;
}
}
};
Symbol 288 MovieClip Frame 2
Symbol 288 MovieClip Frame 3
if (ball.x > 0) {
ball.slideX = ball.slideX + 0.005;
} else {
ball.slideX = ball.slideX - 0.005;
}
if (ball.daloR) {
ball.x = 125;
}
if (ball.daloL) {
ball.x = -125;
} else if (ball.suckedIn) {
ball.speed = -30;
ball.y = ball.y + 3;
}
if (ball.enableControl and (!playerWait)) {
if (Key.isDown(37)) {
ball.rotation = ball.rotation + ball.accelRot;
if (ball.rotation > (ball.normRotation + ball.maxRotation)) {
ball.rotation = ball.normRotation + ball.maxRotation;
}
} else if (Key.isDown(39)) {
ball.rotation = ball.rotation - ball.accelRot;
if (ball.rotation < (ball.normRotation - ball.maxRotation)) {
ball.rotation = ball.normRotation - ball.maxRotation;
}
}
}
if (!playerWait) {
if (((ball.speed > 0) or (ball.slideX != 0)) or (ball.slideZ != 0)) {
collided = false;
var moveTempX = (Math.cos((Math.PI/180) * ball.rotation) * ball.speed);
var moveTempY = (Math.sin((Math.PI/180) * ball.rotation) * ball.speed);
var x1 = ball.x;
var y1 = ball.z;
var x2 = ((x1 + moveTempX) + ball.slideX);
var y2 = ((y1 + moveTempY) + ball.slideZ);
var m = ((y2 - y1) / (x2 - x1));
var b = (-((m * x1) - y1));
if (ball.y == 0) {
if (ball.z < 760) {
a = 0;
while (a < tabObs.length) {
var h = tabObs[a][1];
var k = tabObs[a][3];
var obsR = tabObs[a][4];
if (m == Number.POSITIVE_INFINITY) {
var d = Math.abs(h - x1);
} else if (m == Number.NEGATIVE_INFINITY) {
var d = Math.abs(k - y1);
} else {
var d = (Math.abs(((m * h) - k) + b) / Math.sqrt((m * m) + 1));
}
var d2 = Math.sqrt(((h - x1) * (h - x1)) + ((k - y1) * (k - y1)));
var d22 = Math.sqrt(((h - x2) * (h - x2)) + ((k - y2) * (k - y2)));
if ((d < (ball.r + obsR)) and (d2 < ((ball.speed + ball.r) + obsR))) {
if (tabObs[a][5] == "jellyfish") {
PlaySound("Jellyfish");
ball.lastCollision = "";
_parent.holder[tabObs[a][0]].gotoAndPlay("hit");
tabObs.splice(a, 1);
} else if (tabObs[a][5] == "starfish") {
PlaySound("Ball_special_01");
ball.lastCollision = "";
_parent.holder[tabObs[a][0]].gotoAndPlay("hit");
tabObs.splice(a, 1);
} else if (tabObs[a][5] == "axe") {
PlaySound("Ball_special_03");
ball.lastCollision = "";
ball.fire = false;
ball.spread = true;
_parent.holder[tabObs[a][0]].gotoAndPlay("hit");
tabObs.splice(a, 1);
} else if (tabObs[a][5] == "fire") {
PlaySound("Ball_fire");
ball.lastCollision = "";
_parent.holder.ball.gotoAndPlay("fire");
ball.fire = true;
ball.spread = false;
_parent.holder[tabObs[a][0]].gotoAndPlay("hit");
tabObs.splice(a, 1);
}
}
a++;
}
} else if ((!ball.daloR) && (!ball.daloL)) {
a = 0;
while (a < tabQuille.length) {
if (ball.spread) {
if (!_parent.holder["quille_" + tabQuille[a][0]].falling) {
qx = tabQuille[a][1];
qz = tabQuille[a][3];
bh = ball.r;
bw = 120;
bx = ball.x;
bz = ball.z;
if ((qz >= (bz - (bh / 2))) and (qz <= (bz + (bh / 2)))) {
if ((qx >= (bx - (bw / 2))) and (qx <= (bx + (bw / 2)))) {
if (!strikeSound) {
strikeSound = true;
playSound("pins_strike_middle");
}
_parent.holder["quille_" + tabQuille[a][0]].speed = ball.speed;
_parent.holder["quille_" + tabQuille[a][0]].falling = true;
_parent.holder["quille_" + tabQuille[a][0]].quille.gotoAndPlay("hit");
_parent.holder["quille_" + tabQuille[a][0]].rotation = 90;
_parent.holder["quille_" + tabQuille[a][0]].play();
}
}
}
} else {
h = _parent.holder["quille_" + tabQuille[a][0]].x;
k = _parent.holder["quille_" + tabQuille[a][0]].z;
if (m == Number.POSITIVE_INFINITY) {
var d = Math.abs(h - x1);
} else if (m == Number.NEGATIVE_INFINITY) {
var d = Math.abs(k - y1);
} else {
var d = (Math.abs(((m * h) - k) + b) / Math.sqrt((m * m) + 1));
}
d2 = Math.sqrt(((h - x1) * (h - x1)) + ((k - y1) * (k - y1)));
if (((d < (ball.r + _parent.holder["quille_" + tabQuille[a][0]].r)) and (d2 < ((ball.speed + ball.r) + _parent.holder["quille_" + tabQuille[a][0]].r))) and (!_parent.holder["quille_" + tabQuille[a][0]].falling)) {
if ((!strikeSound) && (!ball.fire)) {
strikeSound = true;
playSound("pins_strike_middle");
}
_parent.holder["quille_" + tabQuille[a][0]].falling = true;
_parent.holder["quille_" + tabQuille[a][0]].quille.gotoAndPlay("hit");
f = d / (ball.r + _parent.holder["quille_" + tabQuille[a][0]].r);
w = Math.acos(f);
w = (w / (Math.PI/180)) - 90;
d4 = Math.sqrt(((ball.r + _parent.holder["quille_" + tabQuille[a][0]].r) * (ball.r + _parent.holder["quille_" + tabQuille[a][0]].r)) - (d * d));
d5 = Math.sqrt((d2 * d2) - (d * d));
d6 = d5 - d4;
moveTempX = Math.cos((Math.PI/180) * ball.rotation) * d6;
moveTempY = Math.sin((Math.PI/180) * ball.rotation) * d6;
newSpeed = (Math.abs(w) / 90) * ball.speed;
_parent.holder["quille_" + tabQuille[a][0]].speed = _parent.holder["quille_" + tabQuille[a][0]].speed + ((ball.speed * 3) - newSpeed);
if (x1 < _parent.holder["quille_" + tabQuille[a][0]].x) {
_parent.holder["quille_" + tabQuille[a][0]].rotation = ball.rotation + w;
} else {
_parent.holder["quille_" + tabQuille[a][0]].rotation = ball.rotation - w;
}
moveTempDefX = Math.cos((Math.PI/180) * _parent.holder["quille_" + tabQuille[a][0]].rotation) * 4;
moveTempDefY = Math.sin((Math.PI/180) * _parent.holder["quille_" + tabQuille[a][0]].rotation) * 4;
_parent.holder["quille_" + tabQuille[a][0]].x = _parent.holder["quille_" + tabQuille[a][0]].x + moveTempDefX;
_parent.holder["quille_" + tabQuille[a][0]].z = _parent.holder["quille_" + tabQuille[a][0]].z + moveTempDefY;
_parent.holder["quille_" + tabQuille[a][0]].play();
if (ball.fire) {
CleanFirePlace = true;
stopsound("ball_rolling");
_parent.fire.gotoAndPlay("play");
playSound("pins_strike_big");
ball.drifting = true;
_parent.holder.ball._visible = false;
_parent.holder.ballShade._visible = false;
b = 0;
while (b < tabQuille.length) {
h = _parent.holder["quille_" + tabQuille[b][0]].x;
k = _parent.holder["quille_" + tabQuille[b][0]].z;
d = Math.abs(((m * h) - k) + b) / Math.sqrt((m * m) + 1);
d2 = Math.sqrt(((h - x1) * (h - x1)) + ((k - y1) * (k - y1)));
explodeRadius = 250;
if ((d2 < ((ball.speed + explodeRadius) + _parent.holder["quille_" + tabQuille[b][0]].r)) and (!_parent.holder["quille_" + tabQuille[b][0]].falling)) {
_parent.holder["quille_" + tabQuille[b][0]].falling = true;
_parent.holder["quille_" + tabQuille[b][0]].quille.gotoAndPlay("hit");
f = d / (explodeRadius + _parent.holder["quille_" + tabQuille[b][0]].r);
w = Math.acos(f);
w = (w / (Math.PI/180)) - 90;
d4 = Math.sqrt(((explodeRadius + _parent.holder["quille_" + tabQuille[b][0]].r) * (explodeRadius + _parent.holder["quille_" + tabQuille[b][0]].r)) - (d * d));
d5 = Math.sqrt((d2 * d2) - (d * d));
d6 = d5 - d4;
moveTempX = Math.cos((Math.PI/180) * ball.rotation) * d6;
moveTempY = Math.sin((Math.PI/180) * ball.rotation) * d6;
newSpeed = (Math.abs(w) / 90) * ball.speed;
_parent.holder["quille_" + tabQuille[b][0]].speed = _parent.holder["quille_" + tabQuille[b][0]].speed + ((ball.speed * 1.5) - newSpeed);
if (x1 < _parent.holder["quille_" + tabQuille[b][0]].x) {
_parent.holder["quille_" + tabQuille[b][0]].rotation = ball.rotation - w;
} else {
_parent.holder["quille_" + tabQuille[b][0]].rotation = ball.rotation + w;
}
moveTempDefX = Math.cos((Math.PI/180) * _parent.holder["quille_" + tabQuille[b][0]].rotation) * 4;
moveTempDefY = Math.sin((Math.PI/180) * _parent.holder["quille_" + tabQuille[b][0]].rotation) * 4;
_parent.holder["quille_" + tabQuille[b][0]].x = _parent.holder["quille_" + tabQuille[b][0]].x + moveTempDefX;
_parent.holder["quille_" + tabQuille[b][0]].z = _parent.holder["quille_" + tabQuille[b][0]].z + moveTempDefY;
_parent.holder["quille_" + tabQuille[b][0]].gotoAndStop(17);
ball.speed = 0;
}
b++;
}
}
}
}
a++;
}
}
}
}
if (!collided) {
ball.x = x2;
ball.z = y2;
}
}
if (ball.z > 1100) {
stopsound("ball_rolling");
resetBall();
} else if (ball.z > 500) {
if (ball.spread) {
_parent.holder.ball.gotoAndStop("log");
}
ball.enableControl = false;
} else if (((ball.z < 0) and (!ball.suckedIn)) and (!ball.drifting)) {
} else if (ball.z < -100) {
_parent.holder.ball.ball.gotoAndStop("flash");
}
if (((ball.x > 125) and (!ball.suckedIn)) and (!ball.drifting)) {
_global.s1.gotoAndPlay("drifting");
ball.daloR = true;
} else if (((ball.x < -125) and (!ball.suckedIn)) and (!ball.drifting)) {
_global.s1.gotoAndPlay("drifting");
ball.daloL = true;
}
if (ball.y < -150) {
_parent.holder.ball.ball.gotoAndStop("flash");
} else if (ball.y > 150) {
_parent.holder.ball.ball.gotoAndStop("flash");
}
curProp = extractTruePos(ball.x, ball.y, ball.z);
if (ball.suckedIn) {
_parent.holder.ball.swapDepths(-10000);
_parent.holder.ballShade.swapDepths(-10001);
} else {
_parent.holder.ball.swapDepths(curProp[2]);
_parent.holder.ballShade.swapDepths(curProp[2] - 1);
}
_parent.holder.ball._x = curProp[0];
_parent.holder.ball._y = curProp[1];
_parent.holder.ball._xscale = (_parent.holder.ball._yscale = 100 * curProp[3]);
_parent.direction._rotation = -ball.rotation;
_parent.holder.ballShade._x = curProp[0];
_parent.holder.ballShade._y = curProp[1];
if (ball.y > 0) {
_parent.holder.ballShade._visible = false;
} else if (ball.y < 0) {
_parent.holder.ballShade._visible = false;
} else if ((ball.y == 0) and (!gamePaused)) {
_parent.holder.ballShade._xscale = (_parent.holder.ballShade._yscale = 100 * curProp[3]);
}
Symbol 288 MovieClip Frame 4
call(3);
Symbol 288 MovieClip Frame 5
gotoAndPlay (4);
Symbol 340 MovieClip Frame 37
gotoAndPlay ("logroll");
Symbol 341 MovieClip Frame 6
gotoAndPlay ("normal");
Symbol 341 MovieClip Frame 18
gotoAndPlay ("fire");
Instance of Symbol 295 MovieClip "ballShade" in Symbol 342 MovieClip Frame 1
onClipEvent (load) {
}
Symbol 505 MovieClip Frame 1
this.CatchX = this._x;
this.inPlace = true;
gotoAndPlay ("catch");
Symbol 505 MovieClip Frame 20
PlaySound("booty_shake");
Symbol 505 MovieClip Frame 67
c.throwBall(this.angle, this.speed);
PlaySound("ball_throw");
Symbol 505 MovieClip Frame 90
gotoAndPlay ("idle");
Symbol 505 MovieClip Frame 91
this.inPlace = false;
this.mouvement = 20;
if (this._x < this.EndingX) {
if ((this.EndingX - this._x) <= 20) {
this._x = this._x + (this.EndingX - this._x);
} else {
this._x = this._x + this.mouvement;
}
} else if ((this._x - this.EndingX) < 20) {
this._x = this._x - (this._x - this.EndingX);
} else {
this._x = this._x - this.mouvement;
}
if (this._x == this.EndingX) {
gotoAndPlay ("pitch");
}
Symbol 505 MovieClip Frame 98
call("walk");
Symbol 505 MovieClip Frame 103
gotoAndPlay ("walk");
Symbol 505 MovieClip Frame 104
stop();
Symbol 505 MovieClip Frame 105
c.WhatsNext();
_parent.plante.play();
Symbol 505 MovieClip Frame 127
this.inPlace = true;
stop();
Symbol 505 MovieClip Frame 167
if (!c.gameover) {
gotoAndPlay ("WalkAlone");
} else {
_parent.gotoAndPlay("levelComplete");
}
Symbol 505 MovieClip Frame 168
Symbol 505 MovieClip Frame 201
playsound("SB_crying");
Symbol 505 MovieClip Frame 251
if (!c.gameover) {
gotoAndPlay ("WalkAlone");
} else {
_parent.gotoAndPlay("levelComplete");
}
Symbol 505 MovieClip Frame 332
_parent.eyes.gotoAndPlay(2);
if (!c.gameover) {
gotoAndPlay ("WalkAlone");
} else {
_parent.gotoAndPlay("levelComplete");
}
Symbol 505 MovieClip Frame 333
this.mouvement = 20;
if (this._x < this.CatchX) {
if ((this.CatchX - this._x) <= 20) {
this._x = this._x + (this.CatchX - this._x);
} else {
this._x = this._x + this.mouvement;
}
} else if ((this._x - this.CatchX) < 20) {
this._x = this._x - (this._x - this.CatchX);
} else {
this._x = this._x - this.mouvement;
}
if (this._x == this.CatchX) {
gotoAndPlay ("catch");
}
Symbol 505 MovieClip Frame 340
call("WalkAlone");
Symbol 505 MovieClip Frame 345
gotoAndPlay ("WalkAlone");
Symbol 505 MovieClip Frame 353
gotoAndPlay ("walk");
Symbol 510 MovieClip Frame 1
stop();
Symbol 529 MovieClip Frame 1
stop();
Symbol 529 MovieClip Frame 8
playsound("ball_Spit");
Symbol 620 MovieClip Frame 35
c.removePinsOnPanel();
Symbol 649 MovieClip Frame 101
gotoAndPlay (1);
Symbol 649 MovieClip Frame 140
playsound("Patrick_setsthescore");
Symbol 649 MovieClip Frame 185
if (this.score != 0) {
c.BobReaction(this.score);
} else {
c.PlacePinsOnPanel();
}
Symbol 649 MovieClip Frame 230
playsound("eats_hammer");
Symbol 649 MovieClip Frame 245
gotoAndPlay (1);
Symbol 649 MovieClip Frame 299
gotoAndPlay (1);
Symbol 673 MovieClip Frame 1
stop();
Symbol 673 MovieClip Frame 123
c.resetBall();
stop();
Symbol 690 MovieClip Frame 1
stop();
Symbol 691 MovieClip Frame 1
stop();
Symbol 695 Button
on (release) {
stopsound("ball_rolling");
gotoAndPlay ("instruct");
}
Symbol 701 Button
on (release) {
stopsound("ball_rolling");
gotoAndPlay ("play");
}
on (press) {
Mouse.removeListener(MouseTracker);
_global.MouseTracker = null;
MouseMove = new Array();
removeMovieClip(timeoutMouse);
}
Symbol 706 MovieClip Frame 1
stop();
Symbol 706 MovieClip Frame 2
playSound("interface_01");
Symbol 706 MovieClip Frame 43
playSound("interface_03");
Symbol 720 MovieClip Frame 1
stop();
Symbol 720 MovieClip Frame 3
if ((c.tabQuille.length == 0) && (!c.CleanFirePlace)) {
this.gotoAndPlay("Startbrunswick");
}
Symbol 720 MovieClip Frame 12
c.BrunswickPinsFall();
Symbol 720 MovieClip Frame 30
c.clearLevel(c.level);
c.processLevel(c.level);
_parent.brunswick.gotoAndPlay("play");
Symbol 727 MovieClip Frame 1
stop();
Symbol 727 MovieClip Frame 14
c.placePins();
Symbol 749 MovieClip Frame 1
stop();
Symbol 752 MovieClip Frame 1
stop();
Symbol 760 MovieClip Frame 1
stop();
Symbol 763 MovieClip Frame 1
stop();
Symbol 766 MovieClip Frame 1
stop();
Symbol 785 Button
on (press) {
gotoAndPlay ("play");
}
Symbol 788 Button
on (press) {
gotoAndPlay ("title");
}
Symbol 799 Button
on (release) {
stopAllSounds();
gotoAndStop ("title");
}