Frame 1
nn = true;
function menuHandler(obj, menuObj) {
if (showItem == false) {
menuObj.customItems[0].enabled = false;
menuObj.customItems[1].enabled = false;
} else {
menuObj.customItems[0].enabled = true;
menuObj.customItems[1].enabled = true;
}
}
function percyPea(obj, item) {
getURL (cl[0], "_blank");
}
var showItem = true;
var my_cm = new ContextMenu(menuHandler);
my_cm.customItems.push(new ContextMenuItem("Developed by PercyPea", percyPea));
this.menu = my_cm;
fscommand ("show_menu", "false");
function sp() {
var _local2 = 1;
while (_local2 <= 10) {
this["ap" + _local2] = ap;
_local2++;
}
}
function ss(n) {
var _local1 = 1 - n;
while (_local1 < 10) {
bb[_local1] = ["board2", "http://www.percypea.co.uk/billBoards.html"];
_local1 = _local1 + 2;
}
}
cl = ["http://percypea.co.uk/?link=buggy", "http://www.gamesterart.com", "http://www.flickr.com/photos/photos_by_kenneth/", "http://www.rumouronline.com", "http://www.tripwireaudio.com", "http://www.youtube.com", "http://percypea.co.uk/?link=buggy", "http://www.tripwireaudio.com"];
ap = "http://www.percypea.com/bannerAds/";
sp();
defaultBillboards = [["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"], ["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"], ["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"], ["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"], ["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"]];
bb = [["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"], ["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"], ["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"], ["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"], ["board4", "http://www.percypea.co.uk/fidi.html"], ["board1", "http://www.percypea.co.uk/?link=3DBuggy"]];
function perfTest() {
tt = getTimer();
var _local1 = 0;
var _local2 = 0;
while ((getTimer() - tt) < 100) {
_local1++;
_local1 = _local1 + Math.sqrt(_local1);
_local2++;
}
recQual = 4;
if (_local2 < 40000) {
recQual = 3;
}
if (_local2 < 22000) {
recQual = 2;
}
if (_local2 < 12000) {
recQual = 1;
}
}
perfTest();
ytPlayerDestroyed = true;
youtubeIDs = ["cfYApDG-pmA", "ObF3jqd_EZA"];
timeOfAd = getTimer() - 300000;
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("a89affab", this, 10301, true);
cookie = SharedObject.getLocal("3dBuggyRacing");
if (cookie.data.lastUser != null) {
var lastUser = cookie.data.lastUser;
username = cookie.data["user" + lastUser].username;
if (cookie.data["user" + lastUser].unlocked == 1) {
cookie.data["user" + lastUser].unlocked = 2;
}
unlocked = cookie.data["user" + lastUser].unlocked;
} else {
username = "";
unlocked = 2;
}
alreadyLoaded = -1;
preloadTo = [59806, 439013, 571743];
myDomain = _url;
System.security.allowDomain("http://www.percypea.com");
loadMovieNum ("http://www.percypea.com/buggy/buggyscores.swf?r=" + random(99999), 1);
stop();
onEnterFrame = function () {
if (alreadyLoaded == -1) {
alreadyLoaded = getBytesLoaded();
}
percentage.setValue(Math.round((100 / (preloadTo[0] - alreadyLoaded)) * (getBytesLoaded() - alreadyLoaded)));
ifFrameLoaded (3) {
gotoAndStop (2);
}
};
allowCache = false;
Frame 2
delete this.onEnterFrame;
Frame 3
play();
mochi.as2.MochiServices.connect("98ab6505dd49d609");
alreadyLoaded = getBytesLoaded();
ifFrameLoaded (6) {
gotoAndStop (4);
}
onEnterFrame = function () {
percentage.setValue(Math.round((100 / (preloadTo[1] - alreadyLoaded)) * (getBytesLoaded() - alreadyLoaded)));
ifFrameLoaded (6) {
gotoAndStop (4);
}
};
Frame 4
if (nn && (!ngConnected)) {
ngConnected = true;
NewgroundsAPI.connectMovie(12227);
}
function sortVid() {
if (showVid) {
if (titleBG._alpha > 5) {
titleBG._alpha = titleBG._alpha - 10;
} else {
doStuff = null;
titleBG._visible = false;
}
}
if (!ytplayerLoaded) {
checkPlayerLoaded();
}
}
function checkPlayerLoaded() {
if (ytplayer.isPlayerLoaded()) {
ytplayer.addEventListener("onStateChange", onPlayerStateChange);
ytplayer.addEventListener("onError", onPlayerError);
ytplayer.loadVideoById(_root.youtubeIDs[0]);
ytplayer.setSize(550, 500);
ytplayerLoaded = true;
}
}
function onPlayerStateChange(newState) {
if (newState == -1) {
titleBG._alpha = 100;
titleBG._visible = true;
}
if (newState == 1) {
ytplayer._visible = true;
ytplayer.setSize(550, 500);
showVid = true;
}
if (newState == 0) {
ytplayer.playVideo();
}
}
function onPlayerError(errorCode) {
ytplayer._visible = false;
titleBG._alpha = 100;
titleBG._visible = true;
}
if (ytPlayerDestroyed) {
doStuff = sortVid;
titleBG._alpha = 200;
showVid = false;
var ytPlayerLoaderListener = {onLoadInit:function () {
ytplayer.setSize(550, 500);
}};
}
if (ytPlayerDestroyed) {
ytPlayerDestroyed = false;
var ytPlayerLoader = new MovieClipLoader();
ytPlayerLoader.addListener(ytPlayerLoaderListener);
createEmptyMovieClip("ytpYAY", getNextHighestDepth());
ytpYAY.onEnterFrame = function () {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
if ((_root._currentframe < 35) && (_root._currentframe > 3)) {
loadMovie ("http://www.youtube.com/apiplayer", ytplayer);
delete this.onEnterFrame;
}
}
};
}
if (((!_root.sclk) && (!_root.na)) && (!_root.nn)) {
mochi.as2.MochiAd.showClickAwayAd({clip:clickaway, id:"98ab6505dd49d609"});
clickaway._y = -1000;
}
function nav() {
_quality = "BEST";
var _local4 = 1;
while (_local4 <= 30) {
this["sea" + _local4].dispose();
_local4++;
}
adLoaded = false;
blacklines.clear();
blacklines.removeMovieClip();
resultPanel.congrats._visible = false;
resultPanel.tryagain._visible = false;
musicLooping = false;
gamePaused = 0;
gameInitied = 0;
finished = false;
delete magic.onEnterFrame;
adFinished = false;
iAmNotHost = 0;
totalAIs = 0;
playersCompleted = 0;
inGame = false;
_global.myRoom = false;
clearGame();
createEmptyMovieClip("ppp", getNextHighestDepth());
ppp.onEnterFrame = function () {
optionsPanel.lines.gotoAndStop(qualVal);
};
qualVal = 0;
lowQualGround.dispose();
optionsPanel.swapDepths(70);
optionsPanel.removeMovieClip();
lastRacer.swapDepths(70);
lastRacer.removeMovieClip();
countdown.gotoAndStop(1);
countdown.removeMovieClip();
countdown._visible = 0;
trackCar = 0;
initialisingValue = 0;
spriteRendering = "nope";
delete billBoards;
groundBmp.dispose();
delete groundBmp;
treesDrawn = 0;
delete wallLinks;
playersCompleted = 0;
gameInited = 0;
delete positions;
delete ai1;
delete ai2;
delete ai3;
delete player;
coloursKnown = 1;
ac = 0;
endRace = 0;
showVid = false;
levelsDone = 0;
resultPanel.gotoAndStop(1);
resultPanel._visible = 0;
lapnum = 0;
engine.stop();
crash.stop();
delete crash;
playersfx.removeMovieClip();
delete engine;
delete theObs;
delete onEnterFrame;
_root.game.removeMovieClip();
delete game;
_root.sky.removeMovieClip();
delete sky;
_root.fade.removeMovieClip();
_root.engine.stop();
_root.mrs.removeMovieClip();
_root.rain.removeMovieClip();
delete _root.engine;
_root.reflections.removeMovieClip();
_root.ground.removeMovieClip();
_root.objects.removeMovieClip();
delete ground;
delete objects;
_root.speedo.removeMovieClip();
_root.countDown.removeMovieClip();
_root.gotoAndStop("title");
}
nav();
function setCookie(username) {
cookie.data.lastUser = username;
if (!cookie.data["user" + username]) {
cookie.data["user" + username] = new Object();
cookie.data["user" + username].username = username;
cookie.data["user" + username].unlocked = 2;
unlocked = 2;
} else {
if (cookie.data["user" + lastUser].unlocked == 1) {
cookie.data["user" + lastUser].unlocked = 2;
}
unlocked = cookie.data["user" + username].unlocked;
}
}
function saveCookie(levelsDone) {
if (debugging != 1) {
if ((levelsDone + 1) > cookie.data["user" + username].unlocked) {
cookie.data["user" + username].unlocked = levelsDone + 1;
unlocked = levelsDone + 1;
}
}
}
function saveUnLock(levelsDone) {
if ((levelsDone + 1) > cookie.data["user" + username].unlocked) {
cookie.data["user" + username].unlocked = levelsDone + 1;
unlocked = levelsDone + 1;
}
}
function sendScores() {
_level1.d(username, totalTime, tracknum);
}
function p(what) {
scorePosition = int(what.s);
dayScore = int(what.d);
monthScore = int(what.m);
weekScore = int(what.w);
resultPanel.gotoAndStop(3);
}
function e() {
resultPanel.gotoAndStop(4);
}
levels = ["America", "Egypt", "France", "England", "Australia", "Switzerland"];
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
function clearGame() {
}
function glowButton(t, toGlow) {
if (toGlow) {
t.toGlow = toGlow;
} else {
t.toGlow = t;
}
t.toGlow.alphaTo = 0;
t.toGlow.alpha = 0;
t.onEnterFrame = function () {
if (this.toGlow.alpha < this.toGlow.alphaTo) {
this.toGlow.alpha = this.toGlow.alpha + 0.2;
}
if (this.toGlow.alpha > this.toGlow.alphaTo) {
this.toGlow.alpha = this.toGlow.alpha - 0.2;
}
if (this.toGlow.alpha > 0) {
this.toGlow.filters = [new flash.filters.GlowFilter(9385011, this.toGlow.alpha, 4, 4, 4, 1, false, false)];
} else {
this.toGlow.filters = [];
}
};
t.onRollOver = (t.onDragOver = function () {
this.toGlow.alphaTo = 1;
});
t.onRollOut = (t.onDragOut = function () {
this.toGlow.alphaTo = 0;
});
if (hit) {
t.hitArea = hit;
}
}
loggedInOnce = false;
instructions._visible = 0;
if (!game) {
game = createEmptyMovieClip("game", 200);
game.createEmptyMovieClip("objects", 3);
game.createEmptyMovieClip("walls", 4);
}
ytC.onEnterFrame = function () {
doStuff();
};
if (q) {
t1._y = t1._y + 39;
t2._visible = 0;
userCount._visible = 0;
}
if (levelHack) {
goto = 0;
gotoAndStop ("preload");
singlePlayer = 1;
unlocked = 5;
}
if (!musicMc) {
musicMc = createEmptyMovieClip("musicMc", 20);
audioMc = createEmptyMovieClip("audioMc", 21);
music = new Sound(musicMc);
audio = new Sound(audioMc);
}
musicMc.n = 100;
music.stop();
music.attachSound("musicloop");
music.start();
music.onSoundComplete = function () {
music.start();
};
Frame 5
function goTrack() {
if (usernameTF.text.length < 1) {
pleaseEnter._visible = 1;
} else {
if (usernameTF.text.toLowerCase() == "iloveham") {
cheat = 1;
debugging = 1;
unlocked = 5;
} else {
setCookie(usernameTF.text);
}
gotoAndStop ("preload");
}
}
pleaseEnter._visible = false;
back.onRelease = function () {
prevFrame();
};
glowButton(back);
selectTrack.onRelease = function () {
goTrack();
};
glowButton(selectTrack);
Frame 6
function checkLoaded() {
percentage.setValue(Math.round((100 / (preloadTo[2] - alreadyLoaded)) * (getBytesLoaded() - alreadyLoaded)));
if (getBytesLoaded() > preloadTo[2]) {
gotoAndStop ("track");
delete this.onEnterFrame;
}
}
alreadyLoaded = getBytesLoaded();
if (levelHack) {
gotoAndStop (17);
} else {
checkLoaded();
onEnterFrame = function () {
checkLoaded();
};
}
Frame 7
prevFrame();
Frame 17
delete enterFrame;
if (levelHack) {
tracknum = levelHack;
gotoAndStop ("loading");
}
var a = 1;
while (a <= unlocked) {
this["locked" + a]._visible = 0;
var b = this["bh" + a];
b.a = a;
glowButton(b, this["b" + a]);
b.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("trackSelected", this.a);
tracknum = this.a;
trackvids.ytplayer2.destroy();
trackvids.ytplayer2Loader.unloadClip();
trackvids.ytplayer2.swapDepths(trackvids.getNextHighestDepth());
trackvids.ytplayer2.removeMovieClip();
gotoAndStop ("select");
};
a++;
}
back.onRelease = function () {
gotoAndStop (5);
};
glowButton(back);
stop();
Frame 18
prevFrame();
Frame 20
red = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
green = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
blue = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
yellow = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
purple = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
cyan = [0, 0.5, 0.5, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
orange = [0.75, 0.25, 0, 0, 0, 0.25, 0.75, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
black = [0, 1.5, 0, 0, -64, 0, 1.5, 0, 0, -64, 0, 1.5, 0, 0, -64, 0, 0, 0, 1, 0];
tempcolours = [red, green, blue, yellow, purple, cyan, orange, black];
goRace.onRelease = function () {
gotoAndStop ("loading");
};
back.onRelease = function () {
gotoAndStop ("track");
};
glowButton(goRace);
glowButton(back);
Frame 21
prevFrame();
Frame 23
if (!nn) {
ng._visible = false;
}
function doClickAway() {
if ((!_root.sclk) || (_root.nn)) {
adOptions.ad_progress = doNothing;
adOptions.ad_finished = doNothing;
adOptions.ad_skipped = doNothing;
clickaway._y = 75;
hasLoaded = _root.getBytesLoaded() - 1;
loadRatio1 = 90;
if (_root.getBytesTotal() == _root.getBytesLoaded()) {
loadRatio1 = 1;
}
loadRatio2 = (100 - loadRatio1) / 100;
magic.onEnterFrame = function () {
var _local2 = ((loadRatio1 / (_root.getBytesTotal() - hasLoaded)) * (_root.getBytesLoaded() - hasLoaded)) + (initialisingValue * loadRatio2);
percentage.setValue(int(_local2));
if (int(_local2) == 100) {
percentage._visible = false;
loadingtext._visible = false;
clickplay._visible = true;
glowButton(clickplay);
clickplay.onRelease = function () {
adFinished = true;
};
}
};
} else {
magic.onEnterFrame = function () {
percentage.setValue(int(initialisingValue));
if (int(initialisingValue) == 100) {
adFinished = true;
}
};
}
}
function doNothing(percent) {
}
function doPercent(percent) {
percentage.setValue(int(percent * 0.95) + int(initialisingValue * 0.05));
}
clickplay._visible = false;
magic.onEnterFrame = function () {
};
var adLoaded = false;
adFailed = false;
var adOptions = {id:"98ab6505dd49d609", res:"550x400", no_progress_bar:true, no_bg:true, ad_progress:doPercent, ad_finished:function () {
if (!adFailed) {
adFinished = true;
}
}, ad_skipped:function () {
adFinished = true;
}, ad_started:function () {
}, ad_failed:function () {
adFailed = true;
timeOfAd = getTimer() - 300000;
doClickAway();
}, ad_loaded:function () {
musicMc.n = 100;
musicMc.onEnterFrame = function () {
music.setVolume((this.n = this.n - 2));
if (this.n <= 0) {
music.stop();
delete this.onEnterFrame;
}
};
adLoaded = true;
loadedAt = getTimer();
}};
if (((!levelHack) && (!_root.na)) && (!_root.nn)) {
if (!adShown) {
mochi.as2.MochiAd.showPreGameAd(adOptions);
adShown = true;
} else if ((getTimer() - timeOfAd) > 300000) {
timeOfAd = getTimer();
adOptions.ad_progress = doNothing;
magic.onEnterFrame = function () {
if (adLoaded) {
timer = ((getTimer() - loadedAt) / 10000) * 100;
if (timer > 100) {
timer = 100;
}
goValue = goValue + ((int(initialisingValue * 0.5) - goValue) * 0.05);
} else {
goValue = goValue + ((int(initialisingValue * 0.5) - goValue) * 0.005);
timer = 0;
}
percentage.setValue(int(timer * 0.5) + Math.round(goValue));
};
mochi.as2.MochiAd.showInterLevelAd(adOptions);
goValue = 0;
} else {
doClickAway();
}
} else {
sclk = true;
doClickAway();
}
function errorLoadingBillboard(which) {
this["boardMC" + which.a].done = "yep";
bb[which.n][0] = defaultBillboards[which.n][0];
bb[which.n][1] = defaultBillboards[which.n][1];
}
function checkLoaded() {
totalLoaded = 0;
var _local3 = 1;
while (_local3 <= 2) {
if (this["boardMC" + _local3] && (this["boardMC" + _local3].done != "yep")) {
var _local4 = this["loader" + _local3].getProgress(this["boardMC" + _local3].loady);
if (this["boardMC" + _local3].getBytesTotal() > 50) {
if (this["boardMC" + _local3].getBytesTotal() == this["boardMC" + _local3].getBytesLoaded()) {
this["board" + _local3] = _level1.b(_local3);
totalLoaded++;
}
}
} else {
totalLoaded++;
}
_local3++;
}
if ((_root.getBytesTotal() == _root.getBytesLoaded()) && (totalLoaded == 2)) {
_root.gotoAndStop("init");
}
}
loadCheck = createEmptyMovieClip("loadCheck", 857);
alreadyLoaded = getBytesLoaded();
totalToLoad = 0;
var a = 1;
while (a <= 2) {
var n = (((tracknum * 2) + a) - 3);
if ((substring(bb[n][0], 1, 1)) != "b") {
var filename = (substring(bb[n][0], 2, -1));
var fileType = (substring(bb[n][0], 1, 1));
if (fileType == "j") {
file = (this["ap" + (n + 1)] + filename) + ".jpg";
}
if (fileType == "g") {
file = (this["ap" + (n + 1)] + filename) + ".gif";
}
if (fileType == "p") {
file = (this["ap" + (n + 1)] + filename) + ".png";
}
totalToLoad++;
var loader = ((this["loader" + a] = new MovieClipLoader()));
var mclListener = ((this["listener" + a] = new Object()));
mclListener.n = n;
mclListener.a = a;
this["boardMC" + a] = _level1.i(file, a, mclListener);
mclListener.onLoadError = function (_mc, errorCode) {
errorLoadingBillboard(this);
};
this["boardMC" + a]._x = -2000;
}
a++;
}
checkLoaded();
loadCheck.onEnterFrame = function () {
checkLoaded();
};
function startMusic() {
musicLooping = true;
music.stop();
music.attachSound("rally");
music.start();
music.setVolume(100);
music.onSoundComplete = function () {
music.start(11.284);
};
}
function loopMusic() {
if (musicLooping != true) {
if (musicMc.n <= 0) {
startMusic();
} else {
musicMc.onEnterFrame = function () {
music.setVolume((this.n = this.n - 2));
if (this.n <= 0) {
startMusic();
delete this.onEnterFrame;
}
};
}
}
}
function startEngine() {
engine.stop();
delete engine;
engine = new Sound(game.objects);
engine.attachSound("idle");
engine.start();
engine.setVolume(50);
engine.onSoundComplete = function () {
engine.attachSound("idle");
engine.start(0, 9999);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(50);
}
};
startAt = 0;
slowing = 0;
gear = 0;
}
function accelerate() {
moving = 1;
if (grassplaying == 1) {
if (slowOnGrass) {
slowOnGrass = 0;
slowing = 0;
engine.stop();
wasGrass = true;
engine.attachSound("ongrass");
engine.start(0, 9999);
slowing = 1;
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(50);
}
}
} else {
slowOnGrass = 1;
if (accel != 1) {
gear++;
startAt = 0;
if (slowing == 1) {
startAt = (engine.duration - engine.position) / 1000;
if (wasGrass) {
wasGrass = false;
startAt = 0.908;
}
slowing = 0;
}
engine.stop();
accel = 1;
engine.attachSound("accel");
engine.start(startAt);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(50);
}
engine.onSoundComplete = function () {
slowing = 0;
fullspeed = 1;
engine.attachSound("fullspeed");
engine.start(0, 9999);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(50);
}
};
}
}
}
function decelerate() {
if (moving != 1) {
if (gear > 0) {
gear = 0;
slowing = 1;
var _local2 = engine.duration - engine.position;
if (fullspeed == 1) {
fullspeed = 0;
_local2 = 0;
}
accel = 0;
engine.stop();
engine.attachSound("decel");
engine.start(_local2 / 1000);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(50);
}
engine.onSoundComplete = function () {
slowing = 0;
engine.attachSound("idle");
engine.start(0, 9999);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(50);
}
};
}
}
}
function brake() {
if (accel == 1) {
engine.stop();
accel = 0;
engine.attachSound("idle");
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(50);
}
engine.start();
}
}
slowOnGrass = 0;
Frame 24
prevFrame();
Frame 26
function initBalls() {
}
function sortBall(ball) {
var _local8 = this;
var _local24 = game.objects;
var _local16 = ball.xpos + _local8._xcam;
var _local14 = ball.ypos + _local8._zcam;
var _local12 = Math.sqrt((_local16 * _local16) + (_local14 * _local14));
if (_local12 < 20) {
ball.my = ((-(_local8._zcam - _local8.oy)) * 1.2) + (ball.my * -0.6);
ball.mx = ((-(_local8._xcam - _local8.ox)) * 1.2) + (ball.mx * -0.6);
var _local15 = 20 / _local12;
ball.xpos = (-_local8._xcam) + ((ball.xpos + _local8._xcam) * _local15);
ball.ypos = (-_local8._zcam) + ((ball.ypos + _local8._zcam) * _local15);
_local8.speed = _local8.speed * 0.6;
}
ball.oz = ball.ypos;
ball.ox = ball.xpos;
ball.ypos = ball.ypos + ball.my;
ball.xpos = ball.xpos + ball.mx;
ball.mx = ball.mx * 0.98;
ball.my = ball.my * 0.98;
var _local23 = int(ball.xpos / 8) + 128;
var _local22 = int(ball.ypos / 8) + 128;
var _local10 = int(ball.xpos / 32) + 32;
var _local9 = int(ball.ypos / 32) + 32;
var _local17 = false;
if ((ball.ax != _local10) || (ball.ay != _local9)) {
_local17 = true;
}
if (game.mapArray[_local23][_local22][0] == 3) {
ball.mx = ball.mx * -1;
ball.my = ball.my * -1;
ball.ypos = ball.ypos + ball.my;
ball.xpos = ball.xpos + ball.mx;
}
sortObject(ball);
if (((ball._x > -50) && (ball._x < 600)) && (ball._y < (550 + ball._height))) {
if (_local17) {
var _local3 = 0;
while (_local3 < objectArray[ball.ax][ball.ay].length) {
if (objectArray[ball.ax][ball.ay][_local3] == ball) {
objectArray[ball.ax][ball.ay].splice(_local3, 1);
break;
}
_local3++;
}
ball.ax = _local10;
ball.ay = _local9;
objectArray[_local10][_local9].push(ball);
ball.apos = objectArray[_local10][_local9].length - 1;
}
var _local7 = ball;
var _local5 = objectArray[_local7.ax][_local7.ay];
var _local4 = 0;
while (_local4 < _local5.length) {
if (_local7 != _local5[_local4]) {
var _local6 = _local5[_local4];
checkColl(_local7, _local6);
}
_local4++;
}
if (ball.fly < 0) {
ball.fly = 0;
}
var _local11 = (-_local8._angleY) - 90;
var _local19 = Math.cos((_local11 * Math.PI) / 180) * (ball.oz - ball.ypos);
var _local18 = Math.sin((_local11 * Math.PI) / 180) * (ball.oz - ball.ypos);
var _local21 = Math.cos((_local11 * Math.PI) / 180) * (ball.ox - ball.xpos);
var _local20 = Math.sin((_local11 * Math.PI) / 180) * (ball.ox - ball.xpos);
var _local13 = Math.atan2(_local18 + _local21, _local19 + _local20);
_local16 = ball.xpos - ball.ox;
_local14 = ball.ypos - ball.oz;
_local12 = Math.sqrt((_local16 * _local16) + (_local14 * _local14));
ball.rot._rotation = ball.rot._rotation - ((Math.cos(_local13) * _local12) * 3.142);
ball.rot.texture._y = ball.rot.texture._y + ((Math.cos((ball.rot._rotation * Math.PI) / 180) * Math.sin(_local13)) * (-_local12));
ball.rot.texture._x = ball.rot.texture._x + ((Math.sin((ball.rot._rotation * Math.PI) / 180) * Math.sin(_local13)) * (-_local12));
while (ball.rot.texture._y < -40) {
ball.rot.texture._y = ball.rot.texture._y + 80;
}
while (ball.rot.texture._y > 40) {
ball.rot.texture._y = ball.rot.texture._y - 80;
}
while (ball.rot.texture._x < -80) {
ball.rot.texture._x = ball.rot.texture._x + 160;
}
while (ball.rot.texture._x > 80) {
ball.rot.texture._x = ball.rot.texture._x - 160;
}
}
}
function checkColl(b1, b2) {
var _local4 = b2.xpos - b1.xpos;
var _local3 = b2.ypos - b1.ypos;
var _local10 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (_local10 < (b1.rad + b2.rad)) {
var _local9 = b1.xpos - b1.ox;
var _local7 = b2.xpos - b2.ox;
var _local6 = b2.ypos - b2.oz;
var _local8 = b1.ypos - b1.oz;
var _local5 = Math.atan2(_local3, _local4);
cosa = Math.cos(_local5);
sina = Math.sin(_local5);
volx1p = (cosa * _local9) + (sina * _local8);
voly1p = (cosa * _local8) - (sina * _local9);
volx2p = (cosa * _local7) + (sina * _local6);
voly2p = (cosa * _local6) - (sina * _local7);
var _local12 = (volx1p * b1.mass) + (volx2p * b2.mass);
var _local11 = volx1p - volx2p;
volx1p = (_local12 - (b2.mass * _local11)) / (b1.mass + b2.mass);
volx2p = _local11 + volx1p;
b1.mx = (cosa * volx1p) - (sina * voly1p);
b1.my = (cosa * voly1p) + (sina * volx1p);
b2.mx = (cosa * volx2p) - (sina * voly2p);
b2.my = (cosa * voly2p) + (sina * volx2p);
diff = ((b1.rad + b2.rad) - _local10) / 2;
cosd = cosa * diff;
sind = sina * diff;
b1.xpos = b1.xpos - cosd;
b1.ypos = b1.ypos - sind;
b2.xpos = b2.xpos + cosd;
b2.ypos = b2.ypos + sind;
}
}
function addBillBoards(num) {
var _local5 = game.objects;
var _local2 = 0;
while (_local2 < billBoards.length) {
var _local4 = _local2 + 90;
var _local1 = (_local5["bp" + _local4] = new Object());
_local1.id = _local4;
_local1.xpos = (billBoards[_local2][0] * 8) - 1024;
_local1.ypos = (billBoards[_local2][1] * 8) - 1024;
_local1.p1 = new Object();
_local1.p2 = new Object();
_local1.p1.xpos = (billBoards[_local2][0] * 8) - 1024;
_local1.p1.ypos = (billBoards[_local2][1] * 8) - 1024;
_local1.p2.xpos = (billBoards[_local2][2] * 8) - 1024;
_local1.p2.ypos = (billBoards[_local2][3] * 8) - 1024;
_local1.p1.height = 100;
_local1.p2.height = 100;
var _local3 = 0;
while (_local3 <= 50) {
uniqueDepth++;
_local1["mc" + _local3] = _local5.createEmptyMovieClip("bp_sec" + uniqueDepth, uniqueDepth);
_local3++;
}
_local1.oT = 0;
drawHit(billBoards[_local2][0], billBoards[_local2][1], billBoards[_local2][2], billBoards[_local2][3], rn);
_local2++;
}
}
function drawHit(p1x, p1y, p2x, p2y, rn) {
var _local2 = p1x - p2x;
var _local1 = p1y - p2y;
if (Math.abs(_local1) > Math.abs(_local2)) {
if (_local1 > 0) {
var _local5 = 0;
while (_local5 <= _local1) {
var _local6 = p1y - _local5;
var _local7 = p1x - ((_local5 * _local2) / _local1);
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local6 = p1y - _local5;
_local7 = (p1x - ((_local5 * _local2) / _local1)) + 1;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local6 = p1y - _local5;
_local7 = (p1x - ((_local5 * _local2) / _local1)) - 1;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local5++;
}
} else {
var _local5 = _local1;
while (_local5 <= 0) {
var _local6 = p1y - _local5;
var _local7 = p1x - ((_local5 * _local2) / _local1);
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local6 = p1y - _local5;
_local7 = (p1x - ((_local5 * _local2) / _local1)) - 1;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local6 = p1y - _local5;
_local7 = (p1x - ((_local5 * _local2) / _local1)) + 1;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local5++;
}
}
} else if (_local2 > 0) {
var _local5 = 0;
while (_local5 <= _local2) {
var _local6 = p1y - ((_local5 * _local1) / _local2);
var _local7 = p1x - _local5;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local6 = (p1y - ((_local5 * _local1) / _local2)) + 1;
_local7 = p1x - _local5;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local6 = (p1y - ((_local5 * _local1) / _local2)) - 1;
_local7 = p1x - _local5;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local5++;
}
} else {
var _local5 = _local2;
while (_local5 <= 0) {
var _local6 = p1y - ((_local5 * _local1) / _local2);
var _local7 = p1x - _local5;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local6 = (p1y - ((_local5 * _local1) / _local2)) - 1;
_local7 = p1x - _local5;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local6 = (p1y - ((_local5 * _local1) / _local2)) + 1;
_local7 = p1x - _local5;
game.mapArray[int(_local7)][int(_local6)] = [3, 180];
_local5++;
}
}
}
function checkPoints(p, num, bg, bp) {
if (qualVal <= 2) {
bg = bg * (4 - qualVal);
}
var _local1 = billPoints[p];
var _local2 = billPoints[p + 1];
var _local4 = -1;
if ((_local1.x > 0) or (_local2.x > 0)) {
_local4++;
}
if ((_local1.x < 550) or (_local2.x < 550)) {
_local4++;
}
if (((Math.abs(_local1.height - _local2.height) > ((billPoints.length * players) * bg)) and (Math.abs(_local1.x - _local2.x) > ((50 * players) * bg))) and (_local4 == 1)) {
billPoints.splice(p + 1, 0, {});
var _local3 = billPoints[p + 1];
_local3.xpos = _local1.xpos + ((_local2.xpos - _local1.xpos) / 2);
_local3.ypos = _local1.ypos + ((_local2.ypos - _local1.ypos) / 2);
_local3.pos = (_local2.pos + _local1.pos) / 2;
sortPoint(_local3, num);
} else {
cpk++;
}
}
function sortBillboard(num) {
var _local25 = game.objects;
var _local8 = 0;
while (_local8 < billBoards.length) {
var _local20 = ((tracknum * 2) + _local8) - 2;
var _local11 = 0;
var _local23 = _local8 + 90;
var _local4 = _local25["bp" + _local23];
_local4.p1.pos = 0;
_local4.p2.pos = 1;
sortPoint(_local4.p1, num);
sortPoint(_local4.p2, num);
var _local10 = _local4.p1.height + _local4.p2.height;
if (_local10 < 64) {
_local11 = 1;
}
if (_local10 < 32) {
_local11 = 2;
}
var _local19 = false;
if ((_local4.p1.x > 0) && (_local4.p1.x < 550)) {
_local19 = true;
}
if ((_local4.p2.x > 0) && (_local4.p2.x < 550)) {
_local19 = true;
}
if (mergeMipmaps && (_local19)) {
if ((_local10 >= 32) && (_local10 <= 128)) {
var _local12 = boardImages[_local8][3];
if (_local10 < 64) {
_local12 = boardImages[_local8][2].clone();
var _local17 = 7.96875 * (_local10 - 32);
_local12.merge(boardImages[_local8][1], _local12.rectangle, new flash.geom.Point(0, 0), _local17, _local17, _local17, _local17);
} else {
_local12 = boardImages[_local8][1].clone();
var _local17 = 3.984375 * (_local10 - 63);
_local12.merge(boardImages[_local8][0], _local12.rectangle, new flash.geom.Point(0, 0), _local17, _local17, _local17, _local17);
}
boardImages[_local8][3] = _local12;
_local11 = 3;
}
}
billPoints = [_local4.p1, _local4.p2];
cpk = 0;
if (_local4.p2.x > _local4.p1.x) {
while ((cpk < (billPoints.length - 1)) and (cpk < 50)) {
checkPoints(cpk, num, 1);
}
if (cpk > 45) {
}
var _local24 = 0;
var _local7 = 0;
while (_local7 <= _local4.oT) {
_local4["mc" + _local7].clear();
_local7++;
}
_local4.oT = billPoints.length - 1;
_local7 = 0;
while (_local7 < (billPoints.length - 1)) {
_local4["mc" + _local7].link = bb[_local20][1];
_local4["mc" + _local7].onRelease = function () {
_root.gamePaused = 1;
_root.pausedGame._visible = true;
getURL (this.link, "_blank");
};
var _local3 = billPoints[_local7];
var _local5 = billPoints[_local7 + 1];
var _local14 = {x:_local3.x, y:_local3.y};
var _local18 = {x:_local5.x, y:_local5.y};
if (_local14.x < _local18.x) {
img = boardImages[_local8][_local11];
} else {
img = boardbg;
}
var _local9 = -1;
if ((_local14.x > 0) or (_local18.x > 0)) {
_local9++;
}
if ((_local14.x < 550) or (_local18.x < 550)) {
_local9++;
}
if ((_local3.visible == 0) or (_local5.visible == 0)) {
_local9 = 0;
}
var _local6 = 300;
if (levelSelected == 2) {
_local6 = 1000;
}
if (_local9 == 1) {
dm.push([(_local3.y + _local5.y) / 2, _local4["mc" + _local7]]);
if (billPoints.length < 5) {
var _local13 = {x:_local5.x, y:_local5.y - (_local5.height * 2)};
var _local16 = {x:_local3.x, y:_local3.y - (_local3.height * 2)};
drawSTriangle(_local4["mc" + _local7], _local14, _local18, _local13, 1, 1 / (_local5.pos - _local3.pos), _local6 * _local3.pos, 1, 0, img, _local6);
drawSTriangle(_local4["mc" + _local7], _local14, _local16, _local13, 0, 1 / (_local5.pos - _local3.pos), _local6 * _local3.pos, 1, 0, img, _local6);
} else {
var _local13 = {x:_local5.x, y:_local5.y - _local5.height};
var _local16 = {x:_local3.x, y:_local3.y - _local3.height};
drawSTriangle(_local4["mc" + _local7], _local14, _local18, _local13, 1, 1 / (_local5.pos - _local3.pos), _local6 * _local3.pos, 2, 0, img, _local6);
drawSTriangle(_local4["mc" + _local7], _local14, _local16, _local13, 0, 1 / (_local5.pos - _local3.pos), _local6 * _local3.pos, 2, 0, img, _local6);
_local14 = {x:_local3.x, y:_local3.y - _local3.height};
_local18 = {x:_local5.x, y:_local5.y - _local5.height};
_local13 = {x:_local5.x, y:_local5.y - (_local5.height * 2)};
_local16 = {x:_local3.x, y:_local3.y - (_local3.height * 2)};
drawSTriangle(_local4["mc" + _local7], _local14, _local18, _local13, 1, 1 / (_local5.pos - _local3.pos), _local6 * _local3.pos, 2, 64, img, _local6);
drawSTriangle(_local4["mc" + _local7], _local14, _local16, _local13, 0, 1 / (_local5.pos - _local3.pos), _local6 * _local3.pos, 2, 64, img, _local6);
}
}
_local7++;
}
} else {
var _local7 = 0;
while (_local7 <= _local4.oT) {
_local4["mc" + _local7].clear();
_local7++;
}
_local4.oT = 0;
if (levelSelected == 1) {
img = boardbg;
while ((cpk < (billPoints.length - 1)) and (cpk < 50)) {
checkPoints(cpk, num, 3);
}
if (cpk > 45) {
}
_local4.oT = billPoints.length - 1;
_local7 = billPoints.length - 1;
while (_local7 > 0) {
uniqueDepth++;
var _local3 = billPoints[_local7];
var _local5 = billPoints[_local7 - 1];
var _local14 = {x:_local3.x, y:_local3.y};
var _local18 = {x:_local5.x, y:_local5.y};
if (_local14.x < _local18.x) {
img = boardbg;
} else {
img = boardImages[_local8][_local11];
}
var _local9 = -1;
if ((_local14.x > 0) or (_local18.x > 0)) {
_local9++;
}
if ((_local14.x < 550) or (_local18.x < 550)) {
_local9++;
}
if ((_local3.visible == 0) or (_local5.visible == 0)) {
_local9 = 0;
}
if (_local9 == 1) {
dm.push([(_local3.y + _local5.y) / 2, _local4["mc" + _local7]]);
if (billPoints.length < 5) {
var _local13 = {x:_local5.x, y:_local5.y - (_local5.height * 2)};
var _local16 = {x:_local3.x, y:_local3.y - (_local3.height * 2)};
drawSTriangle(_local4["mc" + _local7], _local14, _local18, _local13, 1, 1 / (_local5.pos - _local3.pos), 300 * _local3.pos, 1, 0, img, 300);
drawSTriangle(_local4["mc" + _local7], _local14, _local16, _local13, 0, 1 / (_local5.pos - _local3.pos), 300 * _local3.pos, 1, 0, img, 300);
} else {
var _local13 = {x:_local5.x, y:_local5.y - _local5.height};
var _local16 = {x:_local3.x, y:_local3.y - _local3.height};
drawSTriangle(_local4["mc" + _local7], _local14, _local18, _local13, 1, 1 / (_local5.pos - _local3.pos), 300 * _local3.pos, 2, 0, img, 300);
drawSTriangle(_local4["mc" + _local7], _local14, _local16, _local13, 0, 1 / (_local5.pos - _local3.pos), 300 * _local3.pos, 2, 0, img, 300);
_local14 = {x:_local3.x, y:_local3.y - _local3.height};
_local18 = {x:_local5.x, y:_local5.y - _local5.height};
_local13 = {x:_local5.x, y:_local5.y - (_local5.height * 2)};
_local16 = {x:_local3.x, y:_local3.y - (_local3.height * 2)};
drawSTriangle(_local4["mc" + _local7], _local14, _local18, _local13, 1, 1 / (_local5.pos - _local3.pos), 300 * _local3.pos, 2, 64, img, 300);
drawSTriangle(_local4["mc" + _local7], _local14, _local16, _local13, 0, 1 / (_local5.pos - _local3.pos), 300 * _local3.pos, 2, 64, img, 300);
}
}
_local7--;
}
}
}
_local8++;
}
}
function sortPoint(ob, num, brother) {
var _local4 = Math.sin;
var _local6 = Math.cos;
var _local5 = _xcam + ob.xpos;
var _local3 = _zcam + ob.ypos;
var _local2 = ((-_angleY) * Math.PI) / 180;
tx = (_local3 * _local4(_local2)) + (_local5 * _local6(_local2));
ty = ((_local3 * _local6(_local2)) - (_local5 * _local4(_local2))) + 70;
ob.visible = 1;
if (ty < 0) {
ob.visible = 0;
ty = -ty;
}
ob.y = (550 * (20 / ty)) + 200;
var _local7 = ob.y - ((550 * (-10 / ty)) + 200);
ob.height = _local7 * 0.7;
ob.x = (500 * (tx / ty)) + 275;
}
levelSelected = 1;
players = 1;
boardFrame = flash.display.BitmapData.loadBitmap("frame");
boardImages = [];
var a = 1;
while (a <= 2) {
var boardMat = (new flash.geom.Matrix());
boardMat.tx = 3;
boardMat.ty = 3;
var n = (((tracknum * 2) + a) - 3);
if ((substring(bb[n][0], 1, 1)) == "b") {
this["board" + a] = flash.display.BitmapData.loadBitmap(bb[n][0]);
}
boardImages.push([]);
var bmp = (new flash.display.BitmapData(300, 128, true, 0));
boardImages[a - 1].push(bmp);
bmp.draw(this["board" + a], boardMat);
bmp.draw(boardFrame);
var oldQ = _quality;
_quality = "BEST";
var b = 1;
while (b <= 2) {
var temp = (new flash.display.BitmapData(150 / b, 64 / b, true, 0));
boardMat.identity();
boardMat.scale(1 / (b * 2), 1 / (b * 2));
temp.draw(bmp, boardMat, null, null, null, true);
var bmp2 = (new flash.display.BitmapData(300, 128, true, 0));
boardMat.identity();
boardMat.scale(b * 2, b * 2);
bmp2.draw(temp, boardMat, null, null, null, true);
temp.dispose();
boardImages[a - 1].push(bmp2);
b++;
}
boardImages[a - 1].push(new flash.display.BitmapData(300, 128, true, 0));
_quality = oldQ;
a++;
}
boardbg = flash.display.BitmapData.loadBitmap("boardbg");
links = ["http://percypea.co.uk/fidi.html?link=buggy", "http://percypea.co.uk/fidi.html?link=buggy", "http://percypea.co.uk/fidi.html?link=buggy", "http://percypea.co.uk/fidi.html?link=buggy"];
function drawSTriangle(container, a1, a2, a3, t, sx, rx, sy, ry, img, w, mipmap, linkNum) {
if (w == 150) {
var _local7 = 64;
} else {
var _local7 = 128;
}
if (mipmap == 1) {
img = fence1;
var _local7 = _local7 / 2;
w / 2;
rx = rx / 2;
sx = sx * 2;
}
if (mipmap == 2) {
img = fence2;
var _local7 = _local7 / 4;
w / 4;
rx = rx / 4;
sx = sx * 4;
}
if (mipmap == 3) {
img = fence3;
var _local7 = _local7 / 8;
w / 8;
rx = rx / 8;
sx = sx * 8;
}
var _local1 = a1.x;
var _local4 = a1.y;
var _local14 = a2.x;
var _local3 = a2.y;
var _local5 = a3.x;
var _local8 = a3.y;
if (t == 1) {
a2 = _local5 - _local1;
var _local11 = _local3 - _local4;
var _local16 = _local3 - _local8;
} else {
a2 = _local5 - _local1;
var _local11 = _local8 - _local3;
var _local16 = _local4 - _local3;
}
tri.a = Math.abs(a2) / (w / sx);
tri.d = Math.abs(_local16) / (_local7 / sy);
if (_local5 > _local1) {
tri.b = _local11 / (w / sx);
} else {
tri.b = (-_local11) / (w / sx);
}
tri.tx = _local1;
tri.ty = _local4;
tri.tx = _local1 - (rx * tri.a);
tri.ty = (_local4 - (rx * tri.b)) - (ry * tri.d);
tri.c = 0;
if (w == 150) {
if ((a2 < 0) and (tracknum == 3)) {
tri.a = tri.a * -1;
tri.b = tri.b * -1;
}
}
container.beginBitmapFill(img, tri, true, false);
container.moveTo(_local1, _local4);
container.lineTo(_local14, _local3);
container.lineTo(_local5, _local8);
container.endFill();
}
tri = new flash.geom.Matrix();
function createGround() {
tttt = attachMovie("track" + tracknum, "track", 99);
tttt._visible = 0;
var _local1 = 1;
billBoards = [];
while (tttt["board" + _local1]) {
var _local3 = int(tttt["board" + _local1]._x / 8);
var _local2 = int(tttt["board" + _local1]._y / 8);
var _local4 = ((tttt["board" + _local1]._rotation + 90) * Math.PI) / 180;
var _local5 = tttt["board" + _local1]._rotation;
tttt["board" + _local1]._rotation = 90;
var _local7 = int(_local3 + ((Math.cos(_local4) * tttt["board" + _local1]._width) / 8));
var _local6 = int(_local2 + ((Math.sin(_local4) * tttt["board" + _local1]._width) / 8));
tttt["board" + _local1]._rotation = _local5;
billBoards.push([_local3, _local2, _local7, _local6]);
tttt["board" + _local1]._y = int(tttt["board" + _local1]._y / 8) * 8;
tttt["board" + _local1]._x = int(tttt["board" + _local1]._x / 8) * 8;
_local1++;
}
var _local10 = getTimer();
trackBMP = new flash.display.BitmapData(148, 148, true, 0);
var _local8 = new flash.geom.Matrix();
_local8.tx = tttt.m._x + 40;
_local8.ty = tttt.m._y + 40;
if (tracknum != 5) {
var _local9 = [];
_local9.push(tttt.m.filters[0]);
tttt.m.filters = [];
_local8.scale(0.05, 0.05);
trackBMP.draw(tttt.m, _local8);
tttt.m.filters = _local9;
} else {
_local8.scale(0.05, 0.05);
trackBMP.draw(tttt.m, _local8);
tttt.m._visible = false;
}
trackBMP.applyFilter(trackBMP, trackBMP.rectangle, new flash.geom.Point(0, 0), new flash.filters.ColorMatrixFilter([0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 1, 0]));
trackBMP.applyFilter(trackBMP, trackBMP.rectangle, new flash.geom.Point(0, 0), new flash.filters.GlowFilter(16777215, 4, 2, 2, 4, 3, false, false));
groundBmp.dispose();
groundBmp = new flash.display.BitmapData(2880, 2880, true, 0);
}
function initCars() {
var _local6 = game.objects;
var _local3 = 1;
while (_local3 <= totalAI) {
var _local2 = _local6["ai" + _local3];
_local2.topSpeed = this[("level" + tracknum) + "Speeds"][0] - (_local3 * this[("level" + tracknum) + "Speeds"][2]);
_local2.accel = this[("level" + tracknum) + "Speeds"][1] - (this[("level" + tracknum) + "Speeds"][3] * _local3);
_local2.pushed = 0;
_local2.pushx = 0;
_local2.pushy = 0;
_local2.speed = 0;
_local2.checkPointReached = 2;
_local2.lapnum = 0;
_local2.pos = -1;
_local2.ang = (-_angleY) + 180;
_local2.isAi = 1;
_local2.aiNum = _local3 - 1;
nextPos(_local2);
_local2.timerl = 200;
_local2.myFilter = new flash.filters.ColorMatrixFilter(colours[_local3 - 1]);
_local2.dot = speedo.attachMovie("nav", dot + _local3, _local3);
_local2.dot.filters = [_local2.myFilter];
_local2.dot.gotoAndStop(1);
_local2.filters = [_local2.myFilter];
_local2.rad = 10;
var _local5 = int(_local2.xpos / scalePos) + (1024 / scalePos);
var _local4 = int(_local2.ypos / scalePos) + (1024 / scalePos);
_local2.ax = int(_local2.xpos / 32) + 32;
_local2.ay = int(_local2.ypos / 32) + 32;
_local2.dot._x = ((-_local5) / 2.5) - 297;
_local2.dot._y = (_local4 / 2.5) - 263;
sortObject(_local2);
_local2._y = _local2._y + (((_local2.pixel / 6) * _local2._xscale) / 100);
_local2.ox = _local2.xpos;
_local2.oz = _local2.ypos;
_local2.mass = 5;
_local2.bob = maskCar;
_local3++;
}
speedo.reddot.swapDepths(8);
}
function nextPos(car) {
car.pos++;
if (car.pos >= (cArray.length - 1)) {
car.pos = 0;
}
if (cArray[car.pos][0][0]) {
if (!car.pathSplit) {
car.pathSplit = random(cArray[car.pos].length) + 1;
}
} else {
car.pathSplit = 0;
}
if (car.pathSplit > 0) {
car.goalX = (cArray[car.pos][car.pathSplit - 1][0] * scalePos) - 1024;
car.goalY = (cArray[car.pos][car.pathSplit - 1][1] * scalePos) - 1024;
car.dx = car.xpos - car.goalX;
car.dy = car.ypos - car.goalY;
} else {
car.goalX = (cArray[car.pos][0] * scalePos) - 1024;
car.goalY = (cArray[car.pos][1] * scalePos) - 1024;
}
if (tracknum != 4) {
car.goalX = car.goalX + ((random(20) - 10) * 4);
car.goalY = car.goalY + ((random(20) - 10) * 4);
}
car.dx = car.xpos - car.goalX;
car.dy = car.ypos - car.goalY;
car.dz = Math.sqrt((car.dx * car.dx) + (car.dy * car.dy));
car.ra = 0;
car.posCount = 0;
var _local2 = car.dz / 120;
if (_local2 > 1) {
_local2 = 1;
}
_local2 = 1;
car.mt = 1;
car.maxspeed = car.topSpeed * _local2;
}
function moveCars(m) {
var _local3 = 1;
while (_local3 <= (totalAI + endRace)) {
var _local1 = game.objects["ai" + _local3];
_local1.timerl++;
if (ac == 1) {
if (_local1.speed < _local1.maxspeed) {
_local1.speed = _local1.speed + _local1.accel;
}
if ((_local1.speed - _local1.breaking) > _local1.maxspeed) {
_local1.speed = _local1.speed - _local1.breaking;
}
_local1.dx = _local1.xpos - _local1.goalX;
_local1.dy = _local1.ypos - _local1.goalY;
_local1.oldang = _local1.ang;
_local1.angG = ((Math.atan2(_local1.dy, _local1.dx) * 180) / Math.PI) - 90;
_local1.adjustG = 0.05;
_local1.adjustA = 0.7;
checkCars(_local1);
while (_local1.angG > (_local1.ang + 180)) {
_local1.angG = _local1.angG - 360;
}
while (_local1.angG < (_local1.ang - 180)) {
_local1.angG = _local1.angG + 360;
}
_local1.rg = (_local1.angG - _local1.ang) * _local1.adjustG;
_local1.ra = _local1.ra + _local1.rg;
_local1.ra = _local1.ra * _local1.adjustA;
_local1.ang = _local1.ang + _local1.ra;
_local1.posCount = _local1.posCount + _local1.speed;
checkCarPos(_local1);
_local1.velx = -(_local1.xpos - _local1.ox);
_local1.vely = -(_local1.ypos - _local1.oz);
_local1.ox = _local1.xpos;
_local1.oz = _local1.ypos;
_local1.xpos = _local1.xpos + ((Math.sin((_local1.ang * Math.PI) / 180) * _local1.speed) + Math.cos((_local1.ang * Math.PI) / 180));
_local1.ypos = _local1.ypos - ((Math.cos((_local1.ang * Math.PI) / 180) * _local1.speed) + Math.sin((_local1.ang * Math.PI) / 180));
if (_local1.posCount >= _local1.dz) {
nextPos(_local1);
}
}
var _local5 = int(_local1.xpos / 32) + 32;
var _local4 = int(_local1.ypos / 32) + 32;
var _local6 = false;
if ((_local1.ax != _local5) || (_local1.ay != _local4)) {
_local6 = true;
}
if (_local6) {
var _local2 = 0;
while (_local2 < objectArray[_local1.ax][_local1.ay].length) {
if (objectArray[_local1.ax][_local1.ay][_local2] == _local1) {
objectArray[_local1.ax][_local1.ay].splice(_local2, 1);
break;
}
_local2++;
}
_local1.ax = _local5;
_local1.ay = _local4;
objectArray[_local5][_local4].push(_local1);
}
_local1.pushx = _local1.pushx * groundFriction;
_local1.pushy = _local1.pushy * groundFriction;
_local1.xpos = _local1.xpos + _local1.pushx;
_local1.ypos = _local1.ypos + _local1.pushy;
sortObject(_local1);
_local1._y = _local1._y + (((_local1.pixel / 6) * _local1._xscale) / 100);
_local1.car.w1.r._rotation = _local1.car.w1.r._rotation - (_local1.speed * 5);
_local1.car.w2.r._rotation = _local1.car.w2.r._rotation - (_local1.speed * 5);
_local1.car2.w1.r._rotation = _local1.car.w1.r._rotation;
_local1.car2.w2.r._rotation = _local1.car.w2.r._rotation;
_local3++;
}
}
function checkCarPos(car) {
var _local7 = int(car.ox / scalePos) + (1024 / scalePos);
var _local6 = int(car.oz / scalePos) + (1024 / scalePos);
var _local5 = int(car.xpos / scalePos) + (1024 / scalePos);
var _local4 = int(car.ypos / scalePos) + (1024 / scalePos);
var _local9 = _local7 + ((_local5 - _local7) / 2);
var _local12 = _local6 + ((_local4 - _local6) / 2);
var _local11 = int(_local9);
var _local10 = int(_local12);
var _local8 = _root.mapArray[_local11][_local10];
var _local3 = _root.mapArray[_local5][_local4];
car.dot._x = ((-_local5) / 2.5) - 297;
car.dot._y = (_local4 / 2.5) - 263;
if (_local3 == undefined) {
_local3 = 1;
}
if ((((_local3 == 0) or (_local3 == 4)) or (_local3 == 6)) or (_local3 == 8)) {
car.maxspeed = 5;
car.breaking = 0.2;
car.offroad = 1;
} else {
car.maxspeed = car.topSpeed;
car.offroad = 0;
}
if ((((_local3 == 8) or (_local3 == 9)) or (_local8 == 8)) or (_local8 == 9)) {
if (car.timerl > 200) {
car.timerl = 0;
car.checkPointReached = 0;
car.lapnum++;
}
}
}
function checkCars(car) {
var _local4 = 1;
while (_local4 <= (totalAI + endRace)) {
var _local3 = game.objects["ai" + _local4];
if (_local3 != car) {
var _local7 = car.xpos - _local3.xpos;
var _local6 = car.ypos - _local3.ypos;
var _local8 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local12 = Math.atan2(_local6, _local7);
if (_local8 < 50) {
car.angG = ((_local12 * 180) / Math.PI) + 90;
car.adjustG = 0.6;
car.adjustA = 0.05;
}
}
_local4++;
}
if (endRace != 1) {
var _local7 = car.xpos + _xcam;
var _local6 = car.ypos + _zcam;
var _local8 = Math.sqrt((_local7 * _local7) + (_local6 * _local6));
var _local12 = Math.atan2(_local6, _local7);
if (_local8 < 30) {
car.angG = ((_local12 * 180) / Math.PI) + 90;
car.adjustG = 0.6;
car.adjustA = 0.05;
}
if (_local8 < 20) {
if (nextCrash) {
nextCrash = false;
var _local14 = Math.abs(car.velx - velx);
var _local13 = Math.abs(car.vely - vely);
var _local5 = (_local14 + _local13) * 4;
if (_local5 > 100) {
_local5 = 100;
}
if (_local5 > 40) {
crash.attachSound("hit" + (random(3) + 1));
} else {
crash.attachSound("bang" + (random(5) + 1));
_local5 = _local5 + 40;
}
crash.start();
crash.onSoundComplete = function () {
nextCrash = true;
};
if (_root.noSFX == 1) {
crash.setVolume(0);
} else {
crash.setVolume(_local5);
}
}
var _local11 = 20 / _local8;
var _local10 = ((_local7 * _local11) - _local7) / 2;
var _local9 = ((_local6 * _local11) - _local6) / 2;
addXcam = _local10;
addZcam = _local9;
_xcam = _xcam + addXcam;
_zcam = _zcam + addZcam;
car.xpos = car.xpos + _local10;
car.ypos = car.ypos + _local9;
car.pushx = _local10;
car.pushy = _local9;
}
}
}
level1Speeds = [15, 0.3, 0, 0.005];
level2Speeds = [16, 0.3, 0.15, 0.005];
level3Speeds = [16.8, 0.3, 0.3, 0.005];
level4Speeds = [15, 0.3, 0.15, 0.005];
level5Speeds = [15, 0.3, 0, 0.005];
cmat = new flash.geom.Matrix();
cbmat = new flash.geom.Matrix();
tWidth = 2;
endRace = 0;
function sortObject(ob) {
var _local14;
var _local4;
var _local10 = Math.sin;
var _local12 = Math.cos;
var _local11 = _xcam + ob.xpos;
var _local9 = _zcam + ob.ypos;
var _local5 = ((-_angleY) * Math.PI) / 180;
_local14 = (_local9 * _local10(_local5)) + (_local11 * _local12(_local5));
_local4 = ((_local9 * _local12(_local5)) - (_local11 * _local10(_local5))) + 70;
var _local15 = true;
if (_local4 < 20) {
ob._visible = 0;
ob.nam._visible = ob._visible;
ob.reflect._visible = 0;
} else {
ob._visible = 1;
ob.nam._visible = ob._visible;
ob._y = (ob.trueY = (550 * (20 / _local4)) + 200);
var _local8 = ob._y - ((550 * (-10 / _local4)) + 200);
if (ob.isAi) {
_local8 = _local8 * 0.4;
}
if (ob.isBuoy) {
_local8 = _local8 * 3;
}
ob._xscale = (ob._yscale = _local8);
if (ob.heightMultiplier) {
ob._xscale = ob._xscale * ob.heightMultiplier;
ob._yscale = ob._xscale;
}
if (ob._y <= ob.trueY) {
ob._y = ob._y - ((ob.fly * ob._xscale) / 100);
}
if (ob._y > ob.trueY) {
ob._y = ob.trueY;
}
ob._x = (500 * (_local14 / _local4)) + 275;
var _local13 = ob._width / 2;
var _local16 = ob._height;
if (((ob._x > (-_local13)) and (ob._x < (550 + _local13))) and (ob._y < (400 + ob._height))) {
ob.bob(ob);
var _local6 = ob._y;
if (ob.fly > 0) {
_local6 = _local6 + ((ob.fly * ob._xscale) / 100);
}
if (!ob.wall) {
dm.push([_local6, ob]);
} else {
dm.push([_local6, ob.wall]);
}
if ((!ob.isTree) && (!ob.isSplash)) {
var _local7 = (ob._y - 200) / 2;
if (_local7 < 4) {
_local7 = 4;
}
var _local3 = (ob.ang + _angleY) - ((275 - ob._x) / _local7);
_local3 = _local3 + 720;
_local3 = _local3 % 360;
var _local2 = 360 - int(_local3);
if (ob.glow) {
ob.glow._x = 35 * Math.sin((_local3 * Math.PI) / 180);
ob.bit._xscale = 100 * Math.sin((_local3 * Math.PI) / 180);
ob.glow.swapDepths((int(35 * Math.cos((_local3 * Math.PI) / 180)) * 3) + 2);
ob.bit.swapDepths((int(25 * Math.cos((_local3 * Math.PI) / 180)) * 3) + 1);
}
while (_local2 < 1) {
_local2 = _local2 + 360;
}
while (_local2 > 360) {
_local2 = _local2 - 360;
}
ob.car.car.m3.gotoAndStop(_local2);
if (ob.lite) {
ob.lite._alpha = 100 - ((Math.abs(250 - ob._x) / 2) + ((400 - ob._y) / 5));
if (ob.lite._alpha < 0) {
ob.lite._alpha = 0;
}
}
if ((!ob.isSplash) && (!ob.dontRotate)) {
ob.gotoAndStop(_local2);
if (qualVal == 1) {
ob.shad._visible = false;
} else {
ob.shad._visible = true;
ob.shad.r._rotation = 90 + _local2;
}
ob.car.gotoAndStop(_local2);
ob.car.car.gotoAndStop(_local2);
ob.car2.gotoAndStop(_local2);
ob.car2.car.gotoAndStop(_local2);
if (ob.car) {
ob.car.car._visible = 0;
ob.car.bmp.attachBitmap(playerBmps[_local2 - 1], 1, "auto", false);
ob.car.bmp._x = bmpX + playerCoords[_local2 - 1][0];
ob.car.bmp._y = bmpY + playerCoords[_local2 - 1][1];
if ((tracknum != 2) && (ob.pixel >= 1)) {
ob.car2._visible = true;
ob.car2.bmp.attachBitmap(playerBmps[_local2 - 1], 1, "auto", false);
ob.car2.bmp._x = bmpX + playerCoords[_local2 - 1][0];
ob.car2.bmp._y = bmpY + playerCoords[_local2 - 1][1];
ob.car2.car._visible = 0;
} else {
ob.car2._visible = false;
}
}
}
}
} else {
ob._visible = 0;
}
}
}
function sortDepths() {
dm.sortOn(0, Array.NUMERIC);
var _local1 = 0;
while (_local1 < dm.length) {
dm[_local1][1].swapDepths(_local1 + 50);
dm[_local1][1].ccc = dm[_local1][1].getDepth();
_local1++;
}
}
objectArray = [];
var a = 0;
while (a < 90) {
objectArray.push([]);
var b = 0;
while (b < 90) {
objectArray[a].push([]);
b++;
}
a++;
}
function pauseGame() {
gamePaused = 1;
countdown.stop();
for (var _local1 in bushArray) {
}
}
function unPauseGame() {
gamePaused = 0;
countdown.play();
for (var _local1 in bushArray) {
}
}
function maskCar(player, x, y) {
if (!x) {
x = player.xpos + 1024;
}
if (!y) {
y = player.ypos + 1024;
}
x = x % 2880;
y = y % 2880;
while (x < 0) {
x = x + 2880;
}
while (y < 0) {
y = y + 2880;
}
var _local12 = (225 - ((groundBmp.getPixel32(x, y) >> 24) & 255)) - 30;
_local12 = _local12 / 2;
if (_local12 < 0) {
_local12 = 0;
}
if (player.toPixel < _local12) {
player.toPixel = player.toPixel + 6;
} else {
player.toPixel = _local12;
}
if (_local12 != 0) {
player.xm = player.xm + 0.4;
var _local8 = player.mask;
_local8.clear();
_local8.beginFill(65280, 100);
var _local6 = 1;
var _local3 = player.wheels;
while (_local3["m" + _local6]) {
_local6++;
}
_local6--;
_local8.moveTo(_local3.m1._x, _local3.m1._y - 250);
_local8.lineTo(_local3["m" + _local6]._x, _local3["m" + _local6]._y - 250);
var _local11 = (-player.toPixel) / 3;
y = (_local11 * _local3["m" + _local6]._yscale) / 100;
_local8.lineTo(_local3["m" + _local6]._x, _local3["m" + _local6]._y + y);
var _local1 = _local6 - 1;
while (_local1 >= 1) {
x = _local3["m" + (_local1 + 1)]._x;
y = ((_local11 * _local3["m" + (_local1 + 1)]._yscale) / 100) + _local3["m" + (_local1 + 1)]._y;
var _local9 = (((_local11 * _local3["m" + _local1]._yscale) / 100) + _local3["m" + _local1]._y) - y;
var _local10 = _local3["m" + _local1]._x - x;
var _local7 = _local9 / _local10;
while (x > _local3["m" + _local1]._x) {
x = x - 10;
y = y - (_local7 * 10);
_local8.lineTo(x, y + (Math.cos((x / 10) + player.xm) * 2));
}
_local1--;
}
_local8.endFill();
if (player.noMask == 1) {
player._y = player._y + (player.toPixel / 3);
player.noMask = 0;
player.car.setMask(_local8);
}
} else {
player.mask.clear();
if (player.noMask != 1) {
player.noMask = 1;
player.car.setMask(null);
}
}
player.pixel = player.toPixel;
}
function setQual(val) {
optionsPanel.lines.gotoAndStop(val);
if (val != qualVal) {
qualVal = val;
cookie.data["user" + username].qual = val;
removeBushes(boundaryDistance, 0, 5);
boundaryDistance = wallDrawDist[val - 1];
initBushes(boundaryDistance, 0, 5);
if (val <= 2) {
var _local1 = -1;
while (_local1++ , _local1 < 200) {
ground[_local1].clear();
sea[_local1].clear();
}
ground[_local1].clear();
sea[_local1].clear();
ground._visible = 0;
sea._visible = 0;
bmmc._visible = 1;
} else {
ground._visible = 1;
sea._visible = 1;
bmmc._visible = 0;
}
if (val == 1) {
game.fade._visible = 0;
} else {
game.fade._visible = 1;
}
mergeMipmaps = true;
if (val <= 2) {
mergeMipmaps = false;
}
manageMode7();
sortDepths();
}
}
wallDrawDist = [15, 25, 40, 70];
function initialisrEnterFrame() {
if (gameInitied != 1) {
if (!singlePlayer) {
var _local4 = new Object();
_local4.type = "ready";
if (allPlayersAready >= playerArray.length) {
countDownShouldPlay = true;
countdown.gotoAndStop(2);
}
}
gameInited = 1;
trigerMap(0);
_nbScans = 0;
initMode7(0);
resultPanel._visible = 0;
positions = ["1st", "2nd", "3rd", "4th"];
var _local2 = 1;
while (_local2 <= totalAI) {
var _local3 = this["ai" + _local2];
_local3.car.isAI = 1;
_local3.noMask = 1;
_local3.xm = 0;
_local3.xpos = (-_xcam) + (Math.sin((((_angleY - 180) * Math.PI) / 180) + (((Math.PI*2) / (totalAI + 1)) * _local2)) * 80);
_local3.ypos = (-_zcam) + (Math.cos((((_angleY - 180) * Math.PI) / 180) + (((Math.PI*2) / (totalAI + 1)) * _local2)) * 80);
_local2++;
}
initCars();
player = game.objects.player;
playerfilter = new flash.filters.ColorMatrixFilter(colourSelected);
player.filters = [playerfilter];
speedo.reddot.filters = [playerfilter];
player._x = 275;
player._y = 360;
player.xm = 0;
player.noMask = 1;
player.id = 999;
player.swapDepths((int(player._y) * 1000) + 999);
frames.swapDepths(10101);
if (theCar == "toyota") {
playersMaxSpeed = 15;
turningCircle = 0.7;
playersAccel = 0.5;
maximumTurn = 5;
} else {
playersMaxSpeed = 15;
turningCircle = 0.7;
playersAccel = 0.5;
maximumTurn = 5;
}
lapnum = 0;
speedo.lap.gotoAndStop(lapnum + 1);
checkPointReached = 2;
reflections._x = objects._x;
reflections._y = objects._y;
ground = game.createEmptyMovieClip("ground", -1);
if (tracknum != 2) {
sea = game.createEmptyMovieClip("sea", -2);
sea._alpha = 50;
sea.blendMode = "add";
sea._y = 200;
}
ground._y = 200;
if (recQual <= 2) {
ground._visible = 0;
sea._visible = 0;
}
game.attachMovie("fade" + tracknum, "fade", 2);
bmg = new flash.display.BitmapData(275, 100, true, 0);
bmmc = game.createEmptyMovieClip("bmmc", 1);
bmmc.attachBitmap(bmg, 1);
bmmc._xscale = (bmmc._yscale = 200);
bmmc._y = 200;
game.fade._y = 200;
ac = 0;
countdown.swapDepths(1101);
kh1 = 361;
flying = false;
initMode7();
ttt = 0;
cck = 0;
objects.player.fly = 0;
setQual(recQual);
boundaryDistance = wallDrawDist[qualVal - 1];
initBushes(boundaryDistance, 0, 5);
rotchange = 0;
speed = 0;
kartchange = 0;
}
speedo.genTime.text = totalGenTime;
}
function startrace() {
ac = 1;
bestTime = 0;
lapTime = 0;
totalTime = 0;
}
function sortTimer() {
lapTime = lapTime + 4;
var _local3 = int(lapTime % 100);
var _local1 = int(lapTime / 100);
var _local2 = _local1 % 60;
var _local4 = int(_local1 / 60);
speedo.timec.text = (((("LAP TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + sortZero(_local3);
speedo.stimec.text = speedo.timec.text;
totalTime = totalTime + 4;
og = getTimer();
_local3 = int(totalTime % 100);
_local1 = int(totalTime / 100);
_local2 = _local1 % 60;
_local4 = int(_local1 / 60);
speedo.ttime.setValue((sortZero(_local4) + sortZero(_local2)) + sortZero(_local3));
}
function drawLightLines() {
blacklines.clear();
blacklines.beginFill(0, 100);
var _local3 = 1;
while (_local3 < lightLines.length) {
if (game.objects["tree" + lightLines[_local3]]._visible && (game.objects["tree" + lightLines[_local3 - 1]]._visible)) {
var _local2 = game.objects["tree" + lightLines[_local3]];
var _local1 = game.objects["tree" + lightLines[_local3 - 1]];
blacklines.moveTo(_local2._x, _local2._y + ((_local2.liney._y * _local2._yscale) / 100));
blacklines.lineTo(_local1._x, _local1._y + ((_local1.liney._y * _local1._yscale) / 100));
blacklines.lineTo(_local1._x, (_local1._y + ((_local1.liney._y * _local1._yscale) / 100)) + ((2 * _local1._yscale) / 100));
blacklines.lineTo(_local2._x, (_local2._y + ((_local2.liney._y * _local2._yscale) / 100)) + ((2 * _local2._yscale) / 100));
}
_local3++;
}
}
function drawRoad() {
manageKeys();
manageMode7();
}
function manageKeys() {
tm = getTimer() - stra;
stra = getTimer();
var _local12;
var _local11;
var _local14;
var _local13;
vk = 0;
if (endRace != 1) {
player.l1._visible = 0;
player.l2._visible = 0;
player.l3._visible = 0;
upPressed = 0;
if (Key.isDown(38)) {
upPressed = 1;
oldspeed = speed;
if (offgrass) {
offgrass = 0;
accel = 0;
}
accelerate();
if (speed <= (maxspeed * tRatio)) {
if (((ac == 1) and (flying == false)) and (endRace != 1)) {
speed = speed + (((playersAccel - (speed / (50 * tRatio))) * tRatio) * tRatio);
bikeaccell = speed - oldspeed;
}
}
} else {
hasBeenWheelie = 0;
forwards = 0;
}
decelerate();
downPressed = 0;
if (Key.isDown(40)) {
downPressed = 1;
backwards++;
if (((ac == 1) and (speed > (-1 * tRatio))) and (flying == false)) {
speed = speed - ((0.3 * tRatio) * tRatio);
}
} else {
backwards = 0;
}
if ((speed > ((0.2 * tRatio) * tRatio)) and (flying == false)) {
speed = speed - ((0.2 * tRatio) * tRatio);
} else if (flying == false) {
if (Key.isDown(40)) {
} else if (_root.speed < ((-0.2 * tRatio) * tRatio)) {
speed = speed + ((0.2 * tRatio) * tRatio);
} else {
speed = 0;
}
}
if (((speed - ((breaking * tRatio) * tRatio)) > (maxspeed * tRatio)) and (flying == false)) {
speed = speed - ((breaking * tRatio) * tRatio);
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) and (endRace != 1)) {
speed = checkpos(_angleY, speed);
player._y = player._y + (((player.pixel / 6) * player._xscale) / 100);
}
rightPressed = 0;
if (Key.isDown(39)) {
maxTurn = maximumTurn + ((-maximumTurn) / (20 - (speed / tRatio)));
hasBeenWheelie = 0;
rightPressed = 1;
dir = "right";
if (ac == 1) {
if (((rotchange > ((-maxTurn) * tRatio)) and (rotchange < (maxTurn * tRatio))) and (speed != 0)) {
kartchange = kartchange - (0.5 * tRatio);
if (speed > 0) {
rotchange = rotchange - ((turningCircle * tRatio) * tRatio);
} else {
rotchange = rotchange + ((turningCircle * tRatio) * tRatio);
}
}
}
if (rotchange < ((-maxTurn) * tRatio)) {
rotchange = (-maxTurn) * tRatio;
}
if (rotchange > (maxTurn * tRatio)) {
rotchange = maxTurn * tRatio;
}
}
leftPressed = 0;
if (Key.isDown(37)) {
maxTurn = maximumTurn + ((-maximumTurn) / (20 - (speed / tRatio)));
hasBeenWheelie = 0;
leftPressed = 1;
dir = "left";
if (ac == 1) {
if (((rotchange < (maxTurn * tRatio)) and (rotchange > ((-maxTurn) * tRatio))) and (speed != 0)) {
kartchange = kartchange + (0.5 * tRatio);
if (speed > 0) {
rotchange = rotchange + ((turningCircle * tRatio) * tRatio);
} else {
rotchange = rotchange - ((turningCircle * tRatio) * tRatio);
}
}
}
if (rotchange < ((-maxTurn) * tRatio)) {
rotchange = (-maxTurn) * tRatio;
}
if (rotchange > (maxTurn * tRatio)) {
rotchange = maxTurn * tRatio;
}
}
var _local10 = 20 - (speed / tRatio);
rotchange = rotchange - ((rotchange / _local10) * tRatio);
if ((kartchange != 0) and (flying == false)) {
kartchange = kartchange + ((((-kartchange) / ((20 * tRatio) - speed)) * tRatio) * tRatio);
}
if (flying == false) {
_angleY = _angleY - rotchange;
}
player.car.gotoAndStop(Math.round(180 - (kartchange * 6)));
player.shad.r._rotation = 90 + player.car._currentframe;
player.car.car._visible = 0;
player.car.bmp.attachBitmap(playerBmps[Math.round(180 - (kartchange * 6)) - 1], 1);
player.car.bmp._x = bmpX + playerCoords[Math.round(180 - (kartchange * 6)) - 1][0];
player.car.bmp._y = bmpY + playerCoords[Math.round(180 - (kartchange * 6)) - 1][1];
player.car2.car._visible = 0;
player.car2.car._visible = 0;
if ((tracknum != 2) && (player.pixel >= 1)) {
player.car2._visible = true;
player.car2.bmp.attachBitmap(playerBmps[Math.round(180 - (kartchange * 6)) - 1], 1);
player.car2.bmp._x = bmpX + playerCoords[Math.round(180 - (kartchange * 6)) - 1][0];
player.car2.bmp._y = bmpY + playerCoords[Math.round(180 - (kartchange * 6)) - 1][1];
player.car2.gotoAndStop(Math.round(180 - (kartchange * 6)));
player.car2.car.gotoAndStop(Math.round(180 - (kartchange * 6)));
} else {
player.car2._visible = false;
}
player.wheels.gotoAndStop(Math.round(180 - (kartchange * 6)));
var _local6 = int(180 - ((kartchange * 6) / tRatio));
_local6 = _local6 - 180;
if (_local6 < 1) {
_local6 = _local6 + 360;
}
playersMaxSpeed = 15;
var _local2 = Math.abs(speed / (5 * tRatio));
if (kartchange < (-1 / _local2)) {
playersMaxSpeed = 14.5;
}
if (kartchange < (-2 / _local2)) {
playersMaxSpeed = 14;
}
if (kartchange < (-4 / _local2)) {
playersMaxSpeed = 13.5;
}
if (kartchange > (1 / _local2)) {
playersMaxSpeed = 14.5;
}
if (kartchange > (2 / _local2)) {
playersMaxSpeed = 14;
}
if (kartchange > (4 / _local2)) {
playersMaxSpeed = 13.5;
}
if (_root.trackCar == 1) {
_root.objects = game.objects;
var _local9 = (_root.objects.ai8.xpos + _xcam) * 0.002;
var _local8 = (_root.objects.ai8.ypos + _zcam) * 0.002;
_xcama = _xcama + _local9;
_zcama = _zcama + _local8;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local5 = (-_xcam) - _root.objects.ai8.xpos;
var _local4 = (-_zcam) - _root.objects.ai8.ypos;
var _local7 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
theeRot = (Math.atan2(_local4, _local5) * 180) / Math.PI;
ratio = 400 / _local7;
var _local3 = 500 / _local7;
if (_local3 < 0) {
_local3 = 0;
}
if (_local3 > 50) {
_local3 = 50;
}
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(_local3);
}
if (!fullspeed) {
fullspeed = 1;
engine.attachSound("fullspeed");
engine.start(0, 9999);
}
if (ratio < 1) {
_local5 = _local5 * ratio;
_local4 = _local4 * ratio;
_xcam = (-_root.objects.ai8.xpos) - _local5;
_zcam = (-_root.objects.ai8.ypos) - _local4;
}
_angleY = (-theeRot) - 90;
if (benchmark) {
_xcam = -_root.objects.ai8.xpos;
_zcam = -_root.objects.ai8.ypos;
_angleY = (-_root.objects.ai8.ang) + 180;
}
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local4;
var _local1;
_local4 = 0.00174532925199433;
_local1 = 0;
var _local2 = Math.sin;
var _local3 = Math.cos;
i = 0;
while (i < _nbScans) {
ground.createEmptyMovieClip(i, 100 + i);
ground[i]._x = (-ground._x) + (_resoDx * 0.5);
ground[i]._y = i;
_local1 = _local1 + _local4;
rayY = _local2(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
sea.createEmptyMovieClip(i, 100 + i);
sea[i]._x = (-sea._x) + (_resoDx * 0.5);
sea[i]._y = i;
sea[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local12 = game.objects;
var _local1;
var _local11;
var _local3;
var _local15;
var _local17;
var _local14;
var _local20;
var _local22;
var _local18;
var _local19;
var _local2;
var _local21;
_local18 = Math.sin;
_local19 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * Math.PI) / 180);
_local11 = (_resoDx * 0.5) / 500;
_local20 = 0;
_local15 = _local18((_angleY * Math.PI) / 180);
_local14 = _local19((_angleY * Math.PI) / 180);
var _local5 = 0;
while (_local5 < trees.length) {
sortObject(trees[_local5]);
_local5++;
}
if (boundaryDistance != 0) {
prepBushes();
sortBushes(boundaryDistance, 0, 5);
sortAllBushes();
}
sortBillboard();
if (tracknum == 2) {
_local5 = 0;
while (_local5 < balls.length) {
sortBall(_local12["ball" + _local5], num);
_local5++;
}
}
_local21 = seaimage;
if (qualVal <= 2) {
var _local16 = 2;
_local1 = 0;
_local11 = _local11 * 0.5;
var _local13 = 100;
} else {
var _local13 = 200;
_local1 = -1;
var _local16 = 1;
}
var _local10 = _local1;
while (_local1 <= _local13) {
_local1++;
_local10 = _local10 + _local16;
ground[_local1].clear();
sea[_local1].clear();
if (_local17 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local8 = leCoses[_local10];
var _local7 = (_xcam - (_local15 * _local8)) - 1024;
var _local6 = (_zcam - (_local14 * _local8)) - 1024;
_local2.tx = (_local7 * _local2.a) + (_local6 * _local2.c);
_local2.ty = ((_local7 * _local2.b) + (_local6 * _local2.d)) + 70;
_local3 = _local11 * _local9;
var _local4 = _local3;
if ((qualVal != 1) || (tracknum == 2)) {
if (tracknum != 2) {
sea[_local1].beginBitmapFill(seaimage, _local2, true, false);
sea[_local1].moveTo(-_local3, 0);
sea[_local1].lineTo(_local4, 0);
sea[_local1].lineTo(_local4, 1);
sea[_local1].lineTo(-_local3, 1);
sea[_local1].endFill();
}
ground[_local1].beginBitmapFill(groundBmp, _local2, true, false);
} else {
ground[_local1].beginBitmapFill(lowQualGround, _local2, true, false);
}
ground[_local1].moveTo(-_local3, 0);
ground[_local1].lineTo(_local4, 0);
ground[_local1].lineTo(_local4, 1);
ground[_local1].lineTo(-_local3, 1);
ground[_local1].endFill();
}
if (qualVal <= 2) {
if (tracknum != 2) {
if (qualVal == 2) {
bmg.fillRect(bmg.rectangle, 0);
bmg.draw(sky, skyDrawMat);
bmg.draw(sea, groundMat, null, "add");
}
}
bmg.draw(ground, groundMat);
}
}
_root.loadCheck.removeMovieClip();
ipx = px;
if (!game) {
game = createEmptyMovieClip("game", 200);
game.createEmptyMovieClip("objects", 3);
}
theCar = "toyota";
groundFriction = 0.85;
reflectnum = 0;
upPressed = (downPressed = (leftPressed = (rightPressed = (upSwitch = (downSwitch = (leftSwitch = (rightSwitch = 0)))))));
if (tracknum == 2) {
grey._visible = 0;
}
_ycam = 20;
grey._visible = 0;
skidx = 0;
skidy = 0;
skyDrawMat = new flash.geom.Matrix();
skyDrawMat.a = 0.5;
skyDrawMat.d = 0.5;
skyDrawMat.ty = -100;
og = getTimer();
pp = 0;
seacount = 0;
st = getTimer();
uniqueDepth = 50000;
onMouseDown = function () {
ttt = 0;
cck = 0;
};
ttttMat = new flash.geom.Matrix();
tRatio = 1;
tRatios = [];
ratcount = 0;
addXcam = 0;
addZcam = 0;
nextCrash = true;
realEnterFrame = function () {
ratcount++;
oldTimer = getTimer();
if (uniqueDepth > 60000) {
uniqueDepth = 50000;
}
pp++;
if (_quality != "LOW") {
_quality = "LOW";
}
if (gamePaused != 1) {
skidx = skidx * 0.8;
skidy = skidy * 0.8;
if (tracknum == 4) {
seacount = seacount + 2;
} else {
seacount = seacount + 1;
}
if (seacount > 30) {
seacount = 1;
}
seaimage = this["sea" + seacount];
moving = 0;
cck++;
tt = getTimer() - st;
if (allowHack == 1) {
_xcam = -objects.ai3.xpos;
_zcam = -objects.ai3.ypos;
}
player.car.w1.r._rotation = player.car.w1.r._rotation - (speed * 5);
player.car.w2.r._rotation = player.car.w2.r._rotation - (speed * 5);
player.car.w1.r.b._alpha = Math.abs(speed) * 10;
player.car.w2.r.b._alpha = Math.abs(speed) * 10;
if (player.car.w1.r.b._alpha > 100) {
player.car.w1.r.b._alpha = 100;
}
if (player.w2.car.r.b._alpha > 100) {
player.w2.car.r.b._alpha = 100;
}
player.car2.w1.r._rotation = player.car.w1.r._rotation;
player.car2.w2.r._rotation = player.car.w2.r._rotation;
player.car2.w1.r.b._alpha = player.car.w1.r.b._alpha;
player.car2.w2.r.b._alpha = player.car.w2.r.b._alpha;
var _local2 = player._y;
dm = [[_local2, player]];
drawRoad();
sortspeedo();
moveCars();
if ((tracknum != 2) && (trackCar != 1)) {
maskCar(player, Math.floor((-_xcam) + 1024), Math.floor((-_zcam) + 1024));
}
sortSky();
if (tracknum == 5) {
doSnow();
}
if (tracknum == 4) {
doRain();
}
if ((ac == 1) and (endRace != 1)) {
sortTimer();
}
if (tracknum != 2) {
if (qualVal != 1) {
if (random(dolphins.length + 1) == 0) {
addDolphin();
}
}
sortDolphins();
}
sortDepths();
if (tracknum == 5) {
drawLightLines();
}
}
};
halfMat = new flash.geom.Matrix();
halfMat.a = (halfMat.d = 0.5);
groundMat = new flash.geom.Matrix();
groundMat.tx = -138;
gotoAndStop ("select1");
Frame 30
cArray1 = [[67, 259], [80, 249], [93, 238], [109, 228], [118, 214], [122, 201], [122, 182], [110, 167], [100, 155], [82, 131], [69, 122], [54, 104], [49, 86], [51, 66], [70, 56], [97, 52], [134, 51], [183, 47], [232, 47], [262, 50], [293, 58], [316, 74], [323, 86], [330, 99], [326, 119], [315, 130], [304, 142], [292, 156], [286, 173], [286, 190], [298, 208], [310, 225], [321, 239], [325, 262], [325, 282], [318, 298], [305, 317], [288, 325], [268, 321], [[249, 316], [255, 330]], [[238, 310], [238, 335]], [[227, 306], [225, 338]], [[206, 305], [205, 340]], [[186, 313], [184, 341]], [[167, 325], [165, 338]], [141, 334], [116, 332], [100, 330], [81, 325], [65, 315], [53, 303]];
cArray2 = [[41, 262], [54, 232], [86, 224], [138, 232], [173, 239], [211, 227], [241, 203], [244, 178], [229, 149], [188, 134], [158, 135], [113, 150], [71, 151], [37, 129], [32, 96], [39, 62], [70, 40], [105, 40], [146, 53], [179, 66], [210, 66], [250, 45], [284, 43], [310, 56], [327, 85], [328, 124], [323, 156], [319, 190], [328, 226], [339, 263], [337, 304], [322, 325], [296, 342], [269, 332], [241, 317], [225, 304], [200, 291], [165, 304], [133, 340], [96, 343], [62, 322], [46, 303]];
cArray3 = [[78, 268], [90, 254], [101, 223], [91, 196], [69, 169], [76, 147], [104, 130], [106, 111], [84, 98], [61, 86], [58, 65], [73, 45], [109, 42], [160, 53], [202, 53], [239, 45], [275, 44], [303, 50], [322, 66], [330, 89], [324, 111], [312, 133], [292, 139], [271, 129], [245, 112], [222, 105], [192, 105], [177, 126], [168, 139], [168, 158], [178, 175], [193, 187], [207, 201], [225, 207], [[244, 205], [243, 219]], [[260, 187], [260, 234]], [[297, 178], [283, 238]], [[316, 192], [300, 224]], [[340, 211], [317, 222]], [[339, 241], [329, 236]], [331, 277], [[317, 305], [316.95, 302]], [[301, 324], [300.25, 298.05]], [[279, 334], [275.65, 289.7]], [[246, 339], [243.1, 288.8]], [[192, 339], [195.65, 305.1]], [[145, 335], [145, 321]], [105, 326], [77, 309]];
cArray4 = [[61, 274], [[44, 257], [81, 257.2]], [[35, 239], [84, 239]], [[29, 208], [59, 205]], [39, 187], [[29, 166], [49, 168]], [[24, 139], [63, 139]], [[29, 108], [65, 106]], [46, 78], [61, 55], [75, 44], [94, 37], [[115, 31], [115, 46], [117, 31], [114, 46]], [[142, 27], [136, 47], [146, 28], [139, 48]], [[165, 28], [165, 41], [168, 26], [159, 60]], [[185, 28], [185, 41], [186, 19], [180, 62]], [[208, 33], [211, 54], [209, 17], [203, 74]], [[232, 43], [232, 62], [234, 22], [227, 76]], [[248, 46], [248, 65], [252, 29], [248, 67]], [[273, 44], [272, 54], [274, 30], [273, 55]], [[286, 49], [286, 45], [293, 31], [291, 44]], [[309, 39], [312, 39], [311, 37], [314, 41]], [[325, 49], [330, 51], [329, 50], [328, 52]], [338, 67], [340, 115], [340, 127], [323, 160], [323, 182], [335, 226], [338, 256], [335, 282], [323, 308], [301, 319], [270, 322], [247, 316], [232, 298], [228, 270], [[229, 243], [244, 254], [220, 247]], [[226, 224], [264, 240], [202, 238]], [[233, 217], [281, 230], [195, 223]], [[251, 211], [293, 220], [197, 207]], [[263, 200], [293, 205], [202, 195]], [[257, 189], [291, 189], [216, 185]], [[250, 176], [275, 175], [231, 175]], [[251, 165], [264, 165], [247, 167]], [258, 150], [253, 131], [233, 121], [200, 112], [173, 109], [[151, 115], [170, 119]], [[131, 122], [169, 134]], [[119, 129], [161, 152]], [[115, 139], [140, 161]], [118, 167], [120, 194], [132, 217], [147, 234], [159, 264], [159, 286], [141, 303], [121, 311], [93, 310], [76, 298]];
cArray5 = [[37, 258], [27, 216], [48, 180], [88, 156], [88, 123], [60, 83], [55, 59], [79, 40], [115, 31], [146, 40], [170, 60], [196, 68], [221, 55], [240, 32], [270, 25], [300, 25], [329, 40], [336, 66], [336, 95], [328, 121], [305, 126], [275, 113], [259, 112], [250, 121], [252, 131], [270, 157], [294, 177], [315, 200], [329, 231], [336, 270], [330, 300], [313, 321], [292, 324], [274, 315], [262, 290], [257, 256], [244, 211], [228, 176], [203, 155], [171, 141], [148, 148], [133, 170], [135, 197], [147, 226], [175, 245], [199, 273], [194, 305], [174, 315], [143, 322], [111, 321], [79, 315], [63, 297]];
cArray = this["cArray" + tracknum];
lightString = [[785, 223], [820, 223], [892, 223], [927, 223], [962, 223], [996, 225], [1030, 230], [1063, 238], [1096, 249], [1127, 265], [1156, 283], [1184, 304], [1210, 328], [1234, 352], [1260, 373], [1288, 395], [1315, 417], [1343, 438], [1370, 458], [1399, 477], [1428, 495], [1458, 510], [1489, 524], [1521, 535], [1555, 542], [1589, 543], [1623, 540], [1657, 531], [1688, 516], [1717, 496], [1742, 472], [1765, 446], [1785, 418], [1803, 388], [1819, 356], [1835, 324], [1851, 293], [1872, 265], [1896, 241], [1925, 221], [1955, 205], [1988, 193], [2021, 185], [2056, 181], [2091, 180], [2125, 182], [2160, 187], [2194, 189], [2229, 189], [2263, 190], [2298, 190], [2333, 190], [2367, 189], [2401, 190], [2435, 195], [2468, 204], [2500, 218], [2530, 236], [2557, 257], [2581, 282], [2603, 310], [2621, 339], [2638, 370], [2652, 402], [2664, 434], [2675, 468], [2684, 501], [2691, 535], [2698, 569], [2703, 603], [2707, 637], [2710, 672], [2711, 706], [2712, 742], [2711, 776], [2708, 810], [2702, 844], [2692, 877], [2678, 908], [2658, 936], [2632, 958], [2600, 973], [2566, 981], [2532, 983], [2498, 982], [2464, 981], [2429, 978], [2395, 974], [2361, 968], [2328, 959], [2295, 948], [2263, 934], [2231, 920], [2199, 907], [2166, 899], [2131, 894], [2097, 894], [2063, 897], [2033, 912], [2006, 933], [2000, 966], [2018, 996], [2032, 1027], [2043, 1061], [2053, 1095], [2063, 1128], [2084, 1157], [2110, 1181], [2137, 1202], [2166, 1223], [2195, 1243], [2221, 1265], [2244, 1291], [2262, 1320], [2280, 1350], [2301, 1378], [2326, 1402], [2354, 1423], [2384, 1441], [2414, 1460], [2443, 1478], [2471, 1496], [2499, 1517], [2522, 1542], [2537, 1573], [2550, 1605], [2564, 1637], [2577, 1669], [2591, 1701], [2605, 1733], [2619, 1765], [2633, 1796], [2646, 1828], [2658, 1859], [2667, 1891], [2674, 1925], [2677, 1960], [2679, 1995], [2679, 2030], [2679, 2068], [2679, 2105], [2678, 2140], [2676, 2175], [2672, 2209], [2668, 2243], [2663, 2277], [2656, 2311], [2649, 2345], [2640, 2378], [2630, 2411], [2619, 2443], [2606, 2475], [2592, 2506], [2575, 2536], [2556, 2564], [2534, 2591], [2510, 2615], [2483, 2636], [2452, 2653], [2420, 2664], [2386, 2671], [2351, 2673], [2317, 2672], [2283, 2670], [2249, 2667], [2216, 2662], [2182, 2655], [2149, 2647], [2117, 2635], [2086, 2620], [2057, 2602], [2032, 2578], [2012, 2551], [1998, 2519], [1990, 2485], [1988, 2450], [1989, 2416], [1990, 2382], [1993, 2348], [1997, 2314], [2005, 2280], [2015, 2247], [2027, 2214], [2040, 2183], [2051, 2151], [2054, 2117], [2052, 2083], [2045, 2049], [2035, 2015], [2021, 1982], [2007, 1950], [1994, 1918], [1981, 1887], [1972, 1854], [1966, 1820], [1964, 1785], [1967, 1750], [1972, 1716], [1980, 1682], [1989, 1648], [2000, 1614], [2010, 1582], [2015, 1548], [2000, 1515], [1977, 1487], [1953, 1461], [1928, 1437], [1902, 1413], [1876, 1390], [1849, 1367], [1822, 1345], [1795, 1324], [1767, 1302], [1740, 1282], [1712, 1261], [1685, 1241], [1656, 1222], [1628, 1203], [1599, 1184], [1570, 1166], [1540, 1149], [1511, 1133], [1481, 1118], [1450, 1105], [1418, 1096], [1384, 1094], [1348, 1099], [1313, 1108], [1279, 1120], [1246, 1133], [1214, 1148], [1183, 1163], [1152, 1179], [1122, 1195], [1092, 1213], [1062, 1230], [1034, 1249], [1009, 1270], [1001, 1303], [1008, 1339], [1017, 1374], [1026, 1408], [1034, 1440], [1043, 1472], [1050, 1505], [1054, 1539], [1060, 1572], [1070, 1605], [1085, 1636], [1104, 1665], [1129, 1690], [1156, 1711], [1187, 1728], [1219, 1742], [1250, 1754], [1282, 1766], [1313, 1779], [1344, 1792], [1375, 1806], [1406, 1820], [1437, 1836], [1466, 1853], [1494, 1872], [1521, 1894], [1543, 1920], [1557, 1951], [1562, 1985], [1564, 2020], [1563, 2056], [1563, 2091], [1564, 2126], [1565, 2161], [1562, 2195], [1549, 2227], [1532, 2258], [1512, 2289], [1492, 2320], [1474, 2349], [1456, 2379], [1441, 2412], [1429, 2446], [1416, 2477], [1397, 2507], [1380, 2537], [1366, 2567], [1346, 2595], [1318, 2616], [1286, 2628], [1251, 2633], [1216, 2633], [1181, 2631], [1146, 2627], [1112, 2622], [1077, 2615], [1044, 2608], [1010, 2600], [976, 2591], [943, 2581], [911, 2572], [877, 2571], [844, 2573], [810, 2578], [778, 2588], [749, 2608], [717, 2620], [683, 2620], [649, 2612], [619, 2594], [594, 2571], [573, 2543], [556, 2513], [542, 2481], [532, 2448], [525, 2415], [516, 2381], [504, 2349], [489, 2317], [473, 2285], [455, 2254], [438, 2224], [422, 2194], [406, 2163], [390, 2133], [374, 2102], [357, 2072], [339, 2043], [321, 2013], [304, 1985], [286, 1956], [270, 1926], [256, 1895], [245, 1862], [240, 1827], [237, 1792], [236, 1757], [235, 1723], [235, 1689], [237, 1655], [245, 1621], [261, 1590], [281, 1561], [300, 1532], [318, 1502], [336, 1474], [357, 1446], [380, 1422], [408, 1401], [438, 1385], [470, 1369], [502, 1355], [534, 1341], [566, 1327], [596, 1312], [626, 1295], [654, 1275], [679, 1251], [700, 1224], [719, 1196], [737, 1166], [753, 1136], [766, 1105], [776, 1072], [782, 1039], [780, 1004], [770, 971], [753, 942], [729, 916], [701, 895], [672, 876], [641, 859], [610, 843], [581, 828], [551, 812], [521, 794], [493, 775], [467, 752], [443, 728], [423, 700], [407, 669], [396, 636], [388, 602], [384, 568], [384, 533], [385, 499], [389, 465], [399, 432], [417, 402], [441, 377], [468, 355], [497, 335], [527, 317], [557, 300], [589, 284], [621, 268], [653, 253], [685, 239], [717, 225], [751, 223]];
bArray1 = [[231, 286, ["b2"]], [144, 260, ["b3"]], [202, 178, ["b4"]], [244, 91, []]];
bArray2 = (bArray = [[164, 256, ["b2"]], [149, 292, ["b4"]], [113, 314, ["b5"]], [139.15, 304.95, ["b3"]], [89, 313, ["b6"]], [70, 297, ["b7"]], [62, 273, ["b8"]], [76, 253, ["b9"]], [104, 249, ["b10"]], [133, 254, ["b11"]], [164, 257, ["b12"]], [221, 262, ["b13"]], [245, 287, ["b14"]], [269, 308, ["b15"]], [290, 315, ["b16"]], [312, 302, ["b17"]], [323, 273, ["b18"]], [319, 252, ["b19"]], [302, 216, ["b20"]], [292, 190, ["b21"]], [299, 165, ["b22"]], [306, 134, ["b23"]], [310, 100, ["b24"]], [302, 73, ["b25"]], [277, 63, ["b26"]], [277, 63, ["b27"]], [250, 66, ["b28"]], [225, 79, ["b29"]], [202, 91, ["b30"]], [181, 91, ["b31"]], [144, 74, ["b32"]], [113, 58, ["b33"]], [78, 60, ["b34"]], [62, 72, ["b35"]], [55, 94, ["b36"]], [65, 115, ["b37"]], [86, 126, ["b38"]], [113, 123, ["b39"]], [138, 107, ["b40"]], [144, 74, []], [0, 236, ["b42"]], [33, 213, ["b43"]], [66, 199, ["b44"]], [99, 198, ["b45"]], [128, 203, ["b46"]], [160, 215, ["b47"]], [188, 215, ["b48"]], [200, 193, ["b49"]], [200, 193, ["b50"]], [195, 167, ["b51"]], [182, 148, ["b52"]], [158, 150, ["b53"]], [157, 150, ["b54"]], [123, 161, ["b55"]], [96, 174, ["b56"]], [67, 177, ["b57"]], [34, 167, ["b58"]], [34, 167, ["b59"]], [1, 146, []]]);
bArray3 = [[289, 81, ["b2"]], [138, 79, ["b3", "b8"]], [137, 224, ["b4", "b5"]], [104, 281, []], [298, 262, []], [356, 156, ["b7"]], [202, 152, []], [85, 62, []]];
bArray4 = [[95, 184, ["b2", "b3"]], [148, 279, []], [106, 116, ["b4", "b9"]], [177, 94, ["b5"]], [258, 115, ["b6"]], [303, 174, ["b7", "b10"]], [308, 258, ["b8"]], [273, 296, []], [71, 73, []], [329, 123, ["b11"]], [333, 78, []], [187, 357, ["b13"]], [163, 188, ["b14"]], [185, 122, []]];
bArray5 = [[145, 301, ["b2"]], [107, 162, ["b3"]], [123, 115, ["b4", "b7"]], [160, 112, ["b5"]], [221, 124, ["b6", "b8"]], [269, 185, ["b11"]], [77, 69, []], [231, 79, ["b9"]], [266, 48, ["b10"]], [306, 44, []], [284, 271, []], [282, 141, ["b16"]], [185, 196, ["b14"]], [231, 263, ["b15"]], [222, 351, []], [358, 207, []]];
bArray = this["bArray" + tracknum];
bArray.push([1, 1, []]);
bArray.push([1, 358, ["b" + bArray.length]]);
bArray.push([358, 358, ["b" + bArray.length]]);
bArray.push([358, 1, ["b" + bArray.length]]);
bArray.push([1, 1, ["b" + bArray.length]]);
function sortAllBushes(num) {
levelSelected = 1;
players = 1;
var _local4 = myRoot["player" + num];
var _local3 = game.objects;
for (var _local2 in bushes) {
sortObject(bushes[_local2], num);
}
}
function attachTrees(num) {
if (tracknum == 2) {
scalePos = 8;
} else {
scalePos = 8;
}
game.mapArray = mapArray;
players = 1;
var _local3 = game.objects;
var _local4 = new flash.geom.Matrix();
if (tracknum == 2) {
var _local1 = 0;
while (_local1 < balls.length) {
_local3["ball" + _local1].removeMovieClip();
var _local2 = _local3.attachMovie("ball", "ball" + _local1, _local3.getNextHighestDepth());
_local2._x = -1000;
_local2.xpos = balls[_local1][0] - 1024;
_local2.ypos = balls[_local1][1] - 1024;
_local2.mass = 2;
_local2.my = 0;
_local2.mx = 0;
_local2.fly = 0;
_local2.oldfly = 0;
_local2.isBall = true;
_local2.flyamount = 0;
_local2.ax = int(_local2.xpos / 32) + 32;
_local2.ay = int(_local2.ypos / 32) + 32;
_local2.num = _local1;
_local2.heightMultiplier = 0.5;
objectArray[_local2.ax][_local2.ay].push(_local2);
_local2.rad = 7;
_local2._x = -1000;
_local1++;
}
}
trees = [];
var _local1 = 0;
while (_local1 < tArray.length) {
if (players == 1) {
_local3["tree" + _local1].removeMovieClip();
var _local2 = _local3.attachMovie(treeLevels[tracknum - 1], "tree" + _local1, _local3.getNextHighestDepth());
if (allowCache) {
_local2.cacheAsBitmap = true;
}
_local2.xpos = tArray[_local1][0] - 1024;
_local2.ypos = tArray[_local1][1] - 1024;
_local2._x = -1000;
var _local6 = int(_local2.xpos / 8) + 128;
var _local5 = int(_local2.ypos / 8) + 128;
_local2._name = "tree" + ((_local6 * 360) + _local5);
if (tArray[_local1][2]) {
_local2.ang = tArray[_local1][2];
}
_local2.dontRotate = true;
_local2.gotoAndStop(2);
trees.push(_local2);
}
_local4.tx = (tArray[_local1][0] * 8) / scalePos;
_local4.ty = (tArray[_local1][1] * 8) / scalePos;
if (tracknum != 5) {
groundBmp.draw(tshad, _local4);
} else {
groundBmp.draw(lightground, _local4, null, "add");
}
mapArray[tArray[_local1][0] / 8][tArray[_local1][1] / 8] = [3, 181];
mapArray[(tArray[_local1][0] / 8) - 1][(tArray[_local1][1] / 8) - 1] = [3, 181];
mapArray[tArray[_local1][0] / 8][(tArray[_local1][1] / 8) - 1] = [3, 181];
mapArray[(tArray[_local1][0] / 8) + 1][(tArray[_local1][1] / 8) - 1] = [3, 181];
mapArray[(tArray[_local1][0] / 8) - 1][tArray[_local1][1] / 8] = [3, 181];
mapArray[(tArray[_local1][0] / 8) + 1][tArray[_local1][1] / 8] = [3, 181];
mapArray[(tArray[_local1][0] / 8) - 1][(tArray[_local1][1] / 8) + 1] = [3, 181];
mapArray[tArray[_local1][0] / 8][(tArray[_local1][1] / 8) + 1] = [3, 181];
mapArray[(tArray[_local1][0] / 8) + 1][(tArray[_local1][1] / 8) + 1] = [3, 181];
if (players == 2) {
bushArray[tArray[_local1][0]][tArray[_local1][1]] = 4;
}
_local1++;
}
olda = _local1;
_local1 = (_local1 + 5) + olda;
treesDrawn = 1;
addBillBoards(num);
}
function prepBushes() {
myRoot.player1.unique = 0;
myRoot.player2.unique = 0;
}
function initBushes(radius, val, maxval, num) {
var _local9 = game.objects.player;
var _local7 = (-int(_xcam / scalePos)) + int(Math.sin((_angleY * Math.PI) / 180) * radius);
var _local6 = (-int(_zcam / scalePos)) + int(Math.cos((_angleY * Math.PI) / 180) * radius);
_local9.unique = 1;
_local9["oldAX" + _local9.unique] = _local7;
_local9["oldAY" + _local9.unique] = _local6;
var _local5 = -radius;
while (_local5 < radius) {
var _local3 = -radius;
while (_local3 < radius) {
var _local2 = _local5 + _local7;
var _local1 = _local6 + _local3;
_local2 = _local2 + (1024 / scalePos);
_local1 = _local1 + (1024 / scalePos);
if (bushArray[_local2][_local1] > 0) {
attachBush(_local2, _local1, num, bushArray[_local2][_local1]);
}
_local3++;
}
_local5++;
}
}
function removeBushes(radius, val, maxval, num) {
var _local9 = game.objects.player;
var _local7 = (-int(_xcam / scalePos)) + int(Math.sin((_angleY * Math.PI) / 180) * radius);
var _local6 = (-int(_zcam / scalePos)) + int(Math.cos((_angleY * Math.PI) / 180) * radius);
_local9.unique = 1;
_local9["oldAX" + _local9.unique] = _local7;
_local9["oldAY" + _local9.unique] = _local6;
var _local5 = -radius;
while (_local5 < radius) {
var _local1 = -radius;
while (_local1 < radius) {
var _local3 = _local5 + _local7;
var _local2 = _local6 + _local1;
_local3 = _local3 + (1024 / scalePos);
_local2 = _local2 + (1024 / scalePos);
if (bushArray[_local3][_local2] > 0) {
removeBush(_local3, _local2, num);
}
_local1++;
}
_local5++;
}
}
function attachBush(ax, ay, num, n) {
var _local10 = game.objects.player;
var _local4 = game.objects;
var _local9 = game.walls;
var _local2 = (ax * 360) + ay;
var _local6 = _local4["tree" + _local2]._name;
if (!_local6) {
if ((n == 3) || (n >= 1000)) {
if ((tracknum == 5) && (n >= 1000)) {
var _local5 = _local4.attachMovie("light", "tree" + _local2, uniqueDepth++);
_local5._x = -1000;
} else if (tracknum != 2) {
var _local5 = _local4.attachMovie("buoy", "tree" + _local2, uniqueDepth++);
_local5.isBuoy = true;
_local5._x = -1000;
} else {
var _local5 = _local4.attachMovie("rock", "tree" + _local2, uniqueDepth++);
_local5.dontRotate = true;
_local5.gotoAndStop(2);
_local5._x = -1000;
}
} else {
var _local5 = _local4.attachMovie("rock", "tree" + _local2, uniqueDepth++);
_local5.dontRotate = true;
_local5.gotoAndStop(6);
_local5._x = -1000;
if (n < 210) {
_local5.gotoAndStop(5);
}
if (n < 165) {
_local5.gotoAndStop(4);
}
if (n < 120) {
_local5.gotoAndStop(3);
}
if (random(7) == 1) {
_local5.gotoAndStop(1);
}
}
_local5._alpha = 20;
_local5.onEnterFrame = function () {
if (this._alpha < 100) {
this._alpha = this._alpha + 20;
} else {
this.wall._alpha = 100;
this._alpha = 100;
delete this.onEnterFrame;
}
if (this.wall) {
this.wall._alpha = this._alpha;
}
};
bushes.push(_local5);
_local5.xpos = (ax * scalePos) - 1024;
_local5.ypos = (ay * scalePos) - 1024;
_local5.aposx = ax;
_local5.aposy = ay;
_local5.c = _local2;
_local5.p = wallLinks["wall" + _local2].p;
if (!_local5.light) {
_local5.heightMultiplier = 0.2 + (n / 255);
} else {
_local5.light._xscale = (_local5.light._yscale = 50);
_local5.light._y = _local5.light._y + ((Math.sin(((((n - 1000) - 1) * 18) * Math.PI) / 180) * 20) + 20);
_local5.liney._y = _local5.liney._y + ((Math.sin(((((n - 1000) - 1) * 18) * Math.PI) / 180) * 20) + 20);
}
} else {
var _local5 = _local4["tree" + _local2];
_local5.heightMultiplier = 0.2 + (n / 255);
_local5.onEnterFrame = function () {
if (this._alpha < 100) {
this._alpha = this._alpha + 20;
} else {
this._alpha = 100;
this.wall._alpha = 100;
delete this.onEnterFrame;
}
if (this.wall) {
this.wall._alpha = this._alpha;
}
};
if ((_local5._x < -20) or (_local5._x > 755)) {
_local5._alpha = 100;
_local5.wall._alpha = 100;
delete _local4["tree" + _local2].onEnterFrame;
}
}
}
function removeBush(ax, ay, num) {
var _local6 = game.objects.player;
var _local5 = game.objects;
var _local4 = (ax * 360) + ay;
var _local3 = _local5["tree" + _local4];
_local3.onEnterFrame = function () {
if (this._alpha > 0) {
this._alpha = this._alpha - 20;
} else {
var _local2 = 0;
while (_local2 < bushes.length) {
if (bushes[_local2] == this) {
bushes.splice(_local2, 1);
break;
}
_local2++;
}
this.removeCount = 0;
this.removeMovieClip();
}
};
if ((_local3._x < -20) or (_local3._x > 520)) {
var _local2 = 0;
while (_local2 < bushes.length) {
if (bushes[_local2] == _local3) {
bushes.splice(_local2, 1);
break;
}
_local2++;
}
_local3.wall.removeMovieClip();
if (_local3.wall._name) {
}
_local3.removeMovieClip();
}
}
function sortBushes(radius, val, maxval, num) {
var _local2 = game.objects.player;
_local2.unique = 1;
var _local10 = (-int(_xcam / scalePos)) + int(Math.sin((_angleY * Math.PI) / 180) * (radius * 0.8));
var _local9 = (-int(_zcam / scalePos)) + int(Math.cos((_angleY * Math.PI) / 180) * (radius * 0.8));
var _local13 = _local10 - _local2["oldAX" + _local2.unique];
var _local8 = _local9 - _local2["oldAY" + _local2.unique];
if (_local13 > 0) {
var _local11 = radius - _local13;
while (_local11 < radius) {
var _local5 = -radius;
while (_local5 < radius) {
var _local7 = _local11 + _local10;
var _local6 = _local9 + _local5;
_local7 = _local7 + (1024 / scalePos);
_local6 = _local6 + (1024 / scalePos);
var _local12 = bushArray[_local7][_local6];
if (_local12 > 0) {
attachBush(_local7, _local6, num, _local12);
}
_local5++;
}
_local11++;
}
_local11 = -radius;
while (_local11 < (_local13 - radius)) {
var _local5 = -radius;
while (_local5 < radius) {
var _local7 = _local11 + _local2["oldAX" + _local2.unique];
var _local6 = _local5 + _local2["oldAY" + _local2.unique];
_local7 = _local7 + (1024 / scalePos);
_local6 = _local6 + (1024 / scalePos);
var _local12 = bushArray[_local7][_local6];
if (_local12 > val) {
removeBush(_local7, _local6, num);
}
_local5++;
}
_local11++;
}
}
if (_local13 < 0) {
var _local11 = -radius;
while (_local11 < ((-radius) - _local13)) {
var _local5 = -radius;
while (_local5 < radius) {
var _local7 = _local11 + _local10;
var _local6 = _local9 + _local5;
_local7 = _local7 + (1024 / scalePos);
_local6 = _local6 + (1024 / scalePos);
var _local12 = bushArray[_local7][_local6];
if (_local12 > val) {
attachBush(_local7, _local6, num, _local12);
}
_local5++;
}
_local11++;
}
_local11 = radius + _local13;
while (_local11 < radius) {
var _local5 = -radius;
while (_local5 < radius) {
var _local7 = _local11 + _local2["oldAX" + _local2.unique];
var _local6 = _local5 + _local2["oldAY" + _local2.unique];
_local7 = _local7 + (1024 / scalePos);
_local6 = _local6 + (1024 / scalePos);
var _local12 = bushArray[_local7][_local6];
if (_local12 > val) {
removeBush(_local7, _local6, num);
}
_local5++;
}
_local11++;
}
}
if (_local8 > 0) {
var _local11 = -radius;
while (_local11 < radius) {
var _local5 = radius - _local8;
while (_local5 < radius) {
var _local7 = _local11 + _local10;
var _local6 = _local9 + _local5;
_local7 = _local7 + (1024 / scalePos);
_local6 = _local6 + (1024 / scalePos);
var _local12 = bushArray[_local7][_local6];
if (_local12 > val) {
attachBush(_local7, _local6, num, _local12);
}
_local5++;
}
_local11++;
}
_local11 = -radius;
while (_local11 < radius) {
var _local5 = -radius;
while (_local5 < (_local8 - radius)) {
var _local7 = _local11 + _local2["oldAX" + _local2.unique];
var _local6 = _local5 + _local2["oldAY" + _local2.unique];
_local7 = _local7 + (1024 / scalePos);
_local6 = _local6 + (1024 / scalePos);
var _local12 = bushArray[_local7][_local6];
if (_local12 > val) {
removeBush(_local7, _local6, num);
}
_local5++;
}
_local11++;
}
}
if (_local8 < 0) {
var _local11 = -radius;
while (_local11 < radius) {
var _local5 = -radius;
while (_local5 < ((-radius) - _local8)) {
var _local7 = _local11 + _local10;
var _local6 = _local9 + _local5;
_local7 = _local7 + (1024 / scalePos);
_local6 = _local6 + (1024 / scalePos);
var _local12 = bushArray[_local7][_local6];
if (_local12 > val) {
attachBush(_local7, _local6, num, _local12);
}
_local5++;
}
_local11++;
}
_local11 = -radius;
while (_local11 < radius) {
var _local5 = radius + _local8;
while (_local5 < radius) {
var _local7 = _local11 + _local2["oldAX" + _local2.unique];
var _local6 = _local5 + _local2["oldAY" + _local2.unique];
_local7 = _local7 + (1024 / scalePos);
_local6 = _local6 + (1024 / scalePos);
var _local12 = bushArray[_local7][_local6];
if (_local12 > val) {
removeBush(_local7, _local6, num);
}
_local5++;
}
_local11++;
}
}
_local2["oldAX" + _local2.unique] = _local10;
_local2["oldAY" + _local2.unique] = _local9;
}
bushes = new Array();
treeLevels = ["tree", "cact", "tree", "tree", "streetlight"];
popObjects = ["coin", "cone", "cactus", "tree", "tree"];
if (levelSelected == 2) {
popObjects = ["coin", "cone", "cactus", "light", "light"];
}
grass = new Array();
gotoAndStop ("load1");
Frame 32
function setQualLevel() {
qualLevs = ["low", "medium", "high", "ultra"];
qT.setQual(qualLevs[recQual - 1]);
qT.swapDepths(60002);
qT.swapDepths(60003);
}
function startGenerating() {
spriteRendering = "done";
}
function zeros(num) {
num = String(num);
while (num.length < 4) {
num = "0" + num;
}
return(num);
}
function drawBitmap() {
var _local1 = getTimer();
groundBmp.draw(tttt);
totalGenTime = getTimer() - startRenderTime;
setQualLevel();
if (tracknum == 2) {
a = 0;
stoneMat = new flash.geom.Matrix();
onEnterFrame = drawTrack;
} else if (tracknum == 5) {
b = 0;
onEnterFrame = drawLights;
} else {
onEnterFrame = drawTrack;
}
}
function drawLights() {
st = getTimer();
var _local1 = new flash.geom.Matrix();
lightground.light._alpha = 40;
while (((getTimer() - st) < 30) and (b < lightString.length)) {
_local1.tx = lightString[b][0];
_local1.ty = lightString[b][1];
_local1.a = (_local1.d = 0.4);
groundBmp.draw(lightground, _local1, null, "add");
b = b + 2;
}
if (b >= lightString.length) {
lightground.light._alpha = 100;
onEnterFrame = drawTrack;
}
}
function drawTrack() {
st = getTimer();
while (((getTimer() - st) < 30) and (a <= 360)) {
bushArray.push([]);
var _local1 = 0;
while (_local1 <= 360) {
var _local2 = shrubBmp.getPixel(a, _local1);
if ((_local2 > 80) && (random(50) == 1)) {
bushArray[a].push(_local2);
} else {
bushArray[a].push(0);
}
_local1++;
}
a++;
}
initialisingValue = Math.round(a / 8);
load.text = ("DRAWING TRACK, PLEASE WAIT... " + percent) + "%";
if (a > 360) {
if (tracknum == 5) {
var a = 0;
while (a < lightString.length) {
if ((a % 12) == 0) {
} else {
bushArray[int(lightString[a][0] / 8)][int(lightString[a][1] / 8)] = 1000 + (a % 12);
}
a = a + 2;
}
}
onEnterFrame = trackDrawn;
}
}
function trackDrawn() {
st = getTimer();
var _local4 = this["lineA" + tracknum];
var _local3 = this["lineB" + tracknum];
var _local2 = 0;
while (_local2 < _local3.length) {
_local2++;
}
_local2 = 0;
while (_local2 < _local4.length) {
_local2++;
}
initialisingValue = 55;
load.text = "DRAWING TRACK, PLEASE WAIT... 55%";
_xcam = (-tttt.startPos._x) + 1024;
_zcam = (-tttt.startPos._y) + 1024;
var _local6 = -Math.round(_xcam / 8);
var _local5 = -Math.round(_zcam / 8);
_local6 = _local6 + 128;
_local5 = _local5 + 128;
speedo.reddot._x = ((-_local6) / 2.5) - 297;
speedo.reddot._y = (_local5 / 2.5) - 263;
_angleY = (-tttt.startPos._rotation) + 180;
mapArray = tttt.mapArray;
_local2 = 0;
while (_local2 < 360) {
mapArray[_local2][1] = [3, 0];
mapArray[_local2][0] = [3, 0];
mapArray[_local2][358] = [3, 180];
mapArray[_local2][359] = [3, 180];
mapArray[0][_local2] = [3, -90];
mapArray[1][_local2] = [3, -90];
mapArray[358][_local2] = [3, 90];
mapArray[359][_local2] = [3, 90];
_local2++;
}
tttt.removeMovieClip();
t.dispose();
st = getTimer();
attachTrees();
onEnterFrame = drawTrees;
}
function drawTrees() {
initialisingValue = 60;
load.text = "DRAWING TRACK, PLEASE WAIT... 60%";
st = getTimer();
wallLinks = new Object();
var _local1 = createEmptyMovieClip("bound", 97685);
boundary = _local1.createEmptyMovieClip("bound", 1);
_local1._visible = 0;
aa = 0;
onEnterFrame = drawBoundary;
}
function drawBoundary() {
st = getTimer();
while ((aa < bArray.length) and ((getTimer() - st) < 30)) {
var _local10 = 0;
while (_local10 < bArray[aa][2].length) {
boundary.clear();
boundary.lineStyle(1, 0, 100);
var _local11 = int(substring(bArray[aa][2][_local10], 2, -1)) - 1;
var _local8 = bArray[aa][0];
var _local7 = bArray[aa][1];
var _local13 = bArray[_local11][0];
var _local12 = bArray[_local11][1];
var _local6 = _local13 - _local8;
var _local5 = _local12 - _local7;
var _local1 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local14 = _local1 / 3;
var _local15 = _local1 / Math.ceil(_local14);
var _local4 = _local8;
var _local3 = _local7;
bushArray[int(_local4)][int(_local3)] = 3;
var _local2 = 4;
if (Math.abs(_local6) > Math.abs(_local5)) {
_local8 = 1;
_local7 = Math.abs(_local5 / _local6);
_local1 = Math.abs(_local6);
} else {
_local8 = Math.abs(_local6 / _local5);
_local7 = 1;
_local1 = Math.abs(_local5);
}
dist = Math.ceil(_local1 / _local2);
_local2 = _local1 / dist;
if (_local5 < 0) {
_local7 = _local7 * -1;
}
if (_local6 < 0) {
_local8 = _local8 * -1;
}
if (_local1 < _local2) {
_local1 = _local2;
}
var _local9 = 0;
while (_local9 < Math.ceil(_local1 / _local2)) {
ox = int(_local4);
oy = int(_local3);
boundary.moveTo(int(_local4) * 8, int(_local3) * 8);
_local4 = _local4 + (_local8 * _local2);
_local3 = _local3 + (_local7 * _local2);
bushArray[int(_local4)][int(_local3)] = 3;
_local9++;
}
if (tracknum != 2) {
boundary.filters = [new flash.filters.BlurFilter(2, 2, 3)];
groundBmp.draw(bound);
}
_local10++;
}
aa++;
}
initialisingValue = int(60 + ((40 / bArray.length) * aa));
load.text = ("DRAWING TRACK, PLEASE WAIT... " + int(60 + ((40 / bArray.length) * aa))) + "%";
if (aa >= bArray.length) {
bitmapPos = 0;
playerBmps = [];
playerCoords = [];
frameArray = [0, 3, 9, 15, 21, 27, 33, 39, 45, 51, 57, 65, 69, 75, 81, 87, 93, 99, 105, 111, 117, 123, 129, 133, 137, 141, 145, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 215, 219, 225, 231, 237, 243, 249, 255, 261, 267, 273, 279, 285, 291, 297, 303, 309, 315, 321, 327, 333, 339, 345, 351, 357, 359];
onEnterFrame = carBitmaps;
}
}
function carBitmaps() {
st = getTimer();
while ((bitmapPos < frameArray.length) && ((getTimer() - st) < 30)) {
var _local4 = new flash.display.BitmapData(player.car.car._width, player.car.car._height, true, 0);
var _local3 = new flash.geom.Matrix();
var _local6 = player.car.car.getBounds(player.car.car);
_local3.tx = _local3.tx - _local6.xMin;
_local3.ty = _local3.ty - _local6.yMin;
player.car.car.gotoAndStop(frameArray[bitmapPos] + 1);
_local4.draw(player.car.car, _local3);
var _local1 = _local4.getColorBoundsRect(4294967295, 0, false);
var _local8 = _local1.width;
var _local7 = _local1.height;
_local3.tx = -_local1.x;
_local3.ty = -_local1.y;
var _local5 = new flash.display.BitmapData(_local8, _local7, true, 0);
_local5.draw(_local4, _local3);
_local4.dispose();
if (bitmapPos < (frameArray.length - 1)) {
var _local2 = frameArray[bitmapPos];
while (_local2 < frameArray[bitmapPos + 1]) {
playerCoords.push([_local1.x, _local1.y]);
playerBmps.push(_local5);
_local2++;
}
} else {
playerBmps.push(_local5);
}
bitmapPos++;
}
if (bitmapPos >= frameArray.length) {
onEnterFrame = finishIt;
}
}
function finishIt() {
if (!finished) {
if (adFinished) {
var _local4 = createEmptyMovieClip("tat", getNextHighestDepth());
oo = _local4.createEmptyMovieClip("oo", 1);
if (tracknum == 4) {
_local4.oo._alpha = 50;
}
var _local2 = 1;
while (_local2 <= 30) {
var _local3 = flash.display.BitmapData.loadBitmap("sea" + _local2);
oo.beginBitmapFill(_local3);
oo.lineTo(256, 0);
oo.lineTo(256, 256);
oo.lineTo(0, 256);
oo.endFill();
this["sea" + _local2] = new flash.display.BitmapData(256, 256, false, 0);
this["sea" + _local2].draw(_local4);
_local4.oo.clear();
_local2++;
}
_local4.removeMovieClip();
bound.removeMovieClip();
finished = true;
}
if (adFinished) {
sky = attachMovie("sky" + tracknum, "sky", 0);
blacklines = createEmptyMovieClip("blacklines", 100);
logos.swapDepths(100002);
logos.swapDepths(100001);
if (tracknum != 2) {
lowQualGround = new flash.display.BitmapData(2880, 2880, false, 0);
var _local5 = createEmptyMovieClip(seamc, getNextHighestDepth());
tempSea = sea1.clone();
colmatrix = [[0.5, 0, 0, 0, 65, 0, 0.5, 0.05, 0, 80, 0, 0, 0.5, 0, 120, 0, 0, 0, 1, 0], [], [0.5, 0, 0, 0, 75, 0, 0.5, 0.15, 0, 120, 0, 0, 0.5, 0, 150, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, -70, 0, 1, 0, 0, -70, 0, 0, 1, 0, -70, 0, 0, 0, 1, 0]];
tempSea.applyFilter(tempSea, tempSea.rectangle, new flash.geom.Point(0, 0), new flash.filters.ColorMatrixFilter(colmatrix[tracknum - 1]));
_local5.beginBitmapFill(tempSea);
_local5.lineTo(2880, 0);
_local5.lineTo(2880, 2880);
_local5.lineTo(0, 2880);
_local5.endFill();
lowQualGround.draw(_local5);
lowQualGround.draw(groundBmp);
tempSea.dispose();
_local5.removeMovieClip();
}
delete this.onEnterFrame;
gotoAndStop ("level1");
}
}
}
qT._visible = 0;
if (recQual == int(cookie.data["user" + username].qual)) {
}
spriteRendering = "done";
player = game.objects.attachMovie("toyota", "player", 999);
bmpX = player.car.bmp._x;
bmpY = player.car.bmp._y;
if (allowCache) {
player.cacheAsBitmap = true;
}
player._xscale = (player._yscale = 100);
player._x = -1000;
var totalAI = 7;
theObs = [player];
var a = 1;
while (a <= totalAI) {
var ai = ((this["ai" + a] = game.objects.attachMovie("toyota", "ai" + a, 999 - a)));
if (allowCache) {
ai.cacheAsBitmap = true;
}
theObs.push(ai);
ai._x = -1000;
a++;
}
startGenerating();
a = 0;
bushArray = [];
load.text = " PLEASE WAIT...";
createGround();
onEnterFrame = function () {
startRenderTime = getTimer();
var _local5 = getTimer();
shrubBmp = new flash.display.BitmapData(360, 360, false, 0);
var _local3 = new flash.geom.Matrix();
_local3.a = 0.125;
_local3.d = 0.125;
var _local4 = new flash.geom.Matrix();
_local4.a = 8;
_local4.d = 8;
shrubBmp.draw(tttt.shrubs, _local3);
shrubBmp.applyFilter(shrubBmp, shrubBmp.rectangle, new flash.geom.Point(0, 0), new flash.filters.BlurFilter(8, 8, 3));
tttt.shrubs._visible = false;
tArray = [];
balls = [];
for (var _local2 in tttt) {
if (_local2 == "tree") {
tArray.push([Math.round(tttt[_local2]._x / 8) * 8, Math.round(tttt[_local2]._y / 8) * 8]);
tttt[_local2]._name = "done";
}
if (_local2 == "ball") {
balls.push([tttt[_local2]._x, tttt[_local2]._y]);
tttt[_local2]._visible = false;
tttt[_local2]._name = "done";
}
}
lightLines = [];
if (tracknum == 5) {
var _local1 = 0;
while (_local1 < lightString.length) {
lightLines.push((int(lightString[_local1][0] / 8) * 360) + int(lightString[_local1][1] / 8));
if ((_local1 % 12) == 0) {
tArray.push([int(lightString[_local1][0] / 8) * 8, int(lightString[_local1][1] / 8) * 8]);
}
_local1 = _local1 + 2;
}
}
var _local1 = 0;
onEnterFrame = drawBitmap;
};
aibmps = [];
var c = 0;
while (c < 7) {
aibmps[c] = [];
c++;
}
Frame 35
ytplayer.destroy();
ytplayer.unloadClip();
ytplayer.swapDepths(this.getNextHighestDepth());
ytplayer.removeMovieClip();
ytPlayerLoader.removeListener(ytPlayerLoaderListener);
ytplayer.removeEventListener("onStateChange", onPlayerStateChange);
ytplayer.removeEventListener("onError", onPlayerError);
ytPlayerDestroyed = true;
ytplayerLoaded = false;
ytPlayerLoader = null;
stop();
function doRain() {
rain._y = rain._y + 14;
if (rain._y > 0) {
rain._y = rain._y - 400;
}
}
if (tracknum == 4) {
attachMovie("rain", "rain", 2003);
}
if (tracknum == 5) {
heavyness = -1;
a = 0;
c = 0;
tl = 3;
mrs = createEmptyMovieClip("mrs", 1000);
dis = new flash.display.BitmapData(138, 100, false, 0);
dis.draw(noise);
disp = new flash.filters.DisplacementMapFilter(dis, new flash.geom.Point(0, 0), 1, 1, 2, 2);
t = 1;
while (t < tl) {
_root["l" + t] = new flash.display.BitmapData(138, 120, true, 0);
t++;
}
_root["l" + tl] = new flash.display.BitmapData(138, 120, true, 0);
temp = new flash.display.BitmapData(138, 100, true, 0);
mrs._xscale = (mrs._yscale = 400);
realSnowMat = new flash.geom.Matrix();
realSnowMat.ty = -20;
snomat = new flash.geom.Matrix();
snomat.ty = 4;
doSnow = function () {
var _local4 = 1;
while (_local4 <= heavyness) {
var _local2 = 1;
while (_local2 <= tl) {
snomat.tx = random(138);
var _local3 = (_local2 / 4) + 0.5;
snomat.d = _local3;
snomat.a = _local3;
_root["l" + _local2].draw(s, snomat);
_local2++;
}
_local4++;
}
var _local5 = new flash.display.BitmapData(138, 100, true, 0);
mrs.attachBitmap(_local5, 1);
var _local2 = 1;
while (_local2 <= tl) {
_root["l" + _local2].scroll(0, _local2);
if (_local2 != tl) {
_local5.draw(_root["l" + _local2], realSnowMat);
}
_local2++;
}
temp.draw(_root["l" + tl], realSnowMat);
temp.applyFilter(temp, _root["l" + tl].rectangle, new flash.geom.Point(0, 0), disp);
_local5.draw(temp);
};
}
initCars();
function addDolphin() {
totalDolphins++;
var _local1 = game.objects.attachMovie("dolphin", "dolphin" + totalDolphins, uniqueDepth++);
if (allowCache) {
s.cacheAsBitmap = true;
}
_local1.xpos = random(2880) - 1024;
_local1.ypos = random(2880) - 1024;
_local1.ang = random(360);
_local1.dist = random(20) + 20;
var _local4 = (groundBmp.getPixel32(_local1.xpos + 1024, _local1.ypos + 1024) >> 24) & 255;
var _local3 = _local1.xpos + (((Math.sin((_local1.ang * Math.PI) / 180) * (-_local1.dist)) / 4) * _local1.dist);
var _local2 = _local1.ypos - (((Math.cos((_local1.ang * Math.PI) / 180) * (-_local1.dist)) / 4) * _local1.dist);
var _local5 = (groundBmp.getPixel32(_local3 + 1024, _local2 + 1024) >> 24) & 255;
if ((_local4 > 2) or (_local5 > 2)) {
_local1.removeMovieClip();
} else {
_local1.nx = _local3;
_local1.ny = _local2;
_local1.fly = 0;
_local1.flying = true;
_local1.flyamount = _local1.dist;
_local1.oy = _local1.dolphin._y;
_local1.dy = 0;
sortObject(_local1, 1);
if (((_local1._x > -100) and (_local1._x < 650)) and (_local1._y < 500)) {
_local1.dolphin.gotoAndStop(1);
dolphins.push(_local1);
totalSplashes++;
var s = game.objects.attachMovie("splash", "splash" + totalSplashes, uniqueDepth++);
if (allowCache) {
s.cacheAsBitmap = true;
}
s.xpos = _local1.xpos;
s.ypos = _local1.ypos;
s.isSplash = 1;
splashes.push(s);
sortObject(s, 1);
if (players == 2) {
sortObject(_local1, 2);
sortObject(s, 2);
}
} else {
_local1.removeMovieClip();
}
}
}
function sortDolphins() {
for (var _local3 in dolphins) {
var _local1 = dolphins[_local3];
_local1.xpos = _local1.xpos + ((Math.sin((_local1.ang * Math.PI) / 180) * (-_local1.dist)) / 4);
_local1.ypos = _local1.ypos - ((Math.cos((_local1.ang * Math.PI) / 180) * (-_local1.dist)) / 4);
_local1.dy = _local1.dy - _local1.flyamount;
_local1.flyamount = _local1.flyamount - 2;
if (_local1.flyamount == ((-_local1.dist) + 6)) {
totalSplashes++;
var _local2 = game.objects.attachMovie("splash", "splash" + totalSplashes, uniqueDepth++);
_local2.xpos = _local1.nx;
_local2.ypos = _local1.ny;
_local2.isSplash = 1;
splashes.push(_local2);
if (allowCache) {
_local2.cacheAsBitmap = true;
}
sortObject(_local2);
}
if (_local1.flyamount < (-_local1.dist)) {
dolphins.splice(_local3, 1);
_local3--;
_local1.removeMovieClip();
}
sortObject(_local1);
_local1.dolphin.gotoAndStop(int(7 - ((_local1.flyamount + _local1.dist) / ((_local1.dist * 2) / 7))) + 1);
_local1.dolphin._y = _local1.oy + _local1.dy;
}
for (var _local3 in splashes) {
sortObject(splashes[_local3]);
}
}
dolphins = [];
splashes = [];
totalDolphins = 0;
totalSplashes = 0;
function initIt() {
var _local1;
_resoDx = 550;
_resoDy = 200;
ground._x = _resoDx * 0.5;
ground._y = 230;
_angleX = 0;
_ycam = 50;
}
player = objects.player;
_root.player.swapDepths((int(_root.player._y) * 1000) + 999);
var _nbMs;
var _oldTime;
var _resoDx;
var _resoDy;
var _xcam;
var _ycam;
var _zcam;
var _angleX;
var _angleY;
var _nbScans;
var _scanSteps;
var _bmpd;
var _mapId;
var _mapList;
var _bMouse;
camx = 0;
camy = 0;
var x = 0;
var y = 0;
_bMouse = false;
initIt();
function sortspeedo() {
var _local1 = String(int((speed * 5) / tRatio));
if (speed < 0) {
_local1 = 0;
}
while (_local1.length < 3) {
_local1 = "0" + _local1;
}
speedo.mph.setValue(_local1);
}
function sortSky() {
sky.sky._x = ((-_angleY) / 0.09) + levelAdjust[tracknum - 1];
while (sky.sky._x < -2000) {
sky.sky._x = sky.sky._x + 4000;
}
while (sky.sky._x > 0) {
sky.sky._x = sky.sky._x - 4000;
}
var _local1 = (2.5 * Math.cos(((_angleY + 180) * Math.PI) / 180)) + 2.5;
effectMC._alpha = _local1 * _local1;
}
levelAdjust = [1800, 0, 0, 0, 0, 0];
function checkpos(_angleY, speed) {
mapArray = mapArray;
velx = _xcam - ox;
vely = _zcam - oy;
ox = _xcam;
oy = _zcam;
orx = rayX;
ory = rayZ;
rayX = Math.sin((_angleY * Math.PI) / 180);
rayZ = Math.cos((_angleY * Math.PI) / 180);
_xcam = _xcam - ((rayX * speed) + skidx);
_zcam = _zcam - ((rayZ * speed) + skidy);
_xcam = _xcam + addXcam;
_zcam = _zcam + addZcam;
addXcam = addXcam * groundFriction;
addZcam = addZcam * groundFriction;
flying = false;
var _local9 = -Math.round(_xcam / scalePos);
var _local7 = -Math.round(_zcam / scalePos);
_local9 = _local9 + (1024 / scalePos);
_local7 = _local7 + (1024 / scalePos);
var _local25 = ox;
var _local26 = oy;
var _local23 = (-Math.round(_local25 / scalePos)) + (1024 / scalePos);
var _local22 = (-Math.round(_local26 / scalePos)) + (1024 / scalePos);
var _local15 = _root.mapArray[_local9][_local7];
var _local28 = _root.mapArray[_local23][_local22];
speedo.reddot._x = ((-_local9) / 2.5) - 297;
speedo.reddot._y = (_local7 / 2.5) - 263;
game.map._x = 100 + _local9;
game.map._y = 100 - _local7;
var _local21 = speed / 15;
var _local27 = (speed / 2) + 3;
var _local24 = 0;
if (speed > 0) {
_local24 = 1;
}
breaking = 0;
if (_local15 == undefined) {
_local15 = 1;
}
player._rotation = 0;
if ((((_local15 == 0) or (_local15 == 4)) or (_local15 == 6)) or (_local15 == 8)) {
player._y = kh1 + (random(3) * _local21);
player._rotation = ((random(7) - 3) * _local21) + ((random(5) - 2) * _local24);
maxspeed = 5;
breaking = 0.25;
offroad = 1;
grassplaying = 1;
} else {
if (grassplaying == 1) {
offgrass = 1;
grassplaying = 0;
}
player._rotation = (((random(11) - 5) * player.toPixel) / 100) * _local21;
maxspeed = playersMaxSpeed;
maxspeed = playersMaxSpeed - (player.toPixel / 8);
offroad = 0;
player._y = kh1;
}
var _local17 = getLine(_local23, _local22, _local9, _local7);
var _local5 = 0;
while (_local5 < _local17.length) {
_local15 = mapArray[_local17[_local5][0]][_local17[_local5][1]];
if ((_local15 == 4) or (_local15 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
heavyness = heavyness + 0.5;
}
}
if ((_local15 == 6) or (_local15 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
heavyness = heavyness + 0.5;
}
}
if ((_local15 == 8) or (_local15 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
heavyness = heavyness + 0.5;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) or (bestTime == 0)) {
bestTime = lapTime;
var _local19 = int(lapTime % 100);
var _local16 = int(lapTime / 100);
var _local18 = _local16 % 60;
var _local20 = int(_local16 / 60);
speedo.best.text = (((("BEST LAP: " + sortZero(_local20)) + ":") + sortZero(_local18)) + ":") + sortZero(_local19);
}
lapTime = 0;
}
if (lapnum >= 4) {
_xcama = 0;
_zcama = 0;
endRace = 1;
objects = game.objects;
objects.ai8 = game.objects.player;
objects.ai8.dot = speedo.reddot;
objects.ai8.ang = (-_angleY) + 180;
objects.ai8.xpos = (-_xcam) - Math.sin((_angleY * Math.PI) / 180);
objects.ai8.ypos = (-_zcam) - Math.cos((_angleY * Math.PI) / 180);
objects.ai8.topSpeed = 15;
objects.ai8.speed = speed;
objects.ai8.accel = 0.2;
var _local2 = objects.ai8;
_local2.pushx = (_local2.pushy = 0);
objects.ai8.pos++;
_local2.pos = 0;
_local2.goalX = (cArray[_local2.pos][0] * 8) - 1024;
_local2.goalY = (cArray[_local2.pos][1] * 8) - 1024;
_local2.dx = _local2.xpos - _local2.goalX;
_local2.dy = _local2.ypos - _local2.goalY;
_local2.dz = Math.sqrt((_local2.dx * _local2.dx) + (_local2.dy * _local2.dy));
_local2.ra = 0;
_local2.posCount = 0;
_local2.maxspeed = _local2.topSpeed;
_local2.pushed = 0;
_local2.checkPointReached = 2;
_local2.lapnum = 0;
_local2.isAi = 1;
_local2.aiNum = 7;
ca.noMask = 1;
_local2.xm = 0;
trackCar = 1;
_local2.accel = 0.2;
_local2.breaking = 0;
ahead = 0;
_local5 = 1;
while (_local5 <= 7) {
if (objects["ai" + _local5].lapnum >= 4) {
ahead++;
}
_local5++;
}
resultPanel.place.gotoAndStop(ahead + 1);
resultPanel._visible = 1;
speedo.gotoAndStop(2);
if (ahead == 0) {
resultPanel.congrats._visible = 1;
resultPanel.congrats.gotoAndStop(1);
if (tracknum == 1) {
resultPanel.congrats.gotoAndStop(3);
}
if (tracknum == 5) {
resultPanel.congrats.gotoAndStop(2);
}
_root.levelsDone = _root.tracknum;
if (singlePlayer) {
saveUnLock(_root.levelsDone);
}
} else {
resultPanel.tryagain._visible = 1;
if (tracknum == 5) {
resultPanel.tryagain.gotoAndStop(2);
}
}
} else {
speedo.lap.gotoAndStop(lapnum + 1);
}
}
}
var _local12 = 0;
var _local6 = 1;
if (_local15[0] != 3) {
_local6 = 0;
}
while (_local6 == 1) {
_local12++;
if (_local12 > 100) {
_local6 = 0;
}
if (_local15[0] != 3) {
_local6 = 0;
} else {
var _local8 = ((Math.atan2(_zcam - oy, _xcam - ox) * 180) / Math.PI) + 90;
var _local14 = (angAdjust = -_local8);
if (_local15[0] == 3) {
angAdjust = -_local15[1];
}
if (crashed == 1) {
crash.attachSound("thud");
crash.start();
} else if (speed > 5) {
crash.attachSound("hit" + (random(3) + 1));
crash.start();
} else {
crash.attachSound("bang" + (random(5) + 1));
crash.start();
}
if ((speed > 1) && (_root.noSFX != 1)) {
crash.setVolume((speed * 3) + 50);
} else {
crash.setVolume(0);
}
var _local4 = Math.abs(angAdjust - _local14);
while (_local4 > 360) {
_local4 = _local4 - 360;
}
if ((Math.abs(_local4) < 90) or (Math.abs(_local4) >= 270)) {
angAdjust = angAdjust + 180;
}
if (speed < 0) {
angAdjust = angAdjust + 180;
}
var _local13 = angAdjust - (-_local8);
if (speed < 0) {
_local13 = _local13 + 180;
}
var _local10 = speed * 0.6;
skidx = Math.sin((angAdjust * Math.PI) / 180) * _local10;
skidy = Math.cos((angAdjust * Math.PI) / 180) * _local10;
speed = speed * 0.6;
_xcam = ox;
_zcam = oy;
rayX = Math.sin((_angleY * Math.PI) / 180);
rayZ = Math.cos((_angleY * Math.PI) / 180);
_xcam = _xcam - skidx;
_zcam = _zcam - skidy;
ox = _xcam;
oy = _zcam;
_local9 = -Math.round(_xcam / 8);
_local7 = -Math.round(_zcam / 8);
_local9 = _local9 + 128;
_local7 = _local7 + 128;
_local15 = _root.mapArray[_local9][_local7];
}
}
_local5++;
}
if (_local15 == 1) {
objects.player.car._y = kh1 + (random(2) * _local21);
}
_root._angleY = _angleY;
return(speed);
}
function getLine(ox, oy, nx, ny) {
var _local6 = new Array();
var _local9 = nx - ox;
var _local8 = ny - oy;
if (Math.abs(_local9) > Math.abs(_local8)) {
var _local7 = _local9;
var _local5 = 1;
var _local4 = Math.abs(_local8 / _local9);
} else {
var _local7 = _local8;
var _local4 = 1;
var _local5 = Math.abs(_local9 / _local8);
}
if (_local8 < 0) {
var _local4 = _local4 * -1;
}
if (_local9 < 0) {
var _local5 = _local5 * -1;
}
if (!_local5) {
var _local5 = 0;
}
if (!_local4) {
var _local4 = 0;
}
var _local1 = 0;
while (_local1 < Math.abs(_local7)) {
oy = oy + _local4;
ox = ox + _local5;
_local6.push([Math.round(ox), Math.round(oy)]);
_local1++;
}
return(_local6);
}
playersCompleted = 0;
flyamount = 0;
pushed = 0;
trackFriction = 0.5;
qT._visible = true;
initialisrEnterFrame();
realEnterFrame();
delete onEnterFrame;
onEnterFrame = realEnterFrame;
createEmptyMovieClip("playersfx", getNextHighestDepth());
crash = new Sound(playersfx);
startEngine();
loopMusic();
Instance of Symbol 943 MovieClip "speedo" in Frame 35
onClipEvent (load) {
this.swapDepths(4000);
}
Frame 36
stop();
Frame 37
gotoAndStop (36);
Symbol 26 MovieClip [num] Frame 1
stop();
Symbol 30 MovieClip Frame 1
function setValue(number) {
var _local4 = String(number);
var _local2 = 1;
while (_local2 <= 2) {
this["digit" + _local2]._visible = false;
_local2++;
}
var _local5 = _local4.length;
if (_local5 == 3) {
digit1.gotoAndStop(2);
_local2 = 1;
while (_local2 <= 3) {
this["digit" + _local2]._visible = true;
_local2++;
}
digit3.gotoAndStop(1);
digit2.gotoAndStop(1);
}
if (_local5 == 2) {
digit2._visible = true;
digit3._visible = true;
digit2.gotoAndStop(int(substring(_local4, 0, 1)) + 1);
digit3.gotoAndStop(int(substring(_local4, 2, 1)) + 1);
}
if (_local5 == 1) {
digit3._visible = true;
digit3.gotoAndStop(int(_local4));
}
var _local3 = 0;
if (digit1._visible) {
_local3 = _local3 + digit1._width;
}
digit2._x = _local3;
if (digit2._visible) {
_local3 = _local3 + digit2._width;
}
digit3._x = _local3;
_local3 = _local3 + digit3._width;
percent._x = _local3;
}
Symbol 47 MovieClip Frame 1
stop();
blink = "0";
Symbol 47 MovieClip Frame 2
blink = "1";
Symbol 48 MovieClip Frame 1
if (Number(random(50)) == 1) {
if (Number(eyelids.blink) == 0) {
eyelids.play();
}
}
Symbol 48 MovieClip Frame 2
gotoAndPlay (1);
Symbol 65 MovieClip Frame 1
play();
Symbol 80 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 1
h.gotoAndStop(this._name);
play();
forcex = 0;
forcey = 0;
Symbol 81 MovieClip Frame 2
aa = _xmouse - h._x;
bb = _ymouse - h._x;
if ((((Number(aa) > Number(-50)) and (Number(aa) < 50)) and (Number(bb) > Number(-50))) and (Number(bb) < 50)) {
gotoAndPlay (3);
} else {
gotoAndPlay (1);
}
Symbol 81 MovieClip Frame 3
aa = _xmouse - h._x;
bb = _ymouse - h._y;
if ((((Number(aa) > Number(-50)) and (Number(aa) < 50)) and (Number(bb) > Number(-50))) and (Number(bb) < 50)) {
value = Number(aa * aa) + Number(bb * bb);
rr = Math.sqrt(value);
} else {
rr = 0;
if ((Number(powerx) == 0) and (Number(powery) == 0)) {
gotoAndPlay (1);
}
}
if ((!rr) == 0) {
powerx = h._x - (((aa / rr) * (25 + Number(50 - rr))) / (rr / 2));
powery = h._y - (((bb / rr) * (25 + Number(50 - rr))) / (rr / 2));
} else {
powerx = 0;
powery = 0;
}
forcex = (Number(forcex) + Number((-h._x) / 2)) / 1.66;
forcey = (Number(forcey) + Number((-h._y) / 2)) / 1.66;
h._x = Number(powerx) + Number(forcex);
h._y = Number(powery) + Number(forcey);
Symbol 81 MovieClip Frame 4
gotoAndPlay (3);
Symbol 83 MovieClip Frame 60
stop();
_root.nextFrame();
Symbol 85 Button
on (release) {
getURL (cl[0], "_blank");
}
Symbol 1075 MovieClip [__Packages.mochi.as2.MochiSync] Frame 0
class mochi.as2.MochiSync
{
var _syncContainer;
function MochiSync () {
_syncContainer = {};
}
function getProp(name) {
return(_syncContainer[name]);
}
function setProp(name, value) {
if (_syncContainer[name] == value) {
return(undefined);
}
_syncContainer[name] = value;
mochi.as2.MochiServices.send("sync_propUpdate", {name:name, value:value});
}
function triggerEvent(eventType, args) {
switch (eventType) {
case SYNC_REQUEST :
mochi.as2.MochiServices.send("sync_syncronize", _syncContainer);
break;
case SYNC_PROPERTY :
_syncContainer[args.name] = args.value;
}
}
static var SYNC_REQUEST = "SyncRequest";
static var SYNC_PROPERTY = "UpdateProperty";
}
Symbol 1076 MovieClip [__Packages.mochi.as2.MochiServices] Frame 0
class mochi.as2.MochiServices
{
static var _id, _container, _clip, _sendChannelName, __get__comChannelName, onError, _listenChannel, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("3.8 as2");
}
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 get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
warnID(id, false);
if ((!_connected) && (_clip == undefined)) {
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.as2.MochiServices.onError = onError;
} else if (mochi.as2.MochiServices.onError == undefined) {
mochi.as2.MochiServices.onError = function (errorCode) {
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local6 = "_mochiservices_com_" + id;
var _local5 = new MovieClipLoader();
var _local3 = {};
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
if (urlOptions().servURL) {
_servURL = urlOptions().servURL;
}
var _local4 = _servURL + _services;
if (urlOptions().servicesURL) {
_local4 = urlOptions().servicesURL;
}
allowDomains(_local4);
_clip = clip.createEmptyMovieClip(_local6, 10336, false);
_listenChannelName = _listenChannelName + ((Math.floor(new Date().getTime()) + "_") + Math.floor(Math.random() * 99999));
listen();
if (_local3.waitInterval != null) {
clearInterval(_local3.waitInterval);
}
_local3.onLoadError = loadError;
_local3.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_local3.onLoadComplete = function (target_mc) {
target_mc.MochiServices = mochi.as2.MochiServices;
};
_local3.startTime = getTimer();
_local3.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.as2.MochiServices.disconnect();
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_local3.waitInterval = setInterval(_local3, "wait", 1000);
_local5.addListener(_local3);
_local5.loadClip((((((_local4 + "?listenLC=") + _listenChannelName) + "&mochiad_options=") + escape(_root.mochiad_options)) + "&api_version=") + getVersion(), _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
return(_clip);
}
static function loadError(target_mc, errorCode, httpStatus) {
disconnect();
onError.apply(null, [errorCode]);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.as2.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel._nextcallbackID = 0;
_listenChannel._callbacks = {};
_listenChannel.connect(_listenChannelName);
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, version:getVersion()});
_listenChannel.onStatus = function (infoObject) {
mochi.as2.MochiServices.onStatus(infoObject);
};
_listenChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_listenChannel.onEvent = function (pkg) {
switch (pkg.target) {
case "events" :
mochi.as2.MochiEvents.triggerEvent(pkg.event, pkg.args);
break;
case "coins" :
mochi.as2.MochiSocial.triggerEvent(pkg.event, pkg.args);
break;
case "sync" :
mochi.as2.MochiServices.servicesSync.triggerEvent(pkg.event, pkg.args);
}
};
_listenChannel.onError = function () {
mochi.as2.MochiServices.onError.apply(null, ["IOError"]);
};
_connecting = false;
_connected = true;
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function updateCopy(args) {
send("coins_updateCopy", args, null, null);
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _listenChannel._callbacks[_local1.callbackID];
}
delete _listenChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_listenChannel._nextcallbackID});
}
_listenChannel._callbacks[_listenChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_listenChannel._nextcallbackID++;
}
static function urlOptions() {
var _local5 = {};
var _local6;
if (_root._url.indexOf("mochiad_options") != -1) {
var _local2 = (_root._url.indexOf("mochiad_options") + "mochiad_options".length) + 1;
_local6 = _root._url.substr(_local2, _root._url.length);
} else if (_root.mochiad_options) {
_local6 = _root.mochiad_options;
}
if (_local6) {
var _local4 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2].split("=");
_local5[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local5);
}
static function warnID(bid, leaderboard) {
bid = bid.toLowerCase();
if (bid.length != 16) {
return(undefined);
}
if (bid == "1e113c7239048b3f") {
if (leaderboard) {
}
return(undefined);
}
if (bid == "84993a1de4031cd8") {
if (leaderboard) {
}
return(undefined);
}
var _local1 = 0;
while (_local1 < bid.length) {
switch (bid.charAt(_local1)) {
case "0" :
case "1" :
case "2" :
case "3" :
case "4" :
case "5" :
case "6" :
case "7" :
case "8" :
case "9" :
case "a" :
case "b" :
case "c" :
case "d" :
case "e" :
case "f" :
break;
default :
return(undefined);
}
_local1++;
}
}
static function addLinkEvent(url, burl, btn, onClick) {
var timeout = 1500;
var t0 = getTimer();
var _local2 = new Object();
_local2.mav = getVersion();
_local2.swfv = btn.getSWFVersion() || 6;
_local2.swfurl = btn._url;
_local2.fv = System.capabilities.version;
_local2.os = System.capabilities.os;
_local2.lang = System.capabilities.language;
_local2.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local3 = 0;
for (var _local6 in _local2) {
if (_local3 != 0) {
s = s + "&";
}
_local3++;
s = ((s + _local6) + "=") + escape(_local2[_local6]);
}
if (!(netupAttempted || (_connected))) {
var ping = btn.createEmptyMovieClip("ping", 777);
var _local7 = btn.createEmptyMovieClip("nettest", 778);
netupAttempted = true;
ping.loadMovie("http://x.mochiads.com/linkping.swf?t=" + getTimer());
_local7.onEnterFrame = function () {
if ((ping._totalframes > 0) && (ping._totalframes == ping._framesloaded)) {
delete this.onEnterFrame;
} else if ((getTimer() - t0) > timeout) {
delete this.onEnterFrame;
mochi.as2.MochiServices.netup = false;
}
};
}
var _local4 = btn.createEmptyMovieClip("clk", 1001);
_local4._alpha = 0;
_local4.beginFill(1044735);
_local4.moveTo(0, 0);
_local4.lineTo(0, btn._height);
_local4.lineTo(btn._width, btn._height);
_local4.lineTo(btn._width, 0);
_local4.lineTo(0, 0);
_local4.endFill();
_local4.onRelease = function () {
if (mochi.as2.MochiServices.netup) {
getURL (url + s, "_blank");
} else {
getURL (burl, "_blank");
}
if (onClick != undefined) {
onClick();
}
};
}
static function setContainer(clip) {
}
static function stayOnTop(clip) {
}
static var _servURL = "http://www.mochiads.com/static/lib/services/";
static var _services = "services.swf";
static var _mochiLC = "MochiLC.swf";
static var _listenChannelName = "__ms_";
static var _connecting = false;
static var _connected = false;
static var netup = true;
static var netupAttempted = false;
static var servicesSync = new mochi.as2.MochiSync();
}
Symbol 1077 MovieClip [__Packages.mochi.as2.MochiEventDispatcher] Frame 0
class mochi.as2.MochiEventDispatcher
{
var eventTable;
function MochiEventDispatcher () {
eventTable = {};
}
function buildDelegate(thisObject, thatObject) {
var _local2 = {thisObject:thisObject, thatObject:thatObject};
if (thatObject != undefined) {
var funct = ((typeof(thatObject) == "string") ? (thisObject[thatObject]) : (thatObject));
_local2.delegate = function (args) {
funct.call(thisObject, args);
};
} else {
_local2.delegate = thisObject;
}
return(_local2);
}
function compareDelegate(d_A, d_B) {
if ((d_A.thisObject != d_B.thisObject) || (d_A.thatObject != d_B.thatObject)) {
return(false);
}
return(true);
}
function addEventListener(event, thisObject, thatObject) {
removeEventListener(event, thisObject, thatObject);
eventTable[event].push(buildDelegate(thisObject, thatObject));
}
function removeEventListener(event, thisObject, thatObject) {
var _local3 = buildDelegate(thisObject, thatObject);
if (eventTable[event] == undefined) {
eventTable[event] = [];
return(undefined);
}
for (var _local4 in eventTable[event]) {
if (!compareDelegate(eventTable[event][_local4], _local3)) {
continue;
}
eventTable[event].splice(Number(_local4), 1);
}
}
function triggerEvent(event, args) {
if (eventTable[event] == undefined) {
return(undefined);
}
for (var _local4 in eventTable[event]) {
eventTable[event][_local4].delegate(args);
}
}
}
Symbol 1078 MovieClip [__Packages.mochi.as2.MochiEvents] Frame 0
class mochi.as2.MochiEvents
{
function MochiEvents () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function startSession(achievementID) {
mochi.as2.MochiServices.send("events_beginSession", {achievementID:achievementID}, null, null);
}
static function setNotifications(clip, style) {
var _local2 = {};
for (var _local3 in style) {
_local2[_local3] = style[_local3];
}
_local2.clip = clip;
mochi.as2.MochiServices.send("events_setNotifications", _local2, null, null);
}
static function addEventListener(eventType, thisObject, thatObject) {
_dispatcher.addEventListener(eventType, thisObject, thatObject);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, thisObject, thatObject) {
_dispatcher.removeEventListener(eventType, thisObject, thatObject);
}
static function startPlay(tag) {
if (tag == undefined) {
tag = "gameplay";
}
mochi.as2.MochiServices.send("events_setRoundID", {tag:String(tag)}, null, null);
}
static function endPlay() {
mochi.as2.MochiServices.send("events_clearRoundID", null, null, null);
}
static function trackEvent(tag, value) {
mochi.as2.MochiServices.send("events_trackEvent", {tag:tag, value:value}, null, null);
}
static var ACHIEVEMENT_RECEIVED = "AchievementReceived";
static var ALIGN_TOP_LEFT = "ALIGN_TL";
static var ALIGN_TOP = "ALIGN_T";
static var ALIGN_TOP_RIGHT = "ALIGN_TR";
static var ALIGN_LEFT = "ALIGN_L";
static var ALIGN_CENTER = "ALIGN_C";
static var ALIGN_RIGHT = "ALIGN_R";
static var ALIGN_BOTTOM_LEFT = "ALIGN_BL";
static var ALIGN_BOTTOM = "ALIGN_B";
static var ALIGN_BOTTOM_RIGHT = "ALIGN_BR";
static var FORMAT_SHORT = "ShortForm";
static var FORMAT_LONG = "LongForm";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 1079 MovieClip [__Packages.mochi.as2.MochiSocial] Frame 0
class mochi.as2.MochiSocial
{
function MochiSocial () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showLoginWidget(options) {
mochi.as2.MochiServices.setContainer();
mochi.as2.MochiServices.stayOnTop();
mochi.as2.MochiServices.send("coins_showLoginWidget", {options:options});
}
static function hideLoginWidget() {
mochi.as2.MochiServices.send("coins_hideLoginWidget");
}
static function requestLogin() {
mochi.as2.MochiServices.send("coins_requestLogin");
}
static function getUserInfo() {
mochi.as2.MochiServices.send("coins_getUserInfo");
}
static function saveUserProperties(properties) {
mochi.as2.MochiServices.send("coins_saveUserProperties", properties);
}
static function addEventListener(eventType, delegate) {
_dispatcher.addEventListener(eventType, delegate);
}
static function triggerEvent(eventType, args) {
_dispatcher.triggerEvent(eventType, args);
}
static function removeEventListener(eventType, delegate) {
_dispatcher.removeEventListener(eventType, delegate);
}
static var LOGGED_IN = "LoggedIn";
static var LOGGED_OUT = "LoggedOut";
static var LOGIN_SHOW = "LoginShow";
static var LOGIN_HIDE = "LoginHide";
static var LOGIN_SHOWN = "LoginShown";
static var PROFILE_SHOW = "ProfileShow";
static var PROFILE_HIDE = "ProfileHide";
static var PROPERTIES_SAVED = "PropertySaved";
static var WIDGET_LOADED = "WidgetLoaded";
static var USER_INFO = "UserInfo";
static var ERROR = "Error";
static var IO_ERROR = "IOError";
static var NO_USER = "NoUser";
static var PROPERTIES_SIZE = "PropertiesSize";
static var _dispatcher = new mochi.as2.MochiEventDispatcher();
}
Symbol 1080 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(id) {
if (!id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = id;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var _local2 = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(movie_version) {
if (!movie_version) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = movie_version;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!stat_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[stat_name] = CUSTOM_STATS + stat_id;
SendMessage("Created custom event: " + stat_name);
}
}
static function addCustomLink(stat_id, stat_name) {
if (!stat_id) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!stat_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[stat_name] = CUSTOM_STATS + stat_id;
SendMessage((("Created custom link " + stat_id) + ": ") + stat_name);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(special) {
if (special) {
var _local1 = {page:special};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(event_name) {
if (!event_name) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[event_name]) {
SendError("Attempted to log undefined custom event: " + event_name);
} else {
SendEvent(custom_events[event_name]);
}
}
static function loadCustomLink(link_name) {
if (!link_name) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[link_name]) {
SendError("Attempted to open undefined custom link: " + link_name);
} else {
SendLink(custom_links[link_name]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(id) {
SendStat(id, false);
}
static function SendLink(id, extra) {
SendStat(id, true, extra);
}
static function ReadGatewayData(params) {
for (var _local2 in params) {
params[_local2] = unescape(params[_local2]);
movie_options[_local2] = params[_local2];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url);
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(_local4);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(stat_id, open_in_browser, extra) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + stat_id;
for (var _local9 in extra) {
_local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(extra[_local9]));
}
if (debug) {
_local7 = _local7 + "&debug=1";
}
if (open_in_browser) {
getURL (_local7, "_blank");
} else {
var _local10 = new XML();
_local10.ignoreWhite = true;
_local10.onLoad = function (success) {
var _local6 = new Object();
var _local3 = 0;
while (_local3 < this.firstChild.childNodes.length) {
var _local4 = this.firstChild.childNodes[_local3];
var _local5 = _local4.nodeName;
var _local2 = _local4.attributes.value;
if (_local2 == Number(_local2)) {
_local2 = Number(_local2);
}
_local6[_local5] = _local2;
_local3++;
}
NewgroundsAPI.ReadGatewayData(_local6);
};
_local10.load(_local7);
}
}
}
static function SendError(msg) {
}
static function SendMessage(msg) {
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(version, movie_url, redirect_url) {
InitTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + version) + " is now available at:") + newline;
var _local5 = _local3.length;
_local3 = _local3 + movie_url;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format);
}
static function onDenyHost(hostname, movie_url, redirect_url) {
InitTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + hostname) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + movie_url;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = redirect_url;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(ad_url) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 1081 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return(mochi.as2.MochiServices.getVersion());
}
static function showPreGameAd(options) {
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local23 = 11000;
var _local19 = options.ad_timeout;
if (options.skip) {
_local19 = 0;
}
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 _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local22 = options.color;
delete options.color;
var _local20 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local20);
_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 = _local6.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 _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local24, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local19;
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;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
mochi.as2.MochiAd.containerNotify(clip, {id:"hostLoadPcnt", pcnt:_local2}, clip._mochiad._containerLCName);
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
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 showClickAwayAd(options) {
var _local10 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local10);
var clip = options.clip;
var _local9 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local3 = clip._mochiad;
_local3.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local11 = _local5[0];
var _local8 = _local5[1];
_local3._x = _local11 * 0.5;
_local3._y = _local8 * 0.5;
var chk = _local3.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local9;
chk.started = getTimer();
chk.showing = false;
_local3.lc.adLoaded = options.ad_loaded;
_local3.lc.adSkipped = options.ad_skipped;
_local3.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
_local3.rpcTestFn = function (s) {
return(s);
};
var _local21 = false;
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")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
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 () {
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
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;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
return(s);
};
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 showPreloaderAd(options) {
showPreGameAd(options);
}
static function showTimedAd(options) {
showInterLevelAd(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 load(options) {
var _local12 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local12);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local6 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local6._mochiad_loaded) {
return(null);
}
var _local11 = options.depth;
delete options.depth;
var mc = _local6.createEmptyMovieClip("_mochiad", _local11);
var _local10 = _getRes(options);
options.res = (_local10[0] + "x") + _local10[1];
options.server = options.server + options.id;
delete options.id;
_local6._mochiad_loaded = true;
if (_local6._url.indexOf("http") != 0) {
}
var _local4 = mc.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local9 = _local4.server;
delete _local4.server;
var _local13 = _allowDomains(_local9);
mc.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new Object();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = mc;
_local5.name = _local8;
_local5.hostname = _local13;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
mc.lc = _local5;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
_local4.lc = _local8;
_local4.st = getTimer();
if (!options.skip) {
_local4.loadMovie(_local9 + ".swf", "POST");
}
return(mc);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
containerNotify(clip, {id:"unload"}, clip._mochiad._containerLCName);
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") {
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
containerRpcResult(clip, callbackID, _local4, clip._mochiad._containerLCName);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
containerRpcResult(clip, callbackID, _local3, clip._mochiad._containerLCName);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
static function containerNotify(clip, args, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.notify) {
_local1.notify(args);
} else {
new LocalConnection().send(lcName, "notify", args);
}
}
static function containerRpcResult(clip, callbackID, val, lcName) {
var _local1 = clip._mochiad._mochiad_ctr.ad.app;
if (_local1.rpcResult) {
_local1.rpcResult(callbackID, val);
} else {
new LocalConnection().send(lcName, "rpcResult", callbackID, val);
}
}
}
Symbol 92 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 1
this.alpha = 0;
this.alphaTo = 0;
_root.glowButton(this);
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("leaderboards");
this._parent.gotoAndStop("boards");
};
Symbol 98 MovieClip Frame 1
this.alpha = 0;
this.alphaTo = 0;
_root.glowButton(this);
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("instructions");
this._parent.gotoAndStop("instructions");
};
Symbol 101 MovieClip Frame 1
this.alpha = 0;
this.alphaTo = 0;
_root.glowButton(this);
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("credits");
this._parent.gotoAndStop("credits");
};
Symbol 104 MovieClip Frame 1
alphaTo = 0;
alpha = 0;
this.onRelease = function () {
_root.singlePlayer = 1;
_root.unlocked = _root.cookie.data.unlocked;
_root.gotoAndStop("menu");
};
_root.glowButton(this);
Symbol 112 MovieClip Frame 1
this.onRelease = function () {
getURL (_root.cl[5], "_blank");
};
Symbol 117 MovieClip Frame 1
alphaTo = 0;
alpha = 0;
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("credtitsPea");
getURL (_root.cl[0], "_blank");
};
_root.glowButton(this);
Symbol 120 MovieClip Frame 1
alphaTo = 0;
alpha = 0;
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("gamesterart");
getURL (_root.cl[1], "_blank");
};
_root.glowButton(this);
Symbol 123 MovieClip Frame 1
alphaTo = 0;
alpha = 0;
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("kenneth");
getURL (_root.cl[2], "_blank");
};
_root.glowButton(this);
Symbol 126 MovieClip Frame 1
alphaTo = 0;
alpha = 0;
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("ralph");
getURL (_root.cl[3], "_blank");
};
_root.glowButton(this);
Symbol 129 MovieClip Frame 1
alphaTo = 0;
alpha = 0;
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("tripwireText");
getURL (_root.cl[4], "_blank");
};
_root.glowButton(this);
Symbol 132 MovieClip Frame 1
this.onRelease = function () {
mochi.as2.MochiEvents.trackEvent("tripwireImage");
getURL (_root.cl[7], "_blank");
};
Symbol 135 MovieClip Frame 1
function setValue(nam) {
var _local4 = String(nam);
for (var _local6 in this) {
this[_local6].removeMovieClip();
}
var _local5 = 10;
var _local2 = _local4.length;
while (_local2 > 0) {
if ((substring(_local4, _local2, 1)) != " ") {
var _local3 = attachMovie("num", "l" + _local2, _local2);
_local5 = _local5 - (_local3._width - 3);
_local3._x = _local5;
_local3.gotoAndStop(int(substring(_local4, _local2, 1)) + 1);
} else {
_local5 = _local5 + 10;
}
_local2--;
}
}
hider._visible = false;
Symbol 138 MovieClip Frame 1
function setValue(n) {
if (n == -1) {
this._visible = false;
} else {
this._visible = true;
n = String(n);
var _local2 = 1;
while (_local2 <= 6) {
this["d" + _local2].gotoAndStop(int(substring(n, _local2, 1)) + 1);
_local2++;
}
}
}
if (_root._currentframe == 4) {
this._visible = false;
}
Symbol 174 MovieClip Frame 1
stop();
Symbol 175 MovieClip Frame 1
stop();
Symbol 230 MovieClip Frame 1
function setValue(nam) {
var _local4 = nam.toLowerCase();
for (var _local6 in this) {
this[_local6].removeMovieClip();
}
var _local5 = 10;
var _local2 = 1;
while (_local2 <= _local4.length) {
if ((substring(_local4, _local2, 1)) != " ") {
var _local3 = attachMovie("letter", "l" + _local2, _local2);
_local3._x = _local5;
_local3.gotoAndStop(substring(_local4, _local2, 1));
_local5 = _local5 + (_local3._width - 3);
if ((substring(_local4, _local2, 1)) == "t") {
_local5 = _local5 - 2;
}
} else {
_local5 = _local5 + 10;
}
_local2++;
}
}
hider._visible = false;
Symbol 231 MovieClip Frame 1
stop();
Symbol 231 MovieClip Frame 4
function displayData(from) {
for (a in from) {
}
totalScoreData = from.r;
if (totalScoreData > (listPosition + 10)) {
down._visible = 1;
}
var _local4 = listPosition;
var a = 1;
while (a <= 10) {
_root.theMenu["player" + a].setValue(" ");
_root.theMenu["player" + a]._x = 97;
delete _root.theMenu["player" + a].onEnterFrame;
_root.theMenu["track" + a].setValue(-1);
_root.theMenu["num" + a].setValue(" ");
if (a <= (from.r - listPosition)) {
_root.theMenu["num" + a].setValue(a + _local4);
if (from["n" + a] != undefined) {
_root.theMenu["player" + a].setValue(from["n" + a]);
if (_root.theMenu["player" + a]._width > 165) {
_root.theMenu["player" + a].wid = _root.theMenu["player" + a]._width;
_root.theMenu["player" + a].setValue((from["n" + a] + " ") + from["n" + a]);
_root.theMenu["player" + a].onEnterFrame = function () {
this._x = this._x - 2;
if (this._x < (97 - this.wid)) {
this._x = this._x + this.wid;
}
};
}
}
if (from["t" + a] != undefined) {
_root.theMenu["track" + a].setValue(convertTime(from["t" + a]));
}
}
a++;
}
}
function setLoading() {
var _local2 = 1;
while (_local2 <= 10) {
this["num" + _local2].setValue(" ");
this["track" + _local2].setValue(-1);
if (_local2 == 1) {
this["player" + _local2].setValue("loading");
} else {
this["player" + _local2].setValue(" ");
}
this["track" + _local2].setValue(-1);
_local2++;
}
}
function convertTime(time) {
time = int(time);
var _local5 = time % 100;
var _local3 = int(time / 100);
var _local4 = _local3 % 60;
var _local6 = int(_local3 / 60);
return((_root.sortZero(_local6) + _root.sortZero(_local4)) + _root.sortZero(_local5));
}
_quality = "HIGH";
thehours = [24, 168, 720, 175200];
day = 0;
var a = 1;
while (a <= 4) {
days["d" + a].a = a - 1;
days["d" + a].onRelease = function () {
day = this.a;
days.gotoAndStop(this.a + 1);
setLoading();
_level1.g(pos + 1, 0, thehours[day]);
listPosition = 0;
up._visible = 0;
down._visible = 0;
};
a++;
}
setLoading();
up._visible = 0;
down._visible = 0;
listPosition = 0;
if (jumpTo) {
pos = jumpTo - 1;
_level1.g(jumpTo, 0, thehours[day]);
jumpTo = 0;
} else {
pos = 0;
_level1.g(1, 0, thehours[day]);
}
trackname.gotoAndStop(1);
_root.u = displayData;
down.onRelease = function () {
listPosition = listPosition + 10;
setLoading();
_level1.g(pos + 1, listPosition, thehours[day]);
up._visible = 1;
if (listPosition >= (totalScoreData - 10)) {
this._visible = 0;
}
};
up.onRelease = function () {
listPosition = listPosition - 10;
if (listPosition < 10) {
this._visible = 0;
}
setLoading();
_level1.g(pos + 1, listPosition, thehours[day]);
down._visible = 1;
};
rite.onRelease = function () {
listPosition = 0;
up._visible = 0;
down._visible = 0;
pos++;
if (pos > 4) {
pos = 0;
}
trackname.gotoAndStop(pos + 1);
setLoading();
_level1.g(pos + 1, 0, thehours[day]);
};
left.onRelease = function () {
listPosition = 0;
up._visible = 0;
down._visible = 0;
pos--;
if (pos < 0) {
pos = 4;
}
trackname.gotoAndStop(pos + 1);
setLoading();
_level1.g(pos + 1, 0, thehours[day]);
};
Symbol 236 MovieClip [percypealogo] Frame 1
this.hitArea = peahit;
this.onRelease = function () {
if (_root._currentframe == 35) {
_root.pausedGame._visible = true;
_root.gamePaused = 1;
}
if ((_root._currentframe < 23) || (_root._currentframe == 35)) {
mochi.as2.MochiEvents.trackEvent("pealogoClicked");
getURL (_root.cl[6], "_blank");
}
};
Symbol 248 MovieClip Frame 1
stop();
Symbol 274 MovieClip Frame 1
function checkPlayerLoaded() {
if (ytplayer2.isPlayerLoaded()) {
notYetLoaded = false;
ytplayer2.addEventListener("onStateChange", onPlayerStateChange);
ytplayer2.addEventListener("onError", onPlayerError);
ytplayer2.loadVideoById(_root.youtubeIDs[1]);
ytplayer2.setSize(550, 400);
}
}
function onPlayerStateChange(newState) {
if (newState == -1) {
ytplayer2._visible = false;
titleBG._alpha = 100;
titleBG._visible = true;
}
if (newState == 1) {
ytplayer2.setSize(550, 400);
showVid = true;
}
if (newState == 0) {
ytplayer2.playVideo();
}
}
function onPlayerError(errorCode) {
titleBG._alpha = 100;
titleBG._visible = true;
ytplayer2._visible = false;
}
titleBG._alpha = 200;
notYetLoaded = true;
ytplayer2.removeEventListener("onStateChange", onPlayerStateChange);
ytplayer2.removeEventListener("onError", onPlayerError);
ytplayer2Loader.removeListener(ytplayer2LoaderListener);
vidLoaded = false;
onEnterFrame = function () {
if (!vidLoaded) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
ytplayer2Loader.loadClip("http://www.youtube.com/apiplayer", ytplayer2);
vidLoaded = true;
}
} else {
if (showVid) {
if (titleBG._alpha > 5) {
titleBG._alpha = titleBG._alpha - 10;
} else {
doStuff = null;
titleBG._visible = false;
}
}
if (notYetLoaded) {
checkPlayerLoaded();
}
}
};
var ytplayer2LoaderListener = {onLoadInit:function () {
ytplayer2.setSize(550, 400);
}};
var ytplayer2Loader = new MovieClipLoader();
ytplayer2Loader.addListener(ytplayer2LoaderListener);
Symbol 287 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
function setColour(num) {
cars.filters = [new flash.filters.ColorMatrixFilter(_root.tempcolours[num])];
_root.colours = new Array();
var _local2 = 0;
while (_local2 < 8) {
if (_local2 != num) {
_root.colours.push(_root.tempcolours[_local2]);
} else {
_root.colourSelected = _root.tempcolours[_local2];
}
_local2++;
}
}
setColour(0);
var a = 1;
while (a <= 8) {
var t = this["t" + a];
t.a = a;
t.alphaTo = 0;
t.alpha = 0;
t.onRelease = function () {
setColour(this.a - 1);
};
t.onEnterFrame = function () {
if (this.alpha < this.alphaTo) {
this.alpha = this.alpha + 0.2;
}
if (this.alpha > this.alphaTo) {
this.alpha = this.alpha - 0.2;
}
if (this.alpha > 0) {
this.filters = [new flash.filters.GlowFilter(16777215, this.alpha, 8, 8, 2, 3, false, false)];
} else {
this.filters = [];
}
};
t.onRollOver = (t.onDragOver = function () {
this.alphaTo = 1;
});
t.onRollOut = (t.onDragOut = function () {
this.alphaTo = 0;
});
a++;
}
Instance of Symbol 287 MovieClip "cars" in Symbol 292 MovieClip Frame 1
/* no clip actions */
Symbol 307 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 313 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 315 MovieClip Frame 1
function startAd(ngad_url) {
System.security.allowDomain("70.87.128.99");
System.security.allowInsecureDomain("70.87.128.99");
System.security.allowDomain("ads.shizmoo.com");
System.security.allowInsecureDomain("ads.shizmoo.com");
System.security.allowDomain("www.cpmstar.com");
System.security.allowInsecureDomain("www.cpmstar.com");
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (success) {
if (success) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(ngad_url);
}
if (_root.nn) {
if (NewgroundsAPI.getAdURL()) {
startAd(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (ad_url) {
startAd(ad_url);
};
}
stop();
Symbol 327 MovieClip Frame 1
this._visible = 0;
Symbol 333 MovieClip Frame 1
grass.setMask(m);
Symbol 336 MovieClip Frame 1
grass.setMask(mask);
Symbol 339 MovieClip Frame 1
grass.setMask(mask);
Symbol 342 MovieClip Frame 1
grass.setMask(m);
Symbol 345 MovieClip Frame 1
grass.setMask(m);
Symbol 348 MovieClip Frame 1
grass.setMask(m);
Symbol 351 MovieClip Frame 1
grass.setMask(m);
Symbol 355 MovieClip [track1] Frame 1
!!!ERROR
Symbol 366 MovieClip Frame 1
grass.setMask(m);
Symbol 369 MovieClip Frame 1
grass.setMask(mask);
Symbol 372 MovieClip Frame 1
grass.setMask(mask);
Symbol 375 MovieClip Frame 1
grass.setMask(m);
Symbol 378 MovieClip Frame 1
grass.setMask(m);
Symbol 381 MovieClip Frame 1
grass.setMask(m);
Symbol 384 MovieClip Frame 1
grass.setMask(m);
Symbol 387 MovieClip Frame 1
grass.setMask(m);
Symbol 390 MovieClip [track4] Frame 1
!!!ERROR
Symbol 397 MovieClip Frame 1
grass.setMask(m);
Symbol 400 MovieClip Frame 1
grass.setMask(mask);
Symbol 403 MovieClip Frame 1
grass.setMask(mask);
Symbol 406 MovieClip Frame 1
grass.setMask(m);
Symbol 409 MovieClip Frame 1
grass.setMask(m);
Symbol 412 MovieClip Frame 1
grass.setMask(m);
Symbol 415 MovieClip Frame 1
grass.setMask(m);
Symbol 418 MovieClip Frame 1
grass.setMask(m);
Symbol 421 MovieClip [track3] Frame 1
!!!ERROR
Symbol 432 MovieClip [track2] Frame 1
!!!ERROR
Symbol 439 MovieClip Frame 1
this._visible = 0;
Symbol 440 MovieClip [track5] Frame 1
!!!ERROR
Symbol 650 MovieClip Frame 1
this._visible = 0;
Symbol 705 MovieClip [splash] Frame 27
for (var a in _root.splashes) {
if (this == _root.splashes[a]) {
_root.splashes.splice(a, 1);
break;
}
}
this.removeMovieClip();
Symbol 717 MovieClip [rock] Frame 1
stop();
Symbol 799 MovieClip [dolphin] Frame 1
isDolphin = true;
Symbol 824 MovieClip [buoy] Frame 1
function bob() {
o = o + 0.1;
car._y = (Math.sin(o) * 3) + 10;
var _local3 = 0;
if ((this._width <= 40) and (hasStopped == 1)) {
_local3 = 1;
}
if (_local3 != 1) {
hasStopped = 0;
mask.clear();
mask.beginFill(0, 100);
var _local4 = 1;
mask.moveTo(-25, -50);
mask.lineTo(25, -50);
mask.lineTo(25, 0);
if (this._width > 20) {
var _local2 = 25;
while (_local2 >= -25) {
mask.lineTo(_local2, Math.cos(((_local2 / 10) + (o * 4)) + k) * 2);
_local2 = _local2 - 10;
}
} else {
hasStopped = 1;
mask.lineTo(-25, 0);
}
mask.endFill();
}
}
createEmptyMovieClip("mask", 1);
car.setMask(mask);
o = Math.random() * 10;
k = Math.random() * 10;
isBuoy = true;
bob();
Symbol 927 MovieClip Frame 1
stop();
Symbol 930 MovieClip Frame 1
function setQual(qual) {
line1.setValue(qual + " graphics quality set");
line2.setValue("adjust quality in the options menu");
line1._x = int(((-line1._width) / 2) + 275);
line2._x = int(((-line2._width) / 2) + 275);
}
Symbol 934 MovieClip Frame 1
function setValue(number) {
var _local3 = String(number);
var _local2 = 1;
while (_local2 <= 3) {
this["digit" + _local2].gotoAndStop(1);
_local2++;
}
var _local5 = _local3.length;
if (_local5 == 3) {
digit1.gotoAndStop(2);
digit1.gotoAndStop(int(substring(_local3, 1, 1)) + 1);
digit2.gotoAndStop(int(substring(_local3, 2, 1)) + 1);
digit3.gotoAndStop(int(substring(_local3, 3, 1)) + 1);
}
if (_local5 == 2) {
digit2.gotoAndStop(int(substring(_local3, 1, 1)) + 1);
digit3.gotoAndStop(int(substring(_local3, 2, 1)) + 1);
}
if (_local5 == 1) {
digit3._visible = true;
digit3.gotoAndStop(int(_local3));
}
var _local4 = 0;
if (digit1._visible) {
_local4 = _local4 + digit1._width;
}
digit2._x = _local4 - 2;
if (digit2._visible) {
_local4 = _local4 + digit2._width;
}
digit3._x = _local4 - 4;
}
Symbol 941 MovieClip Frame 1
stop();
Symbol 943 MovieClip Frame 1
stop();
_root.glowButton(options);
options.onRelease = function () {
if (!_root.optionsPanel._visible) {
_root.qT._visible = false;
_root.pauseGame();
_root.optionsPanel._visible = 1;
} else {
_root.unPauseGame();
_root.optionsPanel._visible = 0;
}
};
checkpoint._visible = 0;
track.gotoAndStop(_root.tracknum);
track.attachBitmap(_root.trackBMP, 1);
stop();
isPaused = 0;
noMusic = 0;
noSFX = 0;
if (_root.noMusic == 1) {
mButton.gotoAndStop(2);
}
if (_root.noSFX == 1) {
sButton.gotoAndStop(2);
}
pButton.onRelease = function () {
if (isPaused != 1) {
isPaused = 1;
_root.pauseGame();
this.gotoAndStop(2);
} else {
isPaused = 0;
_root.unPauseGame();
this.gotoAndStop(1);
}
};
mButton.onRelease = function () {
if (_root.noMusic != 1) {
_root.noMusic = 1;
_root.music.setVolume(0);
this.gotoAndStop(2);
} else {
_root.noMusic = 0;
_root.music.setVolume(100);
this.gotoAndStop(1);
}
};
sButton.onRelease = function () {
if (_root.noSFX != 1) {
_root.noSFX = 1;
_root.engine.setVolume(0);
this.gotoAndStop(2);
} else {
_root.noSFX = 0;
_root.engine.setVolume(15);
this.gotoAndStop(1);
}
};
Symbol 959 MovieClip [countdown] Frame 1
if (_root.singlePlayer or _root.countDownShouldPlay) {
gotoAndStop (2);
} else {
stop();
}
onEnterFrame = function () {
if (_root.allPlayersAready >= _root.playerArray.length) {
gotoAndStop (2);
}
};
Symbol 959 MovieClip [countdown] Frame 2
startt = getTimer();
play();
onEnterFrame = function () {
if (_currentframe >= 125) {
_root.qT.swapDepths(66);
_root.qT.removeMovieClip();
_root.qT._visible = 0;
_root.startrace();
play();
delete this.onEnterFrame;
play();
}
};
if (_root.levelHack) {
_root.qT.swapDepths(66);
_root.qT.removeMovieClip();
_root.qT._visible = 0;
gotoAndPlay (127);
_root.startrace();
delete this.onEnterFrame;
}
Symbol 959 MovieClip [countdown] Frame 146
this.removeMovieClip();
stop();
Symbol 969 MovieClip Frame 1
stop();
mess._visible = 0;
if (_root.singlePlayer) {
mess._visible = 1;
}
Symbol 994 MovieClip Frame 1
stop();
mess._visible = 0;
if (_root.singlePlayer) {
mess._visible = 1;
}
Symbol 1021 MovieClip Frame 1
this.swapDepths(_root.getNextHighestDepth());
this._visible = 0;
tryagain._visible = 0;
congrats._visible = 0;
stop();
submit.onRelease = function () {
nextFrame();
};
_root.glowButton(submit);
menu.onRelease = function () {
_root.nav();
};
_root.glowButton(menu);
Symbol 1021 MovieClip Frame 2
_root.sendScores();
Symbol 1021 MovieClip Frame 3
tracks = ["american", "english", "canary island", "german", "russian"];
menu.onRelease = function () {
_root.nav();
};
_root.speedo.ttime._x = _root.speedo.ttime._x - 90;
_root.speedo.ttime._y = _root.speedo.ttime._y + 40;
_root.glowButton(menu);
scorePosition = ["dayScore", "weekScore", "monthScore", "scorePosition"];
onEnterFrame = function () {
trackname.setValue(("for the " + tracks[_root.tracknum - 1]) + " track");
trackname._x = int(((-trackname._width) / 2) + 275);
var _local4 = 1;
while (_local4 <= 4) {
var _local3 = this["num" + _local4];
var _local5 = _local3._x;
_local3.setValue(_root[scorePosition[_local4 - 1]]);
_local3._x = _local5 + (_local3._width / 2);
if (_local3._x > 540) {
_local3._x = 540;
}
if ((_local3._x - _local3._width) < 0) {
_local3._x = _local3._width;
}
_local4++;
}
delete onEnterFrame;
};
Symbol 1021 MovieClip Frame 4
retry.onRelease = function () {
gotoAndStop (2);
};
_root.glowButton(retry);
Symbol 1024 Button
on (release) {
_visible = false;
_root.gamePaused = 0;
}
Symbol 1025 MovieClip Frame 1
this.swapDepths(_root.getNextHighestDepth());
this._visible = false;
Symbol 1068 MovieClip Frame 1
_root.glowButton(yes);
_root.glowButton(no);
this._visible = 0;
yes.onRelease = function () {
this._parent._visible = 0;
this._parent._parent._visible = 0;
_root.nav();
this._parent._parent.removeMovieClip();
};
no.onRelease = function () {
this._parent._visible = 0;
};
pp.onRelease = function () {
};
pp.useHandCursor = false;
Symbol 1069 MovieClip Frame 1
stop();
this._visible = 0;
this.swapDepths(_root.getNextHighestDepth());
if (musicOff == 1) {
music.gotoAndStop(2);
} else {
music.gotoAndStop(1);
}
if (_root.noSFX == 1) {
sfx.gotoAndStop(2);
} else {
sfx.gotoAndStop(1);
}
closeB.onRelease = function () {
_root.unPauseGame();
this._parent._visible = 0;
};
music.onRelease = function () {
if (!musicOff) {
musicOff = 1;
music.gotoAndStop(2);
stoppedAt = _root.music.position / 1000;
_root.music.stop();
} else {
music.gotoAndStop(1);
_root.music.start(stoppedAt);
_root.music.onSoundComplete = function () {
_root.music.start(20);
};
musicOff = 0;
}
};
sfx.onRelease = function () {
if (_root.noSFX != 1) {
sfx.gotoAndStop(2);
_root.noSFX = 1;
_root.engine.stop();
} else {
sfx.gotoAndStop(1);
_root.noSFX = 0;
_root.engine.start();
}
};
_root.glowButton(closeB);
_root.glowButton(music);
_root.glowButton(sfx);
_root.glowButton(quit);
quit.onRelease = function () {
sureQuit._visible = 1;
};
var a = 1;
while (a <= 4) {
var s = this["s" + a];
s._visible = 0;
var q = this["q" + a];
_root.glowButton(q);
q.a = a;
q.onRelease = function () {
_root.setQual(this.a);
};
a++;
}
this["s" + _root.recQual]._visible = 1;