Frame 1
totalBytes = this.getBytesTotal();
totalBytesLoaded = this.getBytesLoaded();
fscommand ("allowscale", "false");
if (_root.userName.length == null) {
version = "standalone";
} else if (_root.userName != null) {
version = "mplayer";
}
Frame 2
totalBytesLoaded = this.getBytesLoaded();
percent = (totalBytesLoaded / totalBytes) * 100;
if (percent >= 100) {
gotoAndStop (6);
}
percent = int(percent) + "% loaded.";
ls = Math.round((totalBytesLoaded / (getTimer() / 1000)) / 10.24) / 100;
var speedload = (("@ " + ls) + "kbs");
Frame 3
gotoAndPlay (2);
Frame 6
if (version == "standalone") {
gotoAndStop (10);
} else if (version == "mplayer") {
gotoAndStop (37);
}
Frame 10
stop();
Frame 25
stop();
player1 = "";
player2 = "";
selection.setFocus("player1");
Frame 37
_root.join_room(_root.gameRoom);
stop();
Symbol 21 Button
on (release) {
this.gotoAndStop(1);
}
Symbol 23 MovieClip Frame 1
stop();
Symbol 38 MovieClip Frame 1
stop();
Symbol 38 MovieClip Frame 2
stop();
Symbol 38 MovieClip Frame 3
stop();
Symbol 38 MovieClip Frame 4
stop();
Symbol 38 MovieClip Frame 5
stop();
Symbol 38 MovieClip Frame 6
stop();
Symbol 40 Button
on (rollOver) {
tellTarget ("/high") {
gotoAndStop (6);
};
}
on (rollOut) {
tellTarget ("/high") {
gotoAndStop (1);
};
}
on (release) {
gotoAndStop (15);
}
Symbol 41 Button
on (rollOver) {
tellTarget ("/high") {
gotoAndStop (3);
};
}
on (rollOut) {
tellTarget ("/high") {
gotoAndStop (1);
};
}
on (release) {
numPlayers = 2;
gotoAndStop (25);
}
Symbol 42 Button
on (rollOver) {
tellTarget ("/high") {
gotoAndStop (4);
};
}
on (rollOut) {
tellTarget ("/high") {
gotoAndStop (1);
};
}
on (release) {
gotoAndStop (33);
}
Symbol 43 Button
on (rollOver) {
tellTarget ("/high") {
gotoAndStop (2);
};
}
on (rollOut) {
tellTarget ("/high") {
gotoAndStop (1);
};
}
on (release) {
numPlayers = 1;
gotoAndStop (37);
}
Symbol 44 Button
on (rollOver) {
tellTarget ("/high") {
gotoAndStop (5);
};
}
on (rollOut) {
tellTarget ("/high") {
gotoAndStop (1);
};
}
on (release) {
gotoAndStop (20);
}
Symbol 50 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 2
stop();
Symbol 51 Button
on (rollOver) {
tellTarget ("/back") {
gotoAndStop (2);
};
}
on (rollOut) {
tellTarget ("/back") {
gotoAndStop (1);
};
}
on (release) {
gotoAndStop (10);
}
Symbol 69 MovieClip Frame 1
stop();
Symbol 69 MovieClip Frame 2
stop();
Symbol 70 Button
on (rollOver) {
tellTarget ("/play") {
gotoAndStop (2);
};
}
on (rollOut) {
tellTarget ("/play") {
gotoAndStop (1);
};
}
on (release, keyPress "<Enter>") {
if ((player1 != "") && (player2 != "")) {
gotoAndStop (37);
}
}
Symbol 76 MovieClip Frame 1
stop();
Symbol 76 MovieClip Frame 2
stop();
Symbol 77 Button
on (rollOver) {
tellTarget ("/over") {
gotoAndStop (2);
};
}
on (rollOut) {
tellTarget ("/over") {
gotoAndStop (1);
};
}
on (release) {
getURL ("http://www.electrotank.com/games/multiuser/");
}
Symbol 82 MovieClip Frame 7
stop();
Symbol 83 Button
on (release, keyPress "<Enter>") {
args = new Array();
args[0] = "chat";
args[1] = _parent.myColor;
args[2] = message;
if (message != "") {
_root.sendMovePublic(args);
message = "";
}
}
Symbol 89 Button
on (release) {
_root.join_room("Lobby");
_root.skin.gotoAndStop("chatter");
unloadMovie (this._parent._parent);
}
Symbol 99 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 5
gotoAndStop (1);
Symbol 99 MovieClip Frame 14
gotoAndStop (1);
Symbol 99 MovieClip Frame 20
gotoAndStop (1);
Symbol 99 MovieClip Frame 30
gotoAndStop (1);
Symbol 99 MovieClip Frame 45
gotoAndStop (1);
Symbol 107 MovieClip Frame 1
stop();
Symbol 107 MovieClip Frame 2
stop();
_parent.okToplay = true;
Symbol 107 MovieClip Frame 3
stop();
Symbol 113 Button
on (release) {
if (_currentframe == 1) {
stopAllSounds();
gotoAndStop (2);
} else {
gotoAndPlay (3);
}
}
Symbol 117 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 2
stop();
Symbol 117 MovieClip Frame 3
gotoAndStop (1);
Symbol 122 Button
on (release) {
_root.gotoAndStop("splash");
}
Symbol 127 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 85
gotoAndStop (1);
Symbol 129 MovieClip Frame 1
stop();
Symbol 129 MovieClip Frame 85
gotoAndStop (1);
Symbol 165 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 227 MovieClip Frame 1
stop();
Symbol 260 MovieClip Frame 1
stop();
Symbol 293 MovieClip Frame 1
stop();
Symbol 294 MovieClip Frame 1
stop();
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
Instance of Symbol 227 MovieClip "head" in Symbol 294 MovieClip Frame 1
onClipEvent (load) {
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
}
Symbol 294 MovieClip Frame 2
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
Instance of Symbol 294 MovieClip "player" in Symbol 297 MovieClip Frame 1
onClipEvent (enterFrame) {
head.play();
body.play();
club.play();
}
Symbol 299 MovieClip Frame 1
stop();
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
Instance of Symbol 227 MovieClip "head" in Symbol 299 MovieClip Frame 1
onClipEvent (load) {
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
}
Symbol 299 MovieClip Frame 2
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
Instance of Symbol 299 MovieClip "player" in Symbol 306 MovieClip Frame 1
onClipEvent (enterFrame) {
frame = 18;
head.gotoAndStop(frame);
body.gotoandstop(frame);
club.gotoAndStop(frame);
}
Symbol 313 MovieClip Frame 1
stop();
Instance of Symbol 299 MovieClip "player" in Symbol 316 MovieClip Frame 1
onClipEvent (enterFrame) {
frame = 18;
head.gotoAndStop(frame);
body.gotoandstop(frame);
club.gotoAndStop(frame);
}
Symbol 317 MovieClip Frame 330
_parent.gotoAndStop("refresh");
Symbol 347 MovieClip Frame 1
stop();
Symbol 348 MovieClip Frame 1
stop();
Symbol 444 MovieClip Frame 1
stop();
Symbol 445 MovieClip Frame 1
stop();
Symbol 448 Button
on (release) {
_parent._parent.gotoAndStop("splash");
}
Symbol 457 MovieClip Frame 1
stop();
Symbol 463 Button
on (release) {
_parent.multiPlayAgain();
}
Symbol 464 MovieClip Frame 1
function setPar() {
var i = -1;
s1 = 0;
while ((++i) < _parent.par.length) {
this["p" + (i + 1)] = _parent.par[i];
s1 = s1 + 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) + "fs"] = this[("c" + i) + "fs"] + this[(("c" + i) + "s") + (n + 1)];
this[(("c" + i) + "st") + (n + 1)] = _parent.strokesSaved[i - 1][n];
this[("c" + i) + "fst"] = this[("c" + i) + "fst"] + 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 = "";
}
clearFields();
setPar();
setScores();
this.gotoAndStop(_parent.version);
Symbol 464 MovieClip Frame 5
if (gameOver == "yes") {
play();
} else {
stop();
}
if (_parent.numPlayers == 1) {
head2._visible = 0;
place1._visible = 0;
place2._visible = 0;
}
if (c1fs < c2fs) {
place1.gotoAndStop(1);
place2.gotoAndStop(2);
} else if (csfs < c1fs) {
place1.gotoAndStop(2);
place2.gotoAndStop(1);
} else {
place1.gotoAndStop(5);
place2.gotoAndStop(5);
}
Instance of Symbol 347 MovieClip "head1" in Symbol 464 MovieClip Frame 5
onClipEvent (load) {
this.gotoAndStop(1);
}
Instance of Symbol 348 MovieClip "head2" in Symbol 464 MovieClip Frame 5
onClipEvent (load) {
this.gotoAndStop(2);
}
Instance of Symbol 445 MovieClip in Symbol 464 MovieClip Frame 5
onClipEvent (load) {
this.gotoandstop(5);
}
Instance of Symbol 445 MovieClip in Symbol 464 MovieClip Frame 5
onClipEvent (load) {
this.gotoandstop(5);
}
Symbol 464 MovieClip Frame 6
stop();
Symbol 464 MovieClip Frame 20
stop();
Symbol 464 MovieClip Frame 21
theHole = "Hole " + _parent.holeNumber;
tie = "";
if (c2fs < c1fs) {
end1 = "stats2";
end2 = "stats1";
} else if (c1fs < c2fs) {
end1 = "stats1";
end2 = "stats2";
} else if (c1fs == c2fs) {
end1 = "stats1";
end2 = "stats2";
tie = "yes";
}
if (tie != "yes") {
topText = "First Place.";
bottomText = "Second Place.";
} else {
topText = "Players are tied";
bottomText = "";
}
if (tie != "yes") {
if (end1 == "stats1") {
place1.gotoAndStop(1);
place2.gotoAndStop(2);
} else {
place2.gotoAndStop(1);
place1.gotoAndStop(2);
}
} else {
place2.gotoAndStop(4);
place1.gotoAndStop(3);
}
end1 = "stats1";
end2 = "stats2";
this[end1].score = c1fs;
this[end1].head.gotoAndStop(1);
this[end2].score = c2fs;
this[end1].name = c1;
this[end2].head.gotoAndStop(2);
this[end2].name = c2;
if (gameOver != "yes") {
play();
} else {
prevFrame();
}
Symbol 464 MovieClip Frame 85
_parent.gotoAndStop("main");
Symbol 465 MovieClip Frame 1
function setPar() {
var i = -1;
s1 = 0;
while ((++i) < _parent.par.length) {
this["p" + (i + 1)] = _parent.par[i];
s1 = s1 + 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) + "fs"] = this[("c" + i) + "fs"] + this[(("c" + i) + "s") + (n + 1)];
this[(("c" + i) + "st") + (n + 1)] = _parent.strokesSaved[i - 1][n];
this[("c" + i) + "fst"] = this[("c" + i) + "fst"] + 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 = "";
}
clearFields();
setPar();
setScores();
this.gotoAndStop(_parent.version);
Symbol 465 MovieClip Frame 5
if (gameOver == "yes") {
play();
} else {
stop();
}
if (_parent.numPlayers == 1) {
head2._visible = 0;
place1._visible = 0;
place2._visible = 0;
}
if (c1fs < c2fs) {
place1.gotoAndStop(1);
place2.gotoAndStop(2);
} else if (csfs < c1fs) {
place1.gotoAndStop(2);
place2.gotoAndStop(1);
} else {
place1.gotoAndStop(5);
place2.gotoAndStop(5);
}
Instance of Symbol 347 MovieClip "head1" in Symbol 465 MovieClip Frame 5
onClipEvent (load) {
this.gotoAndStop(1);
}
Instance of Symbol 348 MovieClip "head2" in Symbol 465 MovieClip Frame 5
onClipEvent (load) {
this.gotoAndStop(2);
}
Instance of Symbol 445 MovieClip in Symbol 465 MovieClip Frame 5
onClipEvent (load) {
this.gotoandstop(5);
}
Instance of Symbol 445 MovieClip in Symbol 465 MovieClip Frame 5
onClipEvent (load) {
this.gotoandstop(5);
}
Symbol 465 MovieClip Frame 6
stop();
Symbol 465 MovieClip Frame 20
stop();
Symbol 465 MovieClip Frame 21
theHole = "Hole " + _parent.holeNumber;
tie = "";
if (c2fs < c1fs) {
end1 = "stats2";
end2 = "stats1";
} else if (c1fs < c2fs) {
end1 = "stats1";
end2 = "stats2";
} else if (c1fs == c2fs) {
end1 = "stats1";
end2 = "stats2";
tie = "yes";
}
if (tie != "yes") {
topText = "First Place.";
bottomText = "Second Place.";
} else {
topText = "Players are tied";
bottomText = "";
}
if (tie != "yes") {
if (end1 == "stats1") {
place1.gotoAndStop(1);
place2.gotoAndStop(2);
} else {
place2.gotoAndStop(1);
place1.gotoAndStop(2);
}
} else {
place2.gotoAndStop(4);
place1.gotoAndStop(3);
}
end1 = "stats1";
end2 = "stats2";
this[end1].score = c1fs;
this[end1].head.gotoAndStop(1);
this[end2].score = c2fs;
this[end1].name = c1;
this[end2].head.gotoAndStop(2);
this[end2].name = c2;
if (gameOver != "yes") {
play();
} else {
prevFrame();
}
Symbol 465 MovieClip Frame 85
_parent.gotoAndStop("main");
Symbol 474 MovieClip Frame 1
stop();
Symbol 474 MovieClip Frame 5
stop();
Symbol 476 MovieClip Frame 1
controllerPath = _parent._parent._parent;
Symbol 476 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 476 MovieClip Frame 3
gotoAndPlay (2);
Symbol 476 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 484 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 490 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 490 MovieClip Frame 2
_parent.dummyHole1.gotoAndPlay(2);
Symbol 492 MovieClip Frame 1
if (_name != "shadow") {
num = _name.substr(6);
_x = _parent["ball" + num]._x;
_y = _parent["ball" + num]._y;
}
Symbol 499 MovieClip Frame 1
stop();
Symbol 499 MovieClip Frame 10
stop();
Symbol 499 MovieClip Frame 20
stop();
Instance of Symbol 499 MovieClip "sploosh" in Symbol 500 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(100);
}
Symbol 501 MovieClip Frame 1
controllerPath = _parent._parent._parent;
Symbol 501 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 501 MovieClip Frame 3
gotoAndPlay (2);
Instance of Symbol 506 MovieClip in Symbol 508 MovieClip Frame 1
onClipEvent (load) {
_alpha = 60;
}
Instance of Symbol 507 MovieClip "bar" in Symbol 508 MovieClip Frame 1
onClipEvent (load) {
_alpha = 60;
}
Symbol 509 MovieClip Frame 1
stop();
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
Instance of Symbol 227 MovieClip "head" in Symbol 509 MovieClip Frame 1
onClipEvent (load) {
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
}
Symbol 509 MovieClip Frame 2
head.gotoAndStop(18);
club.gotoAndStop(18);
body.gotoAndStop(18);
Symbol 510 MovieClip Frame 1
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;
player.head.gotoAndStop(step);
player.body.gotoAndStop(step);
player.club.gotoAndStop(step);
player.club.club.gotoAndStop(swingStep);
player.body.body.gotoAndStop(swingStep);
getStrength();
}
function mouseMoveFxn() {
ballName = controllerPath.controller.currentBallName;
follow();
setStrengthBar();
}
function setStrengthBar() {
bar.bar._xScale = 100 * factor;
}
function mouseDownFxn() {
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.1;
factor = (dis - minDis) / maxDis;
if (factor < minFac) {
factor = minFac;
}
if (1 < factor) {
factor = 1;
}
setClubFrame(factor);
}
stop();
_x = _parent.ball0._x;
_y = _parent.ball0._y;
this.swapDepths(11000);
player.head.stop();
player.body.stop();
player.club.stop();
makeInvis = false;
if (makeInvis) {
player._visible = 0;
}
frames = 32;
degreeStep = 360 / frames;
controllerPath = _parent._parent._parent;
ballName = controllerPath.controller.currentBallName;
sinY = controllerPath.controller.sinY;
sinX = controllerPath.controller.sinX;
cosX = controllerPath.controller.cosX;
cosY = controllerPath.controller.cosY;
Instance of Symbol 509 MovieClip "player" in Symbol 510 MovieClip Frame 1
onClipEvent (enterFrame) {
if (key.isDown(key.SHIFT)) {
_visible = 0;
} else {
_visible = 1;
}
}
Symbol 516 MovieClip Frame 1
stop();
Symbol 516 MovieClip Frame 2
currentBallName = _parent._parent._parent.controller.currentBallName;
_x = _parent[currentBallName]._x;
_y = _parent[currentBallName]._y;
Symbol 521 MovieClip Frame 1
stop();
Instance of Symbol 471 MovieClip in Symbol 523 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 484 MovieClip in Symbol 523 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 510 MovieClip "line" in Symbol 523 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 526 MovieClip in Symbol 528 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 510 MovieClip "line" in Symbol 528 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 527 MovieClip "pad" in Symbol 528 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 533 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 535 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 531 MovieClip in Symbol 536 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 510 MovieClip "line" in Symbol 536 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 527 MovieClip "pad" in Symbol 536 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 542 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 549 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 551 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 553 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 555 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 540 MovieClip in Symbol 556 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 510 MovieClip "line" in Symbol 556 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 544 MovieClip in Symbol 556 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(9999);
}
Instance of Symbol 546 MovieClip in Symbol 556 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(500);
}
Instance of Symbol 547 MovieClip in Symbol 556 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(501);
}
Symbol 560 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 560 MovieClip Frame 2
_parent.dummyHole1.gotoAndPlay(2);
Symbol 562 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 564 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 569 MovieClip Frame 1
lb._visible = 0;
tb._visible = 0;
rb._visible = 0;
bb._visible = 0;
Instance of Symbol 510 MovieClip "line" in Symbol 569 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 559 MovieClip in Symbol 569 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 560 MovieClip "hole" in Symbol 569 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Instance of Symbol 527 MovieClip "pad" in Symbol 569 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 573 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 574 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 575 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 510 MovieClip "line" in Symbol 576 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 572 MovieClip in Symbol 576 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 560 MovieClip "hole" in Symbol 576 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 586 MovieClip Frame 1
controllerPath = _parent._parent._parent;
Symbol 586 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)) {
controllerPath.controller.xMov[controllerPath.controller.ballNumber] = controllerPath.controller.xMov[controllerPath.controller.ballNumber] + 0.5;
}
Symbol 586 MovieClip Frame 3
gotoAndPlay (2);
Symbol 587 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 589 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 590 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 591 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 510 MovieClip "line" in Symbol 592 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 580 MovieClip in Symbol 592 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Symbol 597 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 510 MovieClip "line" in Symbol 598 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 595 MovieClip in Symbol 598 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 527 MovieClip "pad" in Symbol 598 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 603 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 603 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 603 MovieClip Frame 3
gotoAndPlay (2);
Symbol 605 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 606 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 510 MovieClip "line" in Symbol 607 MovieClip Frame 1
onClipEvent (mouseMove) {
mouseMoveFxn();
}
onClipEvent (mouseDown) {
mouseDownFxn();
}
Instance of Symbol 602 MovieClip in Symbol 607 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000);
}
Instance of Symbol 527 MovieClip "pad" in Symbol 607 MovieClip Frame 1
onClipEvent (load) {
_visible = 0;
}
Symbol 608 MovieClip Frame 1
stop();
courseShift = 100;
shift = 60;
k = 0.3;
xGive = 30;
yGive = xgive;
Instance of Symbol 523 MovieClip "course" in Symbol 608 MovieClip Frame 5
onClipEvent (enterFrame) {
name = _parent._parent.controller.currentBallName;
point = new Object();
point.x = this[name]._x;
point.y = this[name]._y;
localToGlobal(point);
y = point.y;
if (point.x < shift) {
endX = startX + xGive;
} else if ((700 - shift) < point.x) {
endX = startX - xGive;
}
if (point.y < shift) {
endY = startY + yGive;
} else if ((400 - shift) < point.y) {
endY = startY - yGive;
}
yMov = (endY - _y) * k;
xMov = (endX - _x) * k;
_x = (_x + xMov);
_y = (_y + yMov);
}
onClipEvent (load) {
shift = _parent.courseShift;
xGive = _parent.xGive;
yGive = _parent.yGive;
k = _parent.k;
startY = _y;
startX = _x;
endX = _x;
endY = _y;
}
Instance of Symbol 528 MovieClip "course" in Symbol 608 MovieClip Frame 10
onClipEvent (enterFrame) {
name = _parent._parent.controller.currentBallName;
point = new Object();
point.x = this[name]._x;
point.y = this[name]._y;
localToGlobal(point);
y = point.y;
if (point.x < shift) {
endX = endX + xGive;
} else if ((700 - shift) < point.x) {
endX = endX - xGive;
}
if (point.y < shift) {
endY = startY + yGive;
} else if ((400 - shift) < point.y) {
endY = startY - yGive;
}
yMov = (endY - _y) * k;
xMov = (endX - _x) * k;
_x = (_x + xMov);
_y = (_y + yMov);
}
onClipEvent (load) {
shift = _parent.courseShift;
xGive = _parent.xGive;
yGive = _parent.yGive;
k = _parent.k;
startY = _y;
endX = _x;
endY = _y;
}
Instance of Symbol 536 MovieClip "course" in Symbol 608 MovieClip Frame 16
onClipEvent (enterFrame) {
name = _parent._parent.controller.currentBallName;
point = new Object();
point.x = this[name]._x;
point.y = this[name]._y;
localToGlobal(point);
y = point.y;
if (point.x < shift) {
endX = startX + xGive;
} else if ((700 - shift) < point.x) {
endX = startX - xGive;
}
if (point.y < shift) {
endY = startY + yGive;
} else if ((400 - shift) < point.y) {
endY = startY - yGive;
}
yMov = (endY - _y) * k;
xMov = (endX - _x) * k;
_x = (_x + xMov);
_y = (_y + yMov);
}
onClipEvent (load) {
shift = _parent.courseShift;
xGive = _parent.xGive;
yGive = _parent.yGive;
k = _parent.k;
startY = _y;
startX = _x;
endX = _x;
endY = _y;
}
Instance of Symbol 569 MovieClip "course" in Symbol 608 MovieClip Frame 26
onClipEvent (enterFrame) {
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 = this[ballName]._x;
if (point.y < shift) {
endY = startY + yGive;
} else if ((400 - shift) < point.y) {
endY = startY - yGive;
}
yMov = (endY - _y) * k;
_y = (_y + yMov);
if (0 < x) {
endX = -370;
} else if (x < -10) {
endX = homeX;
}
xMov = (endX - _x) * k;
_x = (_x + xMov);
}
onClipEvent (load) {
homeX = _x;
k = 0.3;
endX = homeX;
shift = _parent.courseShift;
xGive = _parent.xGive;
yGive = _parent.yGive;
k = _parent.k;
startY = _y;
endY = _y;
endX = _x;
}
Instance of Symbol 576 MovieClip "course" in Symbol 608 MovieClip Frame 31
onClipEvent (enterFrame) {
ballName = "ball" + _parent._parent.controller.ballNumber;
x = this[ballName]._x;
if ((-15 < x) && (x < 330)) {
endX = -370;
} else if (350 < x) {
endX = -670;
} else if (x < -30) {
endX = homeX;
}
xMov = (endX - _x) * k;
_x = (_x + xMov);
}
onClipEvent (load) {
homeX = _x;
k = 0.3;
endX = homeX;
}
Instance of Symbol 592 MovieClip "course" in Symbol 608 MovieClip Frame 36
onClipEvent (enterFrame) {
name = _parent._parent.controller.currentBallName;
point = new Object();
point.x = this[name]._x;
point.y = this[name]._y;
localToGlobal(point);
if (point.y < shift) {
endY = startY + yGive;
} else if ((400 - shift) < point.y) {
endY = startY - yGive;
}
yMov = (endY - _y) * k;
_y = (_y + yMov);
ballName = "ball" + _parent._parent.controller.ballNumber;
x = this[ballName]._x;
if (0 < x) {
endX = -370;
} else if (x < -10) {
endX = homeX;
}
xMov = (endX - _x) * k;
_x = (_x + xMov);
}
onClipEvent (load) {
homeX = _x;
k = 0.3;
endX = homeX;
shift = _parent.courseShift;
xGive = _parent.xGive;
yGive = _parent.yGive;
k = _parent.k;
startY = _y;
endY = _y;
}
Instance of Symbol 598 MovieClip "course" in Symbol 608 MovieClip Frame 41
onClipEvent (enterFrame) {
name = _parent._parent.controller.currentBallName;
point = new Object();
point.x = this[name]._x;
point.y = this[name]._y;
localToGlobal(point);
y = point.y;
if (point.x < shift) {
endX = startX + xGive;
} else if ((700 - shift) < point.x) {
endX = startX - xGive;
}
if (point.y < shift) {
endY = startY + yGive;
} else if ((400 - shift) < point.y) {
endY = startY - yGive;
}
yMov = (endY - _y) * k;
xMov = (endX - _x) * k;
_x = (_x + xMov);
_y = (_y + yMov);
}
onClipEvent (load) {
shift = _parent.courseShift;
xGive = _parent.xGive;
yGive = _parent.yGive;
k = _parent.k;
startY = _y;
startX = _x;
endX = _x;
endY = _y;
}
Instance of Symbol 607 MovieClip "course" in Symbol 608 MovieClip Frame 46
onClipEvent (enterFrame) {
name = _parent._parent.controller.currentBallName;
point = new Object();
point.x = this[name]._x;
point.y = this[name]._y;
localToGlobal(point);
if (point.y < shift) {
endY = startY + yGive;
} else if ((400 - shift) < point.y) {
endY = startY - yGive;
}
yMov = (endY - _y) * k;
_y = (_y + yMov);
ballName = "ball" + _parent._parent.controller.ballNumber;
x = this[ballName]._x;
if (0 < x) {
endX = homeX;
} else if (x < -10) {
endX = 370;
}
xMov = (endX - _x) * k;
_x = (_x + xMov);
}
onClipEvent (load) {
homeX = _x;
k = 0.3;
endX = homeX;
shift = _parent.courseShift;
xGive = _parent.xGive;
yGive = _parent.yGive;
startY = _y;
k = _parent.k;
endY = _y;
}
Symbol 613 MovieClip Frame 1
stop();
Symbol 613 MovieClip Frame 2
play();
Symbol 613 MovieClip Frame 35
gotoAndStop (1);
Symbol 617 MovieClip Frame 1
function passInfo(args) {
controller.manualShoot(args);
if (args[0] == "restart") {
this.gotoAndPlay(1);
} else if (args[0] == "chat") {
if (args[1] == "w") {
bub1.message = args[2];
bub1.gotoAndPlay(2);
} else if (args[1] == "b") {
bub2.message = args[2];
bub2.gotoAndPlay(2);
}
}
}
function multiPlayAgain() {
this.gotoAndPlay(1);
args = new Array();
args[0] = "restart";
_root.sendMove(args);
}
function changePlayer(name) {
if (1 < numPlayers) {
playerText = names[name] + "'s Turn.";
}
}
holeNumber = 0;
version = _parent.version;
totalHoles = 9;
maxStrokes = 7;
par = new Array();
strokes = new Array(0, 0, 0, 0, 0, 0, 0);
strokesSaved = new Array(new Array(), new Array());
par = [2, 2, 2, 2, 3, 3, 3, 3, 3];
numPlayers = _parent.numPlayers;
char1 = 1;
char2 = 2;
if (version == "mplayer") {
numPlayers = 2;
myColor = _root.letter;
if ((myColor == "w") || (myColor == "white")) {
myColor = "w";
myTurn = true;
_parent.player1 = _root.userName;
_parent.player2 = _root.opponent;
} else {
myColor = "b";
myTurn = false;
_parent.player2 = _root.userName;
_parent.player1 = _root.opponent;
}
refreshClip._visible = 0;
} else {
chat._visible = 0;
status._visible = 0;
}
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 (3);
} else {
gotoAndStop (11);
}
} else {
stop();
}
Instance of Symbol 92 MovieClip "chat" in Symbol 617 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.version == "mplayer") {
if (selection.getFocus().substr(selection.getFocus().length - 7) != "message") {
selection.setFocus("message");
}
}
}
Instance of Symbol 107 MovieClip "status" in Symbol 617 MovieClip Frame 1
onClipEvent (enterFrame) {
delay++;
if ((_parent.version == "mplayer") && (3 < delay)) {
if (_root.myRoom == _root.gameRoom) {
if ((Number(_root.userTotal) == 2) && (Number(_currentframe) == 1)) {
_parent.wereHere = "yes";
_parent.gotoAndStop("intro");
this.gotoAndStop(2);
} else if ((Number(_root.userTotal) < 2) && (_currentframe == 2)) {
this.gotoAndStop(3);
}
}
}
}
onClipEvent (load) {
delay = 0;
}
Instance of Symbol 123 MovieClip in Symbol 617 MovieClip Frame 1
onClipEvent (load) {
if (_parent.version == "mplayer") {
_visible = 0;
}
}
Instance of Symbol 127 MovieClip "bub1" in Symbol 617 MovieClip Frame 1
onClipEvent (load) {
endX = _x;
endY = _y;
}
onClipEvent (enterFrame) {
_x = endX;
_y = endY;
}
Instance of Symbol 129 MovieClip "bub2" in Symbol 617 MovieClip Frame 1
onClipEvent (enterFrame) {
endX = _x;
endY = _y;
_x = endX;
_y = endY;
}
Symbol 617 MovieClip Frame 3
stop();
Symbol 617 MovieClip Frame 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!";
}
Instance of Symbol 464 MovieClip "scoreCard" in Symbol 617 MovieClip Frame 19
onClipEvent (mouseDown) {
if (_parent.version == "standalone") {
_parent.gotoAndStop("main");
}
}
Instance of Symbol 465 MovieClip "scoreCard" in Symbol 617 MovieClip Frame 25
onClipEvent (load) {
gameOver = "yes";
}
Symbol 617 MovieClip Frame 35
function setStrokeText(num) {
strokes[num]++;
strokeText = "Number of strokes: " + strokes[num];
}
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";
stop();
Instance of Symbol 468 MovieClip "controller" in Symbol 617 MovieClip Frame 35
onClipEvent (load) {
function shotMessage(msgType, numStrokes) {
if (msgType == "shotlimit") {
shotMsg = "Stroke Limit Reached.";
}
if (msgType == "ballin") {
if (numStrokes == 1) {
shotMsg = "Hole in one!";
} else if (((par - numStrokes) == 2) && (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) {
shotMsg = "Finally, the ball is in.";
}
}
_parent.shotMessage.message = shotMsg;
_parent.shotMessage.gotoAndPlay(2);
}
function manualShoot(args) {
if ((args[0] == "shot") && (args[9] != _root.username)) {
xPos[0] = Number(args[3]);
yPos[0] = Number(args[4]);
zPos[0] = Number(args[5]);
xPos[1] = Number(args[6]);
yPos[1] = Number(args[7]);
zPos[1] = Number(args[8]);
shoot(Number(args[1]), Number(args[2]), "manual");
} else if (args[0] == "restart") {
_parent.gotoAndPlay(1);
}
}
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;
_root.sendMove(args);
}
function changeTurns() {
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;
}
}
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["char" + (charNum + 1)] + 1);
currentBallName = tempName;
}
}
function shoot(rot, factor, shotType) {
if (((shotType == "manual") && (ballNumber != myBallNumber)) || (shotType != "manual")) {
_parent.setStrokeText(ballNumber);
maxSpeed = 14;
var speed = (factor * maxSpeed);
xMov[ballNumber] = speed * math.cos(rot);
zMov[ballNumber] = speed * math.sin(rot);
volume = 100 * factor;
_parent.sounds.smack = new Sound(_parent.sounds);
_parent.sounds.smack.attachSound("hit");
_parent.sounds.smack.setVolume(volume);
_parent.sounds.smack.start();
if ((_parent.version == "mplayer") && (ballNumber == myBallNumber)) {
sendShot(rot, factor);
}
}
}
function readyToShoot() {
gamePath.line._visible = 1;
gamePath.line.player.gotoAndStop(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["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);
}
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;
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;
}
}
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) && (onRamp != true)) && (onRamp1 != true)) && (onRamp2 != true)) && (onRamp3 != true)) && (onRamp4 != 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[n] * vx1p) + (mass[m] * vx2p);
V = vx1p - vx2p;
var v1f = ((P - (mass[m] * V)) / (mass[n] + 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)) {
angle = gamePath[bankName].angle;
if (triangleSlopeDetect(angle, left, right, top, bottom, tempX, tempZ)) {
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 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;
collision = "no";
if ((((left < (tempX + rad)) && ((tempX - rad) < right)) && (top < (tempZ + rad))) && ((tempZ - rad) < bottom)) {
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];
var z = zPos[ballNumber];
var x = xPos[ballNumber];
if ((z >= top) && (x >= left)) {
var region = 1;
} else if ((z >= top) && (right >= x)) {
var region = 2;
} else if ((bottom >= z) && (right >= x)) {
var region = 3;
} else if ((bottom >= z) && (x >= 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 = 10;
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) {
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 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])) {
_parent.sounds.bounce = new Sound(_parent.sounds);
_parent.sounds.bounce.attachSound("softBounce");
_parent.sounds.bounce.setVolume(volume);
_parent.sounds.bounce.start();
} 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 == "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 == "hole8") {
rl = leftWall;
rr = rightWall;
rt = -220;
rb = -160;
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 == "hole8") {
rl = leftWall;
rr = rightWall;
rt = -120;
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;
}
}
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 == "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 == "hole7") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((tempZ + rad) < -335) {
floor = topFloor;
} else if (-130 < (tempZ - rad)) {
floor = topFloor;
}
}
if (hole == "hole8") {
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 ((-160 < (tempZ - rad)) && ((tempZ + rad) < -120)) {
floor = topFloor;
} else if (-35 < (tempZ - rad)) {
floor = bottomFloor;
}
if (tempX < 100) {
floor = topFloor;
}
}
}
if (hole == "hole9") {
var tempZ = (zPos[ballNumber] + zMov[ballNumber]);
if ((tempZ + rad) < rt) {
floor = topFloor;
} else if (rb < (tempZ - rad)) {
floor = -bottomFloor;
}
}
}
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;
}
ballNumber = 0;
currentBallName = "ball0";
testMode = true;
if (testMode) {
_root.soundToggle = true;
}
if (_parent.version == "mplayer") {
myColor = _parent.myColor;
if (myColor == "w") {
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;
numBoxes = 0;
numBumpers = 0;
topFloor = 0;
startFloor = topFloor;
par = _parent.par[_parent.holeNumber - 1];
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 == 8) {
bottomFLoor = 40;
startFloor = bottomFloor;
} else if (_parent.holeNumber == 6) {
bottomFLoor = 40;
} else if (_parent.holeNumber == 7) {
bottomFLoor = 15;
} else if (_parent.holeNumber == 9) {
bottomFLoor = 170;
}
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) {
terrain = mainTerrain;
if (ballInPlay) {
terrain = mainTerrain;
ball2BoxDetection();
ball2BankDetection();
ball2BallHappened = false;
ball2ballcollisionDetection();
if (ball2BallHappened) {
ball2ballcollisionDetection();
}
rampDetection();
wallDetection();
sandTrap();
hitPuddle();
holeDetection();
update();
orderBall();
} else {
gamePath.line._visible = 0;
refreshDelay++;
if (48 < refreshDelay) {
_parent.gotoAndStop("refresh");
}
}
}