Frame 1
MochiAd.showPreGameAd({id:"af1f83ee22b9b3ad", res:"640x480"});
Frame 2
function gameMenu(menu, obj) {
getURL (_root.authorsSite, "_blank");
}
var gameTitle = "offroad";
this._lockroot = true;
vNum = "1.01";
flashVersionsNeeded = 8;
legalDomain = "http://www.terrypaton.com";
authorName = "Terry Paton";
authorContact = "terry@terrypaton.com";
authorsSite = "http://www.terrypaton.com";
gameLocation = _root._url.substr(0, legalDomain.length);
var gameName = "offroad";
gameQuality = "AUTO";
var menu_cm = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem(authorsSite, gameMenu));
menu_cm.hideBuiltInItems();
_root.menu = menu_cm;
this._lockroot = true;
if (gameLocation != legalDomain) {
}
var score = 0;
Frame 3
loadingClip.onLoad = function () {
};
loadingClip.onEnterFrame = function () {
pL = Math.floor((this._parent.getBytesLoaded() / this._parent.getBytesTotal()) * 100);
if (pL < 100) {
this.mask._xscale = (pL / 100) * 100;
this._parent.stop();
} else {
i = 0;
while (i < stringLength) {
removeMovieClip(eval ("loadingHolder.l" + i));
i++;
}
this._parent.play();
}
};
wordString = "offroad";
stringLength = wordString.length;
wordOffset = (stringLength * 20) / 2;
this.createEmptyMovieClip("loadingHolder", 1);
loadingHolder._x = (320 - wordOffset) + 10;
loadingHolder._y = 175;
i = 0;
while (i < stringLength) {
t = loadingHolder.attachMovie("letter", "l" + i, i);
t._x = i * 20;
t.angle = i;
t.Lvar.text = wordString.charAt(i);
t._xscale = (t._yscale = 200);
i++;
}
stop();
Frame 4
if (false) {
}
Frame 6
function attachSoundFromLibrary(idname) {
var _local2 = new Sound(this);
_local2.attachSound(idname);
return(_local2);
}
function playSound(temp) {
if (skidSnd != temp) {
lastSound = temp;
eval (temp).start();
}
}
var crashSnd = attachSoundFromLibrary("crashSnd.wav");
var pointsScored = attachSoundFromLibrary("pointsScored.wav");
var skidSnd = attachSoundFromLibrary("skidSnd.wav");
var mouseOverSnd = attachSoundFromLibrary("mouseOver.wav");
var mouseDownSnd = attachSoundFromLibrary("mouseDown.wav");
var winGameSnd = attachSoundFromLibrary("winGame.wav");
var gameOverSnd = attachSoundFromLibrary("gameOverSnd.wav");
storage = SharedObject.getLocal("offroadStore");
yourhigh = storage.data.myhighscore;
if (yourhigh == undefined) {
storage.data.myhighscore = 0;
yourhigh = 0;
}
trace("yourhigh = " + yourhigh);
Frame 7
this.howToPlayBtn.onRollOver = function () {
_root.playSound("mouseOverSnd");
};
this.howToPlayBtn.onRelease = function () {
gotoAndPlay (7);
playSound("mouseDownSnd");
};
this.playBtn.onRollOver = function () {
playSound("mouseOverSnd");
};
this.playBtn.onRelease = function () {
gotoAndPlay (48);
playSound("mouseDownSnd");
};
this.sendToAFriendBtn.onRelease = function () {
gotoAndPlay (7);
playSound("mouseDownSnd");
};
this.sendToAFriendBtn.onRollOver = function () {
playSound("mouseOverSnd");
};
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
Frame 47
stop();
Frame 48
function Isometric(x, z) {
maxx = x;
maxz = z;
theta = 30;
alpha = 45;
theta = theta * (Math.PI/180);
alpha = alpha * (Math.PI/180);
sinTheta = Math.sin(theta);
cosTheta = Math.cos(theta);
sinAlpha = Math.sin(alpha);
cosAlpha = Math.cos(alpha);
leeway = 5;
}
function mapToScreen(xpp, ypp, zpp) {
yp = ypp;
xp = (xpp * cosAlpha) + (zpp * sinAlpha);
zp = (zpp * cosAlpha) - (xpp * sinAlpha);
x = xp;
y = (yp * cosTheta) - (zp * sinTheta);
return([x, y]);
}
function mapToIsoWorld(screenX, screenY) {
z = ((screenX / cosAlpha) - (screenY / (sinAlpha * sinTheta))) * (1 / ((cosAlpha / sinAlpha) + (sinAlpha / cosAlpha)));
x = (1 / cosAlpha) * (screenX - (z * sinAlpha));
return([x, z]);
}
function changeY(num) {
player.y = player.y + num;
if (player.y > 0) {
player.y = 0;
}
}
Isometric();
function zDepthAdjust(temp) {
if ((pz < temp.dz) || (px < temp.dx)) {
pdepth = stageHolder.stage.player.getDepth();
objDepth = temp.getDepth();
if (pdepth > objDepth) {
temp.swapDepths(stageHolder.stage.player);
}
}
}
function bouncePlayer() {
playSound("crashSnd");
bounceXMove = -(xMove * 3);
bounceYMove = -(yMove * 3);
trace("bounceXMove = " + bounceXMove);
if (bounceXMove < -10) {
bounceXMove = -10;
}
if (bounceXMove > 10) {
bounceXMove = 10;
}
if (bounceYMove < -10) {
bounceYMove = -10;
}
if (bounceYMove > 10) {
bounceYMove = 10;
}
if (Math.abs(bounceXMove) == 0) {
bounceXMove = 5;
}
if (Math.abs(bounceYMove) == 0) {
bounceXMove = 5;
}
if (Math.abs(bounceXMove) < 2) {
bounceXMove = bounceXMove * 2;
}
if (Math.abs(bounceYMove) < 2) {
bounceYMove = bounceYMove * 2;
}
pz = pz - bounceYMove;
px = px - bounceXMove;
pz = pz - bounceYMove;
speed = (-speed) / 3;
rotatePlayer();
}
function addSkid() {
if ((speed > 3) && (speed < 10)) {
if (!skidSndPlayer) {
playSound("skidSnd");
skidSndPlayer = true;
}
t = stageHolder.stage.attachMovie("skidMark", "skid" + skNum, skNum);
a = Math.floor(angle / 11.25) + 1;
t.gotoAndStop(a);
var _local2 = _root.mapToScreen(px, 0, pz);
t._x = screenX + _local2[0];
t._y = screenY - _local2[1];
skNum++;
if (skNum > 220) {
skNum = 200;
}
}
}
function addPoints(temp, tclip) {
playSound("pointsScored");
t = stageHolder.stage.attachMovie("pointsClip", "p" + pNum, pNum);
trace(tclip);
pNum++;
if (pNum > 2030) {
pNum = 2010;
}
t._x = tclip._x;
t._y = tclip._y;
trace(temp);
switch (temp) {
case -5 :
score = score - 5;
if (score < 0) {
score = 0;
}
n = 1;
break;
case 10 :
score = score + 10;
n = 2;
break;
case 20 :
score = score + 20;
n = 3;
break;
case 50 :
score = score + 50;
n = 4;
break;
case 100 :
score = score + 100;
n = 5;
}
trace(n);
t.gotoAndStop(n);
t.textBox.text = addp;
}
function testObjectHit(temp) {
if (objectLastHit != temp) {
if (stageHolder.stage.player.hitShape.hitTest(temp)) {
objectLastHit = temp;
return(true);
}
}
return(false);
}
function keyFunc() {
if (!Key.isDown(37)) {
skidSndPlayer = false;
} else if (!Key.isDown(39)) {
skidSndPlayer = false;
}
if (Math.abs(speed) > 1) {
if (Key.isDown(37)) {
speed = speed * 0.95;
addSkid();
angle = angle - turningSpeed;
if (angle < 0) {
angle = angle + 360;
}
} else if (Key.isDown(39)) {
speed = speed * 0.95;
addSkid();
angle = angle + turningSpeed;
if (angle > 360) {
angle = angle - 360;
}
}
}
if (Key.isDown(40)) {
speed = speed - 2;
if (speed < -10) {
speed = -10;
}
}
if (Key.isDown(38)) {
speed = speed + 1.3;
if (speed > 20) {
speed = 20;
}
}
xMove = speed * Math.cos((angle * Math.PI) / 180);
yMove = speed * Math.sin((angle * Math.PI) / 180);
rotater._rotation = angle;
}
function rotatePlayer() {
if (angle > 360) {
angle = angle - 360;
} else if (angle < 0) {
angle = angle + 360;
}
a = Math.floor(angle / 11.25) + 1;
stageHolder.stage.player.gotoAndStop(a);
stageHolder.stage.player.clip.clip2._rotation = angle + 45;
}
function itemCollected() {
itemsLeft--;
if (itemsLeft < 0) {
itemsLeft = 0;
}
if (itemsLeft < 1) {
trace("level amount reached complete");
levelComplete = true;
collectDisplay.gotoAndStop(2);
}
}
function setUpLevel() {
trace("setup level");
t = stageHolder.stage.attachMovie("player", "player", 2000);
i = 0;
while (i < 5500) {
removeMovieClip(eval ("stage.ob" + i));
i = i + 3;
}
speed = 0;
xMove = 0;
yMove = 0;
collectDisplay.gotoAndStop(1);
levelComplete = false;
maxRot = 145;
rotStep = 2;
steps = Math.floor(levelTime / 2);
steps = 100;
trace(steps);
timeWarningShowed = false;
timeWarning._visible = false;
yachtX = 450;
timeUsed = 0;
if (level == 1) {
levelTime = 750;
itemsLeft = 20;
px = 100;
pz = -500;
angle = 180;
levelStorage = new Array(157.5, -280, 1, 175, -693, 1, 178.5, -1039.5, 1, 192.5, -1379, 1, 357, -1939, 1, 829.5, -1606.5, 1, 843.5, -1249.5, 1, 861, -819, 1, 871.5, -462, 1, 1158.5, -234.5, 1, 1582, -542.5, 1, 1596, -920.5, 1, 1617, -1424.5, 1, 1606.5, -1795.5, 1, 2026.5, -73.5, 1, 539, -66.5, 1, 199.5, -507.5, 2, 119, -871.5, 2, 220.5, -1204, 2, 192.5, -1764, 2, 651, -1946, 2, 836.5, -1022, 2, 1361.5, -346.5, 2, 1603, -1200.5, 2, 1904, -1928.5, 2, 1666, -1977.5, 2, 864.5, -1403.5, 2, 511, -668.5, 2, 542.5, -1200.5, 2, 1795.5, -59.5, 2, 2026.5, -532, 2, 441, -434, 3, 518, -899.5, 3, 392, -1445.5, 3, 423.5, -1666, 3, 1228.5, -1246, 3, 1193.5, -854, 3, 1260, -539, 3, 1186.5, -1708, 3, 966, -1963.5, 3, 1312.5, -1974, 3, 1921.5, -1694, 3, 1918, -1211, 3, 1739.5, -157.5, 3, 931, -70, 3, 528.5, -220.5, 3, 350, -59.5, 4, 479.5, -511, 4, 553, -1484, 4, 1253, -1470, 4, 1015, -1610, 4, 1113, -1088.5, 4, 1904, -910, 4, 1844.5, -528.5, 4, 1589, -168, 4, 1347.5, -63, 4, 1631, -276.5, 5, 1718.5, -343, 5, 1729, -416.5, 5, 1424.5, -1946, 5, 1491, -2033.5, 5, 1337, -1676.5, 5, 945, -1767.5, 5, 896, -1925, 5, 819, -1977.5, 5, 1043, -1211, 5, 1046.5, -1368.5, 5, 1060.5, -514.5, 5, 1113, -395.5, 5, 1207.5, -364, 5, 801.5, -189, 5, 717.5, -255.5, 5, 668.5, -353.5, 5, 399, -770, 5, 416.5, -920.5, 5, 423.5, -1137.5, 5, 56, -1865.5, 5, 119, -1984.5, 5, 269.5, -2065, 5, 1767.5, -1438.5, 3, 1981, -1491, 3, 612.5, -812, 3, 1172.5, -651, 3, 577.5, -1641.5, 5, 546, -1718.5, 5, 1267, -934.5, 5, 1277.5, -1050, 5);
}
if (level == 2) {
levelTime = 900;
itemsLeft = 20;
px = -250;
pz = -350;
angle = 90;
levelStorage = new Array(1991.5, -1025.5, 3, 679, -500.5, 3, 542.5, -637, 3, 1585.5, -1911, 4, 1253, -140, 4, 276.5, -1764, 4, 35, -1141, 3, 766.5, -1722, 3, 1008, -1736, 3, 1256.5, -1736, 3, 1491, -1718.5, 3, 1673, -1596, 3, 1753.5, -1442, 3, 1764, -1228.5, 3, 1760.5, -931, 3, 1680, -696.5, 3, 1596, -504, 3, 1393, -392, 3, 1064, -329, 3, 560, -546, 4, 434, -980, 4, 504, -1200.5, 4, 693, -1610, 4, 903, -1578.5, 4, 1330, -1683.5, 4, 1673, -1368.5, 4, 1585.5, -920.5, 4, 1403.5, -591.5, 4, 1071, -455, 4, 49, -1904, 5, 98, -1988, 5, 196, -2047.5, 5, 1851.5, -2075.5, 5, 1981, -2019.5, 5, 2068.5, -1886.5, 5, 1473.5, -1792, 5, 1645, -1743, 5, 1767.5, -1617, 5, 35, -287, 5, 35, -157.5, 5, 105, -94.5, 5, 210, -35, 5, 1865.5, -28, 5, 1995, -59.5, 5, 2065, -147, 5, 2075.5, -283.5, 5, 353.5, -1477, 5, 402.5, -1578.5, 5, 493.5, -1666, 5, 619.5, -1722, 5, 322, -574, 5, 395.5, -448, 5, 507.5, -339.5, 5, 672, -290.5, 5, 1046.5, -983.5, 3, 955.5, -1057, 3, 1043, -1144.5, 3, 1113, -1046.5, 3, 1018.5, -1050, 4, 927.5, -924, 5, 1092, -875, 5, 1207.5, -1004.5, 5, 1176, -1162, 5, 1025.5, -1239, 5, 878.5, -1169, 5, 861, -1036, 5, 301, -269.5, 2, 136.5, -493.5, 2, 136.5, -707, 2, 133, -889, 2, 199.5, -1039.5, 2, 119, -1239, 2, 213.5, -1358, 2, 122.5, -1466.5, 2, 84, -1718.5, 2, 262.5, -1648.5, 2, 276.5, -1925, 2, 542.5, -1844.5, 2, 626.5, -2016, 2, 1060.5, -1991.5, 2, 1298.5, -1904, 2, 801.5, -1879.5, 2, 1603, -2023, 2, 1827, -1925, 2, 1830.5, -1746.5, 2, 1984.5, -1575, 2, 1991.5, -1211, 2, 1876, -1102.5, 2, 1981, -819, 2, 1893.5, -535.5, 2, 1732.5, -448, 2, 1680, -199.5, 2, 1382.5, -154, 2, 1155, -199.5, 2, 875, -101.5, 2, 598.5, -140, 2, 395.5, -157.5, 2, 206.5, -182, 6, 1946, -1865.5, 7, 759.5, -759.5, 1, 1015, -707, 1, 1284.5, -801.5, 1, 1449, -1060.5, 1, 1424.5, -1337, 1, 1235.5, -1435, 1, 878.5, -1417.5, 1, 658, -1242.5, 1, 658, -945, 1, 1865.5, -28, 5, 1995, -59.5, 5, 2065, -147, 5, 2075.5, -283.5, 5, 353.5, -1477, 5, 402.5, -1578.5, 5, 493.5, -1666, 5, 619.5, -1722, 5, 322, -574, 5, 395.5, -448, 5, 507.5, -339.5, 5, 672, -290.5, 5, 1046.5, -983.5, 3, 955.5, -1057, 3, 1043, -1144.5, 3, 1113, -1046.5, 3, 1018.5, -1050, 4, 927.5, -924, 5, 1092, -875, 5, 1207.5, -1004.5, 5, 1176, -1162, 5, 1025.5, -1239, 5, 878.5, -1169, 5, 861, -1036, 5);
}
if (level == 3) {
levelTime = 900;
itemsLeft = 32;
px = 0;
pz = 1350;
angle = 230;
levelStorage = new Array(2033.5, -66.5, 6, 1340.5, -763, 7, 990.5, -637, 4, 1179.5, -602, 4, 1368.5, -598.5, 4, 1515.5, -682.5, 4, 1557.5, -854, 4, 1550.5, -1008, 4, 1421, -1116.5, 4, 1627.5, -920.5, 3, 1578.5, -749, 3, 1480.5, -577.5, 3, 1274, -535.5, 3, 1067.5, -546, 3, 1543.5, -1102.5, 3, 1256.5, -1081.5, 4, 749, -703.5, 4, 976.5, -1148, 4, 724.5, -1291.5, 4, 574, -1431.5, 4, 609, -1610, 4, 784, -1704.5, 4, 1011.5, -1708, 4, 581, -731.5, 4, 402.5, -588, 4, 399, -437.5, 4, 518, -325.5, 4, 1487.5, -1505, 4, 1613.5, -1575, 4, 1718.5, -1715, 4, 1746.5, -1900.5, 4, 150.5, -1116.5, 4, 56, -1270.5, 4, 35, -1501.5, 4, 945, -329, 4, 1085, -234.5, 4, 1872.5, -497, 4, 2026.5, -588, 4, 1991.5, -472.5, 3, 1970.5, -661.5, 3, 1603, -1659, 3, 658, -1505, 3, 45.5, -1375.5, 3, 56, -1130.5, 3, 1109.5, -1130.5, 3, 899.5, -1347.5, 3, 941.5, -1792, 3, 1760.5, -2040.5, 3, 1792, -1778, 3, 1718.5, -1564.5, 3, 490, -493.5, 3, 434, -654.5, 3, 1074.5, -308, 3, 444.5, -217, 3, 10.5, -94.5, 3, 87.5, -7, 3, 1942.5, -14, 3, 2079, -2030, 3, 2093, -812, 3, 63, -2054.5, 3, 24.5, -1830.5, 3, 752.5, -1396.5, 5, 738.5, -1529.5, 5, 815.5, -1603, 5, 1169, -668.5, 5, 1018.5, -682.5, 5, 857.5, -714, 5, 1326.5, -987, 5, 1445.5, -899.5, 5, 178.5, -1277.5, 5, 248.5, -1176, 5, 315, -1099, 5, 434, -1011.5, 5, 343, -1001, 5, 241.5, -1001, 5, 129.5, -997.5, 5, 73.5, -927.5, 5, 45.5, -829.5, 5, 140, -1386, 5, 70, -150.5, 5, 122.5, -80.5, 5, 220.5, -35, 5, 339.5, -21, 5, 1603, -21, 5, 1708, -14, 5, 1813, -17.5, 5, 2058, -157.5, 5, 2068.5, -234.5, 5, 2068.5, -336, 5, 2089.5, -1064, 5, 2037, -1158.5, 5, 1904, -1239, 5, 1771, -1302, 5, 1666, -1347.5, 5, 1606.5, -1802.5, 5, 1631, -1911, 5, 1571.5, -1988, 5, 1473.5, -2040.5, 5, 1340.5, -2075.5, 5, 84, -1907.5, 5, 150.5, -1981, 5, 241.5, -2016, 5, 336, -2047.5, 5, 448, -2047.5, 5, 66.5, -1757, 5, 63, -1645, 5, 892.5, -1648.5, 5, 1057, -1610, 5, 1127, -1578.5, 5, 1204, -1722, 5, 1141, -1655.5, 5, 1057, -1207.5, 3, 1197, -1137.5, 3, 850.5, -633.5, 3, 542.5, -626.5, 3, 1876, -1974, 2, 2009, -1904, 2, 1977.5, -1760.5, 2, 1438.5, -1774.5, 2, 1354.5, -1953, 2, 1018.5, -1970.5, 2, 721, -1935.5, 2, 374.5, -1711.5, 2, 231, -1757, 2, 346.5, -1309, 2, 651, -1130.5, 2, 1001, -952, 2, 745.5, -899.5, 2, 315, -798, 2, 189, -591.5, 2, 192.5, -308, 2, 686, -87.5, 2, 1078, -143.5, 2, 784, -476, 2, 1190, -168, 2, 1554, -339.5, 2, 1848, -759.5, 2, 1767.5, -1134, 2, 1351, -1309, 2, 1046.5, -1403.5, 2, 1169, -1326.5, 1, 1582, -1274, 1, 1897, -955.5, 1, 1669.5, -612.5, 1, 1774.5, -255.5, 1, 1284.5, -336, 1, 745.5, -238, 1, 640.5, -525, 1, 255.5, -462, 1, 108.5, -850.5, 1, 497, -983.5, 1, 997.5, -910, 1, 283.5, -1571.5, 1, 507.5, -1925, 1, 878.5, -2002, 1, 1277.5, -1690.5, 1, 1232, -1879.5, 1, 1179.5, -938, 1, 1074.5, -801.5, 1, 756, -1165.5, 1, 2033.5, -1582, 1, 1949.5, -1522.5, 1, 1911, -1652, 1, 1106, -2051, 1, 1893.5, -1823.5, 5, 2033.5, -1813, 5, 2030, -1676.5, 5, 1886.5, -1568, 5, 1998.5, -1232, 5, 1844.5, -1302, 5, 1627.5, -1417.5, 5);
}
if (level == 4) {
levelTime = 900;
itemsLeft = 30;
px = -1750;
pz = 1350;
angle = 270;
levelStorage = new Array(1918, -168, 7, 1921.5, -1918, 6, 2051, -353.5, 3, 1900.5, -353.5, 3, 1750, -357, 3, 1554, -343, 3, 1375.5, -343, 3, 1137.5, -343, 3, 952, -343, 3, 780.5, -343, 3, 584.5, -346.5, 3, 465.5, -346.5, 3, 28, -703.5, 3, 196, -703.5, 3, 399, -703.5, 3, 581, -700, 3, 847, -693, 3, 1060.5, -693, 3, 1235.5, -703.5, 3, 1435, -689.5, 3, 1564.5, -689.5, 3, 1683.5, -696.5, 3, 2068.5, -1043, 3, 1907.5, -1046.5, 3, 1687, -1046.5, 3, 1512, -1050, 3, 1344, -1053.5, 3, 1172.5, -1057, 3, 1036, -1057, 3, 815.5, -1057, 3, 619.5, -1053.5, 3, 472.5, -1053.5, 3, 360.5, -1050, 3, 35, -1396.5, 3, 199.5, -1400, 3, 490, -1403.5, 3, 640.5, -1403.5, 3, 780.5, -1403.5, 3, 903, -1403.5, 3, 1106, -1400, 3, 1561, -1400, 3, 1718.5, -1400, 3, 1806, -1400, 3, 2079, -1389.5, 3, 1757, -1739.5, 3, 1529.5, -1743, 3, 1312.5, -1743, 3, 1004.5, -1743, 3, 735, -1746.5, 3, 490, -1746.5, 3, 245, -1750, 3, 868, -1736, 3, 1256.5, -1722, 3, 1148, -1715, 4, 1645, -1725.5, 4, 1911, -1729, 4, 2033.5, -1739.5, 4, 1907.5, -1403.5, 4, 346.5, -1424.5, 4, 686, -707, 4, 665, -294, 4, 1312.5, -752.5, 4, 1424.5, -1074.5, 4, 1606.5, -308, 4, 941.5, -742, 4, 665, -1333.5, 4, 1211, -1424.5, 4, 1414, -1715, 4, 546, -1739.5, 4, 346.5, -1652, 4, 371, -962.5, 4, 59.5, -77, 4, 91, -616, 4, 52.5, -815.5, 4, 1228.5, -332.5, 4, 1561, -1991.5, 2, 1382.5, -1890, 2, 1221.5, -1984.5, 2, 945, -1872.5, 2, 826, -2009, 2, 514.5, -1876, 2, 357, -1974, 2, 147, -1883, 2, 66.5, -1715, 2, 115.5, -1543.5, 2, 399, -1512, 2, 815.5, -1582, 2, 1193.5, -1585.5, 2, 1613.5, -1540, 2, 1981, -1550.5, 2, 1347.5, -1368.5, 2, 1743, -1242.5, 2, 1995, -1214.5, 2, 1851.5, -549.5, 2, 1967, -717.5, 2, 1746.5, -896, 2, 1354.5, -910, 2, 854, -889, 2, 535.5, -871.5, 2, 161, -1039.5, 2, 189, -1211, 2, 630, -1211, 2, 1057, -1211, 2, 1302, -525, 2, 910, -514.5, 2, 469, -518, 2, 171.5, -399, 2, 262.5, -178.5, 2, 640.5, -136.5, 2, 1113, -126, 2, 1452.5, -140, 2, 1613.5, -84, 1, 836.5, -178.5, 1, 437.5, -217, 1, 252, -542.5, 1, 1127, -451.5, 1, 1694, -469, 1, 1638, -1221.5, 1, 1445.5, -1526, 1, 1988, -843.5, 1, 1911, -1277.5, 1, 2082.5, -1596, 1, 2068.5, -1494.5, 1, 168, -1589, 1, 633.5, -2051, 1, 1130.5, -1925, 1, 371, -1239, 1, 199.5, -871.5, 1, 913.5, -1232, 1, 1694, -1473.5, 5, 1694, -1529.5, 5, 1690.5, -1575, 5, 1694, -1631, 5, 1610, -1109.5, 5, 1683.5, -1141, 5, 1764, -1179.5, 5, 1802.5, -1253, 5, 1809.5, -1309, 5, 73.5, -143.5, 5, 185.5, -63, 5, 101.5, -490, 5, 189, -602, 5, 38.5, -889, 5, 147, -787.5, 5, 45.5, -1288, 5, 31.5, -1470, 5, 24.5, -2023, 5, 70, -2065, 5, 1736, -626.5, 5, 1732.5, -749, 5, 1991.5, -98, 5, 2005.5, -220.5, 5, 1827, -241.5, 5, 1809.5, -91, 5);
}
if (level == 5) {
levelTime = 900;
itemsLeft = 35;
px = -750;
pz = 650;
angle = 270;
levelStorage = new Array(1228.5, -882, 6, 1956.5, -1935.5, 7, 1036, -868, 2, 906.5, -910, 2, 826, -1060.5, 2, 875, -1204, 2, 1022, -1274, 2, 1207.5, -1281, 2, 1424.5, -1249.5, 2, 1543.5, -1155, 2, 1606.5, -1004.5, 2, 1592.5, -836.5, 2, 1508.5, -700, 2, 1337, -616, 2, 1134, -581, 2, 931, -581, 2, 770, -626.5, 2, 633.5, -752.5, 2, 539, -910, 2, 504, -1074.5, 1, 563.5, -1267, 1, 689.5, -1414, 1, 931, -1487.5, 1, 1116.5, -1505, 1, 1375.5, -1505, 1, 1648.5, -1400, 1, 1813, -1246, 1, 1869, -1015, 1, 1862, -815.5, 1, 1788.5, -640.5, 1, 1645, -479.5, 1, 1456, -367.5, 1, 1260, -325.5, 1, 1022, -315, 1, 787.5, -315, 1, 612.5, -357, 1, 479.5, -423.5, 1, 371, -563.5, 1, 311.5, -721, 1, 280, -864.5, 1, 252, -1025.5, 1, 252, -1225, 1, 297.5, -1424.5, 1, 378, -1568, 1, 472.5, -1659, 1, 570.5, -1722, 2, 714, -1750, 2, 819, -1715, 2, 903, -1725.5, 2, 962.5, -1788.5, 2, 1043, -1907.5, 2, 1148, -1977.5, 2, 1274, -1939, 2, 1386, -1876, 2, 1480.5, -1781.5, 2, 1592.5, -1718.5, 2, 1750, -1718.5, 2, 1865.5, -1795.5, 2, 1095.5, -1011.5, 3, 1022, -1120, 3, 791, -836.5, 3, 675.5, -1106, 3, 983.5, -1386, 3, 1484, -1333.5, 3, 1743, -1078, 3, 1386, -1039.5, 3, 1641.5, -679, 3, 1309, -472.5, 3, 889, -455, 3, 598.5, -602, 3, 409.5, -903, 3, 416.5, -1330, 3, 714, -1564.5, 3, 1071, -1634.5, 3, 1197, -1774.5, 3, 1375.5, -1645, 3, 1708, -1575, 3, 1942.5, -1697.5, 3, 1690.5, -1946, 3, 1519, -2016, 3, 819, -1981, 3, 605.5, -1963.5, 3, 283.5, -1739.5, 3, 140, -1515.5, 3, 84, -738.5, 3, 171.5, -301, 3, 378, -150.5, 3, 1043, -66.5, 3, 1750, -164.5, 3, 1991.5, -455, 3, 2005.5, -672, 3, 1417.5, -108.5, 3, 1596, -126, 4, 192.5, -147, 4, 150.5, -1659, 4, 1760.5, -2075.5, 4, 430.5, -2005.5, 4, 1995, -1267, 4, 1991.5, -1571.5, 4, 689.5, -945, 5, 497, -224, 5, 374.5, -259, 5, 287, -325.5, 5, 224, -427, 5, 231, -1515.5, 5, 297.5, -1627.5, 5, 420, -1750, 5, 556.5, -1830.5, 5, 1501.5, -1890, 5, 1617, -1823.5, 5, 1764, -1848, 5, 1130.5, -1151.5, 5, 1277.5, -1162, 5, 1407, -1116.5, 5, 882, -787.5, 5, 1004.5, -738.5, 5, 1162, -724.5, 5, 1305.5, -735, 5, 1592.5, -199.5, 5, 1711.5, -252, 5, 1781.5, -294, 5, 1851.5, -374.5, 5, 1897, -469, 5, 1935.5, -66.5, 1, 2037, -91, 1, 2040.5, -189, 1, 56, -213.5, 2, 84, -1876, 2, 91, -2002, 2, 220.5, -2058, 2, 304.5, -1932, 2, 161, -1956.5, 1, 469, -1792, 5, 150.5, -1393, 5, 87.5, -1232, 5, 1879.5, -1354.5, 5, 1781.5, -1435, 5, 1564.5, -1533, 5, 1470, -1557.5, 5, 1267, -1596, 5, 1165.5, -1592.5, 5, 966, -1592.5, 5, 868, -1571.5, 5, 619.5, -1477, 5, 511, -1396.5, 5, 406, -1179.5, 5, 399, -1043, 5, 441, -805, 5, 518, -679, 5, 696.5, -535.5, 5, 794.5, -493.5, 5, 1015, -448, 4, 1176, -458.5, 3, 1505, -553, 3, 1403.5, -507.5, 5, 1694, -780.5, 5, 1725.5, -917, 5, 1596, -1256.5, 5, 1669.5, -1169, 5, 1319.5, -1372, 5, 1134, -1379, 5, 868, -1354.5, 5, 717.5, -1242.5, 5);
}
itemsTotal = 0;
levelObjects = levelStorage.length;
i = 0;
while (i < levelObjects) {
a = levelStorage[i + 2];
if (a < 6) {
t = stageHolder.stage.attachMovie("object", "ob" + i, i + 1000);
tx = levelStorage[i];
tz = levelStorage[i + 1];
t.gotoAndStop(a);
if (a == 3) {
b = random(3) + 1;
t.clip.gotoAndStop(b);
t.clip2.gotoAndStop(b);
}
td.dx = tx;
t.dy = 0;
t.dz = tz;
t.objType = a;
if ((a == 1) || (a == 2)) {
itemsTotal++;
}
var tempD = _root.mapToScreen(tx, 0, tz);
t._x = tempD[0];
t._y = tempD[1];
}
i = i + 3;
}
trace("itemsTotal = " + itemsTotal);
timeLeft = Math.ceil((levelTime - timeUsed) / 30);
t = attachMovie("levelAnnounce", "levelAnnounce", 4000);
t.lvlTxt.text = "LEVEL " + level;
counter = 60;
yachtX = 450;
var tempD = _root.mapToScreen(px, py, pz);
stageHolder.stage._x = screenX - stageHolder.stage.player._x;
stageHolder.stage._y = screenY - stageHolder.stage.player._y;
stageHolder.stage.player._x = screenX + tempD[0];
stageHolder.stage.player._y = screenY - tempD[1];
var tempD = _root.mapToScreen(yachtX, 0, -840);
stageHolder.stage.yacht._x = screenX + tempD[0];
stageHolder.stage.yacht._y = screenY - tempD[1];
}
skidTime = getTimer();
pNum = 2010;
onEnterFrame = function () {
dr = (Math.abs(speed) / 20) * 211;
speedo.dial._rotation = dr;
switch (gameState) {
case "playing" :
if ((speed >= 0) && (speed < 3)) {
goClip._visible = true;
} else {
goClip._visible = false;
}
timeUsed++;
timeLeft = Math.ceil((levelTime - timeUsed) / 30);
if (timeLeft <= 0) {
if (levelComplete) {
gameState = "next level";
} else {
gameState = "game over";
}
}
if (timeWarningShowed == false) {
if (timeLeft < 10) {
timeWarning._visible = true;
timeWarningShowed = true;
}
}
yachtX = yachtX - 1;
if (yachtX < -1900) {
yachtX = 450;
}
var _local2 = _root.mapToScreen(yachtX, 0, -840);
stageHolder.stage.yacht._x = screenX + _local2[0];
stageHolder.stage.yacht._y = screenY - _local2[1];
_local2 = _root.mapToScreen(px, py, pz);
stageHolder.stage._x = screenX - stageHolder.stage.player._x;
stageHolder.stage._y = screenY - stageHolder.stage.player._y;
stageHolder.stage.player._x = screenX + _local2[0];
stageHolder.stage.player._y = screenY - _local2[1];
px = px + xMove;
pz = pz + yMove;
testObjectHit();
rotatePlayer();
if (speed > 0) {
speed = speed * 0.98;
} else {
speed = speed * 0.98;
}
if ((speed > -0.5) && (speed < 0.5)) {
speed = 0;
}
if (pz > 1530) {
speed = (-speed) / 2;
pz = 1530;
}
if (pz < -580) {
speed = (-speed) / 2;
pz = -580;
}
if (px < -2050) {
speed = (-speed) / 2;
px = -2050;
}
if (px > 200) {
speed = (-speed) / 2;
px = 200;
}
keyFunc();
break;
case "next level" :
level++;
if (level > 5) {
gameFinished = true;
gameState = "game over";
} else {
t = attachMovie("levelAnnounce", "levelAnnounce", 4000);
t.lvlTxt.text = "LEVEL COMPLETE";
gameState = "setup level";
}
break;
case "setup level" :
setUpLevel();
gameState = "setup level wait";
break;
case "setup level wait" :
positionYacht();
_local2 = _root.mapToScreen(px, py, pz);
stageHolder.stage._x = screenX - stageHolder.stage.player._x;
stageHolder.stage._y = screenY - stageHolder.stage.player._y;
stageHolder.stage.player._x = screenX + _local2[0];
stageHolder.stage.player._y = screenY - _local2[1];
rotatePlayer();
counter--;
if (counter < 1) {
gameState = "playing";
_quality = "LOW";
}
break;
case "setup" :
gameFinished = false;
xoffset = 0;
yoffset = 0;
var _local3 = new flash.geom.Rectangle(xoffset, yoffset, 640, 480);
stageHolder._x = xoffset;
stageHolder._y = yoffset;
stageHolder.scrollRect = _local3;
turningSpeed = 5;
_quality = "HIGH";
level = 1;
t = stageHolder.stage.attachMovie("yacht", "yacht", 3000);
skNum = 200;
_local2 = _root.mapToScreen(yachtX, 0, -780);
t._x = screenX + _local2[0];
t._y = screenY - _local2[1];
screenX = 320;
screenY = 240;
py = 0;
angle = 180;
kt = 5;
player.gotoAndStop(1);
skidSndPlayer = false;
gNum = 1;
k = 0;
while (k > -6) {
j = 0;
while (j < 6) {
t = stageHolder.stage.attachMovie("grass", "g" + gNum, gNum + 100);
_local2 = _root.mapToScreen(178 + (j * 353), 0, -178 + (k * 353));
t._x = _local2[0];
t._y = _local2[1];
t.gotoAndStop(random(3) + 1);
gNum++;
j++;
}
k--;
}
score = 0;
t = stageHolder.stage.attachMovie("player", "player", 2000);
gameState = "setup level";
break;
case "game over" :
gotoAndPlay (52);
delete gameState;
delete onEnterFrame;
break;
default :
gameState = "setup";
}
};
Frame 51
stop();
Frame 52
if (!gameFinished) {
gameFinishedClip._visible = false;
} else {
levelClip._visible = false;
}
Frame 56
this.playBtn.onRollOver = function () {
playSound("mouseOverSnd");
};
this.playBtn.onRelease = function () {
gotoAndPlay (48);
playSound("mouseDownSnd");
};
this.sendToAFriendBtn.onRelease = function () {
gotoAndPlay (52);
playSound("mouseDownSnd");
};
this.sendToAFriendBtn.onRollOver = function () {
playSound("mouseOverSnd");
};
if (score > yourhigh) {
yourhigh = score;
storage.data.myhighscore = score;
}
if (score > 500) {
t = this.createEmptyMovieClip("highHolder", depth);
loadMovie ("http://www.terrypaton.com/highscores/highscoreSubmit.swf", highHolder);
t._x = 90;
t._y = 300;
}
if (yourhigh != undefined) {
yourHighestText = "YOUR HIGHEST SCORE: " + yourhigh;
} else {
yourHighestText = " ";
}
storage.flush();
delete onEnterFrame;
stop();
Symbol 283 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.3");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local27);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0) {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Symbol 284 MovieClip [__Packages.letterClass] Frame 0
class letterClass extends MovieClip
{
var centerY, radiusY, speed, y, _y, x, _x, angle;
function letterClass () {
super();
}
function onLoad() {
centerY = 48;
radiusY = 5;
speed = 0.05;
y = _y;
x = _x;
}
function onEnterFrame() {
if (angle != undefined) {
y = centerY + (Math.sin(angle) * radiusY);
angle = angle + speed;
_x = x;
_y = y;
}
}
}
Symbol 285 MovieClip [__Packages.skidMarkClass] Frame 0
class skidMarkClass extends MovieClip
{
var c, _alpha, removeMovieClip;
function skidMarkClass () {
super();
}
function onLoad() {
c = 60;
}
function onEnterFrame() {
c--;
if (c < 30) {
if (_root.speed < 1) {
_alpha = _alpha - 10;
}
if (c < 1) {
removeMovieClip();
}
}
}
}
Symbol 286 MovieClip [__Packages.dirtSprayClass] Frame 0
class dirtSprayClass extends MovieClip
{
var _visible;
function dirtSprayClass () {
super();
}
function onEnterFrame() {
if (_root.speed > 2) {
_visible = true;
} else {
_visible = false;
}
}
}
Symbol 287 MovieClip [__Packages.pointsClass] Frame 0
class pointsClass extends MovieClip
{
var _y, _alpha, removeMovieClip;
function pointsClass () {
super();
}
function onLoad() {
}
function onEnterFrame() {
_y = _y - 2;
_alpha = _alpha - 5;
if (_alpha < 5) {
removeMovieClip();
}
}
}
Symbol 288 MovieClip [__Packages.announceClass] Frame 0
class announceClass extends MovieClip
{
var _x, _y, c, _alpha, state, _xscale, _yscale, removeMovieClip, clip;
function announceClass () {
super();
}
function onLoad() {
_x = 320;
_y = 240;
c = 30;
_alpha = 5;
state = "start";
_xscale = (_yscale = 50);
}
function onEnterFrame() {
switch (state) {
case "start" :
if (_alpha < 100) {
_alpha = _alpha + 3.3;
}
if (_xscale < 100) {
_xscale = (_yscale = _yscale + 2);
} else {
state = "wait";
c = 30;
_alpha = 100;
_xscale = (_yscale = 100);
}
break;
case "wait" :
c--;
if (c < 1) {
state = "leave";
}
break;
case "leave" :
_alpha = _alpha - 2;
_xscale = (_yscale = _yscale + 2);
if (_alpha >= 5) {
break;
}
removeMovieClip();
}
clip._rotation++;
}
}
Symbol 289 MovieClip [__Packages.objectClass] Frame 0
class objectClass extends MovieClip
{
var hitSpot, x, _x, y, _y, knocked, angle, range, ySpeed, xSpeed, obState, objType, clip1, c, _alpha, removeMovieClip;
function objectClass () {
super();
}
function onLoad() {
hitSpot._visible = false;
x = _x;
y = _y;
knocked = false;
angle = 0;
range = 10;
ySpeed = 0.05;
xSpeed = 1;
obState = "wait";
if (((objType == 3) || (objType == 4)) || (objType == 5)) {
clip1.gotoAndStop(random(3) + 1);
}
}
function onEnterFrame() {
switch (obState) {
case "wait" :
if ((objType == 1) || (objType == 2)) {
if (_root.testObjectHit(hitSpot)) {
obState = "collected";
_root.itemCollected();
_root.addPoints(100, this);
}
}
if ((objType == 3) || (objType == 4)) {
_root.zDepthAdjust(this);
if (_root.testObjectHit(hitSpot)) {
_root.bouncePlayer();
trace("bounce player off tree");
}
}
if (objType == 5) {
if (!knocked) {
if (_root.testObjectHit(hitSpot)) {
knocked = true;
clip1.gotoAndStop(5);
clip1.knocked.gotoAndStop(random(4) + 1);
trace("knock cone");
trace("adding points");
_root.addPoints(10, this);
}
}
}
break;
case "collected" :
obState = "collected wait";
c = 10;
break;
case "collected wait" :
clip1._y = clip1._y - 2;
_alpha = _alpha - 10;
c--;
if (c < 1) {
removeMovieClip();
}
break;
}
_y = y;
_x = x;
}
}
Symbol 20 MovieClip [letter] Frame 1
#initclip 8
Object.registerClass("letter", letterClass);
#endinitclip
Symbol 63 MovieClip [object] Frame 1
#initclip 13
Object.registerClass("object", objectClass);
#endinitclip
Symbol 96 MovieClip [skidMark] Frame 1
#initclip 9
Object.registerClass("skidMark", skidMarkClass);
#endinitclip
Symbol 110 MovieClip [dirtSpray] Frame 1
#initclip 10
Object.registerClass("dirtSpray", dirtSprayClass);
#endinitclip
Symbol 188 MovieClip [pointsClip] Frame 1
#initclip 11
Object.registerClass("pointsClip", pointsClass);
#endinitclip
Symbol 202 MovieClip [levelAnnounce] Frame 1
#initclip 12
Object.registerClass("levelAnnounce", announceClass);
#endinitclip
Symbol 210 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 1
_root.stop();
Symbol 215 MovieClip Frame 75
_root.play();
Symbol 250 MovieClip Frame 1
this.onPress = function () {
getURL ("http://www.terrypaton.com", "_blank");
};
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.stop();