Frame 1
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;
var pv;
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);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&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__("5b7a75d3", this, 10301, true);
fscommand ("allowscale", true);
Stage.scaleMode = "exactFit";
unlocked = 1;
Instance of Symbol 13 MovieClip in Frame 1
onClipEvent (enterFrame) {
this._rotation = this._rotation + 100;
}
Frame 2
stot = this.getBytesTotal();
sloa = this.getBytesLoaded();
if (stot != 0) {
per = Math.floor((sloa / stot) * 100);
} else {
per = 0;
}
mc_bar.mc._x = mc_bar.mc._width * (-1 + (sloa / stot));
mc_bar.mc1._x = mc_bar.mc._width * (-1 + (sloa / stot));
txtPer = String(per) + "%";
if (((sloa >= 1) && (stot >= 1)) && (sloa == stot)) {
gotoAndPlay ("title");
inMenuFirst();
}
Frame 3
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
var ms = new Sound(_root.createEmptyMovieClip("bgs1", 5010));
ms.attachSound("bgs");
var bs = new Sound(_root.createEmptyMovieClip("blood splatter1", 6010));
bs.attachSound("blood splatter");
var bu = new Sound(_root.createEmptyMovieClip("button1", 7010));
bu.attachSound("button");
var go = new Sound(_root.createEmptyMovieClip("game over1", 8010));
go.attachSound("game over");
var pb = new Sound(_root.createEmptyMovieClip("PLAYBG1", 9010));
pb.attachSound("PLAYBG");
delete this.onEnterFrame;
logos.swapDepths(3000);
jumpTo = 0;
_quality = "HIGH";
fade.removeMovieClip();
var playerDetails = SharedObject.getLocal("ride");
if (playerDetails.data.lev == undefined) {
playerDetails.data.lev = unlocked;
} else {
unlocked = playerDetails.data.lev;
}
var a = 1;
while (a <= 4) {
var t = this["t" + a];
t.a = a;
t.alphaTo = 0;
t.alpha = 0;
t.onRelease = function () {
goto = this.a - 1;
gotoAndStop ("preload");
};
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, 4, 4, 2, 3, false, false)];
} else {
this.filters = [];
}
};
t.onRollOver = (t.onDragOver = function () {
this.alphaTo = 1;
});
t.onRollOut = (t.onDragOut = function () {
this.alphaTo = 0;
});
a++;
}
onEnterFrame = function () {
o._rotation++;
o._x++;
};
Frame 4
prevFrame();
Frame 6
function checkLoaded() {
load.text = ("LOADING, PLEASE WAIT... " + Math.round((100 / (gotos[goto][1] - alreadyLoaded)) * (getBytesLoaded() - alreadyLoaded))) + "%";
ifFrameLoaded (gotos[goto][0] + 0) {
if (gotos[goto][0] == 10) {
gotoAndStop (8);
} else {
gotoAndStop(gotos[goto][0]);
}
delete this.onEnterFrame;
}
}
gotos = [[10, 439351], [20, 445795], [23, 453413], [26, 468231]];
alreadyLoaded = getBytesLoaded();
checkLoaded();
onEnterFrame = function () {
checkLoaded();
};
Frame 7
prevFrame();
Frame 8
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 = 5;
unlocked = 5;
} else {
if (cookie.data["user" + lastUser].unlocked == 1) {
cookie.data["user" + lastUser].unlocked = 5;
}
unlocked = cookie.data["user" + username].unlocked;
}
}
pleaseEnter._visible = 0;
if (username) {
enterConfirm.gotoAndStop(2);
}
Selection.setFocus(usernameTF);
Frame 9
prevFrame();
Frame 10
function pauseGame() {
gamePaused = 1;
countdown.stop();
for (var _local1 in bushArray) {
bushes[_local1].stop();
}
}
function unPauseGame() {
gamePaused = 0;
countdown.play();
for (var _local1 in bushArray) {
bushes[_local1].play();
}
}
function startEngine() {
engine.stop();
delete engine;
engine = new Sound(objects.player);
engine.attachSound("start");
engine.start();
engine.onSoundComplete = function () {
engine.attachSound("idle");
engine.start(0, 9999);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(15);
}
};
startAt = 0;
slowing = 0;
gear = 0;
}
function accelerate() {
moving = 1;
if (accel != 1) {
gear++;
startAt = 0;
if (slowing == 1) {
startAt = (engine.duration - engine.position) / 1000;
slowing = 0;
}
engine.stop();
accel = 1;
engine.attachSound("accel");
engine.start(startAt);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(15);
}
engine.onSoundComplete = function () {
slowing = 0;
fullspeed = 1;
engine.attachSound("fullspeed");
engine.start(0, 9999);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(15);
}
};
}
}
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("decell");
engine.start(_local2 / 1000);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(15);
}
engine.onSoundComplete = function () {
slowing = 0;
engine.attachSound("idle");
engine.start(0, 9999);
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(15);
}
};
}
}
}
function brake() {
if (accel == 1) {
engine.stop();
accel = 0;
engine.attachSound("idle");
if (_root.noSFX == 1) {
engine.setVolume(0);
} else {
engine.setVolume(15);
}
engine.start();
}
}
trace(unlocked);
groundBmp.dispose();
fade.removeMovieClip();
_quality = "HIGH";
var a = 1;
while (a <= unlocked) {
var t = this["t" + a];
t.a = a;
t.alphaTo = 0;
t.alpha = 0;
t1.onRelease = function () {
levelSelected = 3;
gotoAndStop ("loading");
};
if (unlocked >= 2) {
t2.onRelease = function () {
levelSelected = 2;
gotoAndStop ("loading");
};
}
if (unlocked >= 3) {
t3.onRelease = function () {
levelSelected = 5;
gotoAndStop ("loading");
};
}
if (unlocked >= 4) {
t4.onRelease = function () {
levelSelected = 1;
gotoAndStop ("loading");
};
}
if (unlocked >= 5) {
t5.onRelease = function () {
levelSelected = 4;
gotoAndStop ("loading");
};
}
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 = [];
}
};
a++;
}
var a = 2;
while (a <= unlocked) {
this["locked" + a]._visible = 0;
a++;
}
Frame 11
prevFrame();
Frame 15
function createBmps() {
var _local2 = 0;
while (_local2 < textures.length) {
this["bmp" + _local2].dispose();
this["bmp" + _local2] = flash.display.BitmapData.loadBitmap(textures[_local2]);
_local2++;
}
fill1 = bmp0;
fill2 = bmp2;
fill3 = bmp4;
fill4 = bmp5;
fill5 = bmp6;
}
function createGround() {
groundBmp.dispose();
if (levelSelected == 4) {
groundBmp = new flash.display.BitmapData(2880, 2880, true, 0);
} else {
groundBmp = new flash.display.BitmapData(2880, 2880, false, 0);
}
temc.removeMovieClip();
temc = createEmptyMovieClip("temc", 9);
temc.beginBitmapFill(this["fill" + levelSelected], null, true, false);
temc.lineTo(2880, 0);
temc.lineTo(2880, 2880);
temc.lineTo(0, 2880);
temc.endFill();
groundBmp.draw(temc);
temc.removeMovieClip();
t.dispose();
initialiseDrawTrack();
}
function initCars() {
if (theCar == "toyota") {
objects.ai3 = objects.ais1;
objects.ais2._visible = 0;
} else {
objects.ai3 = objects.ais2;
objects.ais1._visible = 0;
}
objects.ai2.xpos = -766;
objects.ai2.ypos = 952;
objects.ai1.xpos = -736;
objects.ai1.ypos = 928;
objects.ai3.xpos = -766;
objects.ai3.ypos = 878;
objects.ai1.topSpeed = 14;
objects.ai2.topSpeed = 13;
objects.ai3.topSpeed = 12;
objects.ai1.accel = 0.2;
objects.ai2.accel = 0.2;
objects.ai3.accel = 0.2;
objects.ai1.pushed = 0;
objects.ai2.pushed = 0;
objects.ai3.pushed = 0;
var _local3 = 1;
while (_local3 <= 3) {
var _local2 = objects["ai" + _local3];
_local2.speed = 0;
_local2.checkPointReached = 2;
_local2.lapnum = 0;
_local2.pos = -1;
_local2.ang = 180;
nextPos(_local2);
_local2.myFilter = new flash.filters.ColorMatrixFilter(_root[("ai" + _local3) + "ColourArray"]);
_local3++;
}
}
function nextPos(car) {
car.pos++;
if (car.pos >= (cArray.length - 1)) {
car.pos = 0;
}
car.dx = car.xpos - ((cArray[car.pos][0] * 8) - 1024);
car.dy = car.ypos - ((cArray[car.pos][1] * 8) - 1024);
car.dz = Math.sqrt((car.dx * car.dx) + (car.dy * car.dy));
car.ra = 0;
car.posCount = 0;
car.maxspeed = car.topSpeed;
}
function tyreTracks(car) {
var _local3 = car.xpos - car.oxpos;
var _local4 = car.ypos - car.oypos;
var _local2 = Math.sqrt((_local3 * _local3) + (_local4 * _local4));
if (int(_local2) >= 1) {
var _local5 = Math.atan2(_local4, _local3);
cmat.tx = -car.xpos;
cmat.ty = -car.ypos;
tyre.drawTo.beginBitmapFill(bmp1, cmat, true);
tyre.drawTo.moveTo(-tWidth, 0);
tyre.drawTo.lineTo(tWidth, 0);
tyre.drawTo.lineTo(tWidth, _local2);
tyre.drawTo.lineTo(-tWidth, _local2);
tyre.drawTo.endFill();
tyre.bg.beginBitmapFill(bmp1, cmat, true);
tyre.bg.moveTo((-tWidth) * 6, 0);
tyre.bg.lineTo(tWidth * 6, 0);
tyre.bg.lineTo(tWidth * 6, _local2);
tyre.bg.lineTo((-tWidth) * 6, _local2);
tyre.bg.endFill();
tyre.bg._rotation = (tyre.drawTo._rotation = ((_local5 * 180) / 3.141593) + 90);
cbmat.tx = car.xpos + 1024;
cbmat.ty = car.ypos + 1024;
tyre.drawTo.filters = [new flash.filters.BevelFilter(4, 135, 16769177, 0.4, 2235136, 0.4, 4, 4, 1, 1, "full", false)];
groundBmp.draw(tyre, cbmat);
tyre.drawTo.clear();
tyre.bg.clear();
}
}
function moveCars() {
var _local2 = 1;
while (_local2 <= (3 + endRace)) {
var _local1 = objects["ai" + _local2];
_local1.pushed = _local1.pushed * trackFriction;
if (ac == 1) {
if (_local1.speed < _local1.topSpeed) {
_local1.speed = _local1.speed + _local1.accel;
} else {
_local1.speed = _local1.topSpeed;
}
if ((_local1.speed - _local1.breaking) > _local1.maxspeed) {
_local1.speed = _local1.speed - _local1.breaking;
}
_local1.dx = _local1.xpos - ((cArray[_local1.pos][0] * 8) - 1024);
_local1.dy = _local1.ypos - ((cArray[_local1.pos][1] * 8) - 1024);
_local1.angG = ((Math.atan2(_local1.dy, _local1.dx) * 180) / 3.141593) - 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.oxpos = _local1.xpos;
_local1.oypos = _local1.ypos;
_local1.xpos = _local1.xpos + ((Math.sin((_local1.ang * 3.141593) / 180) * _local1.speed) + (Math.cos((_local1.ang * 3.141593) / 180) * _local1.pushed));
_local1.ypos = _local1.ypos - ((Math.cos((_local1.ang * 3.141593) / 180) * _local1.speed) + (Math.sin((_local1.ang * 3.141593) / 180) * _local1.pushed));
if (_local1.posCount >= _local1.dz) {
nextPos(_local1);
}
}
sortObject(_local1);
_local1.car.filters = [_local1.myFilter];
_local2++;
}
}
function checkCarPos(car) {
var _local5 = int(car.oxpos / 8) + 128;
var _local6 = int(car.oypos / 8) + 128;
var _local7 = int(car.xpos / 8) + 128;
var _local8 = int(car.ypos / 8) + 128;
var _local11 = _local5 + ((_local7 - _local5) / 2);
var _local9 = _local6 + ((_local8 - _local6) / 2);
var _local10 = int(_local11);
var _local12 = int(_local9);
var _local4 = _root.mapArray[_local10][_local12];
var _local3 = _root.mapArray[_local7][_local8];
if (_local3 == undefined) {
_local3 = 1;
}
if ((((_local3 == 0) || (_local3 == 4)) || (_local3 == 6)) || (_local3 == 8)) {
car.maxspeed = 2;
car.breaking = 0.5;
car.offroad = 1;
} else {
car.maxspeed = car.topSpeed;
car.offroad = 0;
}
if ((((_local3 == 4) || (_local3 == 5)) || (_local4 == 4)) || (_local4 == 5)) {
if (car.checkPointReached == 0) {
car.checkPointReached = 1;
}
}
if ((((_local3 == 6) || (_local3 == 7)) || (_local4 == 6)) || (_local4 == 7)) {
if (car.checkPointReached == 1) {
car.checkPointReached = 2;
}
}
if ((((_local3 == 8) || (_local3 == 9)) || (_local4 == 8)) || (_local4 == 9)) {
if (car.checkPointReached == 2) {
car.checkPointReached = 0;
car.lapnum++;
}
}
if (levelSelected == 1) {
if (((((-car.xpos) < 856) && ((-car.xpos) > 784)) && ((-car.ypos) < -176)) && ((-car.ypos) > -232)) {
car.oldfly = car.fly;
car.fly = -176 + car.ypos;
car.flyamount = car.fly - car.oldfly;
} else {
car.fly = car.fly + car.flyamount;
if (car.flyamount > 0) {
car.flying = true;
}
}
car.flyamount = car.flyamount - 2;
}
}
function checkCars(car) {
var _local4 = 1;
while (_local4 <= 3) {
var _local5 = objects["ai" + _local4];
if (_local5 != car) {
var _local2 = car.xpos - _local5.xpos;
var _local3 = car.ypos - _local5.ypos;
var _local6 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local7 = Math.atan2(_local3, _local2);
if (_local6 < 30) {
car.angG = ((_local7 * 180) / 3.141593) + 90;
car.adjustG = 0.6;
car.adjustA = 0.05;
}
}
_local4++;
}
if (endRace != 1) {
var _local2 = car.xpos + _xcam;
var _local3 = car.ypos + _zcam;
var _local6 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
var _local7 = Math.atan2(_local3, _local2);
if (_local6 < 30) {
car.angG = ((_local7 * 180) / 3.141593) + 90;
car.adjustG = 0.6;
car.adjustA = 0.05;
}
if (_local6 < 20) {
var _local8 = 20 / _local6;
_xcam = _xcam + (_local2 * _local8);
_zcam = _zcam + (_local3 * _local8);
car.xpos = car.xpos - ((_local2 * _local8) / 2);
car.ypos = car.ypos - ((_local3 * _local8) / 2);
car.pushed = _local7 * (20 - _local6);
pushed = _local7 * (20 - _local6);
}
}
}
function isCenter(car) {
var _local2 = int(car.xpos / 8) + 128;
var _local3 = int(car.ypos / 8) + 128;
var _local6 = 0;
if (_root.mapArray[_local2][_local3] == 1) {
while (_root.mapArray[int(_local2)][int(_local3)] == 1) {
_local2 = _local2 + Math.cos((car.ang * 3.141593) / 180);
_local3 = _local3 + Math.sin((car.ang * 3.141593) / 180);
_local6++;
}
}
_local2 = int(car.xpos / 8) + 128;
_local3 = int(car.ypos / 8) + 128;
var _local5 = 0;
if (_root.mapArray[_local2][_local3] == 1) {
while (_root.mapArray[int(_local2)][int(_local3)] == 1) {
_local2 = _local2 - Math.cos((car.ang * 3.141593) / 180);
_local3 = _local3 - Math.sin((car.ang * 3.141593) / 180);
_local5++;
}
}
var _local8 = _local5 - _local6;
var _local7 = _local5 / _local6;
if ((_local7 < 0.5) || (_local7 > 2)) {
car.ang = car.ang - _local8;
}
}
function drawBoundary() {
var _local14 = createEmptyMovieClip("boundary", getNextHighestDepth());
var _local13 = _local14.createEmptyMovieClip("bound", 1);
_local13.lineStyle(2, 0, 75);
if (levelSelected == 4) {
_local13.lineStyle(10, 51, 75);
}
var _local7 = 0;
while (_local7 < bArray.length) {
var _local10 = 0;
while (_local10 < bArray[_local7][2].length) {
_local13.moveTo(bArray[_local7][0] * 8, bArray[_local7][1] * 8);
var _local9 = int(substring(bArray[_local7][2][_local10], 2, -1)) - 1;
_local13.lineTo(bArray[_local9][0] * 8, bArray[_local9][1] * 8);
var _local3 = bArray[_local7][0];
var _local4 = bArray[_local7][1];
var _local11 = bArray[_local9][0];
var _local12 = bArray[_local9][1];
var _local5 = _local11 - _local3;
var _local6 = _local12 - _local4;
var _local1 = _local3;
var _local2 = _local4;
if (Math.abs(_local5) > Math.abs(_local6)) {
_local4 = _local6 / _local5;
_local3 = 1;
if (_local5 < 0) {
_local4 = _local4 * -1;
_local3 = -1;
}
if (levelSelected != 4) {
if (levelSelected != 5) {
var _local8 = 0;
while (_local8 < Math.abs(_local5)) {
_local1 = _local1 + (_local3 * 3);
_local2 = _local2 + (_local4 * 3);
bushArray[int(_local1)][int(_local2)] = 2 + random(2);
totTreeNum++;
_local8 = _local8 + 3;
}
} else {
var _local8 = 0;
while (_local8 < Math.abs(_local5)) {
_local1 = _local1 + (_local3 * 4);
_local2 = _local2 + (_local4 * 4);
totTreeNum++;
bushArray[(int(_local1) + random(3)) - 1][(int(_local2) + random(3)) - 1] = 1;
_local8 = _local8 + 4;
}
}
}
} else {
_local3 = _local5 / _local6;
_local4 = 1;
if (_local6 < 0) {
_local3 = _local3 * -1;
_local4 = -1;
}
if (levelSelected != 4) {
if (levelSelected != 5) {
var _local8 = 0;
while (_local8 < Math.abs(_local6)) {
_local1 = _local1 + (_local3 * 3);
_local2 = _local2 + (_local4 * 3);
bushArray[int(_local1)][int(_local2)] = 2 + random(2);
totTreeNum++;
_local8 = _local8 + 3;
}
} else {
var _local8 = 0;
while (_local8 < Math.abs(_local6)) {
_local1 = _local1 + (_local3 * 4);
_local2 = _local2 + (_local4 * 4);
bushArray[(int(_local1) + random(3)) - 1][(int(_local2) + random(3)) - 1] = 1;
totTreeNum++;
_local8 = _local8 + 4;
}
}
}
}
_local10++;
}
_local7++;
}
_local13.filters = [new flash.filters.BlurFilter(2, 2, 3)];
groundBmp.draw(_local14);
groundBmp.draw(lake);
groundBmp.draw(clouds);
_local14.removeMovieClip();
}
function getrn() {
ranPos = ranPos + randomKey[keyPos];
if (ranPos >= randomNums.length) {
ranPos = ranPos - randomNums.length;
}
var _local1 = randomNums[ranPos];
keyPos++;
if (keyPos >= randomKey.length) {
keyPos = keyPos - randomKey.length;
}
return(_local1);
}
function initialiseDrawTrack() {
startTrack = getTimer();
py = 0;
px = 0;
trackNeedsDrawing = true;
temc.removeMovieClip();
temc = _root.createEmptyMovieClip("temc", 9);
temc._x = -100;
temptrack.removeMovieClip();
temptrack = createEmptyMovieClip("temptrack", 10);
tracky.dispose();
tracky = new flash.display.BitmapData(2700, 2700, true, 0);
if (levelSelected == 4) {
alphaBmp.dispose();
alphaBmp = new flash.display.BitmapData(2880, 2880, true, 855638016);
}
temptrack.attachBitmap(tracky, 1);
temptrack._visible = 0;
tma = new flash.geom.Matrix();
}
function drawTrack() {
if (levelSelected == 2) {
var _local10 = 2;
} else {
var _local10 = 0;
}
if (levelSelected == 3) {
var _local10 = 8;
}
if (levelSelected == 5) {
var _local10 = 6;
}
var _local12 = 0;
var _local11 = 0;
while (_local11 == 0) {
if (((getTimer() - st) > 35) && (_local12 > 1)) {
_local11 = 1;
}
_local12++;
py++;
if (py > 359) {
py = 0;
px++;
bushArray.push([]);
if (px > 359) {
temc.removeMovieClip();
temptrack._visible = 1;
if ((levelSelected == 1) || (levelSelected == 2)) {
temptrack.filters = [new flash.filters.GlowFilter(16777198, 1, 64, 64, 1, 3, true, false), new flash.filters.GlowFilter(0, 1, 2, 2, 1, 3, true, false)];
} else if (levelSelected == 3) {
temptrack.filters = [new flash.filters.GlowFilter(0, 1, 64, 64, 2, 3, true, false), new flash.filters.GlowFilter(0, 1, 2, 2, 1, 3, true, false)];
} else {
temptrack.filters = [new flash.filters.GlowFilter(2234368, 1, 64, 64, 1, 3, true, false), new flash.filters.GlowFilter(0, 1, 2, 2, 1, 3, true, false)];
}
groundBmp.draw(temptrack);
tracky.dispose();
trackNeedsDrawing = false;
temptrack.removeMovieClip();
drawBoundary();
if (levelSelected == 4) {
groundBmp.copyChannel(alphaBmp, new flash.geom.Rectangle(0, 0, 2880, 2880), new flash.geom.Point(0, 0), 8, 8);
}
attachTrees();
addRamp();
var _local9 = new flash.geom.Matrix();
_local9.tx = 224;
_local9.ty = 1976;
groundBmp.draw(sg, _local9);
}
}
var _local7 = false;
var _local5 = 5;
if (levelSelected == 4) {
if (((px % _local5) == 0) && ((py % _local5) == 0)) {
_local7 = true;
}
}
_local5 = 6;
if (levelSelected == 1) {
if (((((((px % _local5) == random(_local5)) && ((py % _local5) == random(_local5))) && (mapArray[px][py] != 1)) && (mapArray[px][py] != 5)) && (mapArray[px][py] != 7)) && (mapArray[px][py] != 9)) {
_local7 = true;
totTreeNum++;
}
}
if (levelSelected == 5) {
if (((((((px % 7) == getrn()) && ((py % 7) == getrn())) && (mapArray[px][py] != 1)) && (mapArray[px][py] != 5)) && (mapArray[px][py] != 7)) && (mapArray[px][py] != 9)) {
if (((((((cm(px + 1, py - 1) && (cm(px + 1, py))) && (cm(px + 1, py + 1))) && (cm(px, py + 1))) && (cm(px - 1, py + 1))) && (cm(px - 1, py))) && (cm(px - 1, py - 1))) && (cm(px, py - 1))) {
_local7 = true;
totTreeNum++;
treeCount++;
treeMat = new flash.geom.Matrix();
treeMat.tx = px * 8;
treeMat.ty = py * 8;
groundBmp.draw(tshad, treeMat);
}
}
}
if (_local7 == true) {
bushArray[px].push(1);
if (levelSelected == 5) {
mapArray[px][py] = [3, 0];
mapArray[px + 1][py - 1] = [3, 0];
mapArray[px + 1][py] = [3, 0];
mapArray[px + 1][py + 1] = [3, 0];
mapArray[px][py + 1] = [3, 0];
mapArray[px - 1][py + 1] = [3, 0];
mapArray[px - 1][py] = [3, 0];
mapArray[px - 1][py - 1] = [3, 0];
mapArray[px][py - 1] = [3, 0];
}
} else {
bushArray[px].push(0);
}
noMoreUntil--;
if (noMoreUntil <= 0) {
if (((((_root.mapArray[px][py] != 0) && (_root.mapArray[px][py][0] != 3)) && (_root.mapArray[px][py] != 4)) && (_root.mapArray[px][py] != 6)) && (_root.mapArray[px][py] != 8)) {
tma.tx = px * -8;
tma.ty = py * -8;
temc.clear();
if (((cm(px - 1, py) || (cm(px + 1, py))) || (cm(px, py - 1))) || (cm(px, py + 1))) {
var _local3 = _root.mapArray[px][py];
if (((_local3 == 4) || (_local3 == 6)) || (_local3 == 8)) {
_local3 = 0;
}
if (((_local3 == 5) || (_local3 == 7)) || (_local3 == 9)) {
_local3 = 1;
}
if (levelSelected != 4) {
temc.beginBitmapFill(this["bmp" + (_local3 + _local10)], tma, true, true);
} else {
temc.beginFill(255, 70);
temc.filters = [new flash.filters.BlurFilter(8, 8, 1)];
}
var _local4 = 1;
while (_local4 <= 8) {
temc.lineTo(_local4, -random(8));
_local4++;
}
_local4 = 1;
while (_local4 <= 8) {
temc.lineTo(random(8) + 8, _local4);
_local4++;
}
_local4 = 8;
while (_local4 >= 0) {
temc.lineTo(_local4, random(8) + 8);
_local4--;
}
_local4 = 8;
while (_local4 >= 0) {
temc.lineTo(-random(8), _local4);
_local4--;
}
} else {
var _local3 = _root.mapArray[px][py];
if (((_local3 == 4) || (_local3 == 6)) || (_local3 == 8)) {
_local3 = 0;
}
if (((_local3 == 5) || (_local3 == 7)) || (_local3 == 9)) {
_local3 = 1;
}
if (levelSelected != 4) {
temc.beginBitmapFill(this["bmp" + (_local3 + _local10)], tma, true, true);
} else {
temc.beginFill(255, 70);
temc.filters = [new flash.filters.BlurFilter(8, 8, 1)];
}
var _local6 = 8;
var _local8 = py + 1;
noMoreUntil = 1;
while (!nextPixel(px, _local8)) {
_local8++;
_local6 = _local6 + 8;
noMoreUntil++;
}
temc.lineTo(8, 0);
temc.lineTo(8, _local6);
temc.lineTo(0, _local6);
}
tma.tx = tma.tx * -1;
tma.ty = tma.ty * -1;
if (levelSelected != 4) {
tracky.draw(temc, tma);
continue;
}
alphaBmp.draw(temc, tma);
}
}
}
load.text = ("track loading... " + int((100 / (359 - ipx)) * (px - ipx))) + "%";
}
function cm(px, py) {
if (((((_root.mapArray[px][py] == 0) || (_root.mapArray[px][py][0] == 3)) || (_root.mapArray[px][py] == 4)) || (_root.mapArray[px][py] == 6)) || (_root.mapArray[px][py] == 8)) {
if (levelSelected == 4) {
return(false);
}
return(true);
}
return(false);
}
function cm2(px, py) {
if (((((_root.mapArray[px][py] == 0) || (_root.mapArray[px][py][0] == 3)) || (_root.mapArray[px][py] == 4)) || (_root.mapArray[px][py] == 6)) || (_root.mapArray[px][py] == 8)) {
return(true);
}
return(false);
}
function nextPixel(px, py) {
if (((cm2(px - 1, py) || (cm2(px + 1, py))) || (cm2(px, py - 1))) || (cm2(px, py + 1))) {
return(true);
}
return(false);
}
function sortObject(ob) {
ob.headLights._visible = 0;
var _local16;
var _local6;
var _local13 = Math.sin;
var _local11 = Math.cos;
var _local12 = _xcam + ob.xpos;
var _local14 = _zcam + ob.ypos;
var _local7 = ((-_angleY) * 3.141593) / 180;
_local16 = (_local14 * _local13(_local7)) + (_local12 * _local11(_local7));
_local6 = ((_local14 * _local11(_local7)) - (_local12 * _local13(_local7))) + 70;
var _local9 = true;
if (ob.friends) {
if (_local6 < 40) {
ob.allowInvisible = true;
} else {
ob.allowInvisible = false;
}
_local9 = false;
var _local5 = 0;
var _local3 = 0;
while (_local3 < ob.friends.length) {
if (ob.friends[_local3].allowInvisible == true) {
_local5++;
}
_local3++;
}
if (_local5 == ob.friends.length) {
_local9 = true;
}
}
if (((_local6 < 40) && (_local9 == true)) || (_local6 < 0)) {
ob._visible = 0;
} else {
ob._visible = 1;
var _local15 = ((-_local6) * 200) / (50 + (2 * _local6));
ob._xscale = (ob._yscale = (100 + _local15) * 5.5);
ob._y = (ob.trueY = (550 * (_ycam / _local6)) + 200);
if (ob._y <= ob.trueY) {
ob._y = ob._y - ((ob.fly * ob._xscale) / 100);
}
if (ob._y > ob.trueY) {
ob._y = ob.trueY;
}
ob.shad._y = (ob.trueY - ob._y) + 4;
var _local10 = 0;
if (ob.myType == "ripple") {
_local10 = -100;
}
ob._x = (500 * (_local16 / _local6)) + 250;
ob.swapDepths(int((ob._y + _local10) * 1000) + ob.id);
if (ob.r) {
ob.r._visible = 1;
ob.r._y = ob._y;
ob.r._x = ob._x;
ob.r._xscale = (ob.r._yscale = ob._xscale);
ob.r._yscale = ob.r._yscale * -1;
ob.r.swapDepths((int(ob._y) * 1000) + ob.id);
}
if (ob.myType != "ripple") {
var _local8 = (ob._y - 200) / 8;
if (_local8 < 4) {
_local8 = 4;
}
var _local4 = (ob.ang + _angleY) - ((250 - ob._x) / _local8);
_local4 = _local4 + 720;
_local4 = _local4 % 360;
var _local2 = 360 - int(_local4);
while (_local2 > 360) {
_local2 = _local2 - 360;
}
while (_local2 < 1) {
_local2 = _local2 + 360;
}
if (ob.glow) {
ob.glow._x = 35 * Math.sin((_local4 * 3.141593) / 180);
ob.bit._xscale = 100 * Math.sin((_local4 * 3.141593) / 180);
ob.glow.swapDepths((int(35 * Math.cos((_local4 * 3.141593) / 180)) * 3) + 2);
ob.bit.swapDepths((int(25 * Math.cos((_local4 * 3.141593) / 180)) * 3) + 1);
}
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;
}
}
ob.gotoAndStop(_local2);
ob.shad.r._rotation = 90 + _local2;
ob.car.gotoAndStop(_local2);
}
}
}
function sortspeedo() {
if (speed > 0) {
speedo.hand._rotation = -120 + (speed * 15);
speedo.spd = speed * 10;
} else {
speedo.hand._rotation = -120;
speedo.spd = 0;
}
}
function headlights(ob) {
if (levelSelected == 3) {
var _local2 = ((-ob._currentframe) * 3.141593) / 180;
var _local4 = Math.sin(_local2 - 0.4) * 300;
var _local6 = Math.cos(_local2 - 0.4) * 60;
var _local5 = Math.sin(_local2 + 0.4) * 300;
var _local3 = Math.cos(_local2 + 0.4) * 60;
ob.headlights.clear();
ob.headlights.beginFill(16777205, 50);
ob.headlights.lineTo(_local4, _local6);
ob.headlights.lineTo(_local5, _local3);
ob.headlights.endFill();
ob.headlights.moveTo(0, 0);
ob.headlights.beginFill(16777205, 100);
ob.headlights.lineTo(_local4 * 0.7, _local6 * 0.9);
ob.headlights.lineTo(_local5 * 0.7, _local3 * 0.9);
ob.headlights.endFill();
} else {
var _local2 = ((-ob._currentframe) * 3.141593) / 180;
var _local4 = Math.sin(_local2 - 0.4) * 100;
var _local6 = Math.cos(_local2 - 0.4) * 20;
var _local5 = Math.sin(_local2 + 0.4) * 100;
var _local3 = Math.cos(_local2 + 0.4) * 20;
var _local7 = Math.sin(_local2 + 2.74) * 100;
var _local9 = Math.cos(_local2 + 2.74) * 20;
var _local8 = Math.sin(_local2 + 3.54) * 100;
var _local10 = Math.cos(_local2 + 3.54) * 20;
ob.shadow.clear();
ob.shadow.beginFill(0, 40);
ob.shadow.moveTo(_local4, _local6);
ob.shadow.lineTo(_local5, _local3);
ob.shadow.lineTo(_local7, _local9);
ob.shadow.lineTo(_local8, _local10);
ob.shadow.endFill();
}
}
function checkLoaded() {
load.text = ("LOADING, PLEASE WAIT... " + Math.round((100 / (loadedK[levelSelected - 1] - alreadyLoaded)) * (getBytesLoaded() - alreadyLoaded))) + "%";
ifFrameLoaded ((15 + (20 * levelSelected)) + 0) {
gotoAndStop("select" + levelSelected);
}
}
textures = ["sand", "smlSand", "snow", "ice", "grass", "desertt", "grass", "mud", "grass2", "tarmac"];
cmat = new flash.geom.Matrix();
cbmat = new flash.geom.Matrix();
tWidth = 2;
tyreM = new flash.geom.Matrix();
endRace = 0;
randomNums = [1, 5, 3, 6, 4, 6, 0, 2, 2, 4];
randomKey = [5, 3, 8, 6, 7, 3, 8, 9, 4, 3];
totTreeNum = 0;
ranPos = 0;
keyPos = 0;
noMoreUntil = 0;
loadedK = [3346453, 4469498, 5693943, 7263494, 8437839];
alreadyLoaded = getBytesLoaded();
checkLoaded();
onEnterFrame = function () {
checkLoaded();
};
Frame 16
prevFrame();
Frame 20
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
function displayData(from) {
totalScoreData = from.r;
if (totalScoreData > (listPosition + 10)) {
down._visible = 1;
}
var _local4 = listPosition;
var _local2 = 1;
while (_local2 <= 10) {
this["player" + _local2].text = " ";
this["lap" + _local2].text = " ";
this["track" + _local2].text = " ";
this["num" + _local2].text = " ";
if (_local2 <= (from.r - listPosition)) {
this["num" + _local2].text = _local2 + _local4;
if (from["n" + _local2] != undefined) {
this["player" + _local2].text = from["n" + _local2];
}
if (from["b" + _local2] != undefined) {
this["lap" + _local2].text = convertTime(from["b" + _local2]);
}
if (from["t" + _local2] != undefined) {
this["track" + _local2].text = convertTime(from["t" + _local2]);
}
}
_local2++;
}
}
function setLoading() {
var _local2 = 1;
while (_local2 <= 10) {
this["num" + _local2].text = " ";
if (_local2 == 1) {
this["player" + _local2].text = "loading...";
} else {
this["player" + _local2].text = " ";
}
this["lap" + _local2].text = " ";
this["track" + _local2].text = " ";
_local2++;
}
}
function convertTime(time) {
time = int(time);
var _local4 = time % 100;
var _local2 = int(time / 100);
var _local5 = _local2 % 60;
var _local3 = int(_local2 / 60);
return((((sortZero(_local3) + ":") + sortZero(_local5)) + ":") + sortZero(_local4));
}
_quality = "HIGH";
sinceDate = "2007-01-01";
sortBy = "totalTime";
setLoading();
up._visible = 0;
down._visible = 0;
listPosition = 0;
if (jumpTo != 0) {
pos = jumpTo - 1;
_level1.getData(jumpTo, 0);
jumpTo = 0;
} else {
pos = 0;
_level1.getData(1, 0);
}
tracks = ["DESERT", "SNOW", "NIGHT", "RAIN", "FOREST"];
trackname.text = tracks[pos] + " TRACK";
sort.onRelease = function () {
if (sortBy == "totalTime") {
sortBy = "bestLap";
setLoading();
listPosition = 0;
_level1.getData(pos + 1, listPosition);
this._x = this._x + 70;
} else {
sortBy = "totalTime";
setLoading();
listPosition = 0;
_level1.getData(pos + 1, listPosition);
this._x = this._x - 70;
}
};
playmoregames.swapDepths(3001);
down.onRelease = function () {
listPosition = listPosition + 10;
setLoading();
_level1.getData(pos + 1, listPosition);
up._visible = 1;
if (listPosition > (totalScoreData - 10)) {
this._visible = 0;
}
};
up.onRelease = function () {
listPosition = listPosition - 10;
if (listPosition < 10) {
this._visible = 0;
}
setLoading();
_level1.getData(pos + 1, listPosition);
down._visible = 1;
};
rite.onRelease = function () {
listPosition = 0;
up._visible = 0;
down._visible = 0;
pos++;
if (pos > 4) {
pos = 0;
}
trackname.text = tracks[pos] + " TRACK";
setLoading();
_level1.getData(pos + 1, 0);
};
left.onRelease = function () {
listPosition = 0;
up._visible = 0;
down._visible = 0;
pos--;
if (pos < 0) {
pos = 4;
}
trackname.text = tracks[pos] + " TRACK";
setLoading();
_level1.getData(pos + 1, 0);
};
Frame 21
prevFrame();
Frame 27
prevFrame();
Frame 30
!!!ERROR
Frame 31
prevFrame();
Frame 32
ipx = px;
onEnterFrame = function () {
st = getTimer();
if (trackNeedsDrawing == true) {
drawTrack();
} else {
gotoAndStop("level" + levelSelected);
}
};
Frame 33
prevFrame();
Frame 35
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = Stage.height;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
function sortSky() {
sky.sky._x = (-_angleY) / 0.09;
while (sky.sky._x < -2000) {
sky.sky._x = sky.sky._x + 2000;
}
while (sky.sky._x > 0) {
sky.sky._x = sky.sky._x - 2000;
}
}
function checkpos(_angleY, _nbMs, speed) {
ox = _xcam;
oy = _zcam;
orx = rayX;
ory = rayZ;
pushed = pushed * trackFriction;
rayX = Math.sin((_angleY * 3.141593) / 180);
rayZ = Math.cos((_angleY * 3.141593) / 180);
_xcam = _xcam - ((rayX * speed) + (rayZ * pushed));
_zcam = _zcam - ((rayZ * speed) + (rayX * pushed));
if ((((_xcam < 1056) && (_xcam > 967)) && (_zcam < -176)) && (_zcam > -232)) {
oldfly = objects.player.fly;
objects.player.fly = -176 - _zcam;
flyamount = objects.player.fly - oldfly;
} else {
objects.player.fly = objects.player.fly + flyamount;
if (flyamount > 0) {
flying = true;
}
}
flyamount = flyamount - 2;
if (objects.player.fly > 0) {
objects.player._y = kh1 - objects.player.fly;
if (flying == true) {
objects.player.shad._y = (kh1 - objects.player._y) + 4;
}
} else {
objects.player._y = kh1;
objects.player.shad._y = (kh1 - objects.player._y) + 4;
}
if (objects.player.fly <= 0) {
flying = false;
var _local22 = ox - _xcam;
var _local23 = oy - _zcam;
var _local9 = -int(_xcam / 8);
var _local10 = -int(_zcam / 8);
_local9 = _local9 + 128;
_local10 = _local10 + 128;
var _local11 = speed / 15;
var _local21 = (speed / 2) + 3;
var _local12 = 0;
if (speed > 0) {
_local12 = 1;
}
var _local14 = ox + ((_xcam - ox) / 2);
var _local16 = oy + ((_zcam - oy) / 2);
var _local18 = (-int(_local14 / 8)) + 128;
var _local19 = (-int(_local16 / 8)) + 128;
var _local5 = _root.mapArray[_local9][_local10];
var _local8 = _root.mapArray[_local18][_local19];
breaking = 0;
if (_local5 == undefined) {
_local5 = 1;
}
if (((_local5 != 6) && (_local5 != 7)) && (_local5 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local5 == 4) || (_local5 == 5)) || (_local8 == 4)) || (_local8 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
}
}
if ((((_local5 == 6) || (_local5 == 7)) || (_local8 == 6)) || (_local8 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
}
}
if ((((_local5 == 8) || (_local5 == 9)) || (_local8 == 8)) || (_local8 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) || (bestTime == 0)) {
bestTime = lapTime;
var _local17 = lapTime % 100;
var _local13 = int(lapTime / 100);
var _local20 = _local13 % 60;
var _local15 = int(_local13 / 60);
speedo.best.text = (((sortZero(_local15) + ":") + sortZero(_local20)) + ":") + sortZero(_local17);
}
lapTime = 0;
}
if (lapnum == 4) {
_xcama = 0;
_zcama = 0;
endRace = 1;
resultPanel._visible = 1;
resultPanel.swapDepths(3002);
objects.ai4 = objects.player;
objects.ai4.ang = objects.player._currentframe;
objects.ai4.xpos = (-_xcam) - Math.sin((objects.ai4.ang * 3.141593) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * 3.141593) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local6 = objects.ai4;
objects.ai4.pos++;
_local6.dx = _local6.xpos - ((cArray[_local6.pos][0] * 8) - 1024);
_local6.dy = _local6.ypos - ((cArray[_local6.pos][1] * 8) - 1024);
_local6.dz = Math.sqrt((_local6.dx * _local6.dx) + (_local6.dy * _local6.dy));
_local6.ra = 0;
_local6.posCount = 0;
_local6.maxspeed = _local6.topSpeed;
_local6.pushed = 0;
trackCar = 1;
ahead = 0;
var _local3 = 1;
while (_local3 <= 3) {
if (objects["ai" + _local3].lapnum >= 4) {
ahead++;
}
_local3++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
stopAllSounds();
resultPanel.congrats.gotoAndStop(3);
unlocked = 5;
_root.playerDetails.data.lev = 5;
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain._visible = 1;
stopAllSounds();
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
resultPanel.tryagain.gotoAndStop(2);
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local5 == 0) || (_local5 == 4)) || (_local5 == 6)) || (_local5 == 8)) {
objects.player._y = kh1 + (random(3) * _local11);
objects.player._rotation = ((random(7) - 3) * _local11) + ((random(5) - 2) * _local12);
maxspeed = 2;
breaking = 0.25;
offroad = 1;
} else {
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local5[0] == 3) || (_local8[0] == 3)) {
var _local4 = (-int(ox / 8)) + 128;
var _local2 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local4][_local2][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
oy = oy + Math.cos((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
_local4 = (-int(ox / 8)) + 128;
_local2 = (-int(oy / 8)) + 128;
}
speed = (-speed) * 0.6;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local5 == 1) {
objects.player._y = kh1 + (random(2) * _local11);
}
}
return(speed);
}
function startrace() {
ac = 1;
bestTime = 0;
lapTime = 0;
totalTime = 0;
}
function sortTimer() {
lapTime = lapTime + 4;
var _local3 = lapTime % 100;
var _local1 = int(lapTime / 100);
var _local4 = _local1 % 60;
var _local2 = int(_local1 / 60);
speedo.timec.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local4 = _local1 % 60;
_local2 = int(_local1 / 60);
speedo.ttime.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
}
function drawRoad() {
synchro();
manageKeys();
manageMode7();
}
function synchro() {
_nbMs = 1;
}
function manageKeys() {
_ycam = 20;
var _local9;
var _local10;
var _local7;
var _local8;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) && (flying == false)) {
if (((rotchange > -5) && (rotchange < 5)) && (speed != 0)) {
kartchange = kartchange - 0.5;
if (speed > 0) {
rotchange = rotchange - turningCircle;
} else {
rotchange = rotchange + turningCircle;
}
}
}
}
if (Key.isDown(37)) {
dir = "left";
if ((ac == 1) && (flying == false)) {
if (((rotchange < 5) && (rotchange > -5)) && (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + turningCircle;
} else {
rotchange = rotchange - turningCircle;
}
}
}
}
if ((rotchange != 0) && (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) && (flying == false)) {
kartchange = kartchange + ((-kartchange) / (20 - speed));
}
if (flying == false) {
_angleY = _angleY - rotchange;
}
objects.player.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.shad.r._rotation = 90 + objects.player._currentframe;
objects.player.car.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.filters = [objects.player.myFilter];
objects.player.l1._visible = 0;
objects.player.l2._visible = 0;
objects.player.l3._visible = 0;
if (Key.isDown(38)) {
accelerate();
if (speed <= maxspeed) {
if (((ac == 1) && (flying == false)) && (endRace != 1)) {
speed = speed + playersAccel;
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) && (speed > -1)) && (flying == false)) {
speed = speed - 0.3;
if (speed > 0) {
objects.player.l1._visible = 1;
objects.player.l2._visible = 1;
} else {
objects.player.l3._visible = 1;
}
}
}
if ((speed > 0.2) && (flying == false)) {
speed = speed - 0.2;
} else if (flying == false) {
if (Key.isDown(40)) {
if (speed < 0) {
objects.player.l3._visible = 1;
}
} else if (_root.speed < -0.2) {
speed = speed + 0.2;
} else {
speed = 0;
}
}
if (((speed - breaking) > maxspeed) && (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) && (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local6 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local6;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local2 = (-_xcam) - _root.objects.ai4.xpos;
var _local3 = (-_zcam) - _root.objects.ai4.ypos;
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
theeRot = (Math.atan2(_local3, _local2) * 180) / 3.141593;
ratio = 400 / _local4;
if (ratio < 1) {
_local2 = _local2 * ratio;
_local3 = _local3 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local2;
_zcam = (-_root.objects.ai4.ypos) - _local3;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local2;
var _local1;
_local2 = ((20 / _nbScans) * 3.141593) / 180;
_local1 = 0;
var _local4 = 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 = (-ground._y) + (i + 200);
_local1 = _local1 + _local2;
rayY = _local4(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local13;
var _local4;
var _local11;
var _local14;
var _local12;
var _local17;
var _local18;
var _local16;
var _local15;
var _local2;
var _local10;
_local16 = Math.sin;
_local15 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * 3.141593) / 180);
_local13 = (_resoDx * 0.5) / 500;
_local17 = 0;
_local11 = _local16((_angleY * 3.141593) / 180);
_local12 = _local15((_angleY * 3.141593) / 180);
var _local3 = 0;
while (_local3 < tArray.length) {
sortObject(objects["tree" + _local3]);
_local3++;
}
prepBushes();
sortBushes(boundaryDistance, 1, 5);
sortBushes(grassDistance, 0, 1);
sortAllBushes();
sortRamp();
_local10 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local14 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local5 = leCoses[_local1];
var _local6 = (_xcam - (_local11 * _local5)) - 1024;
var _local7 = (_zcam - (_local12 * _local5)) - 1024;
_local2.tx = (_local6 * _local2.a) + (_local7 * _local2.c);
_local2.ty = ((_local6 * _local2.b) + (_local7 * _local2.d)) + 70;
_local4 = _local13 * _local9;
var _local8 = _local4;
ground[_local1].beginBitmapFill(_local10, _local2, true, false);
ground[_local1].moveTo(-_local4, 0);
ground[_local1].lineTo(_local8, 0);
ground[_local1].lineTo(_local8, _scanSteps);
ground[_local1].lineTo(-_local4, _scanSteps);
ground[_local1].endFill();
}
}
initCars();
stopAllSounds();
_root.pb.start(0, 2000);
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;
mud = flash.display.BitmapData.loadBitmap("mud");
camx = 0;
camy = 0;
var x = 0;
var y = 0;
_bMouse = false;
initIt();
flyamount = 0;
pushed = 0;
trackFriction = 0.5;
trigerMap(0);
_nbScans = 0;
initMode7(0);
grassDistance = 15;
boundaryDistance = 35;
resultPanel._visible = 0;
positions = ["1st", "2nd", "3rd", "4th"];
fade.swapDepths(2);
_quality = "LOW";
var player = objects.attachMovie(_root.theCar, "player", 999);
player._x = 250;
player._y = 361;
player._xscale = (player._yscale = 150);
player.id = 999;
player.swapDepths((int(player._y) * 1000) + 999);
player.myFilter = new flash.filters.ColorMatrixFilter(_root.colourArray);
player.headLights._visible = 1;
if (theCar == "toyota") {
playersMaxSpeed = 15;
turningCircle = 0.5;
playersAccel = 0.4;
} else {
playersMaxSpeed = 14;
turningCircle = 0.6;
playersAccel = 0.55;
}
lapnum = 0;
speedo.lap.text = ("LAP " + lapnum) + "/3";
checkPointReached = 2;
frames.swapDepths(10);
reflections._x = objects._x;
reflections._y = objects._y;
createEmptyMovieClip("ground", 1);
ac = 0;
countdown.swapDepths(11);
objects.swapDepths(3);
totTrees = 50;
treeMat = new flash.geom.Matrix();
_root.oo = objects.ai1;
_root.oo2 = objects.ai2;
kh1 = 361;
flying = false;
initMode7();
ttt = 0;
cck = 0;
objects.player.fly = 0;
initBushes(boundaryDistance, 1, 5);
initBushes(grassDistance, 0, 1);
onMouseDown = function () {
ttt = 0;
cck = 0;
};
onMouseUp = function () {
};
onEnterFrame = function () {
if (_quality != "LOW") {
_quality = "LOW";
}
if (gamePaused != 1) {
moving = 0;
cck++;
tt = getTimer() - st;
ttt = ttt + int(tt);
tta = int((ttt / cck) * 100) / 100;
st = getTimer();
frames.tt = tt;
frames.tta = tta;
player = objects.player;
if (allowHack == 1) {
_xcam = -objects.ai3.xpos;
_zcam = -objects.ai3.ypos;
}
player.w1.r._rotation = player.w1.r._rotation - (speed * 5);
player.w2.r._rotation = player.w2.r._rotation - (speed * 5);
player.w1.r.b._alpha = Math.abs(speed) * 10;
player.w2.r.b._alpha = Math.abs(speed) * 10;
if (player.w1.r.b._alpha > 100) {
player.w1.r.b._alpha = 100;
}
if (player.w2.r.b._alpha > 100) {
player.w2.r.b._alpha = 100;
}
drawRoad();
sortspeedo();
sortSky();
moveCars();
if ((ac == 1) && (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 611 MovieClip "speedo" in Frame 35
onClipEvent (load) {
this.swapDepths(4);
}
Frame 37
prevFrame();
Frame 50
!!!ERROR
Frame 51
prevFrame();
Frame 52
ipx = px;
stopAllSounds();
onEnterFrame = function () {
st = getTimer();
if (trackNeedsDrawing == true) {
drawTrack();
} else {
gotoAndStop("level" + levelSelected);
}
};
Frame 53
prevFrame();
Frame 55
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = Stage.height;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
function sortSky() {
sky.sky._x = (-_angleY) / 0.09;
while (sky.sky._x < -2000) {
sky.sky._x = sky.sky._x + 2000;
}
while (sky.sky._x > 0) {
sky.sky._x = sky.sky._x - 2000;
}
}
function checkpos(_angleY, _nbMs, speed) {
ox = _xcam;
oy = _zcam;
orx = rayX;
ory = rayZ;
pushed = pushed * trackFriction;
rayX = Math.sin((_angleY * 3.141593) / 180);
rayZ = Math.cos((_angleY * 3.141593) / 180);
_xcam = _xcam - (rayX * speed);
_zcam = _zcam - (rayZ * speed);
if (objects.player.fly <= 0) {
flying = false;
var _local25 = ox - _xcam;
var _local23 = oy - _zcam;
var _local10 = -int(_xcam / 8);
var _local11 = -int(_zcam / 8);
_local10 = _local10 + 128;
_local11 = _local11 + 128;
var _local12 = speed / 15;
var _local24 = (speed / 2) + 3;
var _local13 = 0;
if (speed > 0) {
_local13 = 1;
}
var _local22 = ox + ((_xcam - ox) / 2);
var _local17 = oy + ((_zcam - oy) / 2);
var _local19 = (-int(_local22 / 8)) + 128;
var _local20 = (-int(_local17 / 8)) + 128;
var _local5 = _root.mapArray[_local10][_local11];
var _local7 = _root.mapArray[_local19][_local20];
breaking = 0;
if (_local5 == undefined) {
_local5 = 1;
}
if (((_local5 != 6) && (_local5 != 7)) && (_local5 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local5 == 4) || (_local5 == 5)) || (_local7 == 4)) || (_local7 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
heavyness++;
}
}
if ((((_local5 == 6) || (_local5 == 7)) || (_local7 == 6)) || (_local7 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
heavyness++;
}
}
if ((((_local5 == 8) || (_local5 == 9)) || (_local7 == 8)) || (_local7 == 9)) {
if (checkPointReached == 2) {
heavyness++;
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) || (bestTime == 0)) {
bestTime = lapTime;
var _local18 = lapTime % 100;
var _local14 = int(lapTime / 100);
var _local21 = _local14 % 60;
var _local16 = int(_local14 / 60);
speedo.best.text = (((sortZero(_local16) + ":") + sortZero(_local21)) + ":") + sortZero(_local18);
}
lapTime = 0;
}
if (lapnum == 4) {
_xcama = 0;
_zcama = 0;
endRace = 1;
resultPanel._visible = 1;
resultPanel.swapDepths(3002);
objects.ai4 = objects.player;
objects.ai4.ang = objects.player._currentframe;
objects.ai4.xpos = (-_xcam) - Math.sin((objects.ai4.ang * 3.141593) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * 3.141593) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local6 = objects.ai4;
objects.ai4.pos++;
_local6.dx = _local6.xpos - ((cArray[_local6.pos][0] * 8) - 1024);
_local6.dy = _local6.ypos - ((cArray[_local6.pos][1] * 8) - 1024);
_local6.dz = Math.sqrt((_local6.dx * _local6.dx) + (_local6.dy * _local6.dy));
_local6.ra = 0;
_local6.posCount = 0;
_local6.pushed = 0;
_local6.maxspeed = _local6.topSpeed;
trackCar = 1;
ahead = 0;
var _local3 = 1;
while (_local3 <= 3) {
if (objects["ai" + _local3].lapnum >= 4) {
ahead++;
}
_local3++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
stopAllSounds();
unlocked = 3;
_root.playerDetails.data.lev = 3;
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain._visible = 1;
stopAllSounds();
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local5 == 0) || (_local5 == 4)) || (_local5 == 6)) || (_local5 == 8)) {
objects.player._y = kh1 + (random(3) * _local12);
objects.player._rotation = ((random(7) - 3) * _local12) + ((random(5) - 2) * _local13);
maxspeed = 2;
breaking = 0.2;
offroad = 1;
iceFriction = 0.2;
} else {
iceFriction = 1;
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local5[0] == 3) || (_local7[0] == 3)) {
var _local4 = (-int(ox / 8)) + 128;
var _local2 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local4][_local2][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
oy = oy + Math.cos((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
_local4 = (-int(ox / 8)) + 128;
_local2 = (-int(oy / 8)) + 128;
}
if (_local5[1]) {
var _local15 = _angleY - _local5[1];
tempDiff = _local5[1];
} else {
tempDiff = _local7[1];
var _local15 = _angleY - _local7[1];
}
while (tempDiff > 90) {
tempDiff = tempDiff - 90;
}
while (tempDiff < 0) {
tempDiff = tempDiff + 90;
}
tempAngle = _angleY;
while (tempAngle > 90) {
tempAngle = tempAngle - 90;
}
while (tempAngle < 0) {
tempAngle = tempAngle + 90;
}
var _local15 = tempAngle - tempDiff;
speed = (-speed) * 0.8;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local5 == 1) {
objects.player._y = kh1 + (random(2) * _local12);
}
}
return(speed);
}
function startrace() {
ac = 1;
bestTime = 0;
lapTime = 0;
totalTime = 0;
}
function sortTimer() {
lapTime = lapTime + 4;
var _local3 = lapTime % 100;
var _local1 = int(lapTime / 100);
var _local4 = _local1 % 60;
var _local2 = int(_local1 / 60);
speedo.timec.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local4 = _local1 % 60;
_local2 = int(_local1 / 60);
speedo.ttime.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
}
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
function drawRoad() {
synchro();
manageKeys();
manageMode7();
}
function synchro() {
_nbMs = 1;
}
function manageKeys() {
_ycam = 20;
var _local9;
var _local10;
var _local7;
var _local8;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) && (flying == false)) {
if (((rotchange > -5) && (rotchange < 5)) && (speed != 0)) {
kartchange = kartchange - 0.5;
if (speed > 0) {
rotchange = rotchange - (turningCircle * iceFriction);
} else {
rotchange = rotchange + (turningCircle * iceFriction);
}
}
}
}
if (Key.isDown(37)) {
dir = "left";
if ((ac == 1) && (flying == false)) {
if (((rotchange < 5) && (rotchange > -5)) && (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + (turningCircle * iceFriction);
} else {
rotchange = rotchange - (turningCircle * iceFriction);
}
}
}
}
if ((rotchange != 0) && (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) && (flying == false)) {
kartchange = kartchange + ((-kartchange) / (20 - speed));
}
if (flying == false) {
_angleY = _angleY - rotchange;
}
objects.player.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.filters = [objects.player.myFilter];
objects.player.shad.r._rotation = 90 + objects.player._currentframe;
objects.player.l1._visible = 0;
objects.player.l2._visible = 0;
objects.player.l3._visible = 0;
if (Key.isDown(38)) {
accelerate();
if (speed <= maxspeed) {
if (((ac == 1) && (flying == false)) && (endRace != 1)) {
speed = speed + (playersAccel * iceFriction);
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) && (speed > -1)) && (flying == false)) {
speed = speed - (0.3 * iceFriction);
if (speed > 0) {
objects.player.l1._visible = 1;
objects.player.l2._visible = 1;
} else {
objects.player.l3._visible = 1;
}
}
}
if ((speed > (0.2 * iceFriction)) && (flying == false)) {
speed = speed - (0.2 * iceFriction);
} else if (flying == false) {
if (Key.isDown(40)) {
if (speed < 0) {
objects.player.l3._visible = 1;
}
} else if (_root.speed < -0.2) {
speed = speed + (0.2 * iceFriction);
} else {
speed = 0;
}
}
if (((speed - breaking) > maxspeed) && (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) && (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local6 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local6;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local2 = (-_xcam) - _root.objects.ai4.xpos;
var _local3 = (-_zcam) - _root.objects.ai4.ypos;
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
theeRot = (Math.atan2(_local3, _local2) * 180) / 3.141593;
ratio = 400 / _local4;
if (ratio < 1) {
_local2 = _local2 * ratio;
_local3 = _local3 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local2;
_zcam = (-_root.objects.ai4.ypos) - _local3;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local2;
var _local1;
_local2 = ((20 / _nbScans) * 3.141593) / 180;
_local1 = 0;
var _local4 = 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 = (-ground._y) + (i + 200);
_local1 = _local1 + _local2;
rayY = _local4(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local13;
var _local4;
var _local11;
var _local14;
var _local12;
var _local17;
var _local18;
var _local16;
var _local15;
var _local2;
var _local10;
_local16 = Math.sin;
_local15 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * 3.141593) / 180);
_local13 = (_resoDx * 0.5) / 500;
_local17 = 0;
_local11 = _local16((_angleY * 3.141593) / 180);
_local12 = _local15((_angleY * 3.141593) / 180);
var _local3 = 0;
while (_local3 < tArray.length) {
sortObject(objects["tree" + _local3]);
_local3++;
}
prepBushes();
sortBushes(boundaryDistance, 1, 5);
sortAllBushes();
sortRamp();
_local10 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local14 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local5 = leCoses[_local1];
var _local6 = (_xcam - (_local11 * _local5)) - 1024;
var _local7 = (_zcam - (_local12 * _local5)) - 1024;
_local2.tx = (_local6 * _local2.a) + (_local7 * _local2.c);
_local2.ty = ((_local6 * _local2.b) + (_local7 * _local2.d)) + 70;
_local4 = _local13 * _local9;
var _local8 = _local4;
ground[_local1].beginBitmapFill(_local10, _local2, true, false);
ground[_local1].moveTo(-_local4, 0);
ground[_local1].lineTo(_local8, 0);
ground[_local1].lineTo(_local8, _scanSteps);
ground[_local1].lineTo(-_local4, _scanSteps);
ground[_local1].endFill();
}
}
initCars();
_root.pb.start(0, 2000);
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;
mud = flash.display.BitmapData.loadBitmap("mud");
camx = 0;
camy = 0;
var x = 0;
var y = 0;
_bMouse = false;
initIt();
flyamount = 0;
puashed = 0;
iceFriction = 1;
trackFriction = 0.8;
trigerMap(0);
_nbScans = 0;
initMode7(0);
grassDistance = 15;
boundaryDistance = 35;
resultPanel._visible = 0;
positions = ["1st", "2nd", "3rd", "4th"];
fade.swapDepths(2);
_quality = "LOW";
var player = objects.attachMovie(_root.theCar, "player", 999);
player._x = 250;
player._y = 361;
player._xscale = (player._yscale = 150);
player.id = 999;
player.swapDepths((int(player._y) * 1000) + 999);
player.myFilter = new flash.filters.ColorMatrixFilter(_root.colourArray);
lapnum = 0;
speedo.lap.text = ("LAP " + lapnum) + "/3";
if (theCar == "toyota") {
playersMaxSpeed = 15;
turningCircle = 0.5;
playersAccel = 0.4;
} else {
playersMaxSpeed = 14;
turningCircle = 0.6;
playersAccel = 0.55;
}
checkPointReached = 2;
frames.swapDepths(10);
reflections._x = objects._x;
reflections._y = objects._y;
createEmptyMovieClip("ground", 1);
ac = 0;
countdown.swapDepths(11);
objects.swapDepths(3);
totTrees = 50;
treeMat = new flash.geom.Matrix();
_root.oo = objects.ai1;
_root.oo2 = objects.ai2;
kh1 = 361;
flying = false;
initMode7();
ttt = 0;
cck = 0;
objects.player.fly = 0;
initBushes(boundaryDistance, 1, 5);
onMouseDown = function () {
ttt = 0;
cck = 0;
};
onMouseUp = function () {
};
onEnterFrame = function () {
if (_quality != "LOW") {
_quality = "LOW";
}
if (gamePaused != 1) {
player.headLights._visible = 0;
moving = 0;
cck++;
tt = getTimer() - st;
ttt = ttt + int(tt);
tta = int((ttt / cck) * 100) / 100;
st = getTimer();
frames.tt = tt;
frames.tta = tta;
player = objects.player;
if (allowHack == 1) {
_xcam = -objects.ai3.xpos;
_zcam = -objects.ai3.ypos;
}
player.w1.r._rotation = player.w1.r._rotation - (speed * 5);
player.w2.r._rotation = player.w2.r._rotation - (speed * 5);
player.w1.r.b._alpha = Math.abs(speed) * 10;
player.w2.r.b._alpha = Math.abs(speed) * 10;
if (player.w1.r.b._alpha > 100) {
player.w1.r.b._alpha = 100;
}
if (player.w2.r.b._alpha > 100) {
player.w2.r.b._alpha = 100;
}
drawRoad();
sortspeedo();
sortSky();
doSnow();
moveCars();
if ((ac == 1) && (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 611 MovieClip "speedo" in Frame 55
onClipEvent (load) {
this.swapDepths(2005);
}
Frame 57
prevFrame();
Frame 70
!!!ERROR
Frame 71
prevFrame();
Frame 72
ipx = px;
stopAllSounds();
onEnterFrame = function () {
st = getTimer();
if (trackNeedsDrawing == true) {
drawTrack();
} else {
gotoAndStop("level" + levelSelected);
}
};
Frame 73
prevFrame();
Frame 75
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = Stage.height;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
function sortSky() {
sky.sky._x = (-_angleY) / 0.09;
while (sky.sky._x < -2000) {
sky.sky._x = sky.sky._x + 2000;
}
while (sky.sky._x > 0) {
sky.sky._x = sky.sky._x - 2000;
}
}
function checkpos(_angleY, _nbMs, speed) {
ox = _xcam;
oy = _zcam;
orx = rayX;
ory = rayZ;
pushed = pushed * trackFriction;
rayX = Math.sin((_angleY * 3.141593) / 180);
rayZ = Math.cos((_angleY * 3.141593) / 180);
_xcam = _xcam - (rayX * speed);
_zcam = _zcam - (rayZ * speed);
if (objects.player.fly <= 0) {
flying = false;
var _local25 = ox - _xcam;
var _local23 = oy - _zcam;
var _local10 = -int(_xcam / 8);
var _local11 = -int(_zcam / 8);
_local10 = _local10 + 128;
_local11 = _local11 + 128;
var _local12 = speed / 15;
var _local24 = (speed / 2) + 3;
var _local13 = 0;
if (speed > 0) {
_local13 = 1;
}
var _local22 = ox + ((_xcam - ox) / 2);
var _local17 = oy + ((_zcam - oy) / 2);
var _local19 = (-int(_local22 / 8)) + 128;
var _local20 = (-int(_local17 / 8)) + 128;
var _local5 = _root.mapArray[_local10][_local11];
var _local7 = _root.mapArray[_local19][_local20];
breaking = 0;
if (_local5 == undefined) {
_local5 = 1;
}
if (((_local5 != 6) && (_local5 != 7)) && (_local5 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local5 == 4) || (_local5 == 5)) || (_local7 == 4)) || (_local7 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
}
}
if ((((_local5 == 6) || (_local5 == 7)) || (_local7 == 6)) || (_local7 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
}
}
if ((((_local5 == 8) || (_local5 == 9)) || (_local7 == 8)) || (_local7 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) || (bestTime == 0)) {
bestTime = lapTime;
var _local18 = lapTime % 100;
var _local14 = int(lapTime / 100);
var _local21 = _local14 % 60;
var _local16 = int(_local14 / 60);
speedo.best.text = (((sortZero(_local16) + ":") + sortZero(_local21)) + ":") + sortZero(_local18);
}
lapTime = 0;
}
if (lapnum == 4) {
_xcama = 0;
_zcama = 0;
endRace = 1;
resultPanel._visible = 1;
resultPanel.swapDepths(3002);
objects.ai4 = objects.player;
objects.ai4.ang = objects.player._currentframe;
objects.ai4.xpos = (-_xcam) - Math.sin((objects.ai4.ang * 3.141593) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * 3.141593) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local6 = objects.ai4;
objects.ai4.pos++;
_local6.pushed = 0;
_local6.dx = _local6.xpos - ((cArray[_local6.pos][0] * 8) - 1024);
_local6.dy = _local6.ypos - ((cArray[_local6.pos][1] * 8) - 1024);
_local6.dz = Math.sqrt((_local6.dx * _local6.dx) + (_local6.dy * _local6.dy));
_local6.ra = 0;
_local6.posCount = 0;
_local6.maxspeed = _local6.topSpeed;
trackCar = 1;
ahead = 0;
var _local3 = 1;
while (_local3 <= 3) {
if (objects["ai" + _local3].lapnum >= 4) {
ahead++;
}
_local3++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
stopAllSounds();
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
unlocked = 2;
_root.playerDetails.data.lev = 2;
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain._visible = 1;
stopAllSounds();
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local5 == 0) || (_local5 == 4)) || (_local5 == 6)) || (_local5 == 8)) {
objects.player._y = kh1 + (random(3) * _local12);
objects.player._rotation = ((random(7) - 3) * _local12) + ((random(5) - 2) * _local13);
maxspeed = 2;
breaking = 0.25;
offroad = 1;
} else {
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local5[0] == 3) || (_local7[0] == 3)) {
var _local4 = (-int(ox / 8)) + 128;
var _local2 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local4][_local2][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
oy = oy + Math.cos((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
_local4 = (-int(ox / 8)) + 128;
_local2 = (-int(oy / 8)) + 128;
}
if (_local5[1]) {
var _local15 = _angleY - _local5[1];
tempDiff = _local5[1];
} else {
tempDiff = _local7[1];
var _local15 = _angleY - _local7[1];
}
while (tempDiff > 90) {
tempDiff = tempDiff - 90;
}
while (tempDiff < 0) {
tempDiff = tempDiff + 90;
}
tempAngle = _angleY;
while (tempAngle > 90) {
tempAngle = tempAngle - 90;
}
while (tempAngle < 0) {
tempAngle = tempAngle + 90;
}
var _local15 = tempAngle - tempDiff;
speed = (-speed) * 0.8;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local5 == 1) {
objects.player._y = kh1 + (random(2) * _local12);
}
}
return(speed);
}
function startrace() {
ac = 1;
bestTime = 0;
lapTime = 0;
totalTime = 0;
}
function sortTimer() {
lapTime = lapTime + 4;
var _local3 = lapTime % 100;
var _local1 = int(lapTime / 100);
var _local4 = _local1 % 60;
var _local2 = int(_local1 / 60);
speedo.timec.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local4 = _local1 % 60;
_local2 = int(_local1 / 60);
speedo.ttime.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
}
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
function drawRoad() {
synchro();
manageKeys();
manageMode7();
}
function synchro() {
_nbMs = 1;
}
function manageKeys() {
_ycam = 20;
var _local9;
var _local10;
var _local7;
var _local8;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) && (flying == false)) {
if (((rotchange > -5) && (rotchange < 5)) && (speed != 0)) {
kartchange = kartchange - 0.5;
if (speed > 0) {
rotchange = rotchange - turningCircle;
} else {
rotchange = rotchange + turningCircle;
}
}
}
}
if (Key.isDown(37)) {
dir = "left";
if ((ac == 1) && (flying == false)) {
if (((rotchange < 5) && (rotchange > -5)) && (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + turningCircle;
} else {
rotchange = rotchange - turningCircle;
}
}
}
}
if ((rotchange != 0) && (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) && (flying == false)) {
kartchange = kartchange + ((-kartchange) / (20 - speed));
}
if (flying == false) {
_angleY = _angleY - rotchange;
}
objects.player.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.filters = [objects.player.myFilter];
objects.player.l1._visible = 0;
objects.player.l2._visible = 0;
objects.player.l3._visible = 0;
objects.player.shad.r._rotation = 90 + objects.player._currentframe;
if (Key.isDown(38)) {
accelerate();
if (speed <= maxspeed) {
if (((ac == 1) && (flying == false)) && (endRace != 1)) {
speed = speed + playersAccel;
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) && (speed > -1)) && (flying == false)) {
speed = speed - 0.3;
if (speed > 0) {
objects.player.l1._visible = 1;
objects.player.l2._visible = 1;
} else {
objects.player.l3._visible = 1;
}
}
}
if ((speed > 0.2) && (flying == false)) {
speed = speed - 0.2;
} else if (flying == false) {
if (Key.isDown(40)) {
if (speed < 0) {
objects.player.l3._visible = 1;
}
} else if (_root.speed < -0.2) {
speed = speed + 0.2;
} else {
speed = 0;
}
}
if (((speed - breaking) > maxspeed) && (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) && (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local6 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local6;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local2 = (-_xcam) - _root.objects.ai4.xpos;
var _local3 = (-_zcam) - _root.objects.ai4.ypos;
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
theeRot = (Math.atan2(_local3, _local2) * 180) / 3.141593;
ratio = 400 / _local4;
if (ratio < 1) {
_local2 = _local2 * ratio;
_local3 = _local3 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local2;
_zcam = (-_root.objects.ai4.ypos) - _local3;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local2;
var _local1;
_local2 = ((20 / _nbScans) * 3.141593) / 180;
_local1 = 0;
var _local4 = 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 = (-ground._y) + (i + 200);
_local1 = _local1 + _local2;
rayY = _local4(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local13;
var _local4;
var _local11;
var _local14;
var _local12;
var _local17;
var _local18;
var _local16;
var _local15;
var _local2;
var _local10;
_local16 = Math.sin;
_local15 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * 3.141593) / 180);
_local13 = (_resoDx * 0.5) / 500;
_local17 = 0;
_local11 = _local16((_angleY * 3.141593) / 180);
_local12 = _local15((_angleY * 3.141593) / 180);
var _local3 = 0;
while (_local3 < tArray.length) {
sortObject(objects["tree" + _local3]);
_local3++;
}
prepBushes();
sortBushes(boundaryDistance, 1, 5);
sortAllBushes();
_local10 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local14 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local5 = leCoses[_local1];
var _local6 = (_xcam - (_local11 * _local5)) - 1024;
var _local7 = (_zcam - (_local12 * _local5)) - 1024;
_local2.tx = (_local6 * _local2.a) + (_local7 * _local2.c);
_local2.ty = ((_local6 * _local2.b) + (_local7 * _local2.d)) + 70;
_local4 = _local13 * _local9;
var _local8 = _local4;
ground[_local1].beginBitmapFill(_local10, _local2, true, false);
ground[_local1].moveTo(-_local4, 0);
ground[_local1].lineTo(_local8, 0);
ground[_local1].lineTo(_local8, _scanSteps);
ground[_local1].lineTo(-_local4, _scanSteps);
ground[_local1].endFill();
}
}
initCars();
_root.pb.start(0, 2000);
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;
mud = flash.display.BitmapData.loadBitmap("mud");
camx = 0;
camy = 0;
var x = 0;
var y = 0;
_bMouse = false;
initIt();
flyamount = 0;
pushed = 0;
trackFriction = 0.5;
trigerMap(0);
_nbScans = 0;
initMode7(0);
grassDistance = 15;
boundaryDistance = 35;
resultPanel._visible = 0;
positions = ["1st", "2nd", "3rd", "4th"];
flying = false;
fade.swapDepths(2);
_quality = "LOW";
var player = objects.attachMovie(_root.theCar, "player", 999);
player._x = 250;
player._y = 361;
player._xscale = (player._yscale = 150);
player.id = 999;
player.swapDepths((int(player._y) * 1000) + 999);
player.myFilter = new flash.filters.ColorMatrixFilter(_root.colourArray);
player.headLights._visible = 1;
lapnum = 0;
speedo.lap.text = ("LAP " + lapnum) + "/3";
if (theCar == "toyota") {
playersMaxSpeed = 15;
turningCircle = 0.5;
playersAccel = 0.4;
} else {
playersMaxSpeed = 14;
turningCircle = 0.6;
playersAccel = 0.55;
}
checkPointReached = 2;
frames.swapDepths(10);
reflections._x = objects._x;
reflections._y = objects._y;
createEmptyMovieClip("ground", 1);
ac = 0;
countdown.swapDepths(11);
objects.swapDepths(3);
totTrees = 50;
treeMat = new flash.geom.Matrix();
_root.oo = objects.ai1;
_root.oo2 = objects.ai2;
kh1 = 361;
flying = false;
initMode7();
ttt = 0;
cck = 0;
objects.player.fly = 0;
initBushes(boundaryDistance, 1, 5);
onMouseDown = function () {
ttt = 0;
cck = 0;
};
onMouseUp = function () {
};
onEnterFrame = function () {
if (_quality != "LOW") {
_quality = "LOW";
}
if (gamePaused != 1) {
player.headLights._visible = 1;
moving = 0;
cck++;
tt = getTimer() - st;
ttt = ttt + int(tt);
tta = int((ttt / cck) * 100) / 100;
st = getTimer();
frames.tt = tt;
frames.tta = tta;
player = objects.player;
if (allowHack == 1) {
_xcam = -objects.ai3.xpos;
_zcam = -objects.ai3.ypos;
}
player.w1.r._rotation = player.w1.r._rotation - (speed * 5);
player.w2.r._rotation = player.w2.r._rotation - (speed * 5);
player.w1.r.b._alpha = Math.abs(speed) * 10;
player.w2.r.b._alpha = Math.abs(speed) * 10;
if (player.w1.r.b._alpha > 100) {
player.w1.r.b._alpha = 100;
}
if (player.w2.r.b._alpha > 100) {
player.w2.r.b._alpha = 100;
}
drawRoad();
sortspeedo();
sortSky();
moveCars();
if ((ac == 1) && (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 611 MovieClip "speedo" in Frame 75
onClipEvent (load) {
this.swapDepths(4);
}
Frame 77
prevFrame();
Frame 90
!!!ERROR
Frame 91
prevFrame();
Frame 92
ipx = px;
onEnterFrame = function () {
st = getTimer();
if (trackNeedsDrawing == true) {
drawTrack();
} else {
gotoAndStop("level" + levelSelected);
}
};
Frame 93
prevFrame();
Frame 95
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = Stage.height;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
function sortSky() {
sky.sky._x = (-_angleY) / 0.09;
while (sky.sky._x < -2000) {
sky.sky._x = sky.sky._x + 2000;
}
while (sky.sky._x > 0) {
sky.sky._x = sky.sky._x - 2000;
}
}
function checkpos(_angleY, _nbMs, speed) {
ox = _xcam;
oy = _zcam;
orx = rayX;
ory = rayZ;
pushed = pushed * trackFriction;
rayX = Math.sin((_angleY * 3.141593) / 180);
rayZ = Math.cos((_angleY * 3.141593) / 180);
_xcam = _xcam - (rayX * speed);
_zcam = _zcam - (rayZ * speed);
if ((((_xcam < 176) && (_xcam > 120)) && (_zcam < 584)) && (_zcam > 544)) {
oldfly = objects.player.fly;
objects.player.fly = -(120 - _xcam);
flyamount = objects.player.fly - oldfly;
} else {
objects.player.fly = objects.player.fly + flyamount;
if (flyamount > 0) {
flying = true;
}
}
flyamount = flyamount - 2;
if (objects.player.fly > 0) {
objects.player._y = kh1 - objects.player.fly;
if (flying == true) {
objects.player.shad._y = (kh1 - objects.player._y) + 4;
}
} else {
objects.player._y = kh1;
objects.player.shad._y = (kh1 - objects.player._y) + 4;
}
if (objects.player.fly <= 0) {
flying = false;
var _local25 = ox - _xcam;
var _local23 = oy - _zcam;
var _local10 = -int(_xcam / 8);
var _local11 = -int(_zcam / 8);
_local10 = _local10 + 128;
_local11 = _local11 + 128;
var _local22 = speed / 15;
var _local24 = (speed / 2) + 3;
var _local19 = 0;
if (speed > 0) {
_local19 = 1;
}
var _local15 = ox + ((_xcam - ox) / 2);
var _local17 = oy + ((_zcam - oy) / 2);
var _local20 = (-int(_local15 / 8)) + 128;
var _local21 = (-int(_local17 / 8)) + 128;
var _local5 = _root.mapArray[_local10][_local11];
var _local7 = _root.mapArray[_local20][_local21];
breaking = 0;
if (_local5 == undefined) {
_local5 = 1;
}
if (((_local5 != 6) && (_local5 != 7)) && (_local5 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local5 == 4) || (_local5 == 5)) || (_local7 == 4)) || (_local7 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
}
}
if ((((_local5 == 6) || (_local5 == 7)) || (_local7 == 6)) || (_local7 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
}
}
if ((((_local5 == 8) || (_local5 == 9)) || (_local7 == 8)) || (_local7 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) || (bestTime == 0)) {
bestTime = lapTime;
var _local18 = lapTime % 100;
var _local12 = int(lapTime / 100);
var _local14 = _local12 % 60;
var _local16 = int(_local12 / 60);
speedo.best.text = (((sortZero(_local16) + ":") + sortZero(_local14)) + ":") + sortZero(_local18);
}
lapTime = 0;
}
if (lapnum == 4) {
_xcama = 0;
_zcama = 0;
endRace = 1;
resultPanel._visible = 1;
resultPanel.swapDepths(3002);
objects.ai4 = objects.player;
objects.ai4.ang = objects.player._currentframe;
objects.ai4.xpos = (-_xcam) - Math.sin((objects.ai4.ang * 3.141593) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * 3.141593) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local6 = objects.ai4;
objects.ai4.pos++;
_local6.dx = _local6.xpos - ((cArray[_local6.pos][0] * 8) - 1024);
_local6.dy = _local6.ypos - ((cArray[_local6.pos][1] * 8) - 1024);
_local6.dz = Math.sqrt((_local6.dx * _local6.dx) + (_local6.dy * _local6.dy));
_local6.ra = 0;
_local6.posCount = 0;
_local6.maxspeed = _local6.topSpeed;
_local6.pushed = 0;
trackCar = 1;
ahead = 0;
var _local3 = 1;
while (_local3 <= 3) {
if (objects["ai" + _local3].lapnum >= 4) {
ahead++;
}
_local3++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.mask2.gotoAndPlay(2);
stopAllSounds();
resultPanel.mask2.gotoAndPlay(1);
resultPanel.congrats._visible = 1;
resultPanel.congrats.gotoAndStop(2);
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain._visible = 1;
stopAllSounds();
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local5 == 0) || (_local5 == 4)) || (_local5 == 6)) || (_local5 == 8)) {
maxspeed = 2;
breaking = 0.25;
offroad = 1;
} else {
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local5[0] == 3) || (_local7[0] == 3)) {
var _local4 = (-int(ox / 8)) + 128;
var _local2 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local4][_local2][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
oy = oy + Math.cos((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
_local4 = (-int(ox / 8)) + 128;
_local2 = (-int(oy / 8)) + 128;
}
if (_local5[1]) {
var _local13 = _angleY - _local5[1];
tempDiff = _local5[1];
} else {
tempDiff = _local7[1];
var _local13 = _angleY - _local7[1];
}
while (tempDiff > 90) {
tempDiff = tempDiff - 90;
}
while (tempDiff < 0) {
tempDiff = tempDiff + 90;
}
tempAngle = _angleY;
while (tempAngle > 90) {
tempAngle = tempAngle - 90;
}
while (tempAngle < 0) {
tempAngle = tempAngle + 90;
}
var _local13 = tempAngle - tempDiff;
speed = (-speed) * 0.8;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local5 == 1) {
objects.player._y = kh1 + (random(2) * _local22);
}
}
return(speed);
}
function startrace() {
ac = 1;
bestTime = 0;
lapTime = 0;
totalTime = 0;
}
function sortTimer() {
lapTime = lapTime + 4;
var _local3 = lapTime % 100;
var _local1 = int(lapTime / 100);
var _local4 = _local1 % 60;
var _local2 = int(_local1 / 60);
speedo.timec.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local4 = _local1 % 60;
_local2 = int(_local1 / 60);
speedo.ttime.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
}
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
function drawRoad() {
synchro();
manageKeys();
manageMode7();
}
function synchro() {
_nbMs = 1;
}
function manageKeys() {
_ycam = 20;
var _local9;
var _local10;
var _local7;
var _local8;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) && (flying == false)) {
if (((rotchange > -5) && (rotchange < 5)) && (speed != 0)) {
kartchange = kartchange - 0.5;
if (speed > 0) {
rotchange = rotchange - turningCircle;
} else {
rotchange = rotchange + turningCircle;
}
}
}
}
if (Key.isDown(37)) {
dir = "left";
if ((ac == 1) && (flying == false)) {
if (((rotchange < 5) && (rotchange > -5)) && (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + turningCircle;
} else {
rotchange = rotchange - turningCircle;
}
}
}
}
if ((rotchange != 0) && (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) && (flying == false)) {
kartchange = kartchange + ((-kartchange) / (20 - speed));
}
if (flying == false) {
_angleY = _angleY - rotchange;
}
objects.player.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.filters = [objects.player.myFilter];
objects.player.l1._visible = 0;
objects.player.l2._visible = 0;
objects.player.l3._visible = 0;
objects.player.shad.r._rotation = 90 + objects.player._currentframe;
if (Key.isDown(38)) {
accelerate();
if (speed <= maxspeed) {
if (((ac == 1) && (flying == false)) && (endRace != 1)) {
speed = speed + playersAccel;
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) && (speed > -1)) && (flying == false)) {
speed = speed - 0.3;
if (speed > 0) {
objects.player.l1._visible = 1;
objects.player.l2._visible = 1;
} else {
objects.player.l3._visible = 1;
}
}
}
if ((speed > 0.2) && (flying == false)) {
speed = speed - 0.2;
} else if (flying == false) {
if (Key.isDown(40)) {
if (speed < 0) {
objects.player.l3._visible = 1;
}
} else if (_root.speed < -0.2) {
speed = speed + 0.2;
} else {
speed = 0;
}
}
if (((speed - breaking) > maxspeed) && (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) && (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local6 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local6;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local2 = (-_xcam) - _root.objects.ai4.xpos;
var _local3 = (-_zcam) - _root.objects.ai4.ypos;
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
theeRot = (Math.atan2(_local3, _local2) * 180) / 3.141593;
ratio = 400 / _local4;
if (ratio < 1) {
_local2 = _local2 * ratio;
_local3 = _local3 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local2;
_zcam = (-_root.objects.ai4.ypos) - _local3;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local2;
var _local1;
_local2 = ((20 / _nbScans) * 3.141593) / 180;
_local1 = 0;
var _local4 = 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 = (-ground._y) + (i + 200);
_local1 = _local1 + _local2;
rayY = _local4(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local13;
var _local4;
var _local11;
var _local14;
var _local12;
var _local17;
var _local18;
var _local16;
var _local15;
var _local2;
var _local10;
_local16 = Math.sin;
_local15 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * 3.141593) / 180);
_local13 = (_resoDx * 0.5) / 500;
_local17 = 0;
_local11 = _local16((_angleY * 3.141593) / 180);
_local12 = _local15((_angleY * 3.141593) / 180);
var _local3 = 0;
while (_local3 < tArray.length) {
sortObject(objects["tree" + _local3]);
_local3++;
}
prepBushes();
sortBushes(grassDistance, 0, 1);
sortAllBushes();
sortRamp();
_local10 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local14 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local5 = leCoses[_local1];
var _local6 = (_xcam - (_local11 * _local5)) - 1024;
var _local7 = (_zcam - (_local12 * _local5)) - 1024;
_local2.tx = (_local6 * _local2.a) + (_local7 * _local2.c);
_local2.ty = ((_local6 * _local2.b) + (_local7 * _local2.d)) + 70;
_local4 = _local13 * _local9;
var _local8 = _local4;
ground[_local1].beginBitmapFill(_local10, _local2, true, false);
ground[_local1].moveTo(-_local4, 0);
ground[_local1].lineTo(_local8, 0);
ground[_local1].lineTo(_local8, _scanSteps);
ground[_local1].lineTo(-_local4, _scanSteps);
ground[_local1].endFill();
}
}
initCars();
stopAllSounds();
_root.pb.start(0, 2000);
player = objects.player;
_root.player.swapDepths((int(_root.player._y) * 1000) + 999);
_root.line = _root.createEmptyMovieClip("line", 5001);
pic = createEmptyMovieClip("pic", 10001);
mov = pic.createEmptyMovieClip("mov", 2);
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;
mud = flash.display.BitmapData.loadBitmap("mud");
camx = 0;
camy = 0;
var x = 0;
var y = 0;
_bMouse = false;
initIt();
flyamount = 0;
pushed = 0;
trackFriction = 0.5;
trigerMap(0);
_nbScans = 0;
initMode7(0);
grassDistance = 7;
boundaryDistance = 1;
resultPanel._visible = 0;
positions = ["1st", "2nd", "3rd", "4th"];
fade.swapDepths(2);
_quality = "LOW";
var player = objects.attachMovie(_root.theCar, "player", 999);
player._x = 250;
player._y = 361;
player._xscale = (player._yscale = 150);
player.id = 999;
player.swapDepths((int(player._y) * 1000) + 999);
player.myFilter = new flash.filters.ColorMatrixFilter(_root.colourArray);
lapnum = 0;
speedo.lap.text = ("LAP " + lapnum) + "/3";
checkPointReached = 2;
frames.swapDepths(10);
reflections._x = objects._x;
reflections._y = objects._y;
if (theCar == "toyota") {
playersMaxSpeed = 15;
turningCircle = 0.5;
playersAccel = 0.4;
} else {
playersMaxSpeed = 14;
turningCircle = 0.6;
playersAccel = 0.55;
}
createEmptyMovieClip("ground", 1);
ac = 0;
countdown.swapDepths(11);
objects.swapDepths(3);
totTrees = 50;
treeMat = new flash.geom.Matrix();
_root.oo = objects.ai1;
_root.oo2 = objects.ai2;
kh1 = 361;
flying = false;
initMode7();
ttt = 0;
cck = 0;
objects.player.fly = 0;
initBushes(grassDistance, 0, 1);
onMouseDown = function () {
ttt = 0;
cck = 0;
};
onMouseUp = function () {
};
onEnterFrame = function () {
if (_quality != "LOW") {
_quality = "LOW";
}
if (gamePaused != 1) {
player.headLights._visible = 0;
moving = 0;
cck++;
tt = getTimer() - st;
ttt = ttt + int(tt);
tta = int((ttt / cck) * 100) / 100;
st = getTimer();
frames.tt = tt;
frames.tta = tta;
player = objects.player;
if (allowHack == 1) {
_xcam = -objects.ai3.xpos;
_zcam = -objects.ai3.ypos;
}
player.w1.r._rotation = player.w1.r._rotation - (speed * 5);
player.w2.r._rotation = player.w2.r._rotation - (speed * 5);
player.w1.r.b._alpha = Math.abs(speed) * 10;
player.w2.r.b._alpha = Math.abs(speed) * 10;
if (player.w1.r.b._alpha > 100) {
player.w1.r.b._alpha = 100;
}
if (player.w2.r.b._alpha > 100) {
player.w2.r.b._alpha = 100;
}
drawRoad();
sortspeedo();
sortSky();
moveCars();
if ((ac == 1) && (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 611 MovieClip "speedo" in Frame 95
onClipEvent (load) {
this.swapDepths(2005);
}
Frame 97
prevFrame();
Frame 110
!!!ERROR
Frame 111
prevFrame();
Frame 112
ipx = px;
onEnterFrame = function () {
st = getTimer();
if (trackNeedsDrawing == true) {
drawTrack();
} else {
gotoAndStop("level" + levelSelected);
}
};
Frame 113
prevFrame();
Frame 115
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = Stage.height;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
function sortSky() {
sky.sky._x = (-_angleY) / 0.09;
while (sky.sky._x < -2000) {
sky.sky._x = sky.sky._x + 2000;
}
while (sky.sky._x > 0) {
sky.sky._x = sky.sky._x - 2000;
}
}
function checkpos(_angleY, _nbMs, speed) {
ox = _xcam;
oy = _zcam;
orx = rayX;
ory = rayZ;
rayX = Math.sin((_angleY * 3.141593) / 180);
rayZ = Math.cos((_angleY * 3.141593) / 180);
pushed = pushed * trackFriction;
_xcam = _xcam - (rayX * speed);
_zcam = _zcam - (rayZ * speed);
if (objects.player.fly <= 0) {
flying = false;
var _local25 = ox - _xcam;
var _local23 = oy - _zcam;
var _local10 = -int(_xcam / 8);
var _local11 = -int(_zcam / 8);
_local10 = _local10 + 128;
_local11 = _local11 + 128;
var _local12 = speed / 15;
var _local24 = (speed / 2) + 3;
var _local13 = 0;
if (speed > 0) {
_local13 = 1;
}
var _local22 = ox + ((_xcam - ox) / 2);
var _local17 = oy + ((_zcam - oy) / 2);
var _local19 = (-int(_local22 / 8)) + 128;
var _local20 = (-int(_local17 / 8)) + 128;
var _local5 = _root.mapArray[_local10][_local11];
var _local7 = _root.mapArray[_local19][_local20];
breaking = 0;
if (_local5 == undefined) {
_local5 = 1;
}
if (((_local5 != 6) && (_local5 != 7)) && (_local5 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local5 == 4) || (_local5 == 5)) || (_local7 == 4)) || (_local7 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
}
}
if ((((_local5 == 6) || (_local5 == 7)) || (_local7 == 6)) || (_local7 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
}
}
if ((((_local5 == 8) || (_local5 == 9)) || (_local7 == 8)) || (_local7 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) || (bestTime == 0)) {
bestTime = lapTime;
var _local18 = lapTime % 100;
var _local14 = int(lapTime / 100);
var _local21 = _local14 % 60;
var _local16 = int(_local14 / 60);
speedo.best.text = (((sortZero(_local16) + ":") + sortZero(_local21)) + ":") + sortZero(_local18);
}
lapTime = 0;
}
if (lapnum == 4) {
_xcama = 0;
_zcama = 0;
endRace = 1;
resultPanel._visible = 1;
resultPanel.swapDepths(3002);
objects.ai4 = objects.player;
objects.ai4.ang = objects.player._currentframe;
objects.ai4.xpos = (-_xcam) - Math.sin((objects.ai4.ang * 3.141593) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * 3.141593) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local6 = objects.ai4;
objects.ai4.pos++;
_local6.dx = _local6.xpos - ((cArray[_local6.pos][0] * 8) - 1024);
_local6.dy = _local6.ypos - ((cArray[_local6.pos][1] * 8) - 1024);
_local6.dz = Math.sqrt((_local6.dx * _local6.dx) + (_local6.dy * _local6.dy));
_local6.ra = 0;
_local6.posCount = 0;
_local6.maxspeed = _local6.topSpeed;
_local6.pushed = 0;
trackCar = 1;
ahead = 0;
var _local3 = 1;
while (_local3 <= 3) {
if (objects["ai" + _local3].lapnum >= 4) {
ahead++;
}
_local3++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
stopAllSounds();
unlocked = 4;
_root.playerDetails.data.lev = 4;
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain.gotoAndStop(2);
stopAllSounds();
resultPanel.tryagain._visible = 1;
resultPanel.mask2.gotoAndPlay(2);
resultPanel.mask2.gotoAndPlay(1);
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local5 == 0) || (_local5 == 4)) || (_local5 == 6)) || (_local5 == 8)) {
objects.player._y = kh1 + (random(3) * _local12);
objects.player._rotation = ((random(7) - 3) * _local12) + ((random(5) - 2) * _local13);
maxspeed = 2;
breaking = 0.25;
offroad = 1;
} else {
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local5[0] == 3) || (_local7[0] == 3)) {
var _local4 = (-int(ox / 8)) + 128;
var _local2 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local4][_local2][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
oy = oy + Math.cos((_root.mapArray[_local4][_local2][1] * 3.141593) / 180);
_local4 = (-int(ox / 8)) + 128;
_local2 = (-int(oy / 8)) + 128;
}
if (_local5[1]) {
var _local15 = _angleY - _local5[1];
tempDiff = _local5[1];
} else {
tempDiff = _local7[1];
var _local15 = _angleY - _local7[1];
}
while (tempDiff > 90) {
tempDiff = tempDiff - 90;
}
while (tempDiff < 0) {
tempDiff = tempDiff + 90;
}
tempAngle = _angleY;
while (tempAngle > 90) {
tempAngle = tempAngle - 90;
}
while (tempAngle < 0) {
tempAngle = tempAngle + 90;
}
var _local15 = tempAngle - tempDiff;
speed = (-speed) * 0.8;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local5 == 1) {
objects.player._y = kh1 + (random(2) * _local12);
}
}
return(speed);
}
function startrace() {
ac = 1;
bestTime = 0;
lapTime = 0;
totalTime = 0;
}
function sortTimer() {
lapTime = lapTime + 4;
var _local3 = lapTime % 100;
var _local1 = int(lapTime / 100);
var _local4 = _local1 % 60;
var _local2 = int(_local1 / 60);
speedo.timec.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local4 = _local1 % 60;
_local2 = int(_local1 / 60);
speedo.ttime.text = (((sortZero(_local2) + ":") + sortZero(_local4)) + ":") + sortZero(_local3);
}
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
function drawRoad() {
synchro();
manageKeys();
manageMode7();
}
function synchro() {
_nbMs = 1;
}
function manageKeys() {
_ycam = 20;
var _local9;
var _local10;
var _local7;
var _local8;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) && (flying == false)) {
if (((rotchange > -5) && (rotchange < 5)) && (speed != 0)) {
kartchange = kartchange - 0.5;
if (speed > 0) {
rotchange = rotchange - turningCircle;
} else {
rotchange = rotchange + turningCircle;
}
}
}
}
if (Key.isDown(37)) {
dir = "left";
if ((ac == 1) && (flying == false)) {
if (((rotchange < 5) && (rotchange > -5)) && (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + turningCircle;
} else {
rotchange = rotchange - turningCircle;
}
}
}
}
if ((rotchange != 0) && (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) && (flying == false)) {
kartchange = kartchange + ((-kartchange) / (20 - speed));
}
if (flying == false) {
_angleY = _angleY - rotchange;
}
objects.player.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.gotoAndStop(Math.round(180 - (kartchange * 6)));
objects.player.car.filters = [objects.player.myFilter];
objects.player.l1._visible = 0;
objects.player.l2._visible = 0;
objects.player.l3._visible = 0;
objects.player.shad.r._rotation = 90 + objects.player._currentframe;
if (Key.isDown(38)) {
accelerate();
if (speed <= maxspeed) {
if (((ac == 1) && (flying == false)) && (endRace != 1)) {
speed = speed + playersAccel;
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) && (speed > -1)) && (flying == false)) {
speed = speed - 0.3;
if (speed > 0) {
objects.player.l1._visible = 1;
objects.player.l2._visible = 1;
} else {
objects.player.l3._visible = 1;
}
}
}
if ((speed > 0.2) && (flying == false)) {
speed = speed - 0.2;
} else if (flying == false) {
if (Key.isDown(40)) {
if (speed < 0) {
objects.player.l3._visible = 1;
}
} else if (_root.speed < -0.2) {
speed = speed + 0.2;
} else {
speed = 0;
}
}
if (((speed - breaking) > maxspeed) && (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) && (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local6 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local6;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local2 = (-_xcam) - _root.objects.ai4.xpos;
var _local3 = (-_zcam) - _root.objects.ai4.ypos;
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
theeRot = (Math.atan2(_local3, _local2) * 180) / 3.141593;
ratio = 400 / _local4;
if (ratio < 1) {
_local2 = _local2 * ratio;
_local3 = _local3 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local2;
_zcam = (-_root.objects.ai4.ypos) - _local3;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local2;
var _local1;
_local2 = ((20 / _nbScans) * 3.141593) / 180;
_local1 = 0;
var _local4 = 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 = (-ground._y) + (i + 200);
_local1 = _local1 + _local2;
rayY = _local4(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local11;
var _local3;
var _local10;
var _local13;
var _local12;
var _local16;
var _local17;
var _local14;
var _local15;
var _local2;
var _local9;
_local14 = Math.sin;
_local15 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * 3.141593) / 180);
_local11 = (_resoDx * 0.5) / 500;
_local16 = 0;
_local10 = _local14((_angleY * 3.141593) / 180);
_local12 = _local15((_angleY * 3.141593) / 180);
prepBushes();
sortBushes(grassDistance, 0, 1);
sortAllBushes();
_local9 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local13 < 0) {
continue;
}
var _local8 = dists[_local1];
var _local4 = leCoses[_local1];
var _local5 = (_xcam - (_local10 * _local4)) - 1024;
var _local6 = (_zcam - (_local12 * _local4)) - 1024;
_local2.tx = (_local5 * _local2.a) + (_local6 * _local2.c);
_local2.ty = ((_local5 * _local2.b) + (_local6 * _local2.d)) + 70;
_local3 = _local11 * _local8;
var _local7 = _local3;
ground[_local1].beginBitmapFill(_local9, _local2, true, false);
ground[_local1].moveTo(-_local3, 0);
ground[_local1].lineTo(_local7, 0);
ground[_local1].lineTo(_local7, _scanSteps);
ground[_local1].lineTo(-_local3, _scanSteps);
ground[_local1].endFill();
}
}
initCars();
stopAllSounds();
_root.pb.start(0, 2000);
player = objects.player;
_root.player.swapDepths((int(_root.player._y) * 1000) + 999);
_root.line = _root.createEmptyMovieClip("line", 5001);
pic = createEmptyMovieClip("pic", 10001);
mov = pic.createEmptyMovieClip("mov", 2);
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;
mud = flash.display.BitmapData.loadBitmap("mud");
camx = 0;
camy = 0;
var x = 0;
var y = 0;
_bMouse = false;
initIt();
flyamount = 0;
trackFriction = 0.5;
pushed = 0;
trigerMap(0);
_nbScans = 0;
initMode7(0);
grassDistance = 25;
boundaryDistance = 1;
resultPanel._visible = 0;
positions = ["1st", "2nd", "3rd", "4th"];
fade.swapDepths(2);
_quality = "LOW";
var player = objects.attachMovie(_root.theCar, "player", 999);
player._x = 250;
player._y = 361;
player._xscale = (player._yscale = 150);
player.id = 999;
player.swapDepths((int(player._y) * 1000) + 999);
player.myFilter = new flash.filters.ColorMatrixFilter(_root.colourArray);
lapnum = 0;
speedo.lap.text = ("LAP " + lapnum) + "/3";
checkPointReached = 2;
frames.swapDepths(10);
reflections._x = objects._x;
reflections._y = objects._y;
createEmptyMovieClip("ground", 1);
ac = 0;
if (theCar == "toyota") {
playersMaxSpeed = 15;
turningCircle = 0.5;
playersAccel = 0.4;
} else {
playersMaxSpeed = 14;
turningCircle = 0.6;
playersAccel = 0.55;
}
countdown.swapDepths(11);
objects.swapDepths(3);
totTrees = 50;
treeMat = new flash.geom.Matrix();
_root.oo = objects.ai1;
_root.oo2 = objects.ai2;
kh1 = 361;
flying = false;
initMode7();
ttt = 0;
cck = 0;
objects.player.fly = 0;
initBushes(grassDistance, 0, 1);
onMouseDown = function () {
ttt = 0;
cck = 0;
};
onMouseUp = function () {
};
onEnterFrame = function () {
if (_quality != "LOW") {
_quality = "LOW";
}
if (gamePaused != 1) {
player.headLights._visible = 0;
moving = 0;
cck++;
tt = getTimer() - st;
ttt = ttt + int(tt);
tta = int((ttt / cck) * 100) / 100;
st = getTimer();
frames.tt = tt;
frames.tta = tta;
player = objects.player;
if (allowHack == 1) {
_xcam = -objects.ai3.xpos;
_zcam = -objects.ai3.ypos;
}
player.w1.r._rotation = player.w1.r._rotation - (speed * 5);
player.w2.r._rotation = player.w2.r._rotation - (speed * 5);
player.w1.r.b._alpha = Math.abs(speed) * 10;
player.w2.r.b._alpha = Math.abs(speed) * 10;
if (player.w1.r.b._alpha > 100) {
player.w1.r.b._alpha = 100;
}
if (player.w2.r.b._alpha > 100) {
player.w2.r.b._alpha = 100;
}
drawRoad();
sortspeedo();
sortSky();
moveCars();
if ((ac == 1) && (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 611 MovieClip "speedo" in Frame 115
onClipEvent (load) {
this.swapDepths(4);
}
Frame 117
prevFrame();
Instance of Symbol 3 MovieClip in Symbol 4 MovieClip [light] Frame 1
onClipEvent (load) {
swapDepths(0);
}
Symbol 21 Button
on (release) {
getURL ("http://www.racinggames9.com/", "_blank");
}
Symbol 110 MovieClip Frame 7
this._parent.endMove();
Symbol 111 MovieClip Frame 7
this._parent.endMove();
Symbol 112 MovieClip Frame 7
this._parent.endMove();
Symbol 113 MovieClip Frame 7
this._parent.endMove();
Symbol 114 MovieClip Frame 7
this._parent.endMove();
Symbol 115 MovieClip Frame 7
this._parent.endMove();
Symbol 116 MovieClip Frame 7
this._parent.endMove();
Symbol 117 MovieClip Frame 7
this._parent.endMove();
Symbol 122 MovieClip Frame 1
this.stop();
Symbol 123 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 1
_root.bs.start(0, 1);
Symbol 241 MovieClip Frame 50
stop();
Symbol 251 MovieClip Frame 42
stop();
Symbol 262 MovieClip Frame 10
stop();
Symbol 264 MovieClip Frame 20
stop();
Symbol 266 MovieClip Frame 30
stop();
Symbol 268 MovieClip Frame 20
stop();
Symbol 270 MovieClip Frame 15
stop();
Symbol 274 MovieClip Frame 1
stop();
Symbol 274 MovieClip Frame 2
stop();
Symbol 274 MovieClip Frame 10
gotoAndStop (1);
Symbol 275 MovieClip Frame 55
stop();
onEnterFrame = function () {
pla.onRollOver = function () {
pla1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
pla.onRollOut = function () {
pla1.gotoAndPlay(3);
};
pla.onRelease = function () {
goto = this.a - 1;
_root.gotoAndStop("track");
};
hel.onRollOver = function () {
hel1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
hel.onRollOut = function () {
hel1.gotoAndPlay(3);
};
hel.onRelease = function () {
_root.gotoAndStop("intructions");
};
con.onRollOver = function () {
con1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
con.onRollOut = function () {
con1.gotoAndPlay(3);
};
con.onRelease = function () {
goto = this.a - 1;
_root.gotoAndStop("track");
};
mor.onRollOver = function () {
mor1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
mor.onRollOut = function () {
mor1.gotoAndPlay(3);
};
mor.onRelease = function () {
getURL ("http://www.racinggames9.com/", "_blank");
};
hig.onRollOver = function () {
hig1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
hig.onRollOut = function () {
hig1.gotoAndPlay(3);
};
hig.onRelease = function () {
};
};
Symbol 282 MovieClip Frame 1
_root.ms.start(0, 2000);
Symbol 282 MovieClip Frame 2
stop();
Symbol 309 MovieClip Frame 1
stop();
Symbol 320 MovieClip [ripple] Frame 1
this.myType = "ripple";
this.xpos = (this.oxpos + random(16)) - 8;
this.ypos = (this.oypos + random(16)) - 8;
Symbol 340 MovieClip Frame 1
stop();
Symbol 342 Button
on (release, keyPress "<Enter>") {
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 ("track");
}
}
Symbol 350 MovieClip Frame 55
stop();
onEnterFrame = function () {
mor.onRollOver = function () {
mor1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
mor.onRollOut = function () {
mor1.gotoAndPlay(3);
};
mor.onRelease = function () {
getURL ("http://www.racinggames9.com/", "blank");
};
};
Symbol 355 MovieClip Frame 25
stop();
Symbol 359 MovieClip Frame 30
stop();
Symbol 362 MovieClip Frame 25
stop();
Symbol 365 MovieClip Frame 40
stop();
Symbol 368 MovieClip Frame 35
stop();
Symbol 371 MovieClip Frame 37
stop();
Symbol 373 MovieClip Frame 44
stop();
Symbol 436 MovieClip Frame 55
stop();
onEnterFrame = function () {
mor.onRollOver = function () {
mor1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
mor.onRollOut = function () {
mor1.gotoAndPlay(3);
};
mor.onRelease = function () {
};
con.onRollOver = function () {
con1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
con.onRollOut = function () {
con1.gotoAndPlay(3);
};
con.onRelease = function () {
_root.gotoAndStop("track");
};
};
Symbol 440 MovieClip Frame 1
if (_root.levelSelected != 3) {
this._visible = 0;
}
Symbol 550 MovieClip Frame 1
ai1.id = 1;
ai2.id = 2;
ais1.id = 3;
ais2.id = 3;
Symbol 559 MovieClip Frame 1
_root.theCar = "toyota";
Symbol 572 MovieClip Frame 1
function setColour(num) {
if (num == 1) {
_root.colourArray = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.colourCounterArray = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai1ColourArray = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai2ColourArray = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
_root.ai3ColourArray = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
}
if (num == 2) {
_root.colourArray = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.colourCounterArray = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai1ColourArray = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
_root.ai2ColourArray = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai3ColourArray = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
}
if (num == 3) {
_root.colourArray = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
_root.colourCounterArray = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
_root.ai1ColourArray = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai2ColourArray = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai3ColourArray = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
}
if (num == 4) {
_root.colourArray = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.colourCounterArray = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai1ColourArray = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai2ColourArray = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
_root.ai3ColourArray = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
}
if (num == 5) {
_root.colourArray = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
_root.ai1ColourArray = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.ai2ColourArray = [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0];
_root.ai3ColourArray = [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
_root.colourCounterArray = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
}
cars.filters = [new flash.filters.ColorMatrixFilter(_root.colourArray)];
}
onEnterFrame = function () {
mor.onRollOver = function () {
mor1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
mor.onRollOut = function () {
mor1.gotoAndPlay(3);
};
mor.onRelease = function () {
getURL ("http://www.racinggames9.com/", "_blank");
};
stra.onRollOver = function () {
stra1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
stra.onRollOut = function () {
stra1.gotoAndPlay(3);
};
stra.onRelease = function () {
if (_root.trackNeedsDrawing == true) {
_root.gotoAndStop("load" + _root.levelSelected);
} else {
_root.gotoAndStop("level" + _root.levelSelected);
}
};
};
setColour(1);
var a = 1;
while (a <= 5) {
var t = this["t" + a];
t.a = a;
t.alphaTo = 0;
t.alpha = 0;
t.onRelease = function () {
setColour(this.a);
};
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++;
}
Symbol 598 MovieClip Frame 1
stop();
Symbol 601 Button
on (release) {
getURL ("http://www.racinggames9.com/", "_blank");
}
Symbol 607 Button
on (release) {
gotoAndStop (2);
}
Symbol 608 Button
on (release) {
gotoAndStop (1);
}
Symbol 610 MovieClip Frame 1
stop();
_root.ms.setVolume(100);
_root.bs.setVolume(100);
_root.bu.setVolume(100);
_root.go.setVolume(100);
_root.pb.setVolume(100);
_root.engine.setVolume(100);
Symbol 610 MovieClip Frame 2
stop();
_root.ms.setVolume(0);
_root.bs.setVolume(0);
_root.bu.setVolume(0);
_root.go.setVolume(0);
_root.pb.setVolume(0);
_root.engine.setVolume(0);
Symbol 611 MovieClip Frame 1
hand._rotation = -120;
handshad._rotation = -120;
checkpoint._visible = 0;
stop();
isPaused = 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);
}
};
Symbol 626 MovieClip Frame 1
stop();
Symbol 631 MovieClip Frame 1
stop();
Symbol 637 Button
on (release) {
_root.fade.removeMovieClip();
_root.engine.stop();
_root.mrs.removeMovieClip();
_root.rain.removeMovieClip();
delete _root.engine;
_root.reflections.removeMovieClip();
_root.ground.removeMovieClip();
_root.objects.removeMovieClip();
_root.speedo.removeMovieClip();
_root.countDown.removeMovieClip();
_root.gotoAndStop("track");
for (a in _root) {
if (((((((_root[a] != _root.musicMc) && (_root[a] != _root.music)) && (_root[a] != _root.__mochibot__fe6c8b97)) && (a != "username")) && (a != "unlocked")) && (_root[a] != _level1)) && (a != "cookie")) {
delete _root[a];
_root[a].dispose();
_root[a].removeMovieClip();
}
}
this.removeMovieClip();
}
Symbol 638 MovieClip Frame 1
onEnterFrame = function () {
mor.onRollOver = function () {
mor1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
mor.onRollOut = function () {
mor1.gotoAndPlay(3);
};
mor.onRelease = function () {
getURL ("http://www.racinggames9.com/", "_blank");
};
con.onRollOver = function () {
con1.gotoAndPlay(2);
_root.bu.start(0, 1);
};
con.onRollOut = function () {
con1.gotoAndPlay(3);
};
con.onRelease = function () {
stopAllSounds();
_root.ms.start(0, 2000);
_root.fade.removeMovieClip();
_root.engine.stop();
_root.mrs.removeMovieClip();
_root.rain.removeMovieClip();
delete _root.engine;
_root.reflections.removeMovieClip();
_root.ground.removeMovieClip();
_root.objects.removeMovieClip();
_root.speedo.removeMovieClip();
_root.countDown.removeMovieClip();
_root.gotoAndStop("track");
for (a in _root) {
if (((((((_root[a] != _root.musicMc) && (_root[a] != _root.music)) && (_root[a] != _root.__mochibot__fe6c8b97)) && (a != "username")) && (a != "unlocked")) && (_root[a] != _level1)) && (a != "cookie")) {
delete _root[a];
_root[a].dispose();
_root[a].removeMovieClip();
}
}
this.removeMovieClip();
};
};
t.alpha = 0;
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, 4, 4, 2, 3, false, false)];
} else {
this.filters = [];
}
};
t.onRollOver = (t.onDragOver = function () {
this.alphaTo = 1;
});
t.onRollOut = (t.onDragOut = function () {
this.alphaTo = 0;
});
tryagain._visible = 0;
congrats._visible = 0;
stop();
Instance of Symbol 130 MovieClip in Symbol 638 MovieClip Frame 1
on (release) {
getURL ("http://www.racinggames9.com/", "_blank");
}
Instance of Symbol 130 MovieClip in Symbol 638 MovieClip Frame 1
on (release) {
getURL ("http://www.racinggames9.com/", "_blank");
}
Symbol 647 MovieClip [countdown] Frame 125
_root.startrace();
Symbol 647 MovieClip [countdown] Frame 146
this.removeMovieClip();
stop();