Frame 2
function fEaseInOutExpo(t, b, c, d) {
var _local2 = 1;
if (c < 0) {
_local2 = _local2 * -1;
c = c * -1;
}
if (t < (d / 2)) {
return((_local2 * Math.exp((Math.log(c / 2) / (d / 2)) * t)) + b);
}
return((_local2 * (((-Math.exp(((-2 * Math.log(c / 2)) / d) * (t - d))) + c) + 1)) + b);
}
_global.getAngle = function (t, c) {
return(Math.atan2(t.y - c.y, t.x - c.x));
};
_global.fVectToRadian = function (vect) {
return(Math.atan2(vect.y, vect.x));
};
_global.fRadianToVector = function (rad) {
return({x:Math.sin(rad), y:-Math.cos(rad)});
};
_global.fRadianToAngle = function (rad) {
return((rad * 180) / Math.PI);
};
_global.fAngleToRadian = function (ang) {
return((ang * Math.PI) / 180);
};
_global.fReAngle = function (ang) {
return(ang % 360);
};
_global.fGetDistance = function (a, b) {
return(Math.sqrt(((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y))));
};
function fGetObNum(max) {
pObsticleNum++;
if (pObsticleNum > max) {
pObsticleNum = 0;
}
return(pObsticleNum);
}
function fScore() {
panel.map.refreshMap();
board.playerDisp.gotoAndStop("score");
board.playerShadow._x = 10000;
board.playerDisp._x = _root.board.goalDisp._x;
board.playerDisp._y = _root.board.goalDisp._y - 16;
board.goalDisp.play();
flying = 0;
}
function fEndThrow() {
trace("land");
inSFX.fPlay("land");
board.playerDisp.gotoAndStop("off");
cnt.pLastHit = undefined;
}
function fHighscores() {
gotoAndPlay ("highscore");
}
function fBeginLevel() {
inDrag.fReset();
panel.inThrowType.inST2.fSelect(true);
inFade.gotoAndPlay(1);
board.playerDisp.gotoAndStop("off");
board.goalDisp.txHoleNum.text = _root.cnt.level;
board.goalDisp.gotoAndStop(1);
cnt.refreshMap();
board._x = (-1 * board.goalDisp._x) + 275;
board._y = (-1 * board.goalDisp._y) + 200;
pPauseCam = 90;
}
function fThrowMode(tThrowMode, tNum) {
trace((("fThrowMode: " + tThrowMode) + " : ") + tNum);
throwMode = tThrowMode;
pLastThrowType.fDeselect();
pLastThrowType = tNum;
panel.txThrowType.text = throwMode;
}
function fFire(tRot, tPower) {
pDrag = false;
trace((("fFire A: tdir = " + tRot) + ", power = ") + tPower);
_root.dir = (-tRot) + 180;
_root.dirRads = 0;
board.playerDisp.gotoAndStop("fly");
if (_root.throwMode == "Putt") {
_root.dz = 0.1;
_root.power = tPower * 0.015;
} else {
_root.power = tPower * 0.022;
}
_root.flying = 1;
_root.cnt.player.z = 5;
var _local3 = _global.fAngleToRadian(_root.dir);
_root.dy = Math.sin(_local3) * _root.power;
_root.dx = Math.cos(_local3) * _root.power;
_root.dz = 0.4;
_root.cnt.player.xOld = _root.cnt.player.x;
_root.cnt.player.yOld = _root.cnt.player.y;
fAddThrow();
trace((("fFire B: dir = " + _root.dir) + ", power = ") + _root.power);
}
function fHit(tRot, tPower) {
trace((("fHit A: tdir = " + tRot) + ", power = ") + _root.power);
_root.power = _root.power * 0.5;
_root.dir = tRot;
_root.dirRads = 0;
var _local3 = _global.fAngleToRadian(_root.dir);
_root.dy = Math.sin(_local3) * _root.power;
_root.dx = Math.cos(_local3) * _root.power;
trace((("fHit B: dir = " + _root.dir) + ", power = ") + _root.power);
}
function fAddThrow() {
_root.throws++;
_root.throwsTotal++;
_root.panel.throwsDisp.text = _root.throws;
}
function fHoleEnd() {
cnt.level++;
scorecard.gotoAndPlay(2);
}
function fNextHole() {
cnt.beginLevel();
scorecard.gotoAndStop(1);
}
function fEndLoad() {
trace("LOADED");
gotoAndPlay ("title");
}
function fRestart() {
_root.throws = 0;
_root.throwsTotal = 0;
_root.gotoAndPlay("title");
}
pThrowTypeButtons = [panel.inThrowType.inST1, panel.inThrowType.inST2, panel.inThrowType.inST3, panel.inThrowType.inST4];
pLastThrowType = undefined;
finalscore = 0;
pObsticleNum = 0;
pPauseCam = 0;
_root.pGoalHeight = 35;
_root.pGoalRadius = 12;
_root.throws = 0;
_root.throwsTotal = 0;
Instance of Symbol 55 MovieClip "bar" in Frame 9
onClipEvent (load) {
pTotal = _root.getBytesTotal();
pFrameOn = 0;
pFact = 100 / pTotal;
pActive = true;
pLoaded = 0;
pIntroDone = 0;
endWidth = 2.5;
}
onClipEvent (enterFrame) {
if (pActive == true) {
var tFrame = Math.floor(pFact * _root.getBytesLoaded());
if (tFrame > pFrameOn) {
pFrameOn = pFrameOn + 2;
}
if (pFrameOn < 100) {
_width = (pFrameOn * endWidth);
} else {
pActive = false;
gotoAndStop ("blank");
_root.fEndLoad();
}
}
}
Frame 15
stop();
Frame 23
stop();
Instance of Symbol 143 MovieClip "comHighscores" in Frame 25
//component parameters
onClipEvent (initialize) {
scoreLocation = "_root.throwsTotal";
gamename = "discgolf";
saveScore = true;
scoreIsTime = false;
scoreReversed = true;
negativeScoreAllowed = false;
}
Frame 32
stop();
Instance of Symbol 149 MovieClip "cnt" in Frame 34
onClipEvent (load) {
function clearMarkers() {
i = 0;
while (i <= numMarkers) {
eval ("_root.board.marker_" + i).removeMovieClip();
i++;
}
numMarkers = 0;
}
function beginLevel() {
if (level > 1) {
iStop = lvl[level - 1].obsX.length;
i = 0;
while (i <= iStop) {
eval ("_root.board.obs_" + i).removeMovieClip();
i++;
}
}
clearMarkers();
_root.halt = 0;
_root.throws = 0;
_root.panel.throwsDisp.text = _root.throws;
_root.panel.holeDisp.text = level;
windDir = 0;
WindDirRads = ((windDir / 360) * 2) * Math.PI;
windSpeed = 0;
goal.x = 1 * lvl[level].gx;
goal.y = 1 * lvl[level].gy;
goal.z = 1 * lvl[level].gz;
player.x = 1 * lvl[level].px;
player.y = 1 * lvl[level].py;
player.z = 1 * lvl[level].pz;
iStop = lvl[level].obsX.length;
i = 0;
while (i < iStop) {
obs[i] = new Object();
obs[i].x = lvl[level].obsX[i];
obs[i].y = lvl[level].obsY[i];
obs[i].t = lvl[level].obsT[i];
i++;
}
tx = 0;
ty = 0;
thisX = (xStart + (tx * tw)) + (ty * tw);
thisY = (yStart + (tx * th)) - (ty * th);
_root.board.fieldMarker.gotoAndStop(level);
_root.board.fieldMarker._x = thisX;
_root.board.fieldMarker._y = thisY;
_root.board.fieldMarker._xscale = 375;
_root.board.fieldMarker._yscale = 375;
iStop = lvl[level].obsX.length - 1;
i = 0;
while (i <= iStop) {
tx = obs[i].x / scale;
ty = obs[i].y / scale;
tz = 0;
thisX = (xStart + (tx * tw)) + (ty * tw);
thisY = (yStart + (tx * th)) - (ty * th);
d = ((Math.ceil(thisY + 400) * 1000) + Math.ceil(thisX)) + 5;
duplicateMovieClip (_root.board.obs, "obs_" + i, d);
eval ("_root.board.obs_" + i)._x = thisX;
eval ("_root.board.obs_" + i)._y = thisY;
tmpFrame = obs[i].t;
eval ("_root.board.obs_" + i).gotoAndStop(tmpFrame);
i++;
}
tx = goal.x / scale;
ty = goal.y / scale;
thisX = (xStart + (tx * tw)) + (ty * tw);
thisY = (yStart + (tx * th)) - (ty * th);
_root.board.goalDisp._x = thisX;
_root.board.goalDisp._y = thisY;
d = ((Math.ceil(thisY + 400) * 1000) + Math.ceil(thisX)) + 3;
_root.board.goalDisp.swapDepths(d);
tx = player.x / scale;
ty = player.y / scale;
tz = player.z;
thisX = (xStart + (tx * tw)) + (ty * tw);
thisY = (yStart + (tx * th)) - (ty * th);
_root.board.playerDisp._x = thisX;
_root.board.playerDisp._y = thisY - tz;
_root.board.playerShadow._x = thisX;
_root.board.playerShadow._y = thisY;
d = ((Math.ceil(thisY + 400) * 1000) + Math.ceil(thisX)) + 2;
_root.board.playerDisp.swapDepths(d + 2);
_root.board.playerShadow.swapDepths(d + 1);
_root.fBeginLevel();
resetBoard();
}
function resetBoard() {
refreshMap();
}
function refreshMap() {
_root.panel.map.mapPlayer._x = player.x / 10;
_root.panel.map.mapPlayer._y = player.y / 10;
_root.panel.map.mapGoal._x = goal.x / 10;
_root.panel.map.mapGoal._y = goal.y / 10;
thisX = 1 - ((_root.board.fieldMarker._x + _root.board._x) / scale);
thisY = 1 - ((_root.board.fieldMarker._y + _root.board._y) / scale);
mx = _root.board._x;
my = _root.board._y;
tmpX = ((((((-xStart) + mx) * th) / tw) - yStart) + my) / (2 * th);
tmpY = ((yStart + (tmpX * th)) - my) / th;
thisX = -1 * tmpX;
thisY = -1 * tmpY;
_root.panel.map.mapRect._x = thisX * 1.5;
_root.panel.map.mapRect._y = thisY * 1.5;
}
function fUpdatePos() {
tx = player.x / scale;
ty = player.y / scale;
tz = player.z;
thisX = (xStart + (tx * tw)) + (ty * tw);
thisY = (yStart + (tx * th)) - (ty * th);
_root.board.playerDisp._x = thisX;
_root.board.playerDisp._y = thisY - (tz * 2);
_root.board.playerShadow._x = thisX;
_root.board.playerShadow._y = thisY;
d = ((player.z + (Math.ceil(thisY + 400) * 1000)) + Math.ceil(thisX)) + 2;
_root.board.playerDisp.swapDepths(d + 2);
_root.board.playerShadow.swapDepths(d + 1);
}
pPos = {x:0, y:0};
level = 1;
lvl = Array();
scores = Array();
_root.halt = 0;
pLastHit = undefined;
lvls = Array();
lvls[1] = "369.87|605.07|4*591.84|425.1|4*430.77|453.57|2^426.25|590.65|2^445.15|707.95|2^492.85|480.85|2^526.77|356.37|5^644.95|492.55|5^701.35|463.75|5^724.75|367.15|5^669.25|314.05|5^604.47|310.47|5^250.8|645.54|3^264.6|691.74|3^291.88|728.62|3^377.08|384.28|2^483.28|263.68|2^551.35|734.95|2^";
lvls[2] = "828.25|711.85|4*473.65|555.25|4*797.32|485.38|3^683.05|745.45|3^844.14|776.94|5^881.34|750.54|5^889.11|707.97|5^770.67|541.47|5^808.47|544.47|5^711.25|795.25|5^728.65|763.45|5^734.05|734.05|5^391.45|699.85|5^335.35|662.95|5^298.77|617.97|5^279.28|557.68|5^316.18|486.58|5^401.94|460.79|5^627.87|611.06|2^729.85|647.05|2^936.54|534.54|2^542.37|391.17|4^600.87|429.27|4^594.57|376.17|4^634.77|388.77|4^587.07|327.87|4^755.05|421.45|4^794.65|437.05|4^847.45|433.45|4^789.25|390.85|4^831.85|403.45|4^816.55|370.15|4^655.45|813.85|4^596.65|799.45|4^";
lvls[3] = "550|600|4*375|350|4*461.97|476.37|3^486.87|576.86|2^450.28|383.08|2^288.88|368.08|5^257.08|308.68|5^254.08|256.48|5^267.88|205.48|5^331.48|159.88|5^396.58|172.18|5^435.88|198.28|5^464.37|249.57|5^484.77|283.17|5^470.68|294.28|5^468.57|698.97|5^485.35|740.95|5^509.35|779.35|5^544.15|809.35|5^581.65|810.85|5^641.65|767.65|5^657.55|710.35|5^648.85|642.85|5^624.85|605.65|5^567.87|417.87|2^362.07|539.67|2^643.47|307.47|4^613.16|364.77|4^621.27|410.07|4^662.97|421.77|4^323.07|536.66|4^276.28|541.48|4^356.07|591.27|4^";
lvls[4] = "358.98|380.98|4*573.87|635.07|4*412.77|685.17|4^410.97|658.17|4^436.17|590.97|4^454.77|559.16|4^559.47|437.07|4^579.57|418.77|4^602.37|398.37|4^659.04|373.5|4^685.77|346.17|4^711.27|344.07|4^458.07|533.67|4^416.97|710.97|4^429.58|441.58|2^650.94|495|2^469.47|678.27|2^242.98|392.98|2^296.38|266.38|2^265.77|520.17|2^501.57|184.77|2^697.15|775.15|2^257.68|335.68|3^294.58|323.38|3^282.88|356.08|3^";
lvls[5] = "78.89|920.04|4*353.07|609.87|4*178.18|902.92|6^255.28|876.82|6^437.38|712.12|6^502.45|622.45|6^680.65|410.65|6^772.15|280.15|6^906.24|102.3|6^17.09|903.84|6^167.4|768.54|4^164.4|751.14|4^181.5|747.84|4^349.48|896.62|3^159.29|699.24|3^280.48|855.22|5^298.48|813.22|5^273.58|761.92|5^225|727.74|5^141.31|489.25|2^558.87|177.27|2^855.85|471.85|2^899.95|674.35|2^89.7|977.64|5^51.91|812.65|5^";
lvls[6] = "452.67|407.07|4*590.05|606.85|4*392.38|428.38|4^374.98|400.18|4^372.87|344.07|4^409.47|301.47|4^472.77|290.37|4^526.47|306.86|4^561.27|354.86|4^514.75|554.35|4^579.85|524.65|4^638.95|506.95|4^502.15|665.35|2^421.77|548.97|2^639.57|328.77|2^";
lvls[7] = "707.65|442.45|4*347.37|598.16|4*419.37|518.97|2^459.87|561.87|2^464.07|513.27|2^501.85|583.45|2^312.57|578.97|5^300.87|638.07|5^330.25|691.45|5^675.55|341.95|4^728.65|360.25|4^763.15|395.95|4^790.45|471.25|4";
lvls[8] = "300.25|701.05|4*622.47|422.07|4*404.08|494.08|6^432.27|567.87|6^439.18|377.98|6^538.15|488.95|2^616.75|539.95|2^209.1|713.04|3^233.1|761.04|3^281.98|789.52|3^";
lvls[9] = "464.08|327.28|4*763.15|661.15|4*716.97|590.97|4^738.84|578.1|4^705.57|560.37|4^648.56|401.37|2^550.77|406.77|2^618.84|310.5|2^522.55|534.55|2^781.75|298.15|2^547.18|238.78|5^450.88|384.88|5^680.65|735.85|5^697.15|668.35|5^";
lvls[10] = "474.27|467.07|4*779.32|385.78|4*634.77|321.57|3^647.95|383.95|3^660.55|436.15|3^675.25|485.65|3^584.67|341.07|6^600.55|425.35|6^593.95|529.15|6^441.87|425.07|4^432.87|465.27|4^449.37|504.57|4^757.15|297.55|2^";
lvls[11] = "504.84|309.3|4*479.95|745.15|4*612.25|672.25|2^718.47|332.07|3^320.37|477.57|4^352.17|538.16|4^428.65|729.85|4^505.45|794.65|4^536.95|763.75|4^416.67|555.87|6^497.37|539.37|6^592.77|507.57|6^696.85|478.45|6^821.65|443.65|6^";
lvls[12] = "849.24|213.3|4*512.07|382.47|4*562.75|272.41|2^800.95|376.15|2^737.64|194.1|5^748.14|240.6|5^756.22|293.08|5^895.11|126.02|4^928.69|148.81|4^922.72|202.78|4^894.52|274.18|4^";
lvls[13] = "664.45|786.85|4*499.15|501.55|4*566.66|655.46|2^713.65|694.45|3^698.95|631.75|3^604.77|452.37|3^542.37|565.17|3^730.15|458.95|2^787.15|527.95|2^";
lvls[14] = "464.95|661.75|4*158.08|461.68|4*284.68|533.08|2^343.17|455.97|2^221.97|635.97|2^227.38|432.58|4^204.58|398.98|4^171.87|504.27|4^128.08|504.88|4^368.67|599.07|5^500.05|596.05|5^";
lvls[15] = "515.97|279.57|4*497.95|742.75|4*502.48|246.88|3^723.55|515.95|3^476.65|673.45|2^420.55|749.35|2^531.85|641.05|2^629.94|350.4|2^530.97|415.77|2^456.28|404.68|4^429.88|381.88|4^423.27|323.67|4^727.17|278.37|4^";
lvls[16] = "538.15|536.95|4*701.04|183.9|4*491.66|398.06|3^634.45|490.45|3^487.75|492.55|5^533.95|482.35|5^456.25|553.45|5^577.75|588.55|5^710.35|403.15|5^601.18|182.38|2^";
lvls[17] = "550.45|416.05|4*268.77|585.57|4*407.38|415.78|2^440.67|535.47|2^494.07|561.27|2^408.88|346.48|2^286.47|650.07|2^251.97|631.17|2^210.27|601.47|2^183.28|552.88|2^";
lvls[18] = "684.52|480.58|4*383.67|496.47|4*571.75|536.95|3^584.95|470.95|3^605.07|392.67|3^530.07|405.27|3^524.37|491.96|3^516.85|574.45|3^433.47|527.07|5^455.07|517.47|5^462.27|491.07|5^442.47|466.47|5^422.38|445.18|5^612.55|518.95|5^623.95|455.95|5^638.05|407.65|5^571.75|536.95|3^584.95|470.95|3^605.07|392.67|3^530.07|405.27|3^524.37|491.96|3^516.85|574.45|3^433.47|527.07|5^455.07|517.47|5^462.27|491.07|5^442.47|466.47|5^422.38|445.18|5^612.55|518.95|5^623.95|455.95|5^638.05|407.65|5^648.56|353.37|5^403.45|601.45|6^497.05|601.45|6^601.75|601.75|6^702.55|592.15|6^";
i = 1;
while (i <= lvls.length) {
lvl[i] = new Object();
txt = lvls[i].split("*");
tt = txt[0].split("|");
lvl[i].gx = tt[0];
lvl[i].gy = tt[1];
lvl[i].gz = tt[2];
tt = txt[1].split("|");
lvl[i].px = tt[0];
lvl[i].py = tt[1];
lvl[i].pz = tt[2];
tt = txt[2].split("^");
lvl[i].obsX = Array();
lvl[i].obsY = Array();
lvl[i].obsT = Array();
obsNum = 0;
j = 0;
while (j < (tt.length - 1)) {
ott = tt[j].split("|");
lvl[i].obsX[obsNum] = ott[0];
lvl[i].obsY[obsNum] = ott[1];
lvl[i].obsT[obsNum] = ott[2];
obsNum++;
j++;
}
i++;
}
numLevels = lvls.length - 1;
numMarkers = 0;
_root.panel.shotDisp.gotoAndStop(2);
_root.panel.btnFlat.gotoAndStop(2);
_root.throwMode = "Flat";
_root.flying = 0;
xStart = 50;
yStart = 200;
scale = 15;
tw = _root.board.tile._width * 0.5;
th = _root.board.tile._height * 0.5;
goal = new Object();
player = new Object();
obs = Array();
beginLevel();
}
onClipEvent (enterFrame) {
if (_root.flying == 1) {
windDx = 0;
windDy = 0;
player.x = player.x + _root.dx;
player.y = player.y + _root.dy;
player.z = player.z + _root.dz;
fUpdatePos();
lift = (Math.abs(_root.dx) + Math.abs(_root.dy)) * 0.3;
_root.dz = _root.dz - 0.03;
player.z = player.z + lift;
if (_root.throwMode == "Putt") {
thresh = 0;
windFactor = 1;
}
if (_root.throwMode == "Flat") {
thresh = 1.25;
driftFactor = 0.2;
windFactor = 1;
}
if (_root.throwMode == "Hyzer") {
thresh = 1.5;
driftFactor = -0.3;
windFactor = 2;
}
if (_root.throwMode == "Anhyzer") {
thresh = 1.5;
driftFactor = 0.4;
windFactor = 2;
}
driftFactor = driftFactor * 1.75;
thresh = 0;
wfactor = ((0.15 * windFactor) * windSpeed) * (Math.floor(player.z) / 25);
windDx = Math.sin(windDirRads) * wfactor;
windDy = Math.cos(windDirRads) * wfactor;
dt = Math.abs(_root.dx) + Math.abs(_root.dy);
cthresh = 10;
count++;
if (_root.throwMode != "Putt") {
if ((_root.dx >= 0) and (_root.dy >= 0)) {
rads = Math.atan(_root.dy / _root.dx);
degs = ((rads * 360) / 2) / Math.PI;
tmpdx = _root.dx;
tmpdy = _root.dy;
hyp = Math.sqrt((Math.abs(_root.dy) * Math.abs(_root.dy)) + (Math.abs(_root.dx) * Math.abs(_root.dx)));
degs = degs + driftFactor;
rads = ((degs / 360) * 2) * Math.PI;
_root.dy = Math.sin(rads) * hyp;
_root.dx = Math.cos(rads) * hyp;
}
if ((_root.dx <= 0) and (_root.dy <= 0)) {
rads = Math.atan(_root.dy / _root.dx);
rads = rads * -1;
degs = ((rads * 360) / 2) / Math.PI;
tmpdx = _root.dx;
tmpdy = _root.dy;
hyp = Math.sqrt((Math.abs(_root.dy) * Math.abs(_root.dy)) + (Math.abs(_root.dx) * Math.abs(_root.dx)));
degs = degs - driftFactor;
rads = ((degs / 360) * 2) * Math.PI;
_root.dx = (-1 * Math.cos(rads)) * hyp;
_root.dy = Math.sin(rads) * hyp;
}
if ((_root.dx <= 0) and (_root.dy >= 0)) {
rads = Math.atan(_root.dy / _root.dx);
rads = rads * -1;
degs = ((rads * 360) / 2) / Math.PI;
tmpdx = _root.dx;
tmpdy = _root.dy;
hyp = Math.sqrt((Math.abs(_root.dy) * Math.abs(_root.dy)) + (Math.abs(_root.dx) * Math.abs(_root.dx)));
degs = degs - driftFactor;
rads = ((degs / 360) * 2) * Math.PI;
_root.dx = (-1 * Math.cos(rads)) * hyp;
_root.dy = Math.sin(rads) * hyp;
}
if ((_root.dx >= 0) and (_root.dy <= 0)) {
rads = Math.atan(_root.dy / _root.dx);
rads = rads * -1;
degs = ((rads * 360) / 2) / Math.PI;
tmpdx = _root.dx;
tmpdy = _root.dy;
hyp = Math.sqrt((Math.abs(_root.dy) * Math.abs(_root.dy)) + (Math.abs(_root.dx) * Math.abs(_root.dx)));
degs = degs - driftFactor;
rads = ((degs / 360) * 2) * Math.PI;
_root.dx = Math.cos(rads) * hyp;
_root.dy = (-1 * Math.sin(rads)) * hyp;
}
}
_root.dx = _root.dx * 0.999;
_root.dy = _root.dy * 0.999;
iStop = lvl[level].obsX.length;
i = 0;
while (i <= iStop) {
if (pLastHit != i) {
r = eval ("_root.board.obs_" + i).r;
h = eval ("_root.board.obs_" + i).h;
b = eval ("_root.board.obs_" + i).b;
ttype = eval ("_root.board.obs_" + i).pName;
od = Math.abs(player.x - obs[i].x) + Math.abs(player.y - obs[i].y);
od2 = Math.abs((player.x + _root.dx) - obs[i].x) + Math.abs((player.y + _root.dx) - obs[i].y);
if ((od < r) and (player.z < h)) {
if (ttype == "tree") {
_root.inSFX.fPlay("tree");
} else {
_root.inSFX.fPlay("hit");
}
var tb = {x:(player.x + _root.dx) - obs[i].x, y:(player.y + _root.dx) - obs[i].y};
var trad = _global.fVectToRadian(tb);
var tRot = _global.fRadianToAngle(trad);
_root.fHit(tRot, 1);
pLastHit = i;
hcount = 1;
break;
}
}
i++;
}
if (player.z <= 1) {
_root.fEndThrow();
player.z = 1;
fUpdatePos();
iStop = lvl[level].obsX.length - 1;
splash = 0;
i = 0;
while (i <= iStop) {
r = eval ("_root.board.obs_" + i).r;
b = eval ("_root.board.obs_" + i).b;
od = Math.abs(player.x - obs[i].x) + Math.abs(player.y - obs[i].y);
if ((od < r) and (b == 0)) {
splash = 1;
} else if (_root.flying == 1) {
}
i++;
}
if (((((splash == 1) or (player.x > 1000)) or (player.x < 0)) or (player.y < 0)) or (player.y > 1000)) {
_root.pPauseCam = 20;
if (splash == 1) {
_root.inSFX.fPlay("splash");
} else {
_root.inSFX.fPlay("out");
}
player.x = player.xOld;
player.y = player.yOld;
tx = player.x / scale;
ty = player.y / scale;
tz = player.z;
thisX = (xStart + (tx * tw)) + (ty * tw);
thisY = (yStart + (tx * th)) - (ty * th);
_root.board.playerDisp._x = thisX;
_root.board.playerDisp._y = thisY - (tz * 2);
_root.board.playerShadow._x = thisX;
_root.board.playerShadow._y = thisY;
}
_root.flying = 0;
count = 0;
hcount = 0;
refreshMap();
}
gdd = Math.abs(_root.dx) + Math.abs(_root.dy);
gd = Math.abs(player.x - goal.x) + Math.abs(player.y - goal.y);
gdz = Math.abs(player.z - goal.z);
if (((gd - gdd) < _root.pGoalRadius) && (gdz < _root.pGoalHeight)) {
_root.fScore();
count = 0;
hcount = 0;
scores[level] = _root.throws;
hitgoal = 1;
} else {
hitgoal = 0;
}
}
}
Frame 42
stop();
Symbol 7 MovieClip Frame 1
this._visible = false;
Symbol 13 Button
on (release) {
getURL ("http://www.miniclip.com/", "_blank");
}
Symbol 18 MovieClip Frame 1
pushSWF1 = "http://www.miniclip.com/swfcontent/push/didyouknow.swf";
totalAds = 1;
gotoAndPlay ("ReadCookie");
Symbol 18 MovieClip Frame 9
so = SharedObject.getLocal("MiniclipLoaderAd");
showThisAd = so.data.showThisAd + 1;
if (showThisAd > totalAds) {
showThisAd = 1;
}
so.data.showThisAd = showThisAd;
gotoAndPlay ("prepareAd");
Symbol 18 MovieClip Frame 20
doReadCookie();
showAd = ((this["pushSWF" + showThisAd] + "?cacheBuster=") + getTimer()) + random(999999);
gotoAndPlay ("loadAd");
Symbol 18 MovieClip Frame 31
if (_url.indexOf(http) > 0) {
mcAd.loadMovie(showAd);
}
mcCookie.doWriteCookie(showThisAd);
Symbol 18 MovieClip Frame 33
if ((mcAd.getBytesTotal() != 0) && (mcAd.getBytesLoaded() == mcAd.getBytesTotal())) {
lastAdShown = showThisAd;
doWriteCookie();
gotoAndStop ("showAd");
} else {
gotoAndPlay(_currentframe - 1);
}
Symbol 18 MovieClip Frame 41
stop();
Symbol 28 MovieClip Frame 1
stop();
Symbol 28 MovieClip Frame 100
stop();
Symbol 30 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 12
_root.play();
_root.isFinished = true;
_parent.stop();
stop();
Symbol 33 MovieClip Frame 2
_parent.mcAnimation.play();
stop();
Symbol 33 MovieClip Frame 13
_parent.gotoAndPlay("preload");
stop();
Symbol 47 MovieClip Frame 1
stop();
Symbol 47 MovieClip Frame 60
Symbol 47 MovieClip Frame 121
_parent.mcBackground.play();
stop();
Symbol 48 MovieClip Frame 1
_root.stop();
play();
Instance of Symbol 7 MovieClip "mcIntro" in Symbol 48 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 48 MovieClip Frame 2
xPos = _x;
yPos = _y;
mcBackground._x = mcBackground._x - xPos;
mcBackground._y = mcBackground._y - yPos;
mcAnimation._x = mcAnimation._x - xPos;
mcAnimation._y = mcAnimation._y - yPos;
var stageWidth = Stage.width;
var stageHeight = Stage.height;
var centerStageX = (stageWidth / 2);
var centerStageY = (stageHeight / 2);
mcBackground._width = stageWidth;
mcBackground._height = stageHeight;
mcAnimation._x = mcAnimation._x + centerStageX;
mcAnimation._y = mcAnimation._y + (centerStageY - (stageHeight / 10));
stop();
Instance of Symbol 30 MovieClip "mcLoadingAnimated" in Symbol 48 MovieClip Frame 2
onClipEvent (load) {
_visible = false;
}
Symbol 48 MovieClip Frame 3
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent == 100) {
_root.play();
stop();
} else {
mcLoadingAnimated._visible = true;
}
Symbol 48 MovieClip Frame 5
var loadedPercent = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (loadedPercent < 100) {
mcLoadingAnimated.mcLoading.gotoAndStop(loadedPercent);
mcLoadingAnimated.mcLoading.txtPercentLoaded1 = ("The game is loading (" + loadedPercent) + "%)";
mcLoadingAnimated.mcLoading.txtPercentLoaded2 = ("The game is loading (" + loadedPercent) + "%)";
gotoAndPlay(_currentframe - 1);
} else {
mcLoadingAnimated.play();
stop();
}
Symbol 53 MovieClip Frame 1
gotoAndPlay (2);
Symbol 53 MovieClip Frame 16
stop();
Symbol 62 Button
on (press) {
getURL ("http://www.miniclip.com", "_blank");
}
Symbol 87 MovieClip Frame 1
if (pInstruct == true) {
} else {
stop();
}
Symbol 87 MovieClip Frame 2
Symbol 87 MovieClip Frame 16
if (pInstruct == true) {
stop();
}
Symbol 87 MovieClip Frame 30
_root.fHoleEnd();
stop();
Symbol 95 MovieClip Frame 1
function fWait(tamount) {
pCount = tamount;
stop();
}
pCount = 0;
this.onEnterFrame = function () {
if (pCount > 0) {
pCount--;
if (pCount == 0) {
play();
}
}
};
gotoAndPlay (2);
Symbol 95 MovieClip Frame 58
fWait(30);
Symbol 95 MovieClip Frame 59
fWait(120);
Symbol 95 MovieClip Frame 60
fWait(30);
Symbol 95 MovieClip Frame 69
fWait(30);
Symbol 95 MovieClip Frame 75
fWait(50);
Symbol 95 MovieClip Frame 79
fWait(30);
Symbol 95 MovieClip Frame 86
fWait(120);
Symbol 95 MovieClip Frame 108
fWait(30);
Symbol 95 MovieClip Frame 118
fWait(30);
Instance of Symbol 87 MovieClip in Symbol 95 MovieClip Frame 136
onClipEvent (load) {
pInstruct = true;
}
Symbol 95 MovieClip Frame 151
fWait(120);
Symbol 95 MovieClip Frame 160
fWait(60);
Symbol 95 MovieClip Frame 165
fWait(160);
Symbol 95 MovieClip Frame 170
gotoAndPlay ("loop");
Symbol 101 Button
on (release) {
_root.gotoAndPlay("game");
}
Symbol 111 MovieClip Frame 1
gotoAndPlay (2);
Symbol 111 MovieClip Frame 93
stop();
Symbol 116 Button
on (release) {
_root.fRestart();
}
Symbol 122 MovieClip Frame 1
this._visible = false;
Symbol 137 Button
on (release) {
gameURL = ("http://www.miniclip.com/" + gamename) + ".htm";
getURL (gameURL, "_blank");
}
Instance of Symbol 122 MovieClip "mcHighscores" in Symbol 143 MovieClip Frame 1
onClipEvent (load) {
_visible = false;
}
Symbol 143 MovieClip Frame 2
if (_url.indexOf("miniclip.com") == -1) {
gotoAndStop(_currentframe + 1);
} else {
var noCache = (getTimer() + random(100000));
mcTarget.loadMovie("http://www.miniclip.com/swfcontent/highscore.swf?" + noCache);
stop();
}
Symbol 143 MovieClip Frame 3
stop();
Symbol 149 MovieClip Frame 2
stop();
Symbol 150 Button
on (release) {
fMouse("release");
}
on (press) {
fMouse("press");
}
on (rollOver) {
fMouse("on");
}
on (rollOut) {
fMouse("off");
}
on (dragOver) {
fMouse("on");
}
on (dragOut) {
fMouse("off");
}
on (releaseOutside) {
fMouse("releaseOutside");
}
Symbol 151 MovieClip Frame 1
function fReset() {
pActive = false;
pAnim = false;
}
function fAnimateBoard() {
if (_root.pPauseCam > 0) {
_root.pPauseCam--;
} else {
_root.cnt.pPos.x = (-1 * _root.board.playerDisp._x) + 275;
_root.cnt.pPos.y = (-1 * _root.board.playerDisp._y) + 200;
_root.board._x = _root.board._x + ((_root.cnt.pPos.x - _root.board._x) / 10);
_root.board._y = _root.board._y + ((_root.cnt.pPos.y - _root.board._y) / 10);
}
}
function fMouse(which) {
switch (which) {
case "press" :
fMouseDown();
break;
case "release" :
fMouseUp();
break;
case "releaseOutside" :
fMouseUp();
break;
case "off" :
}
}
function fMouseDown() {
if ((((pActive == false) and (pAnim == false)) and (_root.flying == false)) and (_root.pPauseCam == 0)) {
_root.board._x = _root.cnt.pPos.x;
_root.board._y = _root.cnt.pPos.y;
pActive = true;
pStartPos = {x:_root.board._x, y:_root.board._y};
pStartMouse = {x:_xmouse, y:_ymouse};
xt = 0;
}
}
function fMouseUp() {
if (pActive == true) {
pActive = false;
pAnim = true;
xb = _root.board._x;
xe = pStartPos.x - _root.board._x;
yb = _root.board._y;
ye = pStartPos.y - _root.board._y;
}
}
pStartPos = {x:0, y:0};
pStartMouse = {x:0, y:0};
pActive = false;
this.useHandCursor = false;
pTimeBack = 15;
xt = 0;
xb = _root.board._x;
xe = 0;
xd = pTimeBack;
yb = _root.board._y;
ye = 0;
yd = pTimeBack;
pAnim = false;
this.onEnterFrame = function () {
if (pActive == true) {
_root.board._x = pStartPos.x - ((pStartMouse.x - _xmouse) * 1);
_root.board._y = pStartPos.y - ((pStartMouse.y - _ymouse) * 1);
} else if (pAnim == true) {
xt++;
_root.board._x = _root.fEaseInOutExpo(xt, xb, xe, xd);
_root.board._y = _root.fEaseInOutExpo(xt, yb, ye, yd);
if (xt >= pTimeBack) {
pAnim = false;
}
} else {
fAnimateBoard();
}
};
Symbol 157 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 2
stop();
Symbol 157 MovieClip Frame 3
stop();
Symbol 157 MovieClip Frame 4
stop();
Symbol 157 MovieClip Frame 5
stop();
Symbol 161 Button
on (release) {
fMouse("release");
}
on (press) {
fMouse("press");
}
on (rollOver) {
fMouse("on");
}
on (rollOut) {
fMouse("off");
}
on (dragOver) {
fMouse("on");
}
on (dragOut) {
fMouse("off");
}
on (releaseOutside) {
fMouse("releaseOutside");
}
Symbol 166 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 1
gotoAndStop (2);
Symbol 169 MovieClip Frame 2
stop();
Symbol 170 MovieClip Frame 1
function fMouse(which) {
switch (which) {
case "press" :
_root.cnt.player.z = 5;
_root.cnt.fUpdatePos();
gotoAndStop ("on");
break;
case "release" :
_root.cnt.player.z = 1;
_root.cnt.fUpdatePos();
gotoAndStop ("off");
break;
case "releaseOutside" :
_root.fFire(inArrow.pRot, inArrow.pPower);
}
}
stop();
Instance of Symbol 169 MovieClip "inArrow" in Symbol 170 MovieClip Frame 7
onClipEvent (load) {
pRot = 90;
pOS = {x:0, y:-100};
this._alpha = 0;
}
onClipEvent (enterFrame) {
var trad = _global.getAngle({x:_xmouse, y:_ymouse}, {x:pOS.x, y:pOS.y});
pRot = (Math.floor(_global.fRadianToAngle(trad)) + 270) % 360;
inDir._rotation = pRot;
var tdist = _global.fGetDistance({x:_xmouse, y:_ymouse}, {x:pOS.x, y:pOS.y});
tdist = Math.floor((tdist / 200) * 100);
if (tdist > 100) {
tdist = 100;
} else if (tdist < 1) {
tdist = 1;
}
pPower = tdist;
inDir.gotoAndStop(pPower);
if (this._alpha < 100) {
this._alpha = this._alpha + 5;
}
}
Symbol 192 MovieClip Frame 1
stop();
Symbol 192 MovieClip Frame 2
stop();
Symbol 192 MovieClip Frame 3
stop();
Symbol 192 MovieClip Frame 4
stop();
Symbol 192 MovieClip Frame 5
stop();
Symbol 192 MovieClip Frame 6
stop();
Symbol 192 MovieClip Frame 7
stop();
Symbol 192 MovieClip Frame 8
stop();
Symbol 192 MovieClip Frame 9
stop();
Symbol 192 MovieClip Frame 10
stop();
Symbol 192 MovieClip Frame 11
stop();
Symbol 192 MovieClip Frame 12
stop();
Symbol 192 MovieClip Frame 13
stop();
Symbol 192 MovieClip Frame 14
stop();
Symbol 192 MovieClip Frame 15
stop();
Symbol 192 MovieClip Frame 16
stop();
Symbol 192 MovieClip Frame 17
stop();
Symbol 192 MovieClip Frame 18
stop();
Symbol 197 MovieClip Frame 1
gotoAndStop(_root.fGetObNum(1) + 2);
Symbol 201 MovieClip Frame 1
gotoAndStop(_root.fGetObNum(2) + 2);
Symbol 212 MovieClip Frame 1
gotoAndStop(_root.fGetObNum(3) + 2);
Symbol 217 MovieClip Frame 1
stop();
Symbol 217 MovieClip Frame 2
stop();
r = 18;
h = 35;
b = -0.5;
pName = "tree";
Symbol 217 MovieClip Frame 3
stop();
r = 30;
h = 0;
b = 0;
pName = "water";
Symbol 217 MovieClip Frame 4
stop();
r = 15;
h = 15;
b = -0.5;
pName = "rock";
Symbol 217 MovieClip Frame 5
stop();
r = 15;
h = 15;
b = -0.5;
pName = "rock";
Symbol 217 MovieClip Frame 6
stop();
r = 15;
h = 20;
b = -0.5;
pName = "bin";
Symbol 217 MovieClip Frame 7
stop();
r = 25;
h = 20;
b = -0.5;
pName = "seat";
Instance of Symbol 87 MovieClip "goalDisp" in Symbol 221 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 220 MovieClip in Symbol 221 MovieClip Frame 1
onClipEvent (load) {
this.swapDepths(10000000);
}
onClipEvent (enterFrame) {
this._x = _parent.playerDisp._x - 10;
this._y = _parent.playerDisp._y - 5;
}
Instance of Symbol 225 MovieClip "mapRect" in Symbol 231 MovieClip Frame 1
onClipEvent (load) {
_xscale = (_root.cnt.scale * 15);
_yscale = (_root.cnt.scale * 15);
}
Symbol 242 MovieClip Frame 1
pActive = false;
stop();
Symbol 247 MovieClip Frame 1
pActive = false;
stop();
Symbol 251 MovieClip Frame 1
pActive = false;
stop();
Symbol 256 MovieClip Frame 1
pActive = false;
stop();
Instance of Symbol 242 MovieClip "inST4" in Symbol 258 MovieClip Frame 1
onClipEvent (load) {
function fDeselect() {
pActive = false;
gotoAndStop (1);
}
}
on (release) {
if ((pActive == false) and (_root.flying == false)) {
_root.fThrowMode("Hyzer", this);
pActive = true;
gotoAndStop (3);
}
}
on (rollOver) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (2);
}
}
on (dragOver) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (2);
}
}
on (rollOut) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (1);
}
}
on (dragOut) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (1);
}
}
Instance of Symbol 247 MovieClip "inST3" in Symbol 258 MovieClip Frame 1
onClipEvent (load) {
function fDeselect() {
pActive = false;
gotoAndStop (1);
}
}
on (release) {
if ((pActive == false) and (_root.flying == false)) {
_root.fThrowMode("Putt", this);
pActive = true;
gotoAndStop (3);
}
}
on (rollOver) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (2);
}
}
on (dragOver) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (2);
}
}
on (rollOut) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (1);
}
}
on (dragOut) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (1);
}
}
Instance of Symbol 251 MovieClip "inST2" in Symbol 258 MovieClip Frame 1
onClipEvent (load) {
function fDeselect() {
pActive = false;
gotoAndStop (1);
}
function fSelect(tstart) {
if (tstart == false) {
_root.inSFX.fPlay("click");
}
_root.fThrowMode("Flat", this);
pActive = true;
gotoAndStop (3);
}
pActive = false;
gotoAndStop (1);
}
on (release) {
if ((pActive == false) and (_root.flying == false)) {
fSelect(false);
}
}
on (rollOver) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (2);
}
}
on (dragOver) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (2);
}
}
on (rollOut) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (1);
}
}
on (dragOut) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (1);
}
}
Instance of Symbol 256 MovieClip "inST1" in Symbol 258 MovieClip Frame 1
onClipEvent (load) {
function fDeselect() {
pActive = false;
gotoAndStop (1);
}
}
on (release) {
if ((pActive == false) and (_root.flying == false)) {
_root.fThrowMode("Anhyzer", this);
pActive = true;
gotoAndStop (3);
}
}
on (rollOver) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (2);
}
}
on (dragOver) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (2);
}
}
on (rollOut) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (1);
}
}
on (dragOut) {
if ((pActive == false) and (_root.flying == false)) {
gotoAndStop (1);
}
}
Symbol 258 MovieClip Frame 2
inST2.fSelect(true);
stop();
Instance of Symbol 231 MovieClip "map" in Symbol 260 MovieClip Frame 1
onClipEvent (load) {
pCount = 0;
}
onClipEvent (enterFrame) {
pCount = pCount + 1;
if (pCount == 31) {
pCount = 0;
_root.cnt.refreshMap();
}
}
Symbol 286 Button
on (press) {
_root.fNextHole();
}
Symbol 290 Button
on (release) {
_root.fHighscores();
}
Symbol 293 Button
on (release) {
_root.fRestart();
}
Symbol 295 MovieClip Frame 1
stop();
Symbol 295 MovieClip Frame 2
stop();
Symbol 317 MovieClip Frame 1
stop();
Symbol 317 MovieClip Frame 2
stop();
_root.halt = 1;
if (_root.cnt.level > _root.cnt.numLevels) {
trace("game over");
btns.gotoAndStop(2);
} else {
btns.gotoAndStop(1);
}
totalDisp.text = _root.throwsTotal;
Instance of Symbol 149 MovieClip in Symbol 317 MovieClip Frame 2
onClipEvent (load) {
i = 1;
while (i <= 18) {
trace((i + ": ") + _root.cnt.scores[i]);
eval ("_root.scorecard.t" + i).text = _root.cnt.scores[i];
i++;
}
}
Symbol 323 MovieClip Frame 1
function fPlay(what) {
trace("SFX: " + what);
gotoAndPlay(what);
}
Symbol 323 MovieClip Frame 2
stop();
Symbol 323 MovieClip Frame 16
stop();
Symbol 323 MovieClip Frame 28
stop();
Symbol 323 MovieClip Frame 41
stop();
Symbol 323 MovieClip Frame 55
stop();
Symbol 323 MovieClip Frame 79
stop();
Symbol 323 MovieClip Frame 85
stop();
Symbol 324 Button
on (release) {
_root.fRestart();
}
Symbol 325 MovieClip Frame 41
stop();