Frame 1
totalBytes = this.getBytesTotal();
version = "standalone";
startingHole = 1;
player1Char = 1;
numPlayers = 1;
Frame 2
totalBytesLoaded = this.getBytesLoaded();
percent = (totalBytesLoaded / totalBytes) * 100;
if (percent >= 100) {
gotoAndStop (9);
}
percent = int(percent) + "% loaded.";
ls = Math.round((totalBytesLoaded / (getTimer() / 1000)) / 10.24) / 100;
var speedload = (("@ " + ls) + "kbs");
Frame 3
gotoAndPlay (2);
Frame 9
function tempBlock() {
mx = _root._XMouse;
my = _root._yMouse;
returnVal = true;
i = -1;
while ((++i) < shotBlockArr.length) {
if (shotBlockArr[i].hitDetect()) {
returnVal = false;
break;
}
}
return(returnVal);
}
stop();
_root.shotBlockArr = [];
_root.okToShoot = tempBlock;
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 5
gotoAndStop (1);
Symbol 51 MovieClip Frame 14
gotoAndStop (1);
Symbol 51 MovieClip Frame 20
gotoAndStop (1);
Symbol 51 MovieClip Frame 30
gotoAndStop (1);
Symbol 51 MovieClip Frame 45
gotoAndStop (1);
Symbol 51 MovieClip Frame 55
gotoAndStop (1);
Symbol 51 MovieClip Frame 68
gotoAndStop (1);
Symbol 51 MovieClip Frame 79
gotoAndStop (1);
Symbol 51 MovieClip Frame 92
gotoAndStop (1);
Symbol 51 MovieClip Frame 106
gotoAndStop (1);
Symbol 51 MovieClip Frame 116
gotoAndStop (1);
Symbol 51 MovieClip Frame 124
gotoAndStop (1);
Symbol 51 MovieClip Frame 132
gotoAndStop (1);
Symbol 51 MovieClip Frame 140
gotoAndStop (1);
Symbol 60 MovieClip Frame 1
stop();
Symbol 68 Button
on (release) {
startGame();
}
Symbol 80 MovieClip Frame 264
_parent.startGame();
Symbol 84 MovieClip Frame 1
stop();
Symbol 91 Button
on (release) {
gotoAndStop (2);
}
Symbol 97 Button
on (release) {
_parent.forceEnd();
}
Symbol 100 Button
on (release) {
gotoAndStop (1);
}
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 2
stop();
Symbol 142 MovieClip Frame 1
stop();
Symbol 143 MovieClip Frame 1
function setPar() {
var i = -1;
s1 = 0;
s2 = 0;
while ((++i) < _parent.par.length) {
this["p" + (i + 1)] = _parent.par[i];
if (8 >= i) {
s1 = s1 + this["p" + (i + 1)];
} else {
s2 = s2 + this["p" + (i + 1)];
}
}
}
function setScores() {
var i = 0;
while (_parent.numPlayers >= (++i)) {
j = i - 1;
this["c" + i] = _parent.names[j];
var n = -1;
this[("c" + i) + "fs"] = 0;
while ((++n) < _parent["saveParScores" + i].length) {
this[(("c" + i) + "s") + (n + 1)] = _parent["saveParScores" + i][n];
this[(("c" + i) + "st") + (n + 1)] = _parent.strokesSaved[i - 1][n];
if (8 >= n) {
this[("c" + i) + "fs"] = this[("c" + i) + "fs"] + this[(("c" + i) + "s") + (n + 1)];
this[("c" + i) + "fst"] = this[("c" + i) + "fst"] + this[(("c" + i) + "st") + (n + 1)];
} else {
this[("c" + i) + "fs2"] = this[("c" + i) + "fs2"] + this[(("c" + i) + "s") + (n + 1)];
this[("c" + i) + "fst2"] = this[("c" + i) + "fst2"] + this[(("c" + i) + "st") + (n + 1)];
}
}
}
}
function clearFields() {
var i = -1;
while (18 >= (++i)) {
this["s" + i] = "";
this["c1s" + i] = "";
this["c2s" + i] = "";
this["c1st" + i] = "";
this["c2st" + i] = "";
this["p" + i] = "";
c1fst = 0;
c1fst2 = 0;
c1fs2 = 0;
c2fst = "";
c2fst2 = "";
c2fs2 = "";
if (1 < _parent.numPlayers) {
c2fst = 0;
c2fst2 = 0;
c2fs2 = 0;
}
}
fs = "";
fs1 = "";
fs2 = "";
c1fs = "";
c2fs = "";
c1 = "";
c2 = "";
}
face1 = _parent.player1char;
face2 = _parent.player2char;
clearFields();
setPar();
setScores();
this.gotoAndStop("sj");
Symbol 143 MovieClip Frame 2
theHole = "Hole " + _parent.holeNumber;
holeClip.gotoAndStop(_parent.holeNumber);
strokes = _parent.strokesSaved[0][_parent.strokesSaved[0].length - 1];
hn = _parent.holeNumber - 2;
par = _parent.par[hn];
if (strokes == undefined) {
strokes = 0;
shotScore = 0;
} else {
shotScore = (15 - strokes) * 10;
if (strokes < par) {
shotScore = shotScore * par;
}
}
if (gameOver == "yes") {
clicker._visible = false;
current_time = _parent.current_time;
totalTime = (_parent.total_minutes * 60) * 1000;
timeLeft = totalTime - current_time;
timeBonus = Math.floor((timeLeft / totalTime) * 1000);
if (!_parent.forced) {
shotScore = shotScore + timeBonus;
} else {
shotScore = 0;
}
}
_parent.current_score = _parent.current_score + shotScore;
current_score = _parent.current_score;
if (gameOver == "yes") {
_parent.gotoAndStop("end screen");
}
play();
Symbol 143 MovieClip Frame 25
_parent.gotoAndStop("main");
Symbol 144 MovieClip Frame 1
function setPar() {
var i = -1;
s1 = 0;
s2 = 0;
while ((++i) < _parent.par.length) {
this["p" + (i + 1)] = _parent.par[i];
if (8 >= i) {
s1 = s1 + this["p" + (i + 1)];
} else {
s2 = s2 + this["p" + (i + 1)];
}
}
}
function setScores() {
var i = 0;
while (_parent.numPlayers >= (++i)) {
j = i - 1;
this["c" + i] = _parent.names[j];
var n = -1;
this[("c" + i) + "fs"] = 0;
while ((++n) < _parent["saveParScores" + i].length) {
this[(("c" + i) + "s") + (n + 1)] = _parent["saveParScores" + i][n];
this[(("c" + i) + "st") + (n + 1)] = _parent.strokesSaved[i - 1][n];
if (8 >= n) {
this[("c" + i) + "fs"] = this[("c" + i) + "fs"] + this[(("c" + i) + "s") + (n + 1)];
this[("c" + i) + "fst"] = this[("c" + i) + "fst"] + this[(("c" + i) + "st") + (n + 1)];
} else {
this[("c" + i) + "fs2"] = this[("c" + i) + "fs2"] + this[(("c" + i) + "s") + (n + 1)];
this[("c" + i) + "fst2"] = this[("c" + i) + "fst2"] + this[(("c" + i) + "st") + (n + 1)];
}
}
}
}
function clearFields() {
var i = -1;
while (18 >= (++i)) {
this["s" + i] = "";
this["c1s" + i] = "";
this["c2s" + i] = "";
this["c1st" + i] = "";
this["c2st" + i] = "";
this["p" + i] = "";
c1fst = 0;
c1fst2 = 0;
c1fs2 = 0;
c2fst = "";
c2fst2 = "";
c2fs2 = "";
if (1 < _parent.numPlayers) {
c2fst = 0;
c2fst2 = 0;
c2fs2 = 0;
}
}
fs = "";
fs1 = "";
fs2 = "";
c1fs = "";
c2fs = "";
c1 = "";
c2 = "";
}
face1 = _parent.player1char;
face2 = _parent.player2char;
clearFields();
setPar();
setScores();
this.gotoAndStop("sj");
Symbol 144 MovieClip Frame 2
theHole = "Hole " + _parent.holeNumber;
holeClip.gotoAndStop(_parent.holeNumber);
strokes = _parent.strokesSaved[0][_parent.strokesSaved[0].length - 1];
hn = _parent.holeNumber - 2;
par = _parent.par[hn];
if (strokes == undefined) {
strokes = 0;
shotScore = 0;
} else {
shotScore = (15 - strokes) * 10;
if (strokes < par) {
shotScore = shotScore * par;
}
}
if (gameOver == "yes") {
clicker._visible = false;
current_time = _parent.current_time;
totalTime = (_parent.total_minutes * 60) * 1000;
timeLeft = totalTime - current_time;
timeBonus = Math.floor((timeLeft / totalTime) * 1000);
if (!_parent.forced) {
shotScore = shotScore + timeBonus;
} else {
shotScore = 0;
}
}
_parent.current_score = _parent.current_score + shotScore;
current_score = _parent.current_score;
if (gameOver == "yes") {
_parent.gotoAndStop("end screen");
}
play();
Symbol 144 MovieClip Frame 25
_parent.gotoAndStop("main");
Symbol 153 MovieClip Frame 1
stop();
Symbol 153 MovieClip Frame 5
stop();
Symbol 155 MovieClip Frame 1
controllerPath = _parent._parent._parent;
Symbol 155 MovieClip Frame 2
ballName = "ball" + controllerPath.controller.ballNumber;
point = new Object();
relativeX = _parent[ballName]._x - _x;
relativeY = _parent[ballName]._y - _y;
point.x = relativeX;
point.y = relativeY;
localToGlobal(point);
if (this.hitTest(point.x, point.y, true)) {
xs = controllerPath.controller.xMov[controllerPath.controller.ballNumber];
ys = controllerPath.controller.yMov[controllerPath.controller.ballNumber];
s = math.sqrt((xs * xs) + (ys * ys));
if (0 < s) {
if (sand.puff._currentframe == 1) {
if (1 < s) {
sand.puff.gotoAndPlay(2);
sand.puff._x = relativeX;
sand.puff._y = relativeY;
}
}
controllerPath.controller.onSand = true;
} else {
sand.puff.gotoAndStop(1);
}
} else {
sand.puff.gotoAndStop(1);
controllerPath.controller.onSand = false;
}
Symbol 155 MovieClip Frame 3
gotoAndPlay (2);
Symbol 155 MovieClip Frame 4
ballName = "ball" + controllerPath.controller.ballNumber;
point = new Object();
point.x = _parent[ballName]._x - _x;
point.y = _parent[ballName]._y - _y;
localToGlobal(point);
if (this.hitTest(point.x, point.y, true)) {
controllerPath.controller.onSand = true;
} else {
controllerPath.controller.onSand = false;
}
Symbol 163 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 169 MovieClip Frame 1
controllerPath = _parent._parent._parent;
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (center._x * (_xscale / 100)) + _x;
fy = (center._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
centerX = xp;
centerZ = zp;
fx = (radius._x * (_xscale / 100)) + _x;
fy = (radius._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
radX = xp;
rad = math.abs(centerX - radX);
radius._visible = 0;
center._visible = 0;
stop();
Symbol 169 MovieClip Frame 2
if (_name == "hole") {
_parent.dummyHole1.gotoAndPlay(2);
} else if (_name == "hole2") {
_parent.dummyHole2.gotoAndPlay(2);
} else if (_name == "hole3") {
_parent.dummyHole3.gotoAndPlay(2);
}
Symbol 171 MovieClip Frame 1
if (_name != "shadow") {
num = _name.substr(6);
_x = _parent["ball" + num]._x;
_y = _parent["ball" + num]._y;
}
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 10
stop();
Symbol 178 MovieClip Frame 20
stop();
Instance of Symbol 178 MovieClip "sploosh" in Symbol 179 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(100);
}
Symbol 180 MovieClip Frame 1
controllerPath = _parent._parent._parent;
Symbol 180 MovieClip Frame 2
ballName = "ball" + controllerPath.controller.ballNumber;
point = new Object();
relativeX = _parent[ballName]._x - _x;
relativeY = _parent[ballName]._y - _y;
point.x = relativeX;
point.y = relativeY;
localToGlobal(point);
if (this.hitTest(point.x, point.y, true)) {
xs = controllerPath.controller.xMov[controllerPath.controller.ballNumber];
ys = controllerPath.controller.yMov[controllerPath.controller.ballNumber];
s = math.sqrt((xs * xs) + (ys * ys));
if (0 < s) {
if (puddle.sploosh._currentframe == 1) {
if (5 < s) {
puddle.sploosh.gotoAndPlay("splash2");
} else {
puddle.sploosh.gotoAndPlay("splash1");
}
}
puddle.sploosh._x = relativeX;
puddle.sploosh._y = relativeY;
controllerPath.controller.onPuddle = true;
} else {
puddle.sploosh.gotoAndStop(1);
controllerPath.controller.onPuddle = false;
}
} else {
puddle.sploosh.gotoAndStop(1);
controllerPath.controller.onPuddle = false;
}
Symbol 180 MovieClip Frame 3
gotoAndPlay (2);
Symbol 186 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 2
currentBallName = _parent._parent._parent.controller.currentBallName;
_x = _parent[currentBallName]._x;
_y = _parent[currentBallName]._y;
Symbol 199 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBumpers;
_name = ("bumper" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (c._x * (_xscale / 100)) + _x;
fy = (c._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
centerZ = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
centerX = xp;
fx = (r._x * (_xscale / 100)) + _x;
fy = (r._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
rz = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
rx = xp;
radius = math.abs(centerX - rx);
rm = rx;
tm = rz + radius;
top = centerZ - radius;
bottom = centerZ + radius;
right = centerX + radius;
left = centerX - radius;
controllerPath.controller.addScore(_target);
Symbol 209 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 1
stop();
Symbol 245 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 1
stop();
Symbol 311 MovieClip Frame 1
stop();
Symbol 344 MovieClip Frame 1
stop();
Symbol 373 MovieClip Frame 1
stop();
Symbol 375 MovieClip Frame 1
stop();
Instance of Symbol 374 MovieClip "head5" in Symbol 375 MovieClip Frame 1
onClipEvent (data) {
_visible = false;
this.gotoAndStop(_parent._parent._parent.theStartFrame);
_parent._parent._parent.setHead("yes");
}
Instance of Symbol 374 MovieClip "head6" in Symbol 375 MovieClip Frame 1
onClipEvent (data) {
_visible = false;
this.gotoAndStop(_parent._parent._parent.theStartFrame);
_parent._parent._parent.setHead("yes");
}
Instance of Symbol 374 MovieClip "head4" in Symbol 375 MovieClip Frame 1
onClipEvent (data) {
_visible = false;
this.gotoAndStop(_parent._parent._parent.theStartFrame);
_parent._parent._parent.setHead("yes");
}
Instance of Symbol 374 MovieClip "head3" in Symbol 375 MovieClip Frame 1
onClipEvent (data) {
_visible = false;
this.gotoAndStop(_parent._parent._parent.theStartFrame);
_parent._parent._parent.setHead("yes");
}
Instance of Symbol 374 MovieClip "head2" in Symbol 375 MovieClip Frame 1
onClipEvent (data) {
_visible = false;
this.gotoAndStop(_parent._parent._parent.theStartFrame);
_parent._parent._parent.setHead("yes");
}
Instance of Symbol 374 MovieClip "head1" in Symbol 375 MovieClip Frame 1
onClipEvent (data) {
_visible = false;
this.gotoAndStop(_parent._parent._parent.theStartFrame);
_parent._parent._parent.setHead("yes");
}
Symbol 376 MovieClip Frame 1
stop();
_parent.setAllFrames(18);
Symbol 379 MovieClip Frame 1
_parent.mouseMoveFxn();
Symbol 379 MovieClip Frame 2
_parent.mouseMoveFxn();
Symbol 379 MovieClip Frame 3
_parent.mouseMoveFxn();
stop();
Symbol 380 MovieClip Frame 1
function init(pp1, pp2) {
p1 = pp1;
p2 = pp2;
currentChar = p1;
buildCharacter(currentChar);
}
function sendToFrame() {
step = "";
rotShift = 5.625;
rotation = arrowRot;
if (rotation < 0) {
rotation = rotation + 360;
}
if (360 < rotation) {
rotation = rotation - 360;
}
i = 0;
while (frames >= (++i)) {
if ((rotation >= (degreeStep * (i - 1))) && (rotation < (degreeStep * i))) {
step = i;
}
if ((rotation >= ((degreeStep * (i - 1)) - rotShift)) && (rotation < ((degreeStep * i) - rotShift))) {
}
}
swingStep = 25 * factor;
setAllFrames(step);
getStrength();
}
function setAllFrames(theFrame) {
theStartFrame = theFrame;
player.body.gotoAndStop(theFrame);
player.club.gotoAndStop(theFrame);
player.head["head" + currentChar].gotoAndStop(theFrame);
player.shirt.gotoAndStop(theFrame);
player.skin.gotoAndStop(theFrame);
player.shadow.gotoAndStop(theFrame);
player.pants.gotoAndStop(theFrame);
}
function mouseMoveFxn() {
if (controllerPath.controller.moveEnded == "yes") {
ballName = controllerPath.controller.currentBallName;
follow();
setStrengthBar();
}
}
function setStrengthBar() {
bar.gotoAndStop(Math.round(100 * factor));
}
function mouseDownFxn() {
if (_root.okToShoot()) {
if (controllerPath.controller.moveEnded == "yes") {
if (followMouse == true) {
followMouse = false;
if ((rot == "") || (rot == null)) {
rot = 0;
}
if ((factor == "") || (factor == null)) {
factor = 0.25;
}
controllerPath.controller.shoot(rot, factor);
_visible = 0;
}
}
}
}
function follow() {
if (followMouse == true) {
ballName = controllerPath.controller.currentBallName;
var bx = _parent[ballName]._x;
var by = _parent[ballName]._y;
var fx = _parent._xMouse;
var fy = _parent._yMouse;
var zp = (((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY))));
var xp = ((1 / cosY) * (fx - (zp * sinY)));
var x1 = xp;
var z1 = zp;
var fx = bx;
var fy = by;
var zp = (((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY))));
var xp = ((1 / cosY) * (fx - (zp * sinY)));
var x2 = xp;
var z2 = zp;
var xDiff = (x1 - x2);
var zDiff = (z1 - z2);
rot = math.atan2(zDiff, xDiff) + math.pi;
rotation = ((rot - math.pi) * 180) / math.pi;
if (rotation < 0) {
rotation = rotation + 360;
}
var xDiff = (_parent._xMouse - bx);
var yDiff = (_parent._yMouse - by);
lineRot = math.atan2(yDiff, xDiff);
arrowRot = (lineRot * 180) / math.pi;
arrow._rotation = arrowRot + 180;
sendToFrame();
_x = _parent[ballName]._x;
_y = _parent[ballName]._y;
}
}
function setClubFrame(factor) {
zeroFrame = 10;
maxFrame = 18;
frameStep = maxFrame - zeroFrame;
clubFrame = zeroFrame + int(factor * frameStep);
player.club.club.gotoAndStop(clubFrame);
}
function getStrength() {
var fx = (_parent._xMouse - _x);
var fy = (_parent._yMouse - _y);
var dis = math.sqrt((fx * fx) + (fy * fy));
var minDis = 10;
var maxDis = 80;
var minFac = 0.06;
factor = (dis - minDis) / maxDis;
if (factor < minFac) {
factor = minFac;
}
if (1 < factor) {
factor = 1;
}
setClubFrame(factor);
}
function showMe(name) {
return(((("head" + currentChar) == name) ? true : false));
}
function changeColorOLD(path, r, g, b) {
trace("path=" + path);
myColor = new Color(path);
colorTransform = {ra:100, rb:r, ga:100, gb:g, ba:100, bb:b, aa:100, ab:0};
myColor.setTransform(colorTransform);
}
function setHead(fromHead) {
if (fromHead == "yes") {
headsLoaded++;
}
var i = 0;
while ((++i) < 7) {
player.head["head" + i]._visible = false;
}
player.head["head" + currentChar].gotoAndStop(theStartFrame);
if (headsLoaded >= numPlayers) {
player.head["head" + currentChar]._visible = true;
player._visible = true;
player.run = player.ef;
}
}
function changeCharacter(newChar) {
buildCharacter(this["p" + newChar]);
patch.gotoAndPlay(1);
}
function buildCharacter(whichCharacter) {
currentChar = whichCharacter;
setHead();
charPath = player;
charPath.shirt.changeColor = changeColor;
charPath.pants.changeColor = changeColor;
charPath.skin.changeColor = changeColor;
charPath.shirt.changeColor(this["character" + whichCharacter][0], this["character" + whichCharacter][1], this["character" + whichCharacter][2]);
charPath.pants.changeColor(this["character" + whichCharacter][3], this["character" + whichCharacter][4], this["character" + whichCharacter][5]);
charPath.skin.changeColor(this["character" + whichCharacter][6], this["character" + whichCharacter][7], this["character" + whichCharacter][8]);
}
stop();
numPlayers = _parent._parent._parent.numPlayers;
headsLoaded = 1;
controllerPath = _parent._parent._parent;
player._visible = false;
_x = _parent.ball0._x;
_y = _parent.ball0._y;
this.swapDepths(11000);
setAllFrames(18);
makeInvis = false;
if (makeInvis) {
player._visible = 0;
}
frames = 32;
degreeStep = 360 / frames;
ballName = controllerPath.controller.currentBallName;
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosX = controllerPath.controller.cosX;
cosY = controllerPath.controller.cosY;
character1 = [255, 255, 255, 1, 84, 222, 247, 186, 168];
character2 = [1, 173, 1, 0, 0, 153, 238, 186, 149];
character3 = [120, 105, 228, 47, 191, 190, 247, 187, 168];
character4 = [197, 52, 52, 44, 123, 254, 234, 150, 100];
changeColor = function (r, g, b) {
myColor = new Color(this);
colorTransform = {ra:100, rb:r, ga:100, gb:g, ba:100, bb:b, aa:100, ab:0};
myColor.setTransform(colorTransform);
};
init(controllerPath.player1Char, controllerPath.player2Char);
Instance of Symbol 376 MovieClip "player" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
function ef() {
if (Key.isDown(Key.SHIFT)) {
_alpha = 35;
_parent.bar._alpha = 35;
} else {
_alpha = 100;
_parent.bar._alpha = 100;
}
}
run = ef;
}
onClipEvent (enterFrame) {
run();
}
Instance of Symbol 379 MovieClip "patch" in Symbol 380 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 150 MovieClip in Symbol 381 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 163 MovieClip in Symbol 381 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 202 MovieClip in Symbol 381 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 380 MovieClip "line" in Symbol 381 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 384 MovieClip in Symbol 386 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 380 MovieClip "line" in Symbol 386 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 385 MovieClip "pad" in Symbol 386 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 391 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBanks;
_name = ("bank" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
tm = top;
rm = right;
controllerPath.controller.addScore(_target);
_visible = 0;
angle = 45;
Symbol 393 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Instance of Symbol 389 MovieClip in Symbol 394 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 380 MovieClip "line" in Symbol 394 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 385 MovieClip "pad" in Symbol 394 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 400 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
controllerPath.controller.addScore(_target);
bl._visible = 0;
br._visible = 0;
tl._visible = 0;
tr._visible = 0;
Symbol 407 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBanks;
_name = ("bank" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
tm = top;
rm = right;
controllerPath.controller.addScore(_target);
_visible = 0;
angle = 135;
Symbol 409 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBanks;
_name = ("bank" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
tm = top;
rm = right;
controllerPath.controller.addScore(_target);
_visible = 0;
angle = 315;
Symbol 411 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBanks;
_name = ("bank" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
tm = top;
rm = right;
controllerPath.controller.addScore(_target);
_visible = 0;
angle = 225;
Symbol 413 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Instance of Symbol 398 MovieClip in Symbol 414 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 380 MovieClip "line" in Symbol 414 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 402 MovieClip in Symbol 414 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(9999);
}
Instance of Symbol 404 MovieClip in Symbol 414 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(500);
}
Instance of Symbol 405 MovieClip in Symbol 414 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(501);
}
Symbol 418 MovieClip Frame 1
controllerPath = _parent._parent._parent;
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (center._x * (_xscale / 100)) + _x;
fy = (center._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
centerX = xp;
centerZ = zp;
fx = (radius._x * (_xscale / 100)) + _x;
fy = (radius._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
radX = xp;
rad = math.abs(centerX - radX);
radius._visible = 0;
center._visible = 0;
stop();
Symbol 418 MovieClip Frame 2
if (_name == "hole") {
_parent.dummyHole1.gotoAndPlay(2);
} else if (_name == "hole2") {
_parent.dummyHole2.gotoAndPlay(2);
} else if (_name == "hole3") {
_parent.dummyHole3.gotoAndPlay(2);
}
Symbol 420 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 422 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 427 MovieClip Frame 1
lb._visible = 0;
tb._visible = 0;
rb._visible = 0;
bb._visible = 0;
Instance of Symbol 380 MovieClip "line" in Symbol 427 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 417 MovieClip in Symbol 427 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 418 MovieClip "hole" in Symbol 427 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 385 MovieClip "pad" in Symbol 427 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 202 MovieClip in Symbol 427 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 202 MovieClip in Symbol 427 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 431 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 432 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 433 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Instance of Symbol 380 MovieClip "line" in Symbol 434 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 430 MovieClip in Symbol 434 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 418 MovieClip "hole" in Symbol 434 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 444 MovieClip Frame 1
controllerPath = _parent._parent._parent;
type = "x1";
myNum = ++controllerPath.controller.numBelts;
_name = ("belt" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
tl._visible = 0;
br._visible = 0;
bl._visible = 0;
tr._visible = 0;
Symbol 445 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 447 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 448 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBanks;
_name = ("bank" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
tm = top;
rm = right;
controllerPath.controller.addScore(_target);
_visible = 0;
angle = 135;
Symbol 449 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBanks;
_name = ("bank" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
tm = top;
rm = right;
controllerPath.controller.addScore(_target);
_visible = 0;
angle = 225;
Instance of Symbol 380 MovieClip "line" in Symbol 450 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 438 MovieClip in Symbol 450 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 202 MovieClip in Symbol 450 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 202 MovieClip in Symbol 450 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 455 MovieClip Frame 1
if (done != "yes") {
done = "yes";
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBelts;
_name = ("belt" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
tl._visible = 0;
br._visible = 0;
bl._visible = 0;
tr._visible = 0;
this.gotoAndPlay(random(_totalframes + 2));
}
Symbol 456 MovieClip Frame 1
if (done != "yes") {
done = "yes";
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBelts;
_name = ("belt" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
tl._visible = 0;
br._visible = 0;
bl._visible = 0;
tr._visible = 0;
this.gotoAndPlay(random(_totalframes + 2));
}
Symbol 462 MovieClip Frame 1
controllerPath = _parent._parent._parent;
Symbol 462 MovieClip Frame 2
ballName = "ball" + controllerPath.controller.ballNumber;
point = new Object();
relativeX = _parent[ballName]._x - _x;
relativeY = _parent[ballName]._y - _y;
point.x = relativeX;
point.y = relativeY;
localToGlobal(point);
if (this.hitTest(point.x, point.y, true)) {
xs = controllerPath.controller.xMov[controllerPath.controller.ballNumber];
ys = controllerPath.controller.yMov[controllerPath.controller.ballNumber];
s = math.sqrt((xs * xs) + (ys * ys));
if (0 < s) {
if (sand.puff._currentframe == 1) {
if (3 < s) {
sand.puff.gotoAndPlay(2);
sand.puff._x = relativeX;
sand.puff._y = relativeY;
}
}
controllerPath.controller.onSand = true;
} else {
sand.puff.gotoAndStop(1);
}
} else {
sand.puff.gotoAndStop(1);
controllerPath.controller.onSand = false;
}
Symbol 462 MovieClip Frame 3
gotoAndPlay (2);
Symbol 462 MovieClip Frame 4
ballName = "ball" + controllerPath.controller.ballNumber;
point = new Object();
point.x = _parent[ballName]._x - _x;
point.y = _parent[ballName]._y - _y;
localToGlobal(point);
if (this.hitTest(point.x, point.y, true)) {
controllerPath.controller.onSand = true;
} else {
controllerPath.controller.onSand = false;
}
Instance of Symbol 178 MovieClip "sploosh" in Symbol 464 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(100);
}
Symbol 465 MovieClip Frame 1
controllerPath = _parent._parent._parent;
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = _x - 110;
fy = _y - 25;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
Symbol 465 MovieClip Frame 2
ballName = "ball" + controllerPath.controller.ballNumber;
point = new Object();
relativeX = _parent[ballName]._x - _x;
relativeY = _parent[ballName]._y - _y;
point.x = relativeX;
point.y = relativeY;
localToGlobal(point);
if (this.hitTest(point.x, point.y, true)) {
if (math.abs(controllerPath.controller.yPos[controllerPath.controller.ballNumber] - controllerPath.controller.floor) < 2) {
xs = controllerPath.controller.xMov[controllerPath.controller.ballNumber];
ys = controllerPath.controller.yMov[controllerPath.controller.ballNumber];
s = math.sqrt((xs * xs) + (ys * ys));
if (4 < s) {
puddle.sploosh.gotoAndPlay("splash2");
} else {
puddle.sploosh.gotoAndPlay("splash1");
}
puddle.sploosh._x = relativeX;
puddle.sploosh._y = relativeY;
controllerPath.controller.hitPool(xp, zp);
}
}
Symbol 465 MovieClip Frame 3
gotoAndPlay (2);
Symbol 468 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 473 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
controllerPath.controller.addScore(_target);
bl._visible = 0;
br._visible = 0;
tl._visible = 0;
tr._visible = 0;
Symbol 476 MovieClip Frame 1
if (done != "yes") {
done = "yes";
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBelts;
_name = ("belt" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
tl._visible = 0;
br._visible = 0;
bl._visible = 0;
tr._visible = 0;
this.gotoAndPlay(random(_totalframes + 2));
}
Symbol 478 MovieClip Frame 1
if (done != "yes") {
done = "yes";
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBelts;
_name = ("belt" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
tl._visible = 0;
br._visible = 0;
bl._visible = 0;
tr._visible = 0;
this.gotoAndPlay(random(_totalframes + 2));
}
Symbol 479 MovieClip Frame 1
if (done != "yes") {
done = "yes";
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBelts;
_name = ("belt" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
tl._visible = 0;
br._visible = 0;
bl._visible = 0;
tr._visible = 0;
this.gotoAndPlay(random(_totalframes + 2));
}
Instance of Symbol 178 MovieClip "sploosh" in Symbol 481 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(100);
}
Symbol 482 MovieClip Frame 1
controllerPath = _parent._parent._parent;
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = _x - 110;
fy = _y - 25;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
Symbol 482 MovieClip Frame 2
ballName = "ball" + controllerPath.controller.ballNumber;
point = new Object();
relativeX = _parent[ballName]._x - _x;
relativeY = _parent[ballName]._y - _y;
point.x = relativeX;
point.y = relativeY;
localToGlobal(point);
if (this.hitTest(point.x, point.y, true)) {
if (math.abs(controllerPath.controller.yPos[controllerPath.controller.ballNumber] - controllerPath.controller.floor) < 2) {
xs = controllerPath.controller.xMov[controllerPath.controller.ballNumber];
ys = controllerPath.controller.yMov[controllerPath.controller.ballNumber];
s = math.sqrt((xs * xs) + (ys * ys));
if (4 < s) {
puddle.sploosh.gotoAndPlay("splash2");
} else {
puddle.sploosh.gotoAndPlay("splash1");
}
puddle.sploosh._x = relativeX;
puddle.sploosh._y = relativeY;
controllerPath.controller.hitPool(xp, zp);
}
}
Symbol 482 MovieClip Frame 3
gotoAndPlay (2);
Instance of Symbol 380 MovieClip "line" in Symbol 483 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 455 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "z2";
}
Instance of Symbol 456 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "z21";
}
Instance of Symbol 456 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "z21";
}
Instance of Symbol 456 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "z21";
}
Instance of Symbol 459 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 470 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(303);
}
Instance of Symbol 471 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(302);
}
Instance of Symbol 475 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(331);
}
Instance of Symbol 476 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "x21";
}
Instance of Symbol 476 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "x21";
}
Instance of Symbol 456 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "z21";
}
Instance of Symbol 478 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "x11";
}
Instance of Symbol 479 MovieClip in Symbol 483 MovieClip Frame 1
onClipEvent (load) {
type = "z11";
}
Symbol 488 MovieClip Frame 1
controllerPath = _parent._parent._parent;
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = _x - 110;
fy = _y - 25;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
Symbol 488 MovieClip Frame 2
ballName = "ball" + controllerPath.controller.ballNumber;
point = new Object();
relativeX = _parent[ballName]._x - _x;
relativeY = _parent[ballName]._y - _y;
point.x = relativeX;
point.y = relativeY;
localToGlobal(point);
if (this.hitTest(point.x, point.y, true)) {
if (math.abs(controllerPath.controller.yPos[controllerPath.controller.ballNumber] - controllerPath.controller.floor) < 2) {
xs = controllerPath.controller.xMov[controllerPath.controller.ballNumber];
ys = controllerPath.controller.yMov[controllerPath.controller.ballNumber];
s = math.sqrt((xs * xs) + (ys * ys));
if (4 < s) {
puddle.sploosh.gotoAndPlay("splash2");
} else {
puddle.sploosh.gotoAndPlay("splash1");
}
puddle.sploosh._x = relativeX;
puddle.sploosh._y = relativeY;
controllerPath.controller.hitPool(xp, zp);
}
}
Symbol 488 MovieClip Frame 3
gotoAndPlay (2);
Symbol 490 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numboxes;
_name = ("box" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
rm = right;
tm = top;
_visible = 0;
Symbol 491 MovieClip Frame 1
controllerPath = _parent._parent._parent;
myNum = ++controllerPath.controller.numBanks;
_name = ("bank" + myNum);
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosY = controllerPath.controller.cosY;
cosX = controllerPath.controller.cosX;
fx = (tl._x * (_xscale / 100)) + _x;
fy = (tl._y * (_xscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
top = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
left = xp;
fx = (br._x * (_xscale / 100)) + _x;
fy = (br._y * (_yscale / 100)) + _y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
bottom = zp;
xp = (1 / cosY) * (fx - (zp * sinY));
right = xp;
tm = top;
rm = right;
controllerPath.controller.addScore(_target);
_visible = 0;
angle = 45;
Instance of Symbol 380 MovieClip "line" in Symbol 492 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 487 MovieClip in Symbol 492 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 385 MovieClip "pad" in Symbol 492 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 493 MovieClip Frame 1
function getInfo(x, y) {
_root.point = new Object();
_root.point.x = x;
_root.point.y = y;
globalToLocal(_root.point);
}
function scrollMe() {
ok = true;
if (key.isDown(key.LEFT)) {
endX = endX + xs;
ok = false;
xwent = true;
} else if (key.isDown(key.RIGHT)) {
endX = endX - xs;
xwent = true;
ok = false;
}
if (key.isDown(key.UP)) {
endY = endY + ys;
ywent = true;
ok = false;
} else if (key.isDown(key.DOWN)) {
ywent = true;
endY = endY - ys;
ok = false;
}
if (ok) {
ballName = "ball" + _parent._parent.controller.ballNumber;
name = _parent._parent.controller.currentBallName;
point = new Object();
point.x = this[name]._x;
point.y = this[name]._y;
localToGlobal(point);
x = point.x;
y = point.y;
if (x < xborder) {
if (!xwent) {
endX = endX + xshift;
} else {
_parent.getInfo(xborder, y);
x = _root.point.x - this[name]._x;
endX = x;
_x = x;
}
} else if ((700 - xborder) < x) {
if (!xwent) {
endX = endX - xshift;
} else {
_parent.getInfo(700 - xborder, y);
x = _root.point.x - this[name]._x;
endX = x;
_x = x;
}
}
if (y < yborder) {
if (!ywent) {
endY = endY + yshift;
} else {
_parent.getInfo(x, yborder);
y = _root.point.y - this[name]._y;
endY = y;
_y = y;
}
} else if ((400 - yborder) < y) {
if (!ywent) {
endY = endY - yshift;
} else {
_parent.getInfo(x, 400 - yborder);
y = _root.point.y - this[name]._y;
endY = y;
_y = y;
}
}
xwent = false;
ywent = false;
}
xMov = (endX - _x) * k;
_x = (_x + xMov);
yMov = (endY - _y) * k;
_y = (_y + yMov);
}
function loadMe() {
ball._visible = false;
shadow._visible = false;
dot1._visible = false;
dot2._visible = false;
dot3._visible = false;
dot4._visible = false;
xborder = 120;
xs = 10;
ys = 10;
yborder = 90;
homeX = _x;
k = 0.3;
endX = homeX;
xwent = false;
ywent = false;
xshift = 100;
yshift = 60;
k = 0.3;
startY = _y;
xwent = true;
ywent = true;
endY = _y;
endX = _x;
}
stop();
courseShift = 100;
shift = 60;
k = 0.3;
xGive = 30;
yGive = xgive;
Instance of Symbol 381 MovieClip "course" in Symbol 493 MovieClip Frame 5
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Instance of Symbol 386 MovieClip "course" in Symbol 493 MovieClip Frame 10
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Instance of Symbol 394 MovieClip "course" in Symbol 493 MovieClip Frame 16
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Instance of Symbol 414 MovieClip "course" in Symbol 493 MovieClip Frame 21
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Instance of Symbol 427 MovieClip "course" in Symbol 493 MovieClip Frame 26
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Instance of Symbol 434 MovieClip "course" in Symbol 493 MovieClip Frame 31
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Instance of Symbol 450 MovieClip "course" in Symbol 493 MovieClip Frame 36
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Instance of Symbol 483 MovieClip "course" in Symbol 493 MovieClip Frame 40
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Instance of Symbol 492 MovieClip "course" in Symbol 493 MovieClip Frame 46
onClipEvent (enterFrame) {
scrollMe();
}
onClipEvent (load) {
loadMe = _parent.loadMe;
loadMe();
scrollMe = _parent.scrollMe;
}
Symbol 501 MovieClip Frame 1
stop();
Symbol 501 MovieClip Frame 61
_parent.done();
Symbol 527 MovieClip Frame 26
stop();
Symbol 537 MovieClip Frame 13
stop();
Symbol 550 MovieClip Frame 15
stop();
Symbol 555 MovieClip Frame 10
stop();
Symbol 560 MovieClip Frame 13
stop();
Symbol 565 MovieClip Frame 25
stop();
Symbol 616 MovieClip Frame 41
stop();
Symbol 642 MovieClip Frame 41
stop();
Symbol 655 MovieClip Frame 41
stop();
Symbol 660 MovieClip Frame 39
stop();
Symbol 661 MovieClip Frame 1
function done() {
timerAni.gotoAndStop(1);
gotoAndStop (1);
}
function startAni(num) {
timerAni.gotoAndPlay(2);
gotoAndStop(num);
}
stop();
Symbol 661 MovieClip Frame 2
stop();
Symbol 661 MovieClip Frame 11
stop();
Symbol 661 MovieClip Frame 19
stop();
Symbol 661 MovieClip Frame 27
stop();
Symbol 661 MovieClip Frame 33
stop();
Symbol 661 MovieClip Frame 39
stop();
Symbol 661 MovieClip Frame 50
stop();
Symbol 661 MovieClip Frame 56
stop();
Symbol 661 MovieClip Frame 62
stop();
Symbol 679 MovieClip Frame 1
stop();
Symbol 686 MovieClip Frame 1
stop();
Symbol 688 MovieClip Frame 1
stop();
Symbol 695 MovieClip Frame 1
function changePlayer(name) {
if (1 < numPlayers) {
playerText = names[name] + "'s Turn.";
}
}
total_minutes = 3;
current_score = 0;
count = true;
version = _parent.version;
holeNumber = _parent.startingHole - 1;
player1Char = _parent.player1Char;
timesCalled = 0;
imTesting = "yes";
if (_root.ptype == 1) {
totalHoles = 3;
} else {
totalHoles = 9;
}
maxStrokes = 15;
par = new Array();
strokes = new Array(0, 0, 0, 0, 0, 0, 0);
strokesSaved = new Array(new Array(), new Array());
par = [2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 4, 5, 3, 4];
numPlayers = _parent.numPlayers;
char1 = 1;
char2 = 2;
proceed = "no";
score = new Array(0, 0, 0, 0, 0, 0, 0);
parScore = new Array(0, 0, 0, 0, 0, 0, 0);
strokes = new Array(0, 0, 0, 0, 0, 0, 0);
names = new Array();
var i = -1;
while ((++i) < numPlayers) {
names[i] = _parent["player" + (i + 1)];
this["saveParScores" + (i + 1)] = new Array();
}
if ((version != "mplayer") || (wereHere == "yes")) {
if (_root.playedYet != "yes") {
_root.playedYet = "yes";
gotoAndStop (2);
} else {
gotoAndStop (2);
}
} else {
stop();
}
Instance of Symbol 40 MovieClip "head1" in Symbol 695 MovieClip Frame 1
onClipEvent (data) {
this.gotoAndStop(_parent._parent._parent.theStartFrame);
}
Instance of Symbol 40 MovieClip "head2" in Symbol 695 MovieClip Frame 1
onClipEvent (data) {
this.gotoAndStop(_parent._parent._parent.theStartFrame);
}
Instance of Symbol 40 MovieClip "head3" in Symbol 695 MovieClip Frame 1
onClipEvent (data) {
this.gotoAndStop(_parent._parent._parent.theStartFrame);
}
Instance of Symbol 40 MovieClip "head3" in Symbol 695 MovieClip Frame 1
onClipEvent (data) {
this.gotoAndStop(_parent._parent._parent.theStartFrame);
}
Instance of Symbol 40 MovieClip "head4" in Symbol 695 MovieClip Frame 1
onClipEvent (data) {
this.gotoAndStop(_parent._parent._parent.theStartFrame);
}
Instance of Symbol 40 MovieClip "head5" in Symbol 695 MovieClip Frame 1
onClipEvent (data) {
this.gotoAndStop(_parent._parent._parent.theStartFrame);
}
Instance of Symbol 40 MovieClip "head6" in Symbol 695 MovieClip Frame 1
onClipEvent (data) {
this.gotoAndStop(_parent._parent._parent.theStartFrame);
}
Instance of Symbol 51 MovieClip "soundfx" in Symbol 695 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Instance of Symbol 54 MovieClip "sounds" in Symbol 695 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 695 MovieClip Frame 2
function startGame() {
byPass = true;
gotoAndStop (11);
}
Symbol 695 MovieClip Frame 11
function forceEnd() {
endOfGame = "yes";
forced = true;
gotoAndStop (11);
}
function tallyScore() {
if (0 < holeNumber) {
var i = 0;
while (numPlayers >= (++i)) {
var j = (i - 1);
score[j] = score[j] + strokes[j];
strokesSaved[j][holeNumber - 1] = strokes[j];
var thisPar = (strokes[j] - par[holeNumber - 1]);
parScore[j] = parScore[j] + thisPar;
this["saveParScores" + i].push(thisPar);
}
}
}
tallyScore();
holeNumber++;
changePlayer(0);
if (totalHoles < holeNumber) {
holeNumber = totalHoles;
endOfGame = "yes";
}
if (endOfGame == "yes") {
endOfGame = "no";
gotoAndStop (25);
} else {
gotoAndStop (19);
}
if (numPlayers == 1) {
playerText = "Good Luck!";
}
if (byPass) {
byPass = false;
gotoAndStop (35);
}
Instance of Symbol 86 MovieClip "timer_clip" in Symbol 695 MovieClip Frame 11
onClipEvent (load) {
function getTime() {
if (_parent.count) {
_parent.current_time = getTimer() - base;
if (((total_minutes * 60) * 1000) < _parent.current_time) {
_parent.current_time = (total_minutes * 60) * 1000;
_parent.forceEnd();
_parent.count = false;
}
}
}
_visible = false;
total_minutes = _parent.total_minutes;
base = getTimer();
_parent.current_time = 0;
}
onClipEvent (enterFrame) {
getTime();
}
Instance of Symbol 144 MovieClip "scoreCard" in Symbol 695 MovieClip Frame 25
onClipEvent (load) {
_parent.count = false;
gameOver = "yes";
}
Symbol 695 MovieClip Frame 35
function setStrokeText(num) {
strokes[num]++;
strokeText = "Number of strokes: " + strokes[num];
stroke_clip.gotoAndStop(strokes[num] + 1);
}
strokes = new Array(0, 0, 0, 0, 0, 0, 0);
hole = "hole" + holeNumber;
whichHole = "Hole " + holeNumber;
currentPar = par[holeNumber - 1];
whichPar = "Par " + currentPar;
strokeText = "Number of strokes: 0";
proceed = "no";
stop();
Instance of Symbol 147 MovieClip "controller" in Symbol 695 MovieClip Frame 35
onClipEvent (load) {
function endTheMove(args) {
moveEnded = "yes";
_parent.screenSync._visible = 0;
}
function shotMessage(msgType, numStrokes) {
if (msgType == "shotlimit") {
shotMsg = "limit";
}
if (msgType == "ballin") {
if (numStrokes == 1) {
shotMsg = "hole in one";
} else if (((((par - numStrokes) == 2) || ((par - numStrokes) == 4)) || ((par - numStrokes) == 3)) && (numStrokes != 1)) {
shotMsg = "eagle";
} else if ((par - numStrokes) == 1) {
shotMsg = "birdie";
} else if ((par - numStrokes) == 0) {
shotMsg = "par";
} else if ((par - numStrokes) == -1) {
shotMsg = "bogey";
} else if ((par - numStrokes) == -2) {
shotMsg = "double bogey";
} else if ((par - numStrokes) < -2) {
meanMsg = random(3) + 1;
shotMsg = "bad" + meanMsg;
}
}
_parent.shotMessage.startAni(shotMsg);
}
function manualShoot(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
if (arg9 != _root.username) {
moveEnded = "no";
_parent.screenSync._visible = 1;
xPos[0] = arg3;
yPos[0] = arg4;
zPos[0] = arg5;
xPos[1] = arg6;
yPos[1] = arg7;
zPos[1] = arg8;
shoot(arg1, arg2, "manual");
}
}
function traceArgs() {
argText = "";
var i = -1;
while ((++i) < args.length) {
argText = argText + (((("arg" + i) + "=") + args[i]) + ",");
}
_parent.argText = argText;
}
function sendShot(rot, factor) {
args = new Array();
args[0] = "shot";
args[1] = rot;
args[2] = factor;
args[3] = xPos[0];
args[4] = yPos[0];
args[5] = zPos[0];
args[6] = xPos[1];
args[7] = yPos[1];
args[8] = zPos[1];
args[9] = _root.userName;
_parent.history = _parent.history + ((("sendShot\rrot=" + rot) + ",factor=") + factor);
_root.sendMove(args);
}
function changeTurns() {
if (ballNumber == myBallNumber) {
args = new Array();
args[0] = "endmove";
args[1] = _root.userName;
_root.sendMove(args);
}
if (_parent.strokes[ballNumber] >= _parent.maxStrokes) {
death[ballNumber] = true;
gamePath[currentBallname]._visible = 0;
gamePath["shadow" + ballNumber]._visible = 0;
_parent.tooMany.gotoAndStop(2);
showMessage("shotlimit");
}
var i = -1;
changeTheTurn = false;
while ((++i) < numPlayers) {
if (death[i] == false) {
changeTheTurn = true;
}
}
if (changeTheTurn != true) {
playSound("endOfHole");
ballInPlay = false;
}
if ((multiPlayer == true) && (changeTheTurn == true)) {
turnLoop = true;
while (turnLoop) {
ballNumber++;
turnLoop = false;
if ((numPlayers - 1) < ballNumber) {
ballNumber = 0;
}
if (death[ballNumber] == true) {
turnLoop = true;
}
}
if (changeTheTurn == true) {
currentBallName = "ball" + ballNumber;
gamePath["ball" + ballNumber]._visible = 1;
gamePath["shadow" + ballNumber]._visible = 1;
}
}
gamePath.line._x = gamePath[currentBallName]._x;
gamePath.line._y = gamePath[currentBallName]._y;
characterOnBench();
_parent.changePlayer(ballNumber);
}
function characterOnBench() {
tempName = currentBallName;
if (ballNumber == 0) {
tempNum = 1;
} else {
tempNum = 0;
}
gamePath.bench1.kids.gotoAndStop(1);
gamePath.bench2.kids.gotoAndStop(1);
if (1 < numPlayers) {
if (currentBallName == "ball0") {
currentBallName = "ball1";
} else {
currentBallName = "ball0";
}
var benchx = gamePath.bench1._x;
var benchy = gamePath.bench1._y;
var ballX = gamePath[currentBallName]._x;
var ballY = gamePath[currentBallName]._y;
bDis1 = math.sqrt(((ballX - benchx) * (ballX - benchx)) + ((ballY - benchY) * (bally - benchy)));
var benchx = gamePath.bench2._x;
var benchy = gamePath.bench2._y;
bDis2 = math.sqrt(((ballX - benchx) * (ballX - benchx)) + ((ballY - benchY) * (bally - benchy)));
if (ballNumber == 0) {
charNum = 1;
} else {
charNum = 0;
}
if (bDis2 >= bDis1) {
this["currentBench" + charNum] = "bench1";
} else if (bDis2 < bDis1) {
this["currentBench" + charNum] = "bench2";
}
gamePath[this["currentBench" + charNum]].kids.gotoAndStop(_parent[("player" + (charNum + 1)) + "char"] + 1);
currentBallName = tempName;
}
}
function shoot(rot, factor, shotType) {
if (((shotType == "manual") && (ballNumber != myBallNumber)) || (shotType != "manual")) {
stopped = false;
_parent.setStrokeText(ballNumber);
maxSpeed = 14;
if ((key.isDown(key.UP) && (key.isDown(key.RIGHT))) && (_parent.version != "mplayer")) {
maxSpeed = 20;
}
var speed = (factor * maxSpeed);
xMov[ballNumber] = speed * math.cos(rot);
zMov[ballNumber] = speed * math.sin(rot);
volume = 100 * factor;
soundVol = Math.ceil(volume / 25);
playSound("hit" + soundVol);
_parent.history = _parent.history + ((((("shootfunction\rrot=" + rot) + ",factor=") + factor) + ",shottype=") + shottype);
_parent.history = _parent.history + ((("ballnumber=" + ballnumber) + ",myballnumber=") + myballnumber);
if (shotType != "manual") {
sendShot(rot, factor);
}
}
}
function readyToShoot() {
gamePath.line._visible = 1;
gamePath.line.changeCharacter(ballNumber + 1);
gamePath.line._x = gamePath[currentBallName]._x;
gamePath.line._y = gamePath[currentBallName]._y;
if ((ballInPlay && (_parent.version != "mplayer")) || (ballInPlay && (ballNumber == myBallNumber))) {
gamePath.line.followMouse = true;
}
}
function addScore(target) {
name = target;
var fx = eval (name).rm;
var fy = eval (name).tm;
var zp = (((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY))));
var xp = ((1 / cosY) * (fx - (zp * sinY)));
var itsScore = ((zp * zp) + xp);
var i = -1;
var len = score.length;
while (len >= (++i)) {
if (itsScore < score[i][1]) {
tempScoreA = new Array();
tempScoreB = new Array();
tempScoreA = score.slice(0, i);
tempScoreA.push(new array(name, itsScore));
tempScoreB = score.slice(i);
score = new Array();
score = tempScoreA.concat(tempScoreB);
var i = 10000;
} else if (i == len) {
score.push(new array(name, itsScore));
}
}
orderDepths();
}
function setWalls() {
var showWalls = false;
if (showWalls == false) {
gamePath.leftWall._visible = 0;
gamePath.rightWall._visible = 0;
gamePath.topWall._visible = 0;
gamePath.bottomWall._visible = 0;
}
var fx = gamePath.leftWall._x;
var fy = gamePath.leftWall._y;
var zp = (((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY))));
var xp = ((1 / cosY) * (fx - (zp * sinY)));
leftWall = xp;
var fx = gamePath.topWall._x;
var fy = gamePath.topWall._y;
var zp = (((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY))));
var xp = ((1 / cosY) * (fx - (zp * sinY)));
topWall = zp;
var fx = gamePath.rightWall._x;
var fy = gamePath.rightWall._y;
var zp = (((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY))));
var xp = ((1 / cosY) * (fx - (zp * sinY)));
rightWall = xp;
var fx = gamePath.bottomWall._x;
var fy = gamePath.bottomWall._y;
var zp = (((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY))));
var xp = ((1 / cosY) * (fx - (zp * sinY)));
bottomWall = zp;
}
function orderDepths() {
objectStartDepth = 100;
objectStep = 5;
var i = -1;
while ((++i) < score.length) {
eval (score[i][0]).swapDepths(objectStartDepth + (i * objectStep));
eval (score[i][0]).depth = objectStartDepth + (i * objectStep);
}
}
function orderBall() {
var ballScore = ((zPos[ballNumber] * zPos[ballNumber]) + xPos[ballNumber]);
var i = -1;
while ((++i) < score.length) {
var top = eval (score[i][0]).top;
var bottom = eval (score[i][0]).bottom;
var right = eval (score[i][0]).right;
var left = eval (score[i][0]).left;
var oSlope = ((top - bottom) / (left - right));
var ballSlope = ((top - zPos[ballNumber]) / (left - xPos[ballNumber]));
nname = eval (score[i][ballNumber]);
if ((((ballSlope < oSlope) && (left < xPos[ballNumber])) && ((zPos[ballNumber] - (rad * 2)) < bottom)) && (top < (zPos[ballNumber] + (rad * 2)))) {
ballDepth = (objectStartDepth + (i * objectStep)) + 2;
gamePath[currentBallName].swapDepths(ballDepth);
var i = 100000;
} else if (i == (score.length - 1)) {
ballDepth = 50;
gamePath[currentBallName].swapDepths(ballDepth);
var i = 100000;
}
}
}
function setBallPos() {
death = new Array();
death[ballNumber] = false;
if (multiplayer == true) {
death = new Array();
oldBallNumber = ballNumber;
var i = -1;
while ((++i) < numPlayers) {
ballNumber = i;
duplicateMovieClip (gamePath.ball, "ball" + ballNumber, (i * 5) + 1);
gamePath["ball" + ballNumber]._x = gamePath.pad._x;
gamePath["ball" + ballNumber]._y = gamePath.pad._y;
gamePath.line._x = gamePath.pad._x;
gamePath.line._y = gamePath.pad._y;
gamePath["ball" + ballNumber].gotoAndStop(ballNumber + 1);
gamePath["ball" + ballNumber]._visible = 0;
duplicateMovieClip (gamePath.shadow, "shadow" + i, i * 5);
gamePath["shadow" + ballNumber]._visible = 0;
death[i] = false;
currentBallName = "ball" + ballNumber;
var fx = gamePath[currentBallName]._x;
var fy = gamePath[currentBallName]._y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
xPos[ballNumber] = xp;
zPos[ballNumber] = zp;
yPos[ballNumber] = startFloor;
var x = xPos[ballNumber];
var y = yPos[ballNumber];
var z = zPos[ballNumber];
gamePath[currentBallName]._x = (z * sinY) + (x * cosY);
gamePath[currentBallName]._y = (y * cosX) - (((z * cosY) - (x * sinY)) * sinX);
gamePath["shadow" + ballNumber]._x = (z * sinY) + (x * cosY);
gamePath["shadow" + ballNumber]._y = (floor * cosX) - (((z * cosY) - (x * sinY)) * sinX);
initX[ballNumber] = xPos[ballNumber];
initZ[ballNumber] = zPos[ballNumber];
}
ballNumber = oldBallNumber;
currentBallName = "ball" + ballNumber;
gamePath["ball" + ballNumber]._visible = 1;
gamePath["shadow" + ballNumber]._visible = 1;
} else {
duplicateMovieClip (gamePath.ball, "ball" + ballNumber, 10);
gamePath["ball" + ballNumber]._x = gamePath.pad._x;
gamePath["ball" + ballNumber]._y = gamePath.pad._y;
gamePath.line._x = gamePath.pad._x;
gamePath.line._y = gamePath.pad._y;
duplicateMovieClip (gamePath.shadow, "shadow" + ballNumber, 9);
var fx = gamePath[currentBallName]._x;
var fy = gamePath[currentBallName]._y;
zp = ((fx / cosY) - (fy / (sinY * sinX))) * (1 / ((cosY / sinY) + (sinY / cosY)));
xp = (1 / cosY) * (fx - (zp * sinY));
xPos[ballNumber] = xp;
zPos[ballNumber] = zp;
yPos[ballNumber] = startFloor;
initX[ballNumber] = xPos[ballNumber];
initZ[ballNumber] = zPos[ballNumber];
}
}
function update() {
var name = currentBallName;
if (terrainOn) {
xMov[ballNumber] = xMov[ballNumber] * terrain;
zMov[ballNumber] = zMov[ballNumber] * terrain;
}
altitude();
var x = (xPos[ballNumber] + xMov[ballNumber]);
var y = (yPos[ballNumber] + yMov[ballNumber]);
var z = (zPos[ballNumber] + zMov[ballNumber]);
xPos[ballNumber] = x;
yPos[ballNumber] = y;
zPos[ballNumber] = z;
gamePath[name]._x = (z * sinY) + (x * cosY);
gamePath[name]._y = (y * cosX) - (((z * cosY) - (x * sinY)) * sinX);
gamePath["shadow" + ballNumber]._x = (z * sinY) + (x * cosY);
gamePath["shadow" + ballNumber]._y = (floor * cosX) - (((z * cosY) - (x * sinY)) * sinX);
if (((((((((math.sqrt((xMov[ballNumber] * xMov[ballNumber]) + (zMov[ballNumber] * zMov[ballNumber])) < minSpeed) && (math.abs(floor - yPos[ballNumber]) < 2)) && (onRamp != true)) && (onBelt != true)) && (onRamp1 != true)) && (onRamp2 != true)) && (onRamp3 != true)) && (onRamp4 != true)) && (onRamp5 != true)) {
if (stopped == false) {
xMov[ballNumber] = 0;
zMov[ballNumber] = 0;
changeTurns();
readyToShoot();
stopped = true;
}
} else {
stopped = false;
}
}
function wallDetection() {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if (bottomWall < tempZ) {
tempZ = bottomWall;
zMov[ballNumber] = zMov[ballNumber] * -1;
playSound("wall");
}
if (tempZ < topWall) {
tempZ = topWall;
zMov[ballNumber] = zMov[ballNumber] * -1;
playSound("wall");
}
if (tempX < leftWall) {
tempX = leftWall;
xMov[ballNumber] = xMov[ballNumber] * -1;
playSound("wall");
}
if (rightWall < tempX) {
tempX = rightWall;
xMov[ballNumber] = xMov[ballNumber] * -1;
playSound("wall");
}
xPos[ballNumber] = tempX;
zPos[ballNumber] = tempZ;
}
function ball2ballcollisionDetection() {
var i = 0;
while (numBumpers >= (++i)) {
var name1 = ballNumber;
var bumperName = ("bumper" + i);
var tempX1 = (xPos[name1] + xMov[name1]);
var tempX2 = gamePath[bumperName].centerX;
var tempZ1 = (zPos[name1] + zMov[name1]);
var tempZ2 = gamePath[bumperName].centerZ;
var tempRad2 = gamePath[bumperName].radius;
if (math.sqrt(((tempX1 - tempX2) * (tempX1 - tempX2)) + ((tempZ1 - tempZ2) * (tempZ1 - tempZ2))) < (rad + tempRad2)) {
ball2BallHappened = true;
ball2BallReaction(i, j, tempX1, tempX2, tempZ1, tempZ2);
playSound("wall");
}
}
}
function ball2BallReaction(n, m, tempX1, tempX2, tempZ1, tempZ2) {
n = ballNumber;
m = 1;
mass = new Array(1, 100000);
var vx1 = xMov[ballNumber];
var vx2 = 0;
var vy1 = zMov[ballNumber];
var vy2 = 0;
var initialMomentum = math.sqrt((vx1 * vx1) + (vy1 * vy1));
var x = (-(tempX1 - tempX2));
var y = (-(tempZ1 - tempZ2));
var ang = Math.atan2(y, x);
var cosTheta = math.cos(ang);
var sinTheta = math.sin(ang);
var vx1p = ((vx1 * cosTheta) + (vy1 * sinTheta));
var vx2p = ((vx2 * cosTheta) + (vy2 * sinTheta));
var vy1p = ((vy1 * cosTheta) - (vx1 * sinTheta));
var vy2p = ((vy2 * cosTheta) - (vx2 * sinTheta));
P = (mass[0] * vx1p) + (mass[m] * vx2p);
V = vx1p - vx2p;
var v1f = ((P - (mass[m] * V)) / (mass[0] + mass[m]));
var v2f = (V + v1f);
var vx1p = v1f;
var vx2p = v2f;
var vx1 = ((vx1p * cosTheta) - (vy1p * sinTheta));
var vx2 = ((vx2p * cosTheta) - (vy2p * sinTheta));
var vy1 = ((vy1p * cosTheta) + (vx1p * sinTheta));
var vy2 = ((vy2p * cosTheta) + (vx2p * sinTheta));
xMov[n] = vx1;
zMov[n] = vy1;
}
function ball2BankDetection() {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
var i = 0;
while (numBanks >= (++i)) {
var bankName = ("bank" + i);
var left = gamePath[bankName].left;
var top = gamePath[bankName].top;
var right = gamePath[bankName].right;
var bottom = gamePath[bankName].bottom;
if (((((left < (tempX + rad)) && ((tempX - rad) < right)) && (top < (tempZ + rad))) && ((tempZ - rad) < bottom)) && (ballCollided == false)) {
angle = gamePath[bankName].angle;
if (triangleSlopeDetect(angle, left, right, top, bottom, tempX, tempZ)) {
xPos[ballNumber] = tempX;
zPos[ballNumber] = tempZ;
ballCollided = true;
ball2BankReactions(angle);
playSound("wall");
go = true;
}
}
}
}
function triangleSlopeDetect(angle, left, right, top, bottom, tempX, tempZ) {
returnVal = false;
if (angle == 225) {
var bankSlope = ((top - bottom) / (left - right));
var ballBankSlope = ((top - tempZ) / (left - tempX));
if ((ballBankSlope < bankSlope) && (0 < ballBankSlope)) {
returnVal = true;
}
} else if (angle == 315) {
var bankSlope = ((top - bottom) / (right - left));
var ballBankSlope = ((top - tempZ) / (right - tempX));
if ((bankSlope < ballBankSlope) && (ballBankSlope < 0)) {
returnVal = true;
}
} else if (angle == 135) {
var bankSlope = ((top - bottom) / (right - left));
var ballBankSlope = ((top - tempZ) / (right - tempX));
if ((ballBankSlope < bankSlope) && (ballBankSlope < 0)) {
returnVal = true;
}
} else if (angle == 45) {
var bankSlope = ((top - bottom) / (left - right));
var ballBankSlope = ((top - tempZ) / (left - tempX));
if ((bankSlope < ballBankSlope) && (0 < ballBankSlope)) {
returnVal = true;
}
}
return(returnVal);
}
function ball2BankReactions(angle) {
alpha = angle;
var cosAlpha = math.cos((alpha * math.pi) / 180);
var sinAlpha = math.sin((alpha * math.pi) / 180);
var vyi = zMov[ballNumber];
var vxi = xMov[ballNumber];
var vyip = ((vyi * cosAlpha) - (vxi * sinAlpha));
var vxip = ((vxi * cosAlpha) + (vyi * sinAlpha));
var vyfp = (-vyip);
var vxfp = vxip;
var vyf = ((vyfp * cosAlpha) + (vxfp * sinAlpha));
var vxf = ((vxfp * cosAlpha) - (vyfp * sinAlpha));
xMov[ballNumber] = vxf;
zMov[ballNumber] = vyf;
}
function ball2BeltDetection() {
tempX = xPos[ballNumber] + xMov[ballNumber];
tempZ = zPos[ballNumber] + zMov[ballNumber];
onBelt = false;
var i = 0;
while (numBelts >= (++i)) {
var boxName = ("belt" add i);
left = gamePath[boxName].left;
top = gamePath[boxName].top;
right = gamePath[boxName].right;
bottom = gamePath[boxName].bottom;
beltType = gamePath[boxName].type;
if ((((left < (tempX + rad)) && ((tempX - rad) < right)) && (top < (tempZ + rad))) && ((tempZ - rad) < bottom)) {
onBelt = true;
beltSpeed1 = 0.8;
if (beltType == "x1") {
xMov[ballNumber] = xMov[ballNumber] + 0.5;
} else if (beltType == "x11") {
xMov[ballNumber] = xMov[ballNumber] + beltSpeed1;
} else if (beltType == "x2") {
xMov[ballNumber] = xMov[ballNumber] - 0.5;
} else if (beltType == "x21") {
xMov[ballNumber] = xMov[ballNumber] - beltSpeed1;
} else if (beltType == "x3") {
xMov[ballNumber] = xMov[ballNumber] + 1.5;
} else if (beltType == "z1") {
zMov[ballNumber] = zMov[ballNumber] - 0.5;
} else if (beltType == "z11") {
zMov[ballNumber] = zMov[ballNumber] - beltSpeed1;
} else if (beltType == "z2") {
zMov[ballNumber] = zMov[ballNumber] + 0.5;
} else if (beltType == "z21") {
zMov[ballNumber] = zMov[ballNumber] + beltSpeed1;
}
}
}
}
function ball2BoxDetection() {
tempX = xPos[ballNumber] + xMov[ballNumber];
tempZ = zPos[ballNumber] + zMov[ballNumber];
var i = 0;
while (numBoxes >= (++i)) {
var boxName = ("box" add i);
left = gamePath[boxName].left;
top = gamePath[boxName].top;
right = gamePath[boxName].right;
bottom = gamePath[boxName].bottom;
disregard = gamePath[boxName].disregard;
collision = "no";
if ((((((left < (tempX + rad)) && ((tempX - rad) < right)) && (top < (tempZ + rad))) && ((tempZ - rad) < bottom)) && (disregard != "yes")) && (ballCollided == false)) {
ballCollided = true;
side = determineSideOfCollision(tempX, tempZ, left, right, top, bottom);
ball2BoxReaction(side, left, right, top, bottom);
playSound("wall");
}
}
}
function ball2BoxReaction(side, left, right, top, bottom) {
var xVel = xMov[ballNumber];
var zVel = zMov[ballNumber];
if (side == "left") {
xVel = xVel * -1;
xPos[ballNumber] = left - rad;
} else if (side == "right") {
xVel = xVel * -1;
xPos[ballNumber] = right + rad;
} else if (side == "top") {
zVel = zVel * -1;
zPos[ballNumber] = top - rad;
} else if (side == "bottom") {
zVel = zVel * -1;
zPos[ballNumber] = bottom + rad;
}
xMov[ballNumber] = xVel;
zMov[ballNumber] = zVel;
}
function determineSideOfCollision(tempX, tempZ, left, right, top, bottom) {
ballSlope = zMov[ballNumber] / xMov[ballNumber];
z = zPos[ballNumber];
x = xPos[ballNumber];
if (((z - rad) >= top) && ((x - rad) >= left)) {
var region = 1;
} else if (((z - rad) >= top) && (right >= (x + rad))) {
var region = 2;
} else if ((bottom >= (z + rad)) && (right >= (x + rad))) {
var region = 3;
} else if ((bottom >= (z + rad)) && ((x - rad) >= left)) {
var region = 4;
}
if (region == 1) {
var regionY1 = top;
var regionX1 = left;
var regionY2 = bottom;
var regionX2 = right;
var regionSlope = ((regionY2 - regionY1) / (regionX2 - regionX1));
var ballRegionSlope = ((z - regionY1) / (x - regionX1));
if (ballRegionSlope >= regionSlope) {
var side = "bottom";
} else {
var side = "right";
}
} else if (region == 2) {
var regionY1 = top;
var regionX1 = right;
var regionY2 = bottom;
var regionX2 = left;
var regionSlope = ((regionY2 - regionY1) / (regionX2 - regionX1));
var ballRegionSlope = ((z - regionY1) / (x - regionX1));
if (regionSlope >= ballRegionSlope) {
var side = "bottom";
} else {
var side = "left";
}
} else if (region == 3) {
var regionY1 = bottom;
var regionX1 = right;
var regionY2 = top;
var regionX2 = left;
var regionSlope = ((regionY2 - regionY1) / (regionX2 - regionX1));
var ballRegionSlope = ((z - regionY1) / (x - regionX1));
if (ballRegionSlope >= regionSlope) {
var side = "top";
} else {
var side = "left";
}
} else if (region == 4) {
var regionY1 = bottom;
var regionX1 = left;
var regionY2 = top;
var regionX2 = right;
var regionSlope = ((regionY2 - regionY1) / (regionX2 - regionX1));
var ballRegionSlope = ((z - regionY1) / (x - regionX1));
if (regionSlope >= ballRegionSlope) {
var side = "top";
} else {
var side = "right";
}
}
return(side);
}
function moundDetection() {
moundName = "mound";
maxMoundY = -30;
var moundRad = gamePath[moundName].rad;
var moundCenterX = gamePath[moundName].centerX;
var moundCenterZ = gamePath[moundName].centerZ;
var dis = math.sqrt((((xPos[ballNumber] + xMov[ballNumber]) - moundCenterX) * ((xPos[ballNumber] + xMov[ballNumber]) - moundCenterX)) + (((zPos[ballNumber] + zMov[ballNumber]) - moundCenterZ) * ((zPos[ballNumber] + zMov[ballNumber]) - moundCenterZ)));
if (moundRad >= dis) {
floor = (1 - (dis / moundRad)) * maxMoundY;
} else {
floor = 0;
}
}
function holeDetection() {
var holeIncreasePercent = 15;
var holeRad = ((gamePath.hole.rad * (100 + holeIncreasePercent)) / 100);
var holeX = gamePath.hole.centerX;
var holeZ = gamePath.hole.centerZ;
var dis = math.sqrt((((xPos[ballNumber] + xMov[ballNumber]) - holeX) * ((xPos[ballNumber] + xMov[ballNumber]) - holeX)) + (((zPos[ballNumber] + zMov[ballNumber]) - holeZ) * ((zPos[ballNumber] + zMov[ballNumber]) - holeZ)));
if ((holeRad >= dis) && (death[ballNumber] != true)) {
holeSpeed = math.sqrt((xMov[ballNumber] * xMov[ballNumber]) + (zMov[ballNumber] * zMov[ballNumber]));
if ((maxHoleCollectSpeed >= holeSpeed) && (math.abs(yPos[ballNumber] - floor) < 2)) {
xPos[ballNumber] = holeX;
zPos[ballNumber] = holeZ;
xMov[ballNumber] = 0;
zMov[ballNumber] = 0;
yMov[ballNumber] = 0;
playSound("hole");
gamePath.hole.play();
gamePath[currentBallName]._visible = 0;
gamePath["shadow" + ballNumber]._visible = 0;
death[ballNumber] = true;
shotMessage("ballin", _parent.strokes[ballNumber]);
} else {
yMov[ballNumber] = yMov[ballNumber] - holeTooFastHop;
}
} else if (death[ballNumber] == true) {
xMov[ballNumber] = 0;
zMov[ballNumber] = 0;
yMov[ballNumber] = 0;
}
}
function dummyHoles() {
if (hole == "hole15") {
newY = topFloor;
newXmov = 0;
newZmov = -4;
secondaryHoleDetection();
} else if (hole == "hole16") {
newY = topFloor;
newXmov = 7;
newZmov = 0;
secondaryHoleDetection();
} else if (hole == "hole11") {
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection();
newXmov = 0;
newZmov = -4;
secondaryHoleDetection2();
} else if (hole == "hole19") {
newY = topFloor;
newXmov = 7;
newZmov = 0;
secondaryHoleDetection();
newXmov = 0.8;
newZmov = 0;
secondaryHoleDetection2();
} else if (hole == "hole20") {
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection();
} else if (hole == "hole18") {
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection();
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection2();
newY = topFloor;
newXmov = 0;
newZmov = -1;
secondaryHoleDetection3();
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection4();
} else if (hole == "hole21") {
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection();
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection2();
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection3();
newY = topFloor;
newXmov = 2;
newZmov = 0;
secondaryHoleDetection4();
}
}
function secondaryHoleDetection4() {
var holeIncreasePercent = 10;
var holeRad = ((gamePath.hole3.rad * (100 + holeIncreasePercent)) / 100);
var holeX = gamePath.hole5.centerX;
var holeZ = gamePath.hole5.centerZ;
var newX = gamePath.dummy5.centerX;
var newZ = gamePath.dummy5.centerZ;
var dis = math.sqrt((((xPos[ballNumber] + xMov[ballNumber]) - holeX) * ((xPos[ballNumber] + xMov[ballNumber]) - holeX)) + (((zPos[ballNumber] + zMov[ballNumber]) - holeZ) * ((zPos[ballNumber] + zMov[ballNumber]) - holeZ)));
if ((holeRad >= dis) && (death[ballNumber] != true)) {
holeSpeed = math.sqrt((xMov[ballNumber] * xMov[ballNumber]) + (zMov[ballNumber] * zMov[ballNumber]));
if (maxHoleCollectSpeed >= holeSpeed) {
xPos[ballNumber] = newX;
zPos[ballNumber] = newZ;
yPos[ballNumber] = newY;
xMov[ballNumber] = newXmov;
zMov[ballNumber] = newZmov;
yMov[ballNumber] = 0;
playSound("dummyHole");
gamePath.hole5.play();
} else {
yMov[ballNumber] = yMov[ballNumber] - holeTooFastHop;
}
}
}
function secondaryHoleDetection3() {
var holeIncreasePercent = 10;
var holeRad = ((gamePath.hole4.rad * (100 + holeIncreasePercent)) / 100);
var holeX = gamePath.hole4.centerX;
var holeZ = gamePath.hole4.centerZ;
var newX = gamePath.dummy4.centerX;
var newZ = gamePath.dummy4.centerZ;
var dis = math.sqrt((((xPos[ballNumber] + xMov[ballNumber]) - holeX) * ((xPos[ballNumber] + xMov[ballNumber]) - holeX)) + (((zPos[ballNumber] + zMov[ballNumber]) - holeZ) * ((zPos[ballNumber] + zMov[ballNumber]) - holeZ)));
if ((holeRad >= dis) && (death[ballNumber] != true)) {
holeSpeed = math.sqrt((xMov[ballNumber] * xMov[ballNumber]) + (zMov[ballNumber] * zMov[ballNumber]));
if (maxHoleCollectSpeed >= holeSpeed) {
xPos[ballNumber] = newX;
zPos[ballNumber] = newZ;
yPos[ballNumber] = newY;
xMov[ballNumber] = newXmov;
zMov[ballNumber] = newZmov;
yMov[ballNumber] = 0;
playSound("dummyHole");
gamePath.hole4.play();
} else {
yMov[ballNumber] = yMov[ballNumber] - holeTooFastHop;
}
}
}
function secondaryHoleDetection2() {
var holeIncreasePercent = 10;
var holeRad = ((gamePath.hole3.rad * (100 + holeIncreasePercent)) / 100);
var holeX = gamePath.hole3.centerX;
var holeZ = gamePath.hole3.centerZ;
var newX = gamePath.dummy3.centerX;
var newZ = gamePath.dummy3.centerZ;
var dis = math.sqrt((((xPos[ballNumber] + xMov[ballNumber]) - holeX) * ((xPos[ballNumber] + xMov[ballNumber]) - holeX)) + (((zPos[ballNumber] + zMov[ballNumber]) - holeZ) * ((zPos[ballNumber] + zMov[ballNumber]) - holeZ)));
if ((holeRad >= dis) && (death[ballNumber] != true)) {
holeSpeed = math.sqrt((xMov[ballNumber] * xMov[ballNumber]) + (zMov[ballNumber] * zMov[ballNumber]));
if (maxHoleCollectSpeed >= holeSpeed) {
xPos[ballNumber] = newX;
zPos[ballNumber] = newZ;
yPos[ballNumber] = newY;
xMov[ballNumber] = newXmov;
zMov[ballNumber] = newZmov;
yMov[ballNumber] = 0;
playSound("dummyHole");
gamePath.hole3.play();
} else {
yMov[ballNumber] = yMov[ballNumber] - holeTooFastHop;
}
}
}
function secondaryHoleDetection() {
var holeIncreasePercent = 10;
var holeRad = ((gamePath.hole2.rad * (100 + holeIncreasePercent)) / 100);
var holeX = gamePath.hole2.centerX;
var holeZ = gamePath.hole2.centerZ;
var newX = gamePath.dummy2.centerX;
var newZ = gamePath.dummy2.centerZ;
var dis = math.sqrt((((xPos[ballNumber] + xMov[ballNumber]) - holeX) * ((xPos[ballNumber] + xMov[ballNumber]) - holeX)) + (((zPos[ballNumber] + zMov[ballNumber]) - holeZ) * ((zPos[ballNumber] + zMov[ballNumber]) - holeZ)));
if ((holeRad >= dis) && (death[ballNumber] != true)) {
holeSpeed = math.sqrt((xMov[ballNumber] * xMov[ballNumber]) + (zMov[ballNumber] * zMov[ballNumber]));
if (maxHoleCollectSpeed >= holeSpeed) {
xPos[ballNumber] = newX;
zPos[ballNumber] = newZ;
yPos[ballNumber] = newY;
xMov[ballNumber] = newXmov;
zMov[ballNumber] = newZmov;
yMov[ballNumber] = 0;
floor = newY;
playSound("dummyHole");
gamePath.hole2.play();
} else {
yMov[ballNumber] = yMov[ballNumber] - holeTooFastHop;
}
}
}
function playSound(soundName) {
if (_root.soundToggle) {
if (soundName == "wall") {
theSpeed = math.sqrt((xMov[ballNumber] * xMov[ballNumber]) + (zMov[ballNumber] * zMov[ballNumber]));
volume = ((theSpeed / maxSpeed) * 100) - 10;
if (volume < 10) {
volume = 10;
}
if ((floor - wallHeight) < (yPos[ballNumber] + yMov[ballNumber])) {
soundVol = Math.ceil(volume / 25);
playSound("hardBounce" + soundVol);
} else {
gamePath.force1.gotoAndPlay(2);
soundName = "electric";
_parent.soundFX.gotoAndPlay(soundName);
}
} else {
_parent.soundFX.gotoAndPlay(soundName);
}
}
}
function rampDetection() {
if (hole == "hole2") {
rl = leftWall;
rr = rightWall;
rt = -270;
rb = -100;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp == false) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.sin(theta);
cosTheta = math.cos(theta);
tanTheta = sinTheta / cosTheta;
yMov[ballNumber] = yMov[ballNumber] * ((-zMov[ballNumber]) * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
}
floor = bottomFloor - ((tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] + (((-gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + (((-gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
}
}
if (hole == "hole3") {
rl = leftWall;
rr = rightWall;
rt = -370;
rb = -260;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp == false) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
}
floor = topFloor + (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
}
}
if (hole == "hole19") {
rl = leftWall;
rr = rightWall;
rt = -230;
rb = -134;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp1 == false) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp1 = true;
}
floor = topFloor + (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp1 = false;
}
}
if (hole == "hole19") {
rl = 580;
rr = 614;
rt = topWall;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if (((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) && (380 < tempX)) {
if (onRamp2 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (xMov[ballNumber] * sinTheta);
xMov[ballNumber] = xMov[ballNumber] * cosTheta;
onRamp2 = true;
onRamp = true;
}
floor = math.abs(tempX - rl) * tanTheta;
xMov[ballNumber] = xMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp2 = false;
}
}
if (hole == "hole20") {
rl = -282;
rr = -113;
rt = topWall;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if (((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) && (tempZ < -220)) {
if (onRamp1 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (xMov[ballNumber] * sinTheta);
xMov[ballNumber] = xMov[ballNumber] * cosTheta;
onRamp1 = true;
onRamp = true;
}
floor = math.abs(tempX - rl) * tanTheta;
xMov[ballNumber] = xMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp1 = false;
}
}
if (hole == "hole6") {
rl = leftWall;
rr = rightWall;
rt = 270;
rb = 380;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp == false) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
}
floor = topFloor + (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
}
}
if (hole == "hole5") {
rl = leftWall;
rr = 220;
rt = -190;
rb = -100;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp1 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp1 = true;
}
floor = topFloor + (math.abs(tempZ - rb) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp1 = false;
}
}
if (hole == "hole5") {
rl = 270;
rr = 380;
rt = -40;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp2 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (xMov[ballNumber] * sinTheta);
xMov[ballNumber] = xMov[ballNumber] * cosTheta;
onRamp = true;
onRamp2 = true;
}
floor = topFloor + (math.abs(tempX - rl) * tanTheta);
xMov[ballNumber] = xMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp2 = false;
}
}
if (hole == "hole17") {
rl = leftWall;
rr = rightWall;
rt = -220;
rb = -150;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp1 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp1 = true;
}
floor = topFloor + (math.abs(tempZ - rb) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp1 = false;
}
}
if (hole == "hole17") {
rl = leftWall;
rr = rightWall;
rt = -110;
rb = -35;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if (((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) && (100 < tempX)) {
if (onRamp2 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * ((-zMov[ballNumber]) * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp2 = true;
}
floor = topFloor + (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp2 = false;
}
}
if (hole == "hole7") {
rl = leftWall;
rr = rightWall;
rt = -335;
rb = -300;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp1 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp1 = true;
}
floor = topFloor - (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp1 = false;
}
}
if (hole == "hole7") {
rl = leftWall;
rr = rightWall;
rt = -290;
rb = -255;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp2 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp2 = true;
}
floor = (-bottomFloor) + (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp2 = false;
}
}
if (hole == "hole7") {
rl = leftWall;
rr = rightWall;
rt = -210;
rb = -185;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp3 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp3 = true;
}
floor = topFloor - (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp3 = false;
}
}
if (hole == "hole7") {
rl = leftWall;
rr = rightWall;
rt = -165;
rb = -130;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp4 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp4 = true;
}
floor = (-bottomFloor) + (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp4 = false;
}
}
if (hole == "hole9") {
rl = leftWall;
rr = rightWall;
rt = -280;
rb = -237;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
zMov[ballNumber] = zMov[ballNumber] * 0.9;
onRamp = true;
}
floor = topFloor - (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
}
}
if (hole == "hole10") {
rl = -17;
rr = 32;
rt = topWall;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp2 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (xMov[ballNumber] * sinTheta);
xMov[ballNumber] = xMov[ballNumber] * cosTheta;
onRamp = true;
onRamp2 = true;
}
floor = (-math.abs(tempX - rr)) * tanTheta;
xMov[ballNumber] = xMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp2 = false;
}
}
if (hole == "hole11") {
rl = leftWall;
rr = 290;
rt = -407;
rb = -342;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp1 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp1 = true;
}
floor = topFloor - (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp1 = false;
}
}
if (hole == "hole11") {
rl = leftWall;
rr = 290;
rt = -307;
rb = -238;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp2 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp2 = true;
}
floor = (-math.abs(tempZ - rb)) * tanTheta;
zMov[ballNumber] = zMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
if (zMov[ballNumber] < 0) {
yMov[ballNumber] = 0;
yPos[ballNumber] = floor;
}
} else {
onRamp = false;
onRamp2 = false;
}
}
if (hole == "hole11") {
rl = leftWall;
rr = 290;
rt = -207;
rb = -141;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp3 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp3 = true;
}
floor = topFloor - (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp3 = false;
}
}
if (hole == "hole11") {
rl = leftWall;
rr = 290;
rt = -111;
rb = -38;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp4 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp4 = true;
}
floor = (-math.abs(tempZ - rb)) * tanTheta;
zMov[ballNumber] = zMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
if (zMov[ballNumber] < 0) {
yMov[ballNumber] = 0;
yPos[ballNumber] = floor;
}
} else {
onRamp = false;
onRamp4 = false;
}
}
if (hole == "hole11") {
rl = leftWall;
rr = 290;
rt = -7;
rb = 106;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp5 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp5 = true;
}
floor = topFloor - (math.abs(tempZ - rt) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp5 = false;
}
}
if (hole == "hole12") {
rl = 487;
rr = 580;
rt = topWall;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp1 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (xMov[ballNumber] * sinTheta);
xMov[ballNumber] = xMov[ballNumber] * cosTheta;
onRamp = true;
onRamp1 = true;
}
floor = math.abs(tempX - rl) * tanTheta;
xMov[ballNumber] = xMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp1 = false;
}
}
if (hole == "hole12") {
rl = 615;
rr = 716;
rt = topWall;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp2 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (xMov[ballNumber] * sinTheta);
xMov[ballNumber] = xMov[ballNumber] * cosTheta;
onRamp = true;
onRamp2 = true;
}
floor = math.abs(tempX - rr) * tanTheta;
xMov[ballNumber] = xMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp2 = false;
}
}
if (hole == "hole13") {
rl = 657;
rr = 705;
rt = topWall;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
onRamp = true;
}
floor = math.abs(tempX - rl) * tanTheta;
xMov[ballNumber] = xMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
}
}
if (hole == "hole14") {
rl = 106;
rr = 221;
rt = topWall;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) {
if (onRamp != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (xMov[ballNumber] * sinTheta);
xMov[ballNumber] = xMov[ballNumber] * cosTheta;
onRamp = true;
}
floor = (-math.abs(tempX - rr)) * tanTheta;
xMov[ballNumber] = xMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
}
}
if (hole == "hole15") {
rl = leftWall;
rr = rightWall;
rt = -280;
rb = -228;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if (((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) && (tempX < 370)) {
if (onRamp1 == false) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp1 = true;
}
floor = topFloor + (math.abs(tempZ - rb) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp1 = false;
}
}
if (hole == "hole15") {
rl = 520;
rr = 564;
rt = topWall;
rb = bottomWall;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if (((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) && (380 < tempX)) {
if (onRamp2 != true) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rr - rl);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (xMov[ballNumber] * sinTheta);
xMov[ballNumber] = xMov[ballNumber] * cosTheta;
onRamp2 = true;
onRamp = true;
}
floor = math.abs(tempX - rl) * tanTheta;
xMov[ballNumber] = xMov[ballNumber] + ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp2 = false;
}
}
if (hole == "hole16") {
rl = leftWall;
rr = rightWall;
rb = -186;
rt = -283;
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if (((((rl < (tempX + rad)) && ((tempX - rad) < rr)) && (rt < (tempZ + rad))) && ((tempZ - rad) < rb)) && (tempX < 316)) {
if (onRamp1 == false) {
var h = math.abs(topFloor - bottomFloor);
var l = math.abs(rt - rb);
theta = math.atan2(h, l);
sinTheta = math.abs(math.sin(theta));
cosTheta = math.abs(math.cos(theta));
tanTheta = math.abs(sinTheta / cosTheta);
yMov[ballNumber] = yMov[ballNumber] * (zMov[ballNumber] * sinTheta);
zMov[ballNumber] = zMov[ballNumber] * cosTheta;
onRamp = true;
onRamp1 = true;
}
floor = topFloor + (math.abs(tempZ - rb) * tanTheta);
zMov[ballNumber] = zMov[ballNumber] - ((math.abs(gravity) * sinTheta) * cosTheta);
yMov[ballNumber] = yMov[ballNumber] + ((math.abs(gravity) * sinTheta) * sinTheta);
} else {
onRamp = false;
onRamp1 = false;
}
}
holeSpecific();
}
function holeSpecific() {
if (hole == "hole2") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((tempZ + rad) < rt) {
floor = bottomFloor;
} else if (rb < (tempZ - rad)) {
floor = topFloor;
}
}
if (hole == "hole15") {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if (((tempZ - rad) < -280) && (tempX < 370)) {
floor = bottomFloor;
} else if ((-228 < (tempZ + rad)) && (tempX < 370)) {
floor = topFloor;
} else if (((tempX - rad) < 520) && (380 < tempX)) {
floor = topFloor;
} else if ((564 < (tempX + rad)) && (380 < tempX)) {
floor = bottomFloor;
}
}
if (hole == "hole16") {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if (((tempZ - rad) < -283) && (tempX < 500)) {
floor = bottomFloor;
} else if ((-186 < (tempZ - rad)) && (tempX < 340)) {
floor = topFloor;
} else if (500 < tempX) {
floor = topFloor;
}
}
if (hole == "hole3") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((tempZ + rad) < rt) {
floor = topFloor;
} else if (rb < (tempZ - rad)) {
floor = bottomFloor;
}
}
if (hole == "hole5") {
if (((onRamp == false) && (onRamp1 != true)) && (onRamp2 != true)) {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if ((-100 < tempZ) && (tempX < 270)) {
floor = topFloor;
} else {
floor = bottomFloor;
}
}
}
if (hole == "hole6") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((tempZ - rad) < 270) {
floor = topFloor;
} else if (380 < (tempZ + rad)) {
floor = bottomFloor;
}
}
if (hole == "hole20") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if (tempZ < -220) {
if ((tempX - rad) < -282) {
floor = topFloor;
} else if (-113 < (tempX + rad)) {
floor = bottomFloor;
}
} else {
floor = topFloor;
}
}
if (hole == "hole19") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if (tempX < 300) {
if ((tempZ - rad) < -230) {
floor = topFloor;
} else if (-134 < (tempZ + rad)) {
floor = bottomFloor;
}
} else if (tempX < 580) {
floor = topFloor;
} else if (614 < tempX) {
floor = bottomFloor;
}
}
if (hole == "hole7") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((tempZ + rad) < -335) {
floor = topFloor;
} else if (-130 < (tempZ - rad)) {
floor = topFloor;
}
}
if (hole == "hole9") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((tempZ + rad) < rt) {
floor = topFloor;
} else if (rb < (tempZ - rad)) {
floor = -bottomFloor;
}
}
if (hole == "hole10") {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if (rr < (tempX + rad)) {
floor = topFloor;
} else if ((tempX - rad) < rl) {
floor = -bottomFloor;
}
}
if (((((((hole == "hole11") && (onRamp != true)) && (onRamp1 != true)) && (onRamp2 != true)) && (onRamp3 != true)) && (onRamp4 != true)) && (onRamp5 != true)) {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((tempZ - rad) < -407) {
floor = topFloor;
} else if ((-342 < (tempZ + rad)) && ((tempZ - rad) < -307)) {
floor = -bottomFloor;
} else if ((-238 < (tempZ + rad)) && ((tempZ - rad) < -207)) {
floor = topFloor;
} else if ((-141 < (tempZ + rad)) && ((tempZ - rad) < -111)) {
floor = -bottomFloor;
} else if ((-38 < (tempZ + rad)) && ((tempZ - rad) < -7)) {
floor = topFloor;
} else if (106 < (tempZ + rad)) {
floor = -bottomFloor;
}
if (rr < tempX) {
floor = topFloor;
}
}
if ((((hole == "hole12") && (onRamp != true)) && (onRamp1 != true)) && (onRamp2 != true)) {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if (((tempX - rad) < 487) || (716 < (tempX + rad))) {
floor = topFloor;
} else if ((594 < (tempX - rad)) && ((tempX + rad) < 630)) {
floor = bottomFloor;
}
}
if (hole == "hole13") {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if (rr < (tempX + rad)) {
floor = bottomFloor;
gamepath["moveMe" + ballNumber] = "yes";
} else if ((tempX - rad) < (rr - 10)) {
floor = topfloor;
}
}
if (hole == "hole14") {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if (rr < (tempX + rad)) {
floor = topFloor;
} else if ((tempX - rad) < rl) {
floor = -bottomFloor;
}
}
if (hole == "hole17") {
if (((onRamp == false) && (onRamp1 != true)) && (onRamp2 != true)) {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if ((tempZ + rad) < -220) {
floor = bottomFloor;
} else if ((-150 < (tempZ - rad)) && ((tempZ + rad) < -110)) {
floor = topFloor;
} else if (-35 < (tempZ - rad)) {
floor = bottomFloor;
}
if (tempX < 95) {
floor = topFloor;
}
}
}
}
function altitude() {
yMovMin = 0.8;
yMov[ballNumber] = yMov[ballNumber] + gravity;
if ((math.abs(yMov[ballNumber]) < yMovMin) && (math.abs(yPos[ballNumber] - floor) < 1)) {
yMov[ballNumber] = 0;
}
if (floor < (yPos[ballNumber] + yMov[ballNumber])) {
yPos[ballNumber] = floor;
yMov[ballNumber] = yMov[ballNumber] * floorBounciness;
}
}
function sandTrap() {
if (onSand == true) {
terrain = sandyTerrain;
}
}
function hitPuddle() {
if (onPuddle == true) {
terrain = puddleTerrain;
}
}
function hitPool(x, z) {
xMov[ballNumber] = 0;
zMov[ballNumber] = 0;
xPos[ballNumber] = x;
zPos[ballNumber] = z;
}
function speedFilter() {
if (hole == "hole16") {
var tempX = (xPos[ballNumber] + xMov[ballNumber]);
if ((360 < tempX) && (tempX < 450)) {
sMax = 7;
if (sMax < xMov[ballNumber]) {
xMov[ballNumber] = sMax;
} else if (xMov[ballNumber] < (-sMax)) {
xMov[ballNumber] = -sMax;
}
if (sMax < zov[ballNumber]) {
zMov[ballNumber] = sMax;
} else if (zMov[ballNumber] < (-sMax)) {
zMov[ballNumber] = -sMax;
}
}
}
}
function ball2FanDetection() {
var i = 0;
while (numFans >= (++i)) {
var name1 = ballNumber;
var bumperName = ("fan" + i);
var tempX1 = (xPos[name1] + xMov[name1]);
var tempX2 = gamePath[bumperName].centerX;
var tempZ1 = (zPos[name1] + zMov[name1]);
var tempZ2 = gamePath[bumperName].centerZ;
var tempRad2 = gamePath[bumperName].radius;
if (math.sqrt(((tempX1 - tempX2) * (tempX1 - tempX2)) + ((tempZ1 - tempZ2) * (tempZ1 - tempZ2))) < (rad + tempRad2)) {
yMov[ballNumber] = yMov[ballNumber] - 2;
zMov[ballNumber] = zMov[ballNumber] + 0.5;
}
}
}
_visible = false;
if ((_root.userName == null) || (_root.userName == "")) {
moveEnded = "yes";
}
_parent.screenSync._visible = 0;
ballNumber = 0;
currentBallName = "ball0";
testMode = true;
if (testMode) {
_root.soundToggle = true;
}
if (_parent.myColor == "b") {
args = new Array();
args[0] = "proceed";
args[1] = _root.userName;
_root.sendMove(args);
}
initX = new Array();
initZ = new Array();
if (_parent.version == "mplayer") {
myColor = _parent.myColor;
if (myColor == "w") {
moveEnded = "yes";
myBallNumber = 0;
hisBallNumber = 1;
} else if (myColor == "b") {
myBallNumber = 1;
hisBallNumber = 0;
}
}
hole = _parent.hole;
_parent.course.gotoAndStop(hole);
gamePath = _parent.course.course;
numPlayers = _parent.numPlayers;
if (1 < numPlayers) {
multiPlayer = true;
} else {
multiPlayer = false;
}
i = numPlayers - 1;
while (5 >= (++i)) {
gamePath["ball" + i]._visible = 0;
gamePath["shadow" + i]._visible = 0;
}
wallHeight = 10;
go = true;
ballInPlay = true;
onRamp = false;
terrainOn = true;
xMov = new Array();
yMov = new Array();
zMov = new Array();
score = new Array();
xMov[ballNumber] = 0;
zMov[ballNumber] = 0;
yMov[ballNumber] = 0;
readytoshoot();
rad = gamePath.ball._width / 2;
floorBounciness = -0.25;
minSpeed = 0.3;
maxHoleCollectSpeed = 6;
holeTooFastHop = 2;
numBanks = 0;
numBelts = 0;
numBoxes = 0;
numBumpers = 0;
numFans = 0;
topFloor = 0;
par = _parent.par[_parent.holeNumber - 1];
floor = topFloor;
startFloor = topFloor;
if (_parent.holeNumber == 2) {
bottomFLoor = 35;
startFloor = bottomFloor;
} else if (_parent.holeNumber == 3) {
bottomFLoor = 58;
startFloor = bottomFloor;
} else if (_parent.holeNumber == 5) {
bottomFLoor = 65;
startFloor = bottomFloor;
} else if (_parent.holeNumber == 6) {
bottomFLoor = 40;
} else if (_parent.holeNumber == 7) {
bottomFLoor = 15;
} else if (_parent.holeNumber == 9) {
bottomFLoor = 170;
} else if (_parent.holeNumber == 10) {
bottomFLoor = 45;
startFloor = bottomFloor;
} else if (_parent.holeNumber == 11) {
bottomFLoor = 45;
} else if (_parent.holeNumber == 12) {
bottomFLoor = 30;
} else if (_parent.holeNumber == 13) {
bottomFLoor = 90;
} else if (_parent.holeNumber == 14) {
bottomFLoor = 190;
startFloor = -bottomFloor;
} else if (_parent.holeNumber == 15) {
bottomFLoor = 55;
} else if (_parent.holeNumber == 16) {
bottomFLoor = 40;
} else if (_parent.holeNumber == 17) {
bottomFLoor = 40;
startFloor = bottomFloor;
} else if (_parent.holeNumber == 19) {
bottomFLoor = 50;
} else if (_parent.holeNumber == 20) {
bottomFLoor = 115;
}
floor = topFloor;
xPos = new Array();
zPos = new Array();
yPos = new Array();
yPos[ballNumber] = floor;
mainTerrain = 0.97;
sandyTerrain = 0.8;
puddleTerrain = 0.9;
terrain = mainTerrain;
gravity = 0.7;
yAng = 45;
xAng = 30;
sinY = (cosY = math.sin((yAng * math.pi) / 180));
cosX = math.cos((xAng * math.pi) / 180);
sinX = math.sin((xAng * math.pi) / 180);
setWalls();
setBallPos();
characterOnBench();
}
onClipEvent (enterFrame) {
lTime = getTimer();
terrain = mainTerrain;
if (ballInPlay) {
ballCollided = false;
terrain = mainTerrain;
speedFilter();
ball2FanDetection();
ball2BankDetection();
ball2BoxDetection();
ball2BallHappened = false;
ball2ballcollisionDetection();
if (ball2BallHappened) {
ball2ballcollisionDetection();
}
rampDetection();
wallDetection();
ball2BeltDetection();
sandTrap();
hitPuddle();
holeDetection();
dummyHoles();
update();
orderBall();
} else {
gamePath.line._visible = 0;
refreshDelay++;
if (48 < refreshDelay) {
_parent.gotoAndStop("refresh");
}
}
_parent.x = xPos[ballNumber];
_parent.z = zPos[ballNumber];
_parent.floor = floor;
}
Instance of Symbol 681 MovieClip in Symbol 695 MovieClip Frame 35
onClipEvent (load) {
function setTime() {
var time = (max_time - _parent.current_time);
var minutes = Math.floor(time / ms_in_min).toString();
var seconds = Math.floor((time % ms_in_min) / ms_in_sec).toString();
var miliseconds = Math.floor((time % ms_in_min) % ms_in_sec).toString();
ms1.gotoAndStop(1);
ms2.gotoAndStop(1);
ms3.gotoAndStop(1);
m1.gotoAndStop(1);
m2.gotoAndStop(1);
s1.gotoAndStop(1);
s2.gotoAndStop(1);
var len = miliseconds.length;
var i = 0;
while (i < len) {
var num = miliseconds.substr(i, 1);
var name = ("ms" + (len - i));
this[name].gotoAndStop(Number(num) + 1);
i++;
}
var len = seconds.length;
var i = 0;
while (i < len) {
var num = seconds.substr(i, 1);
var name = ("s" + (len - i));
this[name].gotoAndStop(Number(num) + 1);
i++;
}
var len = minutes.length;
var i = 0;
while (i < len) {
var num = minutes.substr(i, 1);
var name = ("m" + (len - i));
this[name].gotoAndStop(Number(num) + 1);
i++;
}
}
ms_in_min = 60000;
ms_in_sec = 1000;
max_min = _parent.total_minutes;
max_time = max_min * ms_in_min;
}
onClipEvent (enterFrame) {
setTime();
}
Instance of Symbol 689 MovieClip "score_clip" in Symbol 695 MovieClip Frame 35
onClipEvent (load) {
function setScore(score) {
clean();
score = score.toString();
var len = score.length;
var i = 0;
while (i < len) {
var num = score.substr(i, 1);
var name = ("s" + ((len - i) + (4 - len)));
this[name]._visible = true;
this[name].gotoAndStop(Number(num) + 1);
i++;
}
if (3 < len) {
c1._visible = true;
c1.gotoAndStop(2);
}
if (6 < len) {
c2._visible = true;
c2.gotoAndStop(2);
}
if (9 < len) {
c3._visible = true;
c3.gotoAndStop(2);
}
}
function clean() {
var i = 1;
while (12 >= i) {
this["s" + i]._visible = false;
i++;
}
var i = 1;
while (3 >= i) {
this["c" + i]._visible = false;
i++;
}
}
setScore(_parent.current_score);
}
Symbol 695 MovieClip Frame 53
gcode = _root.gcode;
score = current_score;
if (score == 0) {
score = 5;
}
if (_root.url_dest == null) {
getURL ("game.cfm", "_self", "POST");
} else {
getURL (_root.url_dest, "_self", "POST");
}
stop();