Frame 1
stopAllSounds();
ballPlop_sound = new Sound();
ballPlop_sound.attachSound("plop");
caveDrip_sound = new Sound();
caveDrip_sound.attachSound("drips");
birds_sound = new Sound();
birds_sound.attachSound("birds");
birds_sound.setVolume(500);
waterfall_sound = new Sound();
waterfall_sound.attachSound("waterfall");
bloop_sound = new Sound();
bloop_sound.attachSound("bloop");
splat_sound = new Sound();
splat_sound.attachSound("splat");
bees_sound = new Sound();
bees_sound.attachSound("bees");
birds_sound.start(0, 999);
Frame 1091
gotoAndPlay (1);
Frame 1092
stop();
Frame 1115
stop();
Frame 1137
_root.inHoleMessage = "";
_root.OOBMessage = "";
recordArray = new Array();
recordArray.push(new Array());
recordArray.push(new Array());
recordArray.push(new Array());
recordArray.push(new Array());
recordArray.push(new Array());
recordArray.push(new Array());
recordArray.push(new Array());
recordArray.push(new Array());
recordArray.push(new Array());
playArray = new Array();
playArray.push(new Array());
playArray.push(new Array());
playArray.push(new Array());
playArray.push(new Array());
playArray.push(new Array());
playArray.push(new Array());
playArray.push(new Array());
playArray.push(new Array());
playArray.push(new Array());
par1 = 3;
par2 = 3;
par3 = 4;
par4 = 3;
par5 = 4;
par6 = 3;
par7 = 4;
par8 = 4;
par9 = 3;
coursePar = 0;
i = 1;
while (9 >= i) {
coursePar = coursePar + eval ("par" + i);
i++;
}
score1 = " ";
score2 = " ";
score3 = " ";
score4 = " ";
score5 = " ";
score6 = " ";
score7 = " ";
score8 = " ";
score9 = " ";
pScore1 = " ";
pScore2 = " ";
pScore3 = " ";
pScore4 = " ";
pScore5 = " ";
pScore6 = " ";
pScore7 = " ";
pScore8 = " ";
pScore9 = " ";
diff1 = " ";
diff2 = " ";
diff3 = " ";
diff4 = " ";
diff5 = " ";
diff6 = " ";
diff7 = " ";
diff8 = " ";
diff9 = " ";
total = " ";
playArray[0][0] = 8.69999999999999;
playArray[0][1] = 40;
playArray[0][2] = 7.19999999999999;
playArray[0][3] = 119;
playArray[0][4] = 5.1;
playArray[0][5] = 30;
playArray[0][6] = 2.6;
playArray[0][7] = 47;
playArray[1][0] = 8.69999999999999;
playArray[1][1] = 40;
playArray[1][2] = 7.19999999999999;
playArray[1][3] = 119;
playArray[1][4] = 5.1;
playArray[1][5] = 30;
playArray[1][6] = 2.6;
playArray[1][7] = 47;
stop();
Frame 1138
stop();
Frame 1144
stop();
Frame 1152
stop();
Frame 1160
stop();
Frame 1175
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
messages.gotoAndStop(1);
Frame 1194
stop();
Frame 1195
gotoAndStop (1194);
Frame 1224
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("scores");
Frame 1331
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
messages.gotoAndStop(1);
Frame 1350
stop();
Frame 1351
gotoAndStop (1350);
Frame 1380
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("scores");
Frame 1487
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
messages.gotoAndStop(1);
Frame 1506
stop();
Frame 1507
gotoAndStop (1506);
Frame 1536
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("scores");
Frame 1643
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
messages.gotoAndStop(1);
_root.levelStartX = hole._x;
Frame 1662
stop();
Frame 1663
gotoAndStop (1662);
Frame 1692
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("scores");
Frame 1799
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
messages.gotoAndStop(1);
Frame 1818
stop();
Frame 1819
gotoAndStop (1818);
Frame 1848
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("scores");
Frame 1955
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
messages.gotoAndStop(1);
_root.levelStartX = hole._x;
Frame 1974
stop();
Frame 1975
gotoAndStop (1974);
Frame 2004
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("scores");
Frame 2111
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
messages.gotoAndStop(1);
Frame 2130
stop();
Frame 2131
gotoAndStop (2130);
Frame 2160
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("scores");
Frame 2267
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
messages.gotoAndStop(1);
Frame 2286
stop();
Frame 2287
gotoAndStop (2286);
Frame 2316
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("scores");
Frame 2423
currentRotation = 60;
currentPar = eval ("par" + holeNumber);
_root.inHoleMessage = "";
messages.gotoAndStop(1);
Frame 2442
stop();
Frame 2443
gotoAndStop (2442);
Frame 2472
Set("score" + holeNumber, strokeCount);
gotoAndPlay ("lastscores");
stopAllSounds();
Frame 2579
birds_sound = new Sound();
birds_sound.attachSound("birds");
birds_sound.start(0, 999);
i = 1;
total = 0;
while (holeNumber >= i) {
total = total + Number(eval ("score" + i));
i++;
}
i = holeNumber;
if (0 < eval ("diff" + i)) {
Set("diff" + i, "+" + eval ("diff" + i));
}
stop();
Frame 2581
stop();
if (holeNumber == 1) {
gotoAndPlay (1331);
} else if (holeNumber == 2) {
gotoAndPlay (1487);
} else if (holeNumber == 3) {
gotoAndPlay (1643);
} else if (holeNumber == 4) {
gotoAndPlay (1799);
} else if (holeNumber == 5) {
gotoAndPlay (1955);
} else if (holeNumber == 6) {
gotoAndPlay (2111);
} else if (holeNumber == 7) {
gotoAndPlay (2267);
} else if (holeNumber == 8) {
gotoAndPlay (2423);
}
birds_sound.stop();
Frame 2582
stop();
birds_sound = new Sound();
birds_sound.attachSound("birds");
birds_sound.start(0, 999);
i = 1;
total = 0;
while (holeNumber >= i) {
total = total + Number(eval ("score" + i));
i++;
}
finalDiff = total - coursePar;
i = holeNumber;
if (0 < eval ("diff" + i)) {
Set("diff" + i, "+" + eval ("diff" + i));
}
if (0 < finalDiff) {
finalDiff = "+" + finalDiff;
}
Frame 2591
stop();
Frame 2597
stop();
if (holeNumber == 1) {
gotoAndPlay (1331);
} else if (holeNumber == 2) {
gotoAndPlay (1487);
} else if (holeNumber == 3) {
gotoAndPlay (1643);
} else if (holeNumber == 4) {
gotoAndPlay (1799);
} else if (holeNumber == 5) {
gotoAndPlay (1955);
} else if (holeNumber == 6) {
gotoAndPlay (2111);
} else if (holeNumber == 7) {
gotoAndPlay (2267);
} else if (holeNumber == 8) {
gotoAndPlay (2423);
}
birds_sound.stop();
Frame 2598
i = 1;
total = 0;
while (holeNumber >= i) {
total = total + Number(eval ("score" + i));
i++;
}
finalDiff = total - coursePar;
stop();
i = holeNumber;
if (0 < eval ("diff" + i)) {
Set("diff" + i, "+" + eval ("diff" + i));
}
if (0 < finalDiff) {
finalDiff = "+" + finalDiff;
}
Frame 2600
stop();
if (holeNumber == 1) {
gotoAndPlay (1331);
} else if (holeNumber == 2) {
gotoAndPlay (1487);
} else if (holeNumber == 3) {
gotoAndPlay (1643);
} else if (holeNumber == 4) {
gotoAndPlay (1799);
} else if (holeNumber == 5) {
gotoAndPlay (1955);
} else if (holeNumber == 6) {
gotoAndPlay (2111);
} else if (holeNumber == 7) {
gotoAndPlay (2267);
} else if (holeNumber == 8) {
gotoAndPlay (2423);
}
Symbol 41 Button
on (release) {
gotoAndPlay (1137);
}
Symbol 44 Button
on (release) {
gotoAndPlay (1092);
}
Symbol 90 MovieClip Frame 1
stop();
Symbol 104 Button
on (release) {
gotoAndStop ("poohnoch");
}
Symbol 123 Button
on (release) {
gotoAndStop ("aim");
}
Symbol 124 Button
on (release) {
gotoAndStop (1137);
}
Symbol 132 Button
on (rollOver) {
gotoAndStop ("select1");
}
on (rollOut) {
gotoAndStop ("select0");
}
on (release) {
birds_sound.stop();
currentSpriteNumber = 1;
birds_sound.setVolume(100);
gotoAndPlay (1175);
}
Symbol 133 Button
on (rollOver) {
gotoAndStop ("select2");
}
on (rollOut) {
gotoAndStop ("select0");
}
on (release) {
birds_sound.stop();
currentSpriteNumber = 2;
birds_sound.setVolume(100);
gotoAndPlay (1175);
}
Symbol 134 Button
on (rollOver) {
gotoAndStop ("select3");
}
on (rollOut) {
gotoAndStop ("select0");
}
on (release) {
birds_sound.stop();
currentSpriteNumber = 3;
birds_sound.setVolume(100);
gotoAndPlay (1175);
}
Symbol 141 MovieClip Frame 72
stop();
Symbol 151 MovieClip Frame 82
gotoAndPlay (1);
Symbol 151 MovieClip Frame 83
eval ("_parent.ball" + _root.ballNumber)._visible = false;
Symbol 151 MovieClip Frame 158
gotoAndPlay (1);
eval ("_parent.ball" + _root.ballNumber)._visible = true;
Symbol 162 MovieClip Frame 1
this._name = "collision" + (Math.floor(_x) + 1000);
_parent.collisionArray.push(Math.floor(_x) + 1000);
Symbol 162 MovieClip Frame 2
stop();
Symbol 164 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 3
gotoAndStop (1);
Symbol 177 MovieClip Frame 1
stop();
Symbol 177 MovieClip Frame 2
with (right) {
play();
}
play();
Symbol 177 MovieClip Frame 35
with (_root) {
play();
}
_root.ballHit = 1;
Symbol 177 MovieClip Frame 45
stop();
Symbol 178 MovieClip Frame 1
stop();
Symbol 178 MovieClip Frame 2
with (right) {
play();
}
play();
Symbol 178 MovieClip Frame 35
_root.play();
_root.ballHit = 1;
Symbol 178 MovieClip Frame 45
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 179 MovieClip Frame 2
with (right) {
play();
}
play();
Symbol 179 MovieClip Frame 35
with (_root) {
play();
}
_root.ballHit = 1;
Symbol 179 MovieClip Frame 45
stop();
Symbol 180 MovieClip Frame 1
stop();
Symbol 180 MovieClip Frame 2
with (right) {
play();
}
play();
Symbol 180 MovieClip Frame 35
_root.play();
_root.ballHit = 1;
Symbol 180 MovieClip Frame 45
stop();
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 2
with (right) {
play();
}
play();
Symbol 190 MovieClip Frame 35
with (_root) {
play();
}
_root.ballHit = 1;
Symbol 190 MovieClip Frame 45
stop();
Symbol 191 MovieClip Frame 1
stop();
Symbol 191 MovieClip Frame 2
with (right) {
play();
}
play();
Symbol 191 MovieClip Frame 35
_root.play();
_root.ballHit = 1;
Symbol 191 MovieClip Frame 45
stop();
Symbol 200 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 204 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.birds_sound.start(0, 999);
_root.holeNumber = 1;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.puttFriction = 0.8;
_root.OOBnum = 3;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 15;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 204 MovieClip Frame 7
shotInit();
Symbol 204 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 204 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 204 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 204 MovieClip Frame 16
startShot();
Symbol 204 MovieClip Frame 17
makeShot();
Symbol 204 MovieClip Frame 18
gotoAndPlay (17);
Symbol 204 MovieClip Frame 20
endShot();
Symbol 204 MovieClip Frame 112
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 204 MovieClip Frame 156
_root.numberFinished++;
birds_sound.stop();
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole1Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 221 Button
on (rollOver) {
_root.zoomRollover = true;
}
on (rollOut) {
_root.zoomRollover = false;
}
on (release) {
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
}
Symbol 251 MovieClip Frame 1
stop();
Symbol 251 MovieClip Frame 2
stop();
Symbol 251 MovieClip Frame 3
stop();
Symbol 251 MovieClip Frame 4
stop();
Symbol 251 MovieClip Frame 5
stop();
Symbol 251 MovieClip Frame 6
stop();
Symbol 251 MovieClip Frame 7
stop();
Symbol 251 MovieClip Frame 8
stop();
Symbol 251 MovieClip Frame 9
stop();
Symbol 251 MovieClip Frame 10
stop();
Symbol 251 MovieClip Frame 11
stop();
Symbol 251 MovieClip Frame 12
stop();
Symbol 251 MovieClip Frame 13
stop();
Symbol 251 MovieClip Frame 14
stop();
Symbol 251 MovieClip Frame 15
stop();
Symbol 260 MovieClip Frame 24
stop();
Symbol 261 MovieClip Frame 52
stop();
Symbol 262 MovieClip Frame 1
stop();
Symbol 265 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 265 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.birds_sound.start(0, 999);
_root.holeNumber = 2;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.OOBnum = 5;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 13;
_root.OOBMessage4 = 13;
_root.OOBMessage5 = 13;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 265 MovieClip Frame 7
shotInit();
Symbol 265 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 265 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 265 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 265 MovieClip Frame 16
startShot();
Symbol 265 MovieClip Frame 17
makeShot();
Symbol 265 MovieClip Frame 18
gotoAndPlay (17);
Symbol 265 MovieClip Frame 20
endShot();
Symbol 265 MovieClip Frame 112
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 265 MovieClip Frame 156
_root.numberFinished++;
birds_sound.stop();
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole2Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 274 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 274 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.birds_sound.start(0, 999);
_root.holeNumber = 3;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.OOBnum = 3;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 15;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 274 MovieClip Frame 7
shotInit();
Symbol 274 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 274 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 274 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 274 MovieClip Frame 16
startShot();
Symbol 274 MovieClip Frame 17
makeShot();
Symbol 274 MovieClip Frame 18
gotoAndPlay (17);
Symbol 274 MovieClip Frame 20
endShot();
Symbol 274 MovieClip Frame 112
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 274 MovieClip Frame 156
_root.numberFinished++;
birds_sound.stop();
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole3Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 282 MovieClip Frame 1
_root.bumperCount++;
Symbol 282 MovieClip Frame 2
stop();
Symbol 285 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 285 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.birds_sound.start(0, 999);
_root.holeNumber = 4;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.OOBnum = 3;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 11;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 285 MovieClip Frame 7
shotInit();
Symbol 285 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 285 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 285 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 285 MovieClip Frame 16
startShot();
Symbol 285 MovieClip Frame 17
makeShot();
Symbol 285 MovieClip Frame 18
gotoAndPlay (17);
Symbol 285 MovieClip Frame 20
endShot();
Symbol 285 MovieClip Frame 112
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 285 MovieClip Frame 156
_root.numberFinished++;
birds_sound.stop();
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole4Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 297 MovieClip Frame 16
gotoAndPlay ("goagain");
Symbol 298 MovieClip Frame 1
stop();
Symbol 298 MovieClip Frame 75
gotoAndStop (1);
Symbol 304 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 304 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.caveDrip_sound.start(0, 999);
_root.holeNumber = 5;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.OOBnum = 3;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 11;
_root.OOBMessage4 = 14;
_root.OOBMessage5 = 14;
_root.OOBMessage6 = 14;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 304 MovieClip Frame 7
shotInit();
Symbol 304 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 304 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 304 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 304 MovieClip Frame 16
startShot();
Symbol 304 MovieClip Frame 17
makeShot();
Symbol 304 MovieClip Frame 18
gotoAndPlay (17);
Symbol 304 MovieClip Frame 20
endShot();
Symbol 304 MovieClip Frame 112
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 304 MovieClip Frame 156
_root.numberFinished++;
caveDrip_sound.stop();
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole5Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 313 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 313 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.birds_sound.start(0, 999);
_root.holeNumber = 6;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.OOBnum = 4;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 14;
_root.OOBMessage4 = 11;
_root.OOBMessage5 = 14;
_root.OOBMessage6 = 14;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 313 MovieClip Frame 7
shotInit();
Symbol 313 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 313 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 313 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 313 MovieClip Frame 16
startShot();
Symbol 313 MovieClip Frame 17
makeShot();
Symbol 313 MovieClip Frame 18
gotoAndPlay (17);
Symbol 313 MovieClip Frame 20
endShot();
Symbol 313 MovieClip Frame 170
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 313 MovieClip Frame 214
_root.numberFinished++;
birds_sound.stop();
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole6Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 315 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 2
bees_sound.start();
Symbol 315 MovieClip Frame 101
gotoAndStop (1);
Symbol 330 MovieClip Frame 65
stop();
Symbol 336 MovieClip Frame 24
stop();
Symbol 337 MovieClip Frame 55
stop();
Symbol 338 MovieClip Frame 1
stop();
Symbol 340 MovieClip Frame 55
stop();
Symbol 341 MovieClip Frame 1
stop();
Symbol 344 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 344 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.bloop_sound.start(0, 999);
_root.holeNumber = 7;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.OOBnum = 4;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 12;
_root.OOBMessage4 = 12;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 344 MovieClip Frame 7
shotInit();
Symbol 344 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 344 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 344 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 344 MovieClip Frame 16
startShot();
Symbol 344 MovieClip Frame 17
makeShot();
Symbol 344 MovieClip Frame 18
gotoAndPlay (17);
Symbol 344 MovieClip Frame 20
endShot();
Symbol 344 MovieClip Frame 112
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 344 MovieClip Frame 156
_root.numberFinished++;
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole7Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 353 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 353 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.birds_sound.start(0, 999);
_root.holeNumber = 8;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.OOBnum = 4;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 11;
_root.OOBMessage4 = 15;
_root.OOBMessage5 = 14;
_root.OOBMessage6 = 14;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 353 MovieClip Frame 7
shotInit();
Symbol 353 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 353 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 353 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 353 MovieClip Frame 16
startShot();
Symbol 353 MovieClip Frame 17
makeShot();
Symbol 353 MovieClip Frame 18
gotoAndPlay (17);
Symbol 353 MovieClip Frame 20
endShot();
Symbol 353 MovieClip Frame 112
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 353 MovieClip Frame 156
_root.numberFinished++;
birds_sound.stop();
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole8Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 373 MovieClip Frame 1
function shotInit() {
_root.messages.gotoAndStop(1);
_root.strokeCount++;
_root.speed = 0;
_root.bLength = 10;
_root.onGround = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.collision1y = 0;
_root.collision1x = 0;
_root.collision2y = 0;
_root.collision2x = 0;
_root.gradient = 0;
_root.ballG = 0;
_root.newBallG = 0;
_root.newAngle = 0;
_root.newAngleD = 0;
_root.GPos = 0;
_root.Still = 0;
_root.gradientD = 0;
_root.bounceNumber = 0;
_root.currentRotation = 60;
_root.stopLimit = 0.2;
_root.inHole = 0;
_root.previousBallX = 0;
_root.previousBallY = 0;
eval ("ball" + _root.ballNumber)._visible = true;
ballShadow._visible = true;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
_root.speedLimit = 10;
reticle._visible = false;
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
if (_root.playback) {
_root.ballNumber = 2;
} else {
_root.ballNumber = 1;
}
_root.still = 0;
_root.triggered = 0;
_root.released = 0;
_root.launch = 0;
_root.ballHit = 0;
if (this.puttingZone.hitTest(eval ("ball" + _root.ballNumber))) {
_root.putting = true;
} else {
_root.putting = false;
}
_root.currentBallX = eval ("ball" + _root.ballNumber)._x;
_root.currentBallY = eval ("ball" + _root.ballNumber)._y;
eval (("golfer" add _root.currentSpriteNumber) add "r").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "l").gotoAndStop(1);
eval (("golfer" add _root.currentSpriteNumber) add "r")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "l")._visible = false;
eval (("golfer" add _root.currentSpriteNumber) add "r")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "r")._y = _root.currentBallY;
eval (("golfer" add _root.currentSpriteNumber) add "l")._x = _root.currentBallX;
eval (("golfer" add _root.currentSpriteNumber) add "l")._y = _root.currentBallY;
reticle._x = _root.currentBallX;
reticle._y = _root.currentBallY;
z = 1;
while (_root.collisionNumber >= z) {
_root.floorX1 = eval (("collision" add z) add "._x");
_root.floorX2 = eval (("collision" add (z + 1)) add "._x");
_root.floorY1 = eval (("collision" add z) add "._y");
_root.floorY2 = eval (("collision" add (z + 1)) add "._y");
if ((_root.floorX1 < _root.currentBallX) and (_root.currentBallX < _root.floorX2)) {
_root.gradient = (_root.floorY2 - _root.floorY1) / (_root.floorX2 - _root.floorX1);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.rotationHigh = _root.gradientD;
_root.rotationLow = _root.gradientD + 180;
if (_root.rotationLow < 0) {
_root.rotationLow = _root.rotationLow + 360;
}
if (360 < _root.rotationLow) {
_root.rotationLow = _root.rotationLow - 360;
}
_root.rotationHigh = _root.rotationHigh - (_root.rotationHigh % 1);
_root.rotationLow = _root.rotationLow - (_root.rotationLow % 1);
}
z++;
}
}
function lookAhead() {
if (!_root.zoomed) {
if (-350 < _root.hole._x) {
_root.newLevelX = _root.newLevelX - 10;
}
if (-350 >= _root.newLevelX) {
_root.newLevelX = -350;
_root.zoomed = true;
_root.zoomCount = 0;
}
} else {
if ((_root.hole._x < _root.zoomStartX) and (_root.zoomLimit < (_root.zoomCount++))) {
_root.newLevelX = _root.newLevelX + 10;
}
if (_root.newLevelX >= _root.zoomStartX) {
_root.newLevelX = _root.zoomStartX;
_root.zoomed = false;
_root.lookingAhead = false;
}
}
_root.hole._x = _root.newLevelX;
}
function aimShot1() {
if ((90 < _root.currentRotation) and (_root.currentRotation < 270)) {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "l";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = true;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = false;
} else {
_root.currentSprite = ("golfer" + _root.currentSpriteNumber) + "r";
eval (("golfer" + _root.currentSpriteNumber) + "l")._visible = false;
eval (("golfer" + _root.currentSpriteNumber) + "r")._visible = true;
}
if (!_root.playback) {
reticle._visible = true;
}
if (((_root.triggered == 1) and (_root.released == 0)) and (_root.launch != 1)) {
if (_root.speed < _root.speedLimit) {
_root.speed = _root.speed + 0.1;
}
with (_root.powerMeter) {
z = _root.speed * 10;
z = z - (z % 1);
gotoAndStop(z);
}
} else if (((_root.triggered == 1) and (_root.released == 1)) and (_root.launch != 1)) {
_root.previousBallX = _root.currentX;
_root.previousBallY = _root.currentY;
_root.previousLevelX = _root.hole._x;
_root.previousLevelY = _root.hole._y;
if (!_root.playback) {
}
reticle._visible = false;
_root.launch = 1;
with (eval (_root.currentSprite)) {
play();
}
}
if (_root.ballHit) {
gotoAndPlay (15);
}
_root.currentX = eval ("ball" + _root.ballNumber)._x;
_root.currentY = eval ("ball" + _root.ballNumber)._y;
if (_root.currentRotation < 0) {
_root.currentRotation = _root.currentRotation + 360;
}
if (360 < _root.currentRotation) {
_root.currentRotation = _root.currentRotation - 360;
}
if (_root.currentRotation == 0) {
_root.currentRotation = 1;
}
if (_root.putting) {
if (90 < _root.currentRotation) {
_root.currentRotation = 175;
}
if (90 >= _root.currentRotation) {
_root.currentRotation = 5;
}
}
with (reticle) {
gotoAndStop(_root.currentRotation);
}
}
function aimShot2() {
if (!_root.playback) {
if (_root.triggered == 0) {
_root.newMouseX = _xmouse;
_root.newMouseY = _ymouse;
}
_root.mouseDiff = _root.newMouseX - _root.currentMouseX;
_root.gradient = (_root.currentY - _root.newMouseY) / (_root.currentX - _root.newMouseX);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if ((_root.currentX < _root.newMouseX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = -_root.gradientD;
} else if ((_root.currentX < _root.newMouseX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 360 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.newMouseY < _root.currentY)) {
_root.currentRotation = 180 - _root.gradientD;
} else if ((_root.newMouseX < _root.currentX) and (_root.currentY < _root.newMouseY)) {
_root.currentRotation = 180 - _root.gradientD;
}
_root.currentRotation = _root.currentRotation - (_root.currentRotation % 1);
if (_root.rotationHigh < 91) {
if ((_root.rotationHigh < _root.currentRotation) and (_root.currentRotation < _root.rotationLow)) {
} else if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
} else if ((_root.rotationLow < _root.currentRotation) and (_root.currentRotation < _root.rotationHigh)) {
if (_root.currentX < _root.newMouseX) {
_root.currentRotation = _root.rotationHigh;
} else if (_root.newMouseX < _root.currentX) {
_root.currentRotation = _root.rotationLow;
}
}
} else {
_root.triggered = 1;
_root.released = 1;
}
gotoAndPlay (9);
}
function startShot() {
if (!_root.playback) {
_root.recordArray[holeNumber - 1].push(_root.speed);
_root.recordArray[holeNumber - 1].push(_root.currentRotation);
}
_root.ballX = eval ("ball" + _root.ballNumber)._x;
_root.ballY = eval ("ball" + _root.ballNumber)._y;
cannonAngle = _root.currentRotation;
_root.ballR = _root.currentRotation;
if (_root.putting) {
if (90 < cannonAngle) {
_root.ballR = 175;
}
if (90 >= cannonAngle) {
_root.ballR = 5;
}
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = 360 - _root.ballR;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = _root.speed - _root.ySpeed;
}
}
function makeShot() {
if (_root.holeNumber == 5) {
if (250 < ball1._x) {
caveFront._y = 10000;
} else {
caveFront._y = 0;
}
}
if (_root.Still) {
gotoAndPlay (20);
} else {
_root.ballY = _root.ballY - _root.ySpeed;
_root.ballX = _root.ballX + _root.xSpeed;
eval ("ball" + _root.ballNumber)._y = _root.ballY;
eval ("ball" + _root.ballNumber)._x = _root.ballX;
ballShadow._y = _root.collisionFloor - 298;
ballShadow._x = _root.ballX;
if ((300 < ball1._x) and (ball1._x < 650)) {
_root.hole._x = -(ball1._x - 300);
}
if (_root.putting) {
if ((_root.collisionFloor - 300) < eval ("ball" + _root.ballNumber)._y) {
eval ("ball" + _root.ballNumber)._y = _root.collisionFloor - 300;
}
}
}
if (_root.bCount < _root.bLength) {
_root.bCount = _root.bCount + 1;
}
if (_root.bCount == _root.bLength) {
_root.bExit = 1;
}
c = 2;
p = 1;
_root.currentX = _root.ballX;
_root.currentY = _root.ballY;
while (Number(_root.collisionNumber) >= Number(c)) {
_root.testX = Number(_root.currentX) + 400;
_root.testY = Number(_root.currentY) + 300;
_root.collision1x = getProperty("collision" add p, _x) + 400;
_root.collision1y = getProperty("collision" add p, _y) + 300;
_root.collision2x = getProperty("collision" add c, _x) + 400;
_root.collision2y = getProperty("collision" add c, _y) + 300;
_root.collisionH = _root.collision2y - _root.collision1y;
if (Number(_root.collisionH) < 0) {
_root.collisionH = -_root.collisionH;
}
_root.collisionL = _root.collision2x - _root.collision1x;
if (Number(_root.testX) >= Number(_root.collision1x)) {
if (Number(_root.testX) < Number(_root.collision2x)) {
if (Number(_root.collision1y) == Number(_root.collision2y)) {
_root.collisionFloor = _root.collision1y;
}
if (Number(_root.collision1y) < Number(_root.collision2y)) {
_root.collisionFloor = Number(_root.collision1y) + Number(_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if (Number(_root.collision2y) < Number(_root.collision1y)) {
_root.collisionFloor = _root.collision1y - (_root.collisionH * ((_root.testX - _root.collision1x) / _root.collisionL));
}
if ((Number(_root.collisionFloor) < Number(_root.testY)) and (_root.onGround == 0)) {
_root.onGround = 1;
} else {
_root.onGround = 0;
}
_root.scrolledAmount = _root.levelStartX - _root.hole._x;
b = 1;
while (_root.bumperCount >= b) {
if (eval ("bumper" + b).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.bumperHit)) {
_root.onGround = 1;
_root.bumperHit = 1;
_root.bumperRotation = eval ("bumper" + b)._rotation;
break;
}
_root.bumperHit = 0;
b++;
}
if (_root.onGround == 1) {
if (!_root.putting) {
with (bounce) {
play();
}
}
_root.bounceNumber++;
_root.gradient = (_root.collision2y - _root.collision1y) / (_root.collision2x - _root.collision1x);
_root.gradientR = Math.atan(_root.gradient);
_root.gradientD = _root.gradientR / (Math.PI/180);
if (_root.collision1y == _root.collision2y) {
_root.gradientD = 0;
}
if (0 < _root.gradientD) {
_root.gradientD = 360 - _root.gradientD;
} else if (_root.gradientD < 0) {
_root.gradientD = -_root.gradientD;
}
_root.groundGradient = _root.gradientD;
_root.ballG = _root.ySpeed / _root.xSpeed;
_root.ballGR = Math.atan(_root.ballG);
_root.ballGD = _root.ballGR / (Math.PI/180);
if ((0 < _root.xSpeed) and (_root.ySpeed < 0)) {
_root.ballGD = 360 + _root.ballGD;
} else if ((0 < xSpeed) and (0 < ySpeed)) {
_root.ballGD = _root.ballGD;
} else if ((_root.xSpeed < 0) and (0 < _root.ySpeed)) {
_root.ballGD = 180 + _root.ballGD;
} else if ((_root.xSpeed < 0) and (_root.ySpeed < 0)) {
_root.ballGD = 180 + _root.ballGD;
}
if (_root.bumperHit) {
_root.gradientD = _root.bumperRotation * -1;
if (_root.gradientD < 0) {
_root.gradientD = 360 + _root.gradientD;
}
}
if ((270 < _root.ballGD) and (_root.ballGD < 360)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.gradientD - _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGD = _root.gradientD + 360;
_root.ballR = _root.gradientD + (_root.newGD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 180;
_root.ballR = _root.newGD - ((_root.ballGD - 180) - _root.gradientD);
}
} else if ((_root.ballGD >= 0) and (_root.ballGD < 90)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.ballR = _root.ballGD;
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.gradientD + (_root.gradientD - _root.ballGD);
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (180 + _root.ballGD));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.gradientD);
if (_root.ballR < 0) {
_root.ballR = 360 + _root.ballR;
}
}
} else if ((90 < _root.ballGD) and (_root.ballGD < 180)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.ballR = _root.ballGD;
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD + (_root.newGD - (_root.ballGD - 180));
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD + 90;
_root.ballR = _root.newGD - ((_root.ballGD + 180) - _root.newGD);
if (_root.ballR < 0) {
_root.ballR = 360 - _root.ballR;
}
if (360 < _root.ballR) {
_root.ballR = _root.ballR - 360;
}
}
} else if ((180 < _root.ballGD) and (_root.ballGD < 270)) {
if ((270 < _root.gradientD) and (_root.gradientD < 360)) {
_root.newBGD = _root.ballGD - 180;
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.newGD - (_root.newBGD + (360 - _root.gradientD));
if (_root.ballR < 0) {
_root.ballR = _root.ballR + 360;
}
} else if ((0 < _root.gradientD) and (_root.gradientD < 90)) {
_root.newGd = _root.gradientD + 180;
_root.ballR = _root.newGD - (_root.ballGD - _root.newGD);
} else if ((180 < _root.gradientD) and (_root.gradientD < 270)) {
_root.newGD = _root.gradientD - 180;
_root.ballR = _root.gradientD + (_root.newGD - (_root.ballGD - 180));
} else if ((90 < _root.gradientD) and (_root.gradientD < 180)) {
_root.ballR = _root.ballGD;
}
}
if (_root.putting) {
_root.speed = Number(_root.puttFriction) * _root.speed;
}
ballGD_shown = 0;
if (ballGD_shown) {
}
_root.underground = false;
if (_root.ballGD == _root.ballR) {
_root.underground = true;
}
if ((!_root.underground) and (!_root.putting)) {
_root.speed = Number(_root.friction) * _root.speed;
}
if ((0 < _root.ballR) and (90 >= _root.ballR)) {
_root.ySpeed = (_root.ballR / 90) * _root.speed;
_root.xSpeed = _root.speed - _root.ySpeed;
} else if ((90 < _root.ballR) and (180 >= _root.ballR)) {
_root.newBR = 180 - _root.ballR;
_root.ySpeed = (_root.newBR / 90) * _root.speed;
_root.xSpeed = -(_root.speed - _root.ySpeed);
} else if ((180 < _root.ballR) and (270 >= _root.ballR)) {
_root.newBR = _root.ballR - 180;
_root.ySpeed = -((_root.newBR / 90) * _root.speed);
_root.xSpeed = -(_root.speed + _root.ySpeed);
} else if ((270 < _root.ballR) and (360 >= _root.ballR)) {
_root.newBR = _root.ballR - 270;
_root.xSpeed = (_root.newBR / 90) * _root.speed;
_root.ySpeed = -(_root.speed - _root.xSpeed);
}
}
}
}
c = Number(c) + 1;
p = c - 1;
}
if (_root.stopLimit >= _root.speed) {
_root.still = 1;
}
if (eval ("ball" + _root.ballNumber).hitTest(hole)) {
_root.inHole = 1;
_root.still = 1;
eval ("ball" + _root.ballNumber)._visible = false;
ballShadow._visible = false;
}
i = 1;
while (_root.OOBnum >= i) {
if (eval ("OOB" + i).hitTest(ball1._x - _root.scrolledAmount, ball1._y, true) and (!_root.OOB)) {
var _local2 = 1;
switch (_root.holeNumber) {
case _local2 :
if (i == 3) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 2 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 5 :
if (i == 3) {
bat.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 6 :
if (i == 3) {
_root.bees.play();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 7 :
if (i >= 3) {
_root.ballPlop_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 8 :
if (i == 4) {
rabbit.gotoAndPlay("rabbitPlay");
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
case 9 :
if (i >= 3) {
_root.splat_sound.start();
}
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
break;
default :
_root.still = 1;
_root.OOB = 1;
_root.OOBMessage = eval ("_root.OOBMessage" + i);
_root.messages.gotoAndStop(_root.OOBMessage);
}
}
i++;
}
if (_root.onGround) {
} else {
_root.ySpeed = _root.ySpeed - _root.gravity;
}
}
function endShot() {
if (_root.inHole == 1) {
if (_root.playback) {
_root.endStrokeCount = _root.pStrokeCount;
} else {
_root.endStrokeCount = _root.strokeCount;
}
if (!_root.playback) {
Set("score" + _root.holeNumber, _root.endStrokeCount);
} else {
Set("pScore" + _root.holeNumber, _root.endStrokeCount);
}
_root.par = Number(eval ("_root.par" + _root.holeNumber));
_root.diff = _root.endStrokeCount - _root.par;
Set("_root.diff" + _root.holeNumber, _root.diff);
if (_root.endStrokeCount == _root.par) {
_root.inHoleMessage = "Par!";
_root.messages.gotoAndStop(5);
} else if (_root.endStrokeCount == (_root.par - 1)) {
_root.inHoleMessage = "Birdie!";
_root.messages.gotoAndStop(4);
} else if (_root.endStrokeCount == (_root.par - 2)) {
_root.inHoleMessage = "Eagle!";
_root.messages.gotoAndStop(3);
} else if (_root.endStrokeCount == (_root.par + 1)) {
_root.inHoleMessage = "Bogey!";
_root.messages.gotoAndStop(6);
} else if (_root.endStrokeCount == (_root.par + 2)) {
_root.inHoleMessage = "Double Bogey!";
_root.messages.gotoAndStop(7);
} else if (_root.endStrokeCount == (_root.par + 3)) {
_root.inHoleMessage = "Triple Bogey!";
_root.messages.gotoAndStop(8);
} else {
_root.inHoleMessage = "Keep trying!";
_root.messages.gotoAndStop(9);
}
if (_root.endStrokeCount == 1) {
_root.inHoleMessage = "Hole in one!";
_root.messages.gotoAndStop(2);
}
gotoAndPlay ("holeFinish");
} else if (_root.OOB) {
eval ("ball" + _root.ballNumber)._x = _root.previousBallX;
eval ("ball" + _root.ballNumber)._y = _root.previousBallY;
_root.OOB = 0;
ballShadow._x = _root.previousBallX;
ballShadow._y = _root.previousBallY;
gotoAndPlay (57);
} else {
gotoAndPlay (7);
}
}
_root.lookingAhead = 0;
_root.playerNumber = 1;
_root.speed = 0;
_root.xSpeed = 0;
_root.ySpeed = 0;
_root.putting = false;
_root.zoomLimit = 50;
collisionArray = new Array();
Symbol 373 MovieClip Frame 2
_root.collisionNumber = 0;
for (i in collisionArray) {
markerName_str = "collision" + String(collisionArray[i]);
eval (markerName_str)._name = "collision" + (Number(i) + 1);
_root.collisionNumber++;
}
_root.waterfall_sound.start(0, 9999);
_root.holeNumber = 9;
_root.gravity = 0.1;
_root.friction = 0.5;
_root.OOBnum = 4;
_root.OOBMessage1 = 14;
_root.OOBMessage2 = 14;
_root.OOBMessage3 = 10;
_root.OOBMessage4 = 10;
_root.strokeCount = 0;
_root.pStrokeCount = 0;
_root.numberFinished = 0;
if (_root.stopLimit >= _root.speed) {
if (_root.OOB != 1) {
if (_root.lookingAhead == false) {
_root.zoomStartX = _root.hole._x;
_root.newLevelX = _root.zoomStartX;
_root.lookingAhead = true;
}
}
}
Symbol 373 MovieClip Frame 7
shotInit();
Symbol 373 MovieClip Frame 9
if (_root.lookingAhead) {
lookAhead();
} else {
aimShot1();
}
Instance of Symbol 202 MovieClip in Symbol 373 MovieClip Frame 9
onClipEvent (mouseDown) {
if ((!_root.playback) and (!_root.zoomRollover)) {
_root.triggered = 1;
}
}
onClipEvent (mouseUp) {
if ((!_root.playback) and _root.triggered) {
_root.released = 1;
}
}
Symbol 373 MovieClip Frame 10
if (_root.lookingAhead) {
gotoAndPlay (9);
} else {
aimShot2();
}
Symbol 373 MovieClip Frame 16
startShot();
Symbol 373 MovieClip Frame 17
makeShot();
Symbol 373 MovieClip Frame 18
gotoAndPlay (17);
Symbol 373 MovieClip Frame 20
endShot();
Symbol 373 MovieClip Frame 112
_root.hole._x = _root.previousLevelX;
_root.hole._y = _root.previousLevelY;
gotoAndPlay (7);
Symbol 373 MovieClip Frame 156
_root.numberFinished++;
waterfall_sound.stop();
if (_root.numberFinished == _root.playerNumber) {
with (_parent) {
gotoAndPlay("hole9Done");
}
} else {
if (_root.playback) {
playback = 0;
} else {
playback = 0;
}
gotoAndPlay (7);
}
Symbol 422 Button
on (release) {
play();
}
Symbol 468 Button
on (release) {
gotoAndPlay (1);
stopAllSounds();
}
Symbol 471 Button
on (release) {
gotoAndStop ("ScoreTable");
}
Symbol 472 Button
on (release) {
gotoAndPlay (1);
}
Symbol 527 Button
on (release) {
play();
gotoAndPlay (1);
}