Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var _local3;
var _local7;
var _local2;
var _local12;
var _local5;
var _local11;
var _local9;
var _local4;
var _local6;
_local4 = "__mochibot__";
_local6 = "mochibot.com";
_local7 = (_global ? _global : (_level0._root));
if (_local7[_local4 + swfid]) {
return(_local7[_local4 + swfid]);
}
_local2 = System.security;
_local3 = mc._root.getSWFVersion;
_local12 = (_local3 ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!_local2) {
_local2 = {};
}
_local5 = _local2.sandboxType;
if (_local5 == "localWithFile") {
return(null);
}
_local3 = _local2.allowDomain;
if (_local3) {
_local2.allowDomain(_local6);
}
_local3 = _local2.allowInsecureDomain;
if (_local3) {
_local2.allowInsecureDomain(_local6);
}
_local11 = (((((((((((("http://" + _local6) + "/my/core.swf?mv=7&fv=") + _local12) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (_local5 ? ("&sb=" + _local5) : "")) + (trk ? "&t=1" : "");
_local7[_local4 + "level"] = lv;
_local9 = mc.createEmptyMovieClip(_local4 + swfid, lv);
_local9.loadMovie(_local11);
return(_local9);
}
__com_mochibot__("fe6c8b97", this, 10301, true);
cookie = SharedObject.getLocal("3dRallyRacing");
if (cookie.data.lastUser != null) {
var lastUser = cookie.data.lastUser;
username = cookie.data["user" + lastUser].username;
unlocked = cookie.data["user" + lastUser].unlocked;
} else {
username = "";
unlocked = 2;
}
alreadyLoaded = -1;
myDomain = _url;
System.security.allowDomain("http://www.boxofgames.com");
loadMovieNum ("http://www.boxofgames.com/rally/rallyscores.swf", 1);
stop();
onEnterFrame = function () {
if ((alreadyLoaded == -1) and (load.text.length < 2)) {
alreadyLoaded = getBytesLoaded();
}
load.text = ("LOADING, PLEASE WAIT... " + Math.round((100 / (136164 - alreadyLoaded)) * (getBytesLoaded() - alreadyLoaded))) + "%";
ifFrameLoaded (2) {
gotoAndStop (2);
}
};
if (_level0 != this) {
getURL ("http://www.gamersenterprise.com", "_self");
for (var a in _level0) {
delete _level0[a];
_level0[a].removeMovieClip();
}
this.removeMovieClip();
}
Frame 2
load._visible = 0;
onEnterFrame = function () {
load.text = ("LOADING, PLEASE WAIT... " + Math.round((100 / (274960 - alreadyLoaded)) * (getBytesLoaded() - alreadyLoaded))) + "%";
ifFrameLoaded (3) {
if (load._visible == 0) {
skipButton.play();
frame3Loaded = true;
} else {
gotoAndStop (3);
}
delete this.onEnterFrame;
}
};
Frame 3
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
delete this.onEnterFrame;
logos.swapDepths(3000);
jumpTo = 0;
_quality = "HIGH";
fade.removeMovieClip();
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++;
};
if (!musicMc) {
musicMc = createEmptyMovieClip("musicMc", 20);
audioMc = createEmptyMovieClip("audioMc", 21);
music = new Sound(musicMc);
audio = new Sound(audioMc);
music.attachSound("musicloop");
music.start();
music.onSoundComplete = function () {
music.start();
};
}
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]) {
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 = 2;
unlocked = 2;
} else {
unlocked = cookie.data["user" + username].unlocked;
}
}
pleaseEnter._visible = 0;
if (username) {
enterConfirm.gotoAndStop(2);
}
Selection.setFocus(usernameTF);
Frame 9
prevFrame();
Frame 10
function saveCookie(levelsDone) {
if (debugging != 1) {
if ((levelsDone + 1) > cookie.data["user" + username].unlocked) {
cookie.data["user" + username].unlocked = levelsDone + 1;
unlocked = levelsDone + 1;
}
}
}
function sendScores() {
_level1.sendData(username, bestTime, totalTime, levelSelected);
}
function yourPosition(what) {
scorePosition = what.scorePosition;
resultPanel.gotoAndStop(3);
}
function sendError() {
resultPanel.gotoAndStop(4);
}
function sortZero(what) {
if (String(what).length == 1) {
what = "0" + what;
}
return(what);
}
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();
}
}
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;
t.onRelease = function () {
levelSelected = this.a;
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 = [];
}
};
t.onRollOver = (t.onDragOver = function () {
this.alphaTo = 1;
});
t.onRollOut = (t.onDragOut = function () {
this.alphaTo = 0;
});
a++;
}
var a = 3;
while (a <= unlocked) {
this["locked" + a]._visible = 0;
a++;
}
function loopMusic() {
if (musicLooping != true) {
musicLooping = true;
music.onSoundComplete = function () {
music.attachSound("rally");
music.start();
music.onSoundComplete = function () {
music.start();
};
};
}
}
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();
}
}
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();
}
textures = ["sand", "smlSand", "snow", "ice", "grass", "mud", "grass", "mud", "grass2", "tarmac"];
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 _local4 = car.xpos - car.oxpos;
var _local3 = car.ypos - car.oypos;
var _local2 = Math.sqrt((_local4 * _local4) + (_local3 * _local3));
if (int(_local2) >= 1) {
var _local5 = Math.atan2(_local3, _local4);
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) / Math.PI) + 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) / Math.PI) - 90;
_local1.adjustG = 0.05;
_local1.adjustA = 0.7;
checkCars(_local1);
while (_local1.angG > (_local1.ang + 180)) {
_local1.angG = _local1.angG - 360;
}
while (_local1.angG < (_local1.ang - 180)) {
_local1.angG = _local1.angG + 360;
}
_local1.rg = (_local1.angG - _local1.ang) * _local1.adjustG;
_local1.ra = _local1.ra + _local1.rg;
_local1.ra = _local1.ra * _local1.adjustA;
_local1.ang = _local1.ang + _local1.ra;
_local1.posCount = _local1.posCount + _local1.speed;
checkCarPos(_local1);
_local1.oxpos = _local1.xpos;
_local1.oypos = _local1.ypos;
_local1.xpos = _local1.xpos + ((Math.sin((_local1.ang * Math.PI) / 180) * _local1.speed) + (Math.cos((_local1.ang * Math.PI) / 180) * _local1.pushed));
_local1.ypos = _local1.ypos - ((Math.cos((_local1.ang * Math.PI) / 180) * _local1.speed) + (Math.sin((_local1.ang * Math.PI) / 180) * _local1.pushed));
if (_local1.posCount >= _local1.dz) {
nextPos(_local1);
}
}
sortObject(_local1);
_local1.car.filters = [_local1.myFilter];
_local2++;
}
}
function checkCarPos(car) {
var _local8 = int(car.oxpos / 8) + 128;
var _local7 = int(car.oypos / 8) + 128;
var _local6 = int(car.xpos / 8) + 128;
var _local5 = int(car.ypos / 8) + 128;
var _local9 = _local8 + ((_local6 - _local8) / 2);
var _local12 = _local7 + ((_local5 - _local7) / 2);
var _local11 = int(_local9);
var _local10 = int(_local12);
var _local4 = _root.mapArray[_local11][_local10];
var _local3 = _root.mapArray[_local6][_local5];
if (_local3 == undefined) {
_local3 = 1;
}
if ((((_local3 == 0) or (_local3 == 4)) or (_local3 == 6)) or (_local3 == 8)) {
car.maxspeed = 2;
car.breaking = 0.5;
car.offroad = 1;
} else {
car.maxspeed = car.topSpeed;
car.offroad = 0;
}
if ((((_local3 == 4) or (_local3 == 5)) or (_local4 == 4)) or (_local4 == 5)) {
if (car.checkPointReached == 0) {
car.checkPointReached = 1;
}
}
if ((((_local3 == 6) or (_local3 == 7)) or (_local4 == 6)) or (_local4 == 7)) {
if (car.checkPointReached == 1) {
car.checkPointReached = 2;
}
}
if ((((_local3 == 8) or (_local3 == 9)) or (_local4 == 8)) or (_local4 == 9)) {
if (car.checkPointReached == 2) {
car.checkPointReached = 0;
car.lapnum++;
}
}
if (levelSelected == 1) {
if (((((-car.xpos) < 856) and ((-car.xpos) > 784)) and ((-car.ypos) < -176)) and ((-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 _local3 = 1;
while (_local3 <= 3) {
var _local2 = objects["ai" + _local3];
if (_local2 != car) {
var _local6 = car.xpos - _local2.xpos;
var _local5 = car.ypos - _local2.ypos;
var _local4 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local8 = Math.atan2(_local5, _local6);
if (_local4 < 30) {
car.angG = ((_local8 * 180) / Math.PI) + 90;
car.adjustG = 0.6;
car.adjustA = 0.05;
}
}
_local3++;
}
if (endRace != 1) {
var _local6 = car.xpos + _xcam;
var _local5 = car.ypos + _zcam;
var _local4 = Math.sqrt((_local6 * _local6) + (_local5 * _local5));
var _local8 = Math.atan2(_local5, _local6);
if (_local4 < 30) {
car.angG = ((_local8 * 180) / Math.PI) + 90;
car.adjustG = 0.6;
car.adjustA = 0.05;
}
if (_local4 < 20) {
var _local7 = 20 / _local4;
_xcam = _xcam + (_local6 * _local7);
_zcam = _zcam + (_local5 * _local7);
car.xpos = car.xpos - ((_local6 * _local7) / 2);
car.ypos = car.ypos - ((_local5 * _local7) / 2);
car.pushed = _local8 * (20 - _local4);
pushed = _local8 * (20 - _local4);
}
}
}
function isCenter(car) {
var _local4 = int(car.xpos / 8) + 128;
var _local3 = int(car.ypos / 8) + 128;
var _local5 = 0;
if (_root.mapArray[_local4][_local3] == 1) {
while (_root.mapArray[int(_local4)][int(_local3)] == 1) {
_local4 = _local4 + Math.cos((car.ang * Math.PI) / 180);
_local3 = _local3 + Math.sin((car.ang * Math.PI) / 180);
_local5++;
}
}
_local4 = int(car.xpos / 8) + 128;
_local3 = int(car.ypos / 8) + 128;
var _local6 = 0;
if (_root.mapArray[_local4][_local3] == 1) {
while (_root.mapArray[int(_local4)][int(_local3)] == 1) {
_local4 = _local4 - Math.cos((car.ang * Math.PI) / 180);
_local3 = _local3 - Math.sin((car.ang * Math.PI) / 180);
_local6++;
}
}
var _local8 = _local6 - _local5;
var _local7 = _local6 / _local5;
if ((_local7 < 0.5) or (_local7 > 2)) {
car.ang = car.ang - _local8;
}
}
cmat = new flash.geom.Matrix();
cbmat = new flash.geom.Matrix();
tWidth = 2;
tyreM = new flash.geom.Matrix();
endRace = 0;
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 _local5 = 0;
while (_local5 < bArray.length) {
var _local10 = 0;
while (_local10 < bArray[_local5][2].length) {
_local13.moveTo(bArray[_local5][0] * 8, bArray[_local5][1] * 8);
var _local8 = int(substring(bArray[_local5][2][_local10], 2, -1)) - 1;
_local13.lineTo(bArray[_local8][0] * 8, bArray[_local8][1] * 8);
var _local9 = bArray[_local5][0];
var _local7 = bArray[_local5][1];
var _local12 = bArray[_local8][0];
var _local11 = bArray[_local8][1];
var _local4 = _local12 - _local9;
var _local3 = _local11 - _local7;
var _local2 = _local9;
var _local1 = _local7;
if (Math.abs(_local4) > Math.abs(_local3)) {
_local7 = _local3 / _local4;
_local9 = 1;
if (_local4 < 0) {
_local7 = _local7 * -1;
_local9 = -1;
}
if (levelSelected != 4) {
if (levelSelected != 5) {
var _local6 = 0;
while (_local6 < Math.abs(_local4)) {
_local2 = _local2 + (_local9 * 3);
_local1 = _local1 + (_local7 * 3);
bushArray[int(_local2)][int(_local1)] = 2 + random(2);
totTreeNum++;
_local6 = _local6 + 3;
}
} else {
var _local6 = 0;
while (_local6 < Math.abs(_local4)) {
_local2 = _local2 + (_local9 * 4);
_local1 = _local1 + (_local7 * 4);
totTreeNum++;
bushArray[(int(_local2) + random(3)) - 1][(int(_local1) + random(3)) - 1] = 1;
_local6 = _local6 + 4;
}
}
}
} else {
_local9 = _local4 / _local3;
_local7 = 1;
if (_local3 < 0) {
_local9 = _local9 * -1;
_local7 = -1;
}
if (levelSelected != 4) {
if (levelSelected != 5) {
var _local6 = 0;
while (_local6 < Math.abs(_local3)) {
_local2 = _local2 + (_local9 * 3);
_local1 = _local1 + (_local7 * 3);
bushArray[int(_local2)][int(_local1)] = 2 + random(2);
totTreeNum++;
_local6 = _local6 + 3;
}
} else {
var _local6 = 0;
while (_local6 < Math.abs(_local3)) {
_local2 = _local2 + (_local9 * 4);
_local1 = _local1 + (_local7 * 4);
bushArray[(int(_local2) + random(3)) - 1][(int(_local1) + random(3)) - 1] = 1;
totTreeNum++;
_local6 = _local6 + 4;
}
}
}
}
_local10++;
}
_local5++;
}
_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 _local11 = 2;
} else {
var _local11 = 0;
}
if (levelSelected == 3) {
var _local11 = 8;
}
if (levelSelected == 5) {
var _local11 = 6;
}
var _local10 = 0;
var _local12 = 0;
while (_local12 == 0) {
if (((getTimer() - st) > 35) and (_local10 > 1)) {
_local12 = 1;
}
_local10++;
py++;
if (py > 359) {
py = 0;
px++;
bushArray.push([]);
if (px > 359) {
temc.removeMovieClip();
temptrack._visible = 1;
if ((levelSelected == 1) or (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 _local8 = false;
var _local7 = 5;
if (levelSelected == 4) {
if (((px % _local7) == 0) and ((py % _local7) == 0)) {
_local8 = true;
}
}
_local7 = 6;
if (levelSelected == 1) {
if (((((((px % _local7) == random(_local7)) and ((py % _local7) == random(_local7))) and (mapArray[px][py] != 1)) and (mapArray[px][py] != 5)) and (mapArray[px][py] != 7)) and (mapArray[px][py] != 9)) {
_local8 = true;
totTreeNum++;
}
}
if (levelSelected == 5) {
if (((((((px % 7) == getrn()) and ((py % 7) == getrn())) and (mapArray[px][py] != 1)) and (mapArray[px][py] != 5)) and (mapArray[px][py] != 7)) and (mapArray[px][py] != 9)) {
if (((((((cm(px + 1, py - 1) and cm(px + 1, py)) and cm(px + 1, py + 1)) and cm(px, py + 1)) and cm(px - 1, py + 1)) and cm(px - 1, py)) and cm(px - 1, py - 1)) and cm(px, py - 1)) {
_local8 = true;
totTreeNum++;
treeCount++;
treeMat = new flash.geom.Matrix();
treeMat.tx = px * 8;
treeMat.ty = py * 8;
groundBmp.draw(tshad, treeMat);
}
}
}
if (_local8 == 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) and (_root.mapArray[px][py][0] != 3)) and (_root.mapArray[px][py] != 4)) and (_root.mapArray[px][py] != 6)) and (_root.mapArray[px][py] != 8)) {
tma.tx = px * -8;
tma.ty = py * -8;
temc.clear();
if (((cm(px - 1, py) or cm(px + 1, py)) or cm(px, py - 1)) or cm(px, py + 1)) {
var _local3 = _root.mapArray[px][py];
if (((_local3 == 4) or (_local3 == 6)) or (_local3 == 8)) {
_local3 = 0;
}
if (((_local3 == 5) or (_local3 == 7)) or (_local3 == 9)) {
_local3 = 1;
}
if (levelSelected != 4) {
temc.beginBitmapFill(this["bmp" + (_local3 + _local11)], 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) or (_local3 == 6)) or (_local3 == 8)) {
_local3 = 0;
}
if (((_local3 == 5) or (_local3 == 7)) or (_local3 == 9)) {
_local3 = 1;
}
if (levelSelected != 4) {
temc.beginBitmapFill(this["bmp" + (_local3 + _local11)], tma, true, true);
} else {
temc.beginFill(255, 70);
temc.filters = [new flash.filters.BlurFilter(8, 8, 1)];
}
var _local6 = 8;
var _local5 = py + 1;
noMoreUntil = 1;
while (!nextPixel(px, _local5)) {
_local5++;
_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);
} else {
alphaBmp.draw(temc, tma);
}
}
}
}
load.text = ("GENERATING TRACK... " + int((100 / (359 - ipx)) * (px - ipx))) + "%";
}
function cm(px, py) {
if (((((_root.mapArray[px][py] == 0) or (_root.mapArray[px][py][0] == 3)) or (_root.mapArray[px][py] == 4)) or (_root.mapArray[px][py] == 6)) or (_root.mapArray[px][py] == 8)) {
if (levelSelected == 4) {
return(false);
}
return(true);
}
return(false);
}
function cm2(px, py) {
if (((((_root.mapArray[px][py] == 0) or (_root.mapArray[px][py][0] == 3)) or (_root.mapArray[px][py] == 4)) or (_root.mapArray[px][py] == 6)) or (_root.mapArray[px][py] == 8)) {
return(true);
}
return(false);
}
function nextPixel(px, py) {
if (((cm2(px - 1, py) or cm2(px + 1, py)) or cm2(px, py - 1)) or cm2(px, py + 1)) {
return(true);
}
return(false);
}
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;
function sortObject(ob) {
ob.headLights._visible = 0;
var _local15;
var _local5;
var _local11 = Math.sin;
var _local13 = Math.cos;
var _local12 = _xcam + ob.xpos;
var _local10 = _zcam + ob.ypos;
var _local7 = ((-_angleY) * Math.PI) / 180;
_local15 = (_local10 * _local11(_local7)) + (_local12 * _local13(_local7));
_local5 = ((_local10 * _local13(_local7)) - (_local12 * _local11(_local7))) + 70;
var _local8 = true;
if (ob.friends) {
if (_local5 < 40) {
ob.allowInvisible = true;
} else {
ob.allowInvisible = false;
}
_local8 = false;
var _local6 = 0;
var _local2 = 0;
while (_local2 < ob.friends.length) {
if (ob.friends[_local2].allowInvisible == true) {
_local6++;
}
_local2++;
}
if (_local6 == ob.friends.length) {
_local8 = true;
}
}
if (((_local5 < 40) and (_local8 == true)) or (_local5 < 0)) {
ob._visible = 0;
} else {
ob._visible = 1;
var _local16 = ((-_local5) * 200) / (50 + (2 * _local5));
ob._xscale = (ob._yscale = (100 + _local16) * 5.5);
ob._y = (ob.trueY = (550 * (_ycam / _local5)) + 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 _local14 = 0;
if (ob.myType == "ripple") {
_local14 = -100;
}
ob._x = (500 * (_local15 / _local5)) + 250;
ob.swapDepths(int((ob._y + _local14) * 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 _local9 = (ob._y - 200) / 8;
if (_local9 < 4) {
_local9 = 4;
}
var _local4 = (ob.ang + _angleY) - ((250 - ob._x) / _local9);
_local4 = _local4 + 720;
_local4 = _local4 % 360;
var _local3 = 360 - int(_local4);
while (_local3 > 360) {
_local3 = _local3 - 360;
}
while (_local3 < 1) {
_local3 = _local3 + 360;
}
if (ob.glow) {
ob.glow._x = 35 * Math.sin((_local4 * Math.PI) / 180);
ob.bit._xscale = 100 * Math.sin((_local4 * Math.PI) / 180);
ob.glow.swapDepths((int(35 * Math.cos((_local4 * Math.PI) / 180)) * 3) + 2);
ob.bit.swapDepths((int(25 * Math.cos((_local4 * Math.PI) / 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(_local3);
ob.shad.r._rotation = 90 + _local3;
ob.car.gotoAndStop(_local3);
}
}
}
function sortspeedo() {
if (speed > 0) {
speedo.hand._rotation = -120 + (speed * 15);
} else {
speedo.hand._rotation = -120;
}
}
function headlights(ob) {
if (levelSelected == 3) {
var _local2 = ((-ob._currentframe) * Math.PI) / 180;
var _local5 = Math.sin(_local2 - 0.4) * 300;
var _local3 = Math.cos(_local2 - 0.4) * 60;
var _local4 = Math.sin(_local2 + 0.4) * 300;
var _local9 = Math.cos(_local2 + 0.4) * 60;
ob.headlights.clear();
ob.headlights.beginFill(16777205, 50);
ob.headlights.lineTo(_local5, _local3);
ob.headlights.lineTo(_local4, _local9);
ob.headlights.endFill();
ob.headlights.moveTo(0, 0);
ob.headlights.beginFill(16777205, 100);
ob.headlights.lineTo(_local5 * 0.7, _local3 * 0.9);
ob.headlights.lineTo(_local4 * 0.7, _local9 * 0.9);
ob.headlights.endFill();
} else {
var _local2 = ((-ob._currentframe) * Math.PI) / 180;
var _local5 = Math.sin(_local2 - 0.4) * 100;
var _local3 = Math.cos(_local2 - 0.4) * 20;
var _local4 = Math.sin(_local2 + 0.4) * 100;
var _local9 = Math.cos(_local2 + 0.4) * 20;
var _local10 = Math.sin(_local2 + 2.74) * 100;
var _local7 = Math.cos(_local2 + 2.74) * 20;
var _local8 = Math.sin(_local2 + 3.54) * 100;
var _local6 = Math.cos(_local2 + 3.54) * 20;
ob.shadow.clear();
ob.shadow.beginFill(0, 40);
ob.shadow.moveTo(_local5, _local3);
ob.shadow.lineTo(_local4, _local9);
ob.shadow.lineTo(_local10, _local7);
ob.shadow.lineTo(_local8, _local6);
ob.shadow.endFill();
}
}
function checkLoaded() {
load.text = ("LOADING, PLEASE WAIT... " + Math.round((100 / (loadedK[levelSelected - 1] - alreadyLoaded)) * (getBytesLoaded() - alreadyLoaded))) + "%";
ifFrameLoaded (15 + (20 * levelSelected)) {
gotoAndStop("select" + levelSelected);
}
}
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 _local3 = _local2 % 60;
var _local5 = int(_local2 / 60);
return((((sortZero(_local5) + ":") + sortZero(_local3)) + ":") + 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 26
pea.onRelease = function () {
getURL ("http://www.percypea.co.uk/?link=3drally", "_blank");
};
Frame 27
prevFrame();
Frame 30
cArray = [[34.9, 255.65], [35.7, 266.4], [37.05, 276.85], [37.85, 286], [41.35, 295.95], [45.4, 302.4], [52.65, 307.75], [63.9, 309.9], [76.8, 309.9], [87.8, 309.9], [99.9, 310.45], [109.3, 312.3], [121.65, 314.45], [130.5, 318.2], [140.25, 318.5], [149.6, 316.8], [162.1, 315.4], [171.45, 314.55], [180.2, 312], [187.6, 307.75], [193.25, 303.75], [197.8, 296.4], [198.65, 285.9], [197.8, 276.3], [195.5, 268.65], [188.45, 259.85], [183.35, 252.75], [177.4, 248.2], [168.3, 242.25], [160.1, 239.45], [147.65, 238.6], [137.7, 238.85], [126.4, 236.9], [118.15, 229.5], [113.35, 221.3], [110.25, 209.4], [111.65, 197.5], [113.05, 186.75], [117.9, 177.95], [124.7, 169.15], [134.05, 163.8], [146.5, 161.5], [159.8, 160.65], [172, 158.95], [182.75, 164.35], [188.45, 170.85], [195.5, 178.8], [200.05, 187.85], [204.3, 200.35], [204.9, 215.35], [204.9, 227.25], [204.9, 239.45], [208.3, 253.9], [209.4, 265.8], [213.65, 278.25], [217.9, 288.2], [223, 296.1], [231.5, 302.65], [241, 307], [254, 307], [263, 307], [274, 306], [282.25, 305.75], [293.55, 302.65], [302.05, 298.95], [309.45, 292.7], [317.1, 283.35], [319, 268], [322.45, 254.75], [325, 243.7], [326.45, 231.2], [323.6, 219.3], [317.95, 208.85], [312.25, 201.45], [304.9, 194.95], [298.1, 187.85], [294, 179], [293, 166], [302.05, 157.55], [315.4, 152.75], [324.75, 145.95], [328.4, 130.05], [329.85, 108.8], [328.7, 94.9], [328.15, 74.5], [328, 61], [329.85, 48.15], [327.85, 36], [316.5, 26.65], [305.2, 25.2], [293.55, 25.8], [282.25, 28.35], [277.7, 33.7], [270, 44], [267, 56], [268.05, 72.55], [272, 82], [274, 92], [275, 103], [277.2, 112.35], [277, 123], [271.2, 127.7], [264.7, 132.2], [254, 136.2], [239.95, 139.9], [225.9, 139.55], [214.2, 138.55], [205, 131], [196.1, 124.8], [191.1, 113.8], [187.1, 101.05], [187, 89], [187, 81], [189, 70], [194, 56], [191.1, 45.85], [184, 35], [172, 27], [162, 24], [147, 21], [135, 20], [122, 20], [111, 21], [96, 22], [84, 23], [75, 25], [65, 31], [57, 39], [51, 55], [45, 62], [37, 73], [34, 86], [32, 101], [29, 110], [28, 121], [26, 133], [25, 143], [24, 154], [23, 168], [23, 183], [25, 194], [26, 204], [31, 215], [32, 226], [33, 236], [34, 243]];
tArray = [[167, 148], [189, 154], [206, 173], [176, 110], [187, 134], [206, 147], [227, 149], [290, 121], [268, 152], [285, 151], [309, 131], [188, 243], [196, 227], [215, 303], [204, 313], [189, 322], [231, 315], [303, 312], [321, 305], [331, 290], [21, 288], [28, 302], [39, 315], [9, 161], [9, 180], [37, 164], [34, 180], [63, 11], [49, 23], [196, 13], [180, 42], [180, 55], [270, 12], [251, 32], [322, 9], [335, 23], [108, 162], [101, 189], [123, 214], [135, 225]];
bArray = [[107, 102, ["b2"]], [252, 178, ["b3"]], [311, 115, ["b4"]], [297, 42, []], [185, 219, ["b6", "b7"]], [224, 331, []], [135, 186, []]];
!!!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
initCars();
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = 200;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
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();
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 * Math.PI) / 180);
rayZ = Math.cos((_angleY * Math.PI) / 180);
_xcam = _xcam - ((rayX * speed) + (rayZ * pushed));
_zcam = _zcam - ((rayZ * speed) + (rayX * pushed));
if ((((_xcam < 856) and (_xcam > 784)) and (_zcam < -176)) and (_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 _local21 = oy - _zcam;
var _local11 = -int(_xcam / 8);
var _local10 = -int(_zcam / 8);
_local11 = _local11 + 128;
_local10 = _local10 + 128;
var _local9 = speed / 15;
var _local23 = (speed / 2) + 3;
var _local13 = 0;
if (speed > 0) {
_local13 = 1;
}
var _local14 = ox + ((_xcam - ox) / 2);
var _local19 = oy + ((_zcam - oy) / 2);
var _local17 = (-int(_local14 / 8)) + 128;
var _local16 = (-int(_local19 / 8)) + 128;
var _local3 = _root.mapArray[_local11][_local10];
var _local8 = _root.mapArray[_local17][_local16];
breaking = 0;
if (_local3 == undefined) {
_local3 = 1;
}
if (((_local3 != 6) and (_local3 != 7)) and (_local3 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local3 == 4) or (_local3 == 5)) or (_local8 == 4)) or (_local8 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
}
}
if ((((_local3 == 6) or (_local3 == 7)) or (_local8 == 6)) or (_local8 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
}
}
if ((((_local3 == 8) or (_local3 == 9)) or (_local8 == 8)) or (_local8 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) or (bestTime == 0)) {
bestTime = lapTime;
var _local18 = lapTime % 100;
var _local12 = int(lapTime / 100);
var _local15 = _local12 % 60;
var _local20 = int(_local12 / 60);
speedo.best.text = (((("BEST LAP: " + sortZero(_local20)) + ":") + sortZero(_local15)) + ":") + 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 * Math.PI) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * Math.PI) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local4 = objects.ai4;
objects.ai4.pos++;
_local4.dx = _local4.xpos - ((cArray[_local4.pos][0] * 8) - 1024);
_local4.dy = _local4.ypos - ((cArray[_local4.pos][1] * 8) - 1024);
_local4.dz = Math.sqrt((_local4.dx * _local4.dx) + (_local4.dy * _local4.dy));
_local4.ra = 0;
_local4.posCount = 0;
_local4.maxspeed = _local4.topSpeed;
_local4.pushed = 0;
trackCar = 1;
ahead = 0;
var _local2 = 1;
while (_local2 <= 3) {
if (objects["ai" + _local2].lapnum >= 4) {
ahead++;
}
_local2++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
resultPanel.congrats.gotoAndStop(3);
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain._visible = 1;
resultPanel.tryagain.gotoAndStop(2);
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local3 == 0) or (_local3 == 4)) or (_local3 == 6)) or (_local3 == 8)) {
objects.player._y = kh1 + (random(3) * _local9);
objects.player._rotation = ((random(7) - 3) * _local9) + ((random(5) - 2) * _local13);
maxspeed = 2;
breaking = 0.25;
offroad = 1;
} else {
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local3[0] == 3) or (_local8[0] == 3)) {
var _local6 = (-int(ox / 8)) + 128;
var _local5 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local6][_local5][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
oy = oy + Math.cos((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
_local6 = (-int(ox / 8)) + 128;
_local5 = (-int(oy / 8)) + 128;
}
speed = (-speed) * 0.6;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local3 == 1) {
objects.player._y = kh1 + (random(2) * _local9);
}
}
return(speed);
}
flyamount = 0;
pushed = 0;
trackFriction = 0.5;
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 _local2 = _local1 % 60;
var _local4 = int(_local1 / 60);
speedo.timec.text = (((("LAP TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local2 = _local1 % 60;
_local4 = int(_local1 / 60);
speedo.ttime.text = (((("TOT. TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + sortZero(_local3);
}
function drawRoad() {
synchro();
manageKeys();
manageMode7();
}
function synchro() {
_nbMs = 1;
}
function manageKeys() {
_ycam = 20;
var _local8;
var _local7;
var _local10;
var _local9;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) and (flying == false)) {
if (((rotchange > -5) and (rotchange < 5)) and (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) and (flying == false)) {
if (((rotchange < 5) and (rotchange > -5)) and (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + turningCircle;
} else {
rotchange = rotchange - turningCircle;
}
}
}
}
if ((rotchange != 0) and (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) and (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) and (flying == false)) and (endRace != 1)) {
speed = speed + playersAccel;
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) and (speed > -1)) and (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) and (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) and (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) and (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local4 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local4;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local3 = (-_xcam) - _root.objects.ai4.xpos;
var _local2 = (-_zcam) - _root.objects.ai4.ypos;
var _local6 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
theeRot = (Math.atan2(_local2, _local3) * 180) / Math.PI;
ratio = 400 / _local6;
if (ratio < 1) {
_local3 = _local3 * ratio;
_local2 = _local2 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local3;
_zcam = (-_root.objects.ai4.ypos) - _local2;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local4;
var _local1;
_local4 = ((20 / _nbScans) * Math.PI) / 180;
_local1 = 0;
var _local2 = Math.sin;
var _local3 = Math.cos;
i = 0;
while (i < _nbScans) {
ground.createEmptyMovieClip(i, 100 + i);
ground[i]._x = (-ground._x) + (_resoDx * 0.5);
ground[i]._y = (-ground._y) + (i + 200);
_local1 = _local1 + _local4;
rayY = _local2(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local10;
var _local4;
var _local12;
var _local14;
var _local11;
var _local17;
var _local18;
var _local15;
var _local16;
var _local2;
var _local13;
_local15 = Math.sin;
_local16 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * Math.PI) / 180);
_local10 = (_resoDx * 0.5) / 500;
_local17 = 0;
_local12 = _local15((_angleY * Math.PI) / 180);
_local11 = _local16((_angleY * Math.PI) / 180);
var _local3 = 0;
while (_local3 < tArray.length) {
sortObject(objects["tree" + _local3]);
_local3++;
}
prepBushes();
sortBushes(boundaryDistance, 1, 5);
sortBushes(grassDistance, 0, 1);
sortAllBushes();
sortRamp();
_local13 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local14 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local8 = leCoses[_local1];
var _local7 = (_xcam - (_local12 * _local8)) - 1024;
var _local6 = (_zcam - (_local11 * _local8)) - 1024;
_local2.tx = (_local7 * _local2.a) + (_local6 * _local2.c);
_local2.ty = ((_local7 * _local2.b) + (_local6 * _local2.d)) + 70;
_local4 = _local10 * _local9;
var _local5 = _local4;
ground[_local1].beginBitmapFill(_local13, _local2, true, false);
ground[_local1].moveTo(-_local4, 0);
ground[_local1].lineTo(_local5, 0);
ground[_local1].lineTo(_local5, _scanSteps);
ground[_local1].lineTo(-_local4, _scanSteps);
ground[_local1].endFill();
}
}
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) and (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 810 MovieClip "speedo" in Frame 35
onClipEvent (load) {
this.swapDepths(4);
}
Frame 37
prevFrame();
Frame 50
cArray = [[35, 270], [43.85, 287.7], [56.5, 304.05], [79.55, 310], [105.55, 308.5], [134.55, 307.75], [163.55, 304.05], [182.9, 291.4], [197.75, 271.35], [208, 259], [226, 255], [234.9, 260.95], [244.6, 281], [264, 297], [294, 296], [318.2, 278.75], [318.95, 239.35], [316.7, 202.2], [308.5, 185.85], [287.7, 175.45], [267.65, 170.25], [231.95, 162.05], [199.25, 161.3], [174.7, 158.35], [157.6, 150.9], [140.5, 137.5], [129.35, 118.2], [133.05, 102.6], [147.95, 95.15], [166.5, 92.15], [190.3, 91.45], [213.35, 98.85], [228.25, 113.75], [249.05, 129.35], [277.3, 124.9], [298.85, 113], [307.75, 86.95], [311.5, 63.9], [303, 35], [287.7, 23.75], [257.95, 14.1], [226.75, 14.1], [205.2, 15.6], [176.95, 17.85], [154.65, 19.3], [136.8, 17.1], [106.3, 17.85], [82.5, 17.1], [56.5, 14.85], [35.7, 20.8], [20.8, 36.4], [17.85, 60.95], [17.1, 83.25], [20.05, 104.8], [23.05, 120.4], [31.2, 135.3], [46, 152], [78, 166], [104.8, 173.2], [121.9, 198.5], [124.15, 226.75], [117.45, 243.85], [101.85, 252.75], [81.05, 246.05], [78, 222], [82, 197], [60.95, 187.35], [39.4, 197.75], [34.95, 212.6], [34.2, 232.7]];
tArray = [[49, 99], [74, 129], [206, 173], [176, 110], [55, 66], [98, 76], [107, 89], [290, 88], [191, 147], [281, 155], [309, 131], [188, 243], [196, 227], [285, 230], [274, 249], [189, 322], [232, 288], [300, 311], [319, 299], [332, 270], [21, 288], [23, 311], [39, 315], [16, 194], [107, 329], [37, 164], [61, 264], [41, 3], [44, 37], [194, 5], [135, 43], [4, 31], [288, 7], [249, 32], [328, 50], [335, 23], [108, 162], [107, 198], [95, 221], [101, 271]];
bArray = [[20, 208, ["b2"]], [28, 187, ["b3"]], [47, 178, ["b4"]], [72, 177, ["b5", "b8"]], [98, 189, ["b6"]], [108, 210, ["b7"]], [105, 235, []], [44, 165, []], [47, 218, ["b10"]], [58, 211, ["b11"]], [66, 216, ["b12"]], [59, 244, ["b13"]], [50, 265, ["b14"]], [60, 285, ["b15"]], [94, 290, ["b16"]], [134, 283, ["b17"]], [190, 212, ["b18", "b19"]], [292, 242, []], [113, 140, ["b20"]], [109, 105, ["b21"]], [126, 82, ["b22"]], [161, 52, ["b23"]], [215, 35, ["b24"]], [273, 41, ["b25"]], [296, 64, ["b26"]], [298, 82, []], [223, 143, ["b28", "b35"]], [197, 109, ["b29"]], [175, 104, ["b30", "b31"]], [193, 108, []], [148, 109, ["b32"]], [143, 114, ["b33"]], [141, 121, ["b34"]], [145, 126, []], [253, 150, ["b36"]], [279, 150, ["b37"]], [299, 150, ["b38", "b39"]], [306, 137, []], [334, 181, []]];
!!!ERROR
Frame 51
prevFrame();
Frame 52
ipx = px;
onEnterFrame = function () {
st = getTimer();
if (trackNeedsDrawing == true) {
drawTrack();
} else {
gotoAndStop("level" + levelSelected);
}
};
Frame 53
prevFrame();
Frame 55
initCars();
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = 200;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
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();
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 * Math.PI) / 180);
rayZ = Math.cos((_angleY * Math.PI) / 180);
_xcam = _xcam - (rayX * speed);
_zcam = _zcam - (rayZ * speed);
if (objects.player.fly <= 0) {
flying = false;
var _local24 = ox - _xcam;
var _local23 = oy - _zcam;
var _local12 = -int(_xcam / 8);
var _local11 = -int(_zcam / 8);
_local12 = _local12 + 128;
_local11 = _local11 + 128;
var _local9 = speed / 15;
var _local25 = (speed / 2) + 3;
var _local14 = 0;
if (speed > 0) {
_local14 = 1;
}
var _local15 = ox + ((_xcam - ox) / 2);
var _local21 = oy + ((_zcam - oy) / 2);
var _local19 = (-int(_local15 / 8)) + 128;
var _local18 = (-int(_local21 / 8)) + 128;
var _local3 = _root.mapArray[_local12][_local11];
var _local7 = _root.mapArray[_local19][_local18];
breaking = 0;
if (_local3 == undefined) {
_local3 = 1;
}
if (((_local3 != 6) and (_local3 != 7)) and (_local3 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local3 == 4) or (_local3 == 5)) or (_local7 == 4)) or (_local7 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
heavyness++;
}
}
if ((((_local3 == 6) or (_local3 == 7)) or (_local7 == 6)) or (_local7 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
heavyness++;
}
}
if ((((_local3 == 8) or (_local3 == 9)) or (_local7 == 8)) or (_local7 == 9)) {
if (checkPointReached == 2) {
heavyness++;
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) or (bestTime == 0)) {
bestTime = lapTime;
var _local20 = lapTime % 100;
var _local13 = int(lapTime / 100);
var _local16 = _local13 % 60;
var _local22 = int(_local13 / 60);
speedo.best.text = (((("BEST LAP: " + sortZero(_local22)) + ":") + sortZero(_local16)) + ":") + sortZero(_local20);
}
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 * Math.PI) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * Math.PI) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local4 = objects.ai4;
objects.ai4.pos++;
_local4.dx = _local4.xpos - ((cArray[_local4.pos][0] * 8) - 1024);
_local4.dy = _local4.ypos - ((cArray[_local4.pos][1] * 8) - 1024);
_local4.dz = Math.sqrt((_local4.dx * _local4.dx) + (_local4.dy * _local4.dy));
_local4.ra = 0;
_local4.posCount = 0;
_local4.pushed = 0;
_local4.maxspeed = _local4.topSpeed;
trackCar = 1;
ahead = 0;
var _local2 = 1;
while (_local2 <= 3) {
if (objects["ai" + _local2].lapnum >= 4) {
ahead++;
}
_local2++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain._visible = 1;
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local3 == 0) or (_local3 == 4)) or (_local3 == 6)) or (_local3 == 8)) {
objects.player._y = kh1 + (random(3) * _local9);
objects.player._rotation = ((random(7) - 3) * _local9) + ((random(5) - 2) * _local14);
maxspeed = 2;
breaking = 0.2;
offroad = 1;
iceFriction = 0.2;
} else {
iceFriction = 1;
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local3[0] == 3) or (_local7[0] == 3)) {
var _local6 = (-int(ox / 8)) + 128;
var _local5 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local6][_local5][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
oy = oy + Math.cos((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
_local6 = (-int(ox / 8)) + 128;
_local5 = (-int(oy / 8)) + 128;
}
if (_local3[1]) {
var _local17 = _angleY - _local3[1];
tempDiff = _local3[1];
} else {
tempDiff = _local7[1];
var _local17 = _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 _local17 = tempAngle - tempDiff;
speed = (-speed) * 0.8;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local3 == 1) {
objects.player._y = kh1 + (random(2) * _local9);
}
}
return(speed);
}
flyamount = 0;
puashed = 0;
iceFriction = 1;
trackFriction = 0.8;
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 _local2 = _local1 % 60;
var _local4 = int(_local1 / 60);
speedo.timec.text = (((("LAP TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local2 = _local1 % 60;
_local4 = int(_local1 / 60);
speedo.ttime.text = (((("TOT. TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + 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 _local8;
var _local7;
var _local10;
var _local9;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) and (flying == false)) {
if (((rotchange > -5) and (rotchange < 5)) and (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) and (flying == false)) {
if (((rotchange < 5) and (rotchange > -5)) and (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + (turningCircle * iceFriction);
} else {
rotchange = rotchange - (turningCircle * iceFriction);
}
}
}
}
if ((rotchange != 0) and (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) and (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) and (flying == false)) and (endRace != 1)) {
speed = speed + (playersAccel * iceFriction);
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) and (speed > -1)) and (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)) and (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) and (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) and (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local4 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local4;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local3 = (-_xcam) - _root.objects.ai4.xpos;
var _local2 = (-_zcam) - _root.objects.ai4.ypos;
var _local6 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
theeRot = (Math.atan2(_local2, _local3) * 180) / Math.PI;
ratio = 400 / _local6;
if (ratio < 1) {
_local3 = _local3 * ratio;
_local2 = _local2 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local3;
_zcam = (-_root.objects.ai4.ypos) - _local2;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local4;
var _local1;
_local4 = ((20 / _nbScans) * Math.PI) / 180;
_local1 = 0;
var _local2 = Math.sin;
var _local3 = Math.cos;
i = 0;
while (i < _nbScans) {
ground.createEmptyMovieClip(i, 100 + i);
ground[i]._x = (-ground._x) + (_resoDx * 0.5);
ground[i]._y = (-ground._y) + (i + 200);
_local1 = _local1 + _local4;
rayY = _local2(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local10;
var _local4;
var _local12;
var _local14;
var _local11;
var _local17;
var _local18;
var _local15;
var _local16;
var _local2;
var _local13;
_local15 = Math.sin;
_local16 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * Math.PI) / 180);
_local10 = (_resoDx * 0.5) / 500;
_local17 = 0;
_local12 = _local15((_angleY * Math.PI) / 180);
_local11 = _local16((_angleY * Math.PI) / 180);
var _local3 = 0;
while (_local3 < tArray.length) {
sortObject(objects["tree" + _local3]);
_local3++;
}
prepBushes();
sortBushes(boundaryDistance, 1, 5);
sortAllBushes();
sortRamp();
_local13 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local14 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local8 = leCoses[_local1];
var _local7 = (_xcam - (_local12 * _local8)) - 1024;
var _local6 = (_zcam - (_local11 * _local8)) - 1024;
_local2.tx = (_local7 * _local2.a) + (_local6 * _local2.c);
_local2.ty = ((_local7 * _local2.b) + (_local6 * _local2.d)) + 70;
_local4 = _local10 * _local9;
var _local5 = _local4;
ground[_local1].beginBitmapFill(_local13, _local2, true, false);
ground[_local1].moveTo(-_local4, 0);
ground[_local1].lineTo(_local5, 0);
ground[_local1].lineTo(_local5, _scanSteps);
ground[_local1].lineTo(-_local4, _scanSteps);
ground[_local1].endFill();
}
}
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) and (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 810 MovieClip "speedo" in Frame 55
onClipEvent (load) {
this.swapDepths(2005);
}
Frame 57
prevFrame();
Frame 70
cArray = [[29.2, 267.45], [30.3, 283.9], [41.45, 300.95], [55.25, 310.5], [77, 315], [99.4, 306.8], [126, 302.55], [147.25, 302.55], [167.45, 307.3], [187.65, 315.8], [226.45, 317.4], [255.15, 317.95], [276.95, 314.75], [298, 292], [309.4, 267.95], [309, 243], [300.9, 218.55], [283.35, 202.6], [264.75, 198.3], [240.8, 198.85], [218.5, 214.25], [207.3, 227.55], [187.65, 241.4], [168.5, 247.75], [147.8, 248.3], [134.5, 245.1], [116.4, 233.95], [104.2, 221.2], [86.1, 208.95], [81.3, 182.9], [82.9, 159], [97.25, 144.1], [115.9, 141.45], [133.95, 139.85], [164.8, 144.65], [201.45, 157.4], [245, 156], [268.45, 151.55], [294, 142], [306, 130], [316.85, 100.5], [313.35, 83.9], [301.7, 71.65], [286.05, 71.5], [268.35, 63.45], [253.8, 44.3], [237.95, 26.45], [214.8, 22.5], [194.95, 24.5], [177.15, 34.4], [160.6, 52.25], [152, 64.8], [138.8, 83.95], [128.2, 99.8], [111.05, 107.1], [93.2, 109.75], [66, 103], [56, 85], [58.8, 70.75], [75.35, 59.5], [88.55, 56.85], [94.5, 44.95], [93.6, 31.95], [79.9, 18.25], [62.2, 13.7], [46.8, 16.55], [35, 26], [32, 42], [31.95, 73.65], [34.25, 114.75], [35.4, 151.85], [32.55, 189.55], [33.65, 237.5]];
tArray = [[25, 294, -23], [70, 306, 99], [111, 312, -102], [154, 292, 97], [196, 325, -80], [243, 308, 87], [297, 304, -130], [305, 255, 0], [302, 205, 153], [257, 210, -83], [221, 199, 56], [205, 240, -123], [160, 241, 94], [122, 250, -53], [105, 206, 123], [74, 172, 0], [109, 130, 92], [150, 153, -62], [194, 145, 106], [234, 164, -92], [276, 140, 57], [320, 122, -153], [299, 88, -42], [279, 62, 137], [241, 45, -32], [204, 15, 89], [172, 54, -141], [132, 73, 27], [105, 116, -88], [70, 90, 137], [62, 55, 46], [94, 13, 132], [48, 27, -134], [24, 53, 0], [42, 93, 177], [25, 132, 0], [41, 166, -178], [25, 204, 0], [42, 251, 179], [466, -88, 0]];
bArray = [[83, 37, ["b2"]], [73, 29, ["b3"]], [57, 26, ["b4"]], [44, 36, ["b5"]], [43, 280, ["b6"]], [54, 294, ["b7"]], [70, 301, ["b8"]], [89, 301, ["b9"]], [114, 291, ["b10"]], [153, 286, ["b11"]], [181, 266, ["b12"]], [230, 223, []], [321, 240, ["b14"]], [312, 209, ["b15"]], [292, 190, ["b16"]], [251, 186, ["b17"]], [216, 194, ["b18"]], [184, 229, ["b19"]], [155, 239, []], [79, 145, ["b21", "b23"]], [72, 165, ["b22"]], [73, 201, []], [98, 130, ["b24"]], [148, 129, ["b25"]], [193, 143, ["b26"]], [256, 144, ["b27"]], [292, 124, []], [137, 63, ["b29", "b33"]], [119, 95, ["b30"]], [96, 99, ["b31"]], [80, 94, ["b32"]], [76, 75, []], [162, 31, ["b34"]], [193, 14, []]];
!!!ERROR
Frame 71
prevFrame();
Frame 72
ipx = px;
onEnterFrame = function () {
st = getTimer();
if (trackNeedsDrawing == true) {
drawTrack();
} else {
gotoAndStop("level" + levelSelected);
}
};
Frame 73
prevFrame();
Frame 75
initCars();
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = 200;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
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();
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 * Math.PI) / 180);
rayZ = Math.cos((_angleY * Math.PI) / 180);
_xcam = _xcam - (rayX * speed);
_zcam = _zcam - (rayZ * speed);
if (objects.player.fly <= 0) {
flying = false;
var _local24 = ox - _xcam;
var _local23 = oy - _zcam;
var _local12 = -int(_xcam / 8);
var _local11 = -int(_zcam / 8);
_local12 = _local12 + 128;
_local11 = _local11 + 128;
var _local9 = speed / 15;
var _local25 = (speed / 2) + 3;
var _local14 = 0;
if (speed > 0) {
_local14 = 1;
}
var _local15 = ox + ((_xcam - ox) / 2);
var _local21 = oy + ((_zcam - oy) / 2);
var _local19 = (-int(_local15 / 8)) + 128;
var _local18 = (-int(_local21 / 8)) + 128;
var _local3 = _root.mapArray[_local12][_local11];
var _local7 = _root.mapArray[_local19][_local18];
breaking = 0;
if (_local3 == undefined) {
_local3 = 1;
}
if (((_local3 != 6) and (_local3 != 7)) and (_local3 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local3 == 4) or (_local3 == 5)) or (_local7 == 4)) or (_local7 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
}
}
if ((((_local3 == 6) or (_local3 == 7)) or (_local7 == 6)) or (_local7 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
}
}
if ((((_local3 == 8) or (_local3 == 9)) or (_local7 == 8)) or (_local7 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) or (bestTime == 0)) {
bestTime = lapTime;
var _local20 = lapTime % 100;
var _local13 = int(lapTime / 100);
var _local16 = _local13 % 60;
var _local22 = int(_local13 / 60);
speedo.best.text = (((("BEST LAP: " + sortZero(_local22)) + ":") + sortZero(_local16)) + ":") + sortZero(_local20);
}
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 * Math.PI) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * Math.PI) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local4 = objects.ai4;
objects.ai4.pos++;
_local4.pushed = 0;
_local4.dx = _local4.xpos - ((cArray[_local4.pos][0] * 8) - 1024);
_local4.dy = _local4.ypos - ((cArray[_local4.pos][1] * 8) - 1024);
_local4.dz = Math.sqrt((_local4.dx * _local4.dx) + (_local4.dy * _local4.dy));
_local4.ra = 0;
_local4.posCount = 0;
_local4.maxspeed = _local4.topSpeed;
trackCar = 1;
ahead = 0;
var _local2 = 1;
while (_local2 <= 3) {
if (objects["ai" + _local2].lapnum >= 4) {
ahead++;
}
_local2++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain._visible = 1;
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local3 == 0) or (_local3 == 4)) or (_local3 == 6)) or (_local3 == 8)) {
objects.player._y = kh1 + (random(3) * _local9);
objects.player._rotation = ((random(7) - 3) * _local9) + ((random(5) - 2) * _local14);
maxspeed = 2;
breaking = 0.25;
offroad = 1;
} else {
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local3[0] == 3) or (_local7[0] == 3)) {
var _local6 = (-int(ox / 8)) + 128;
var _local5 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local6][_local5][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
oy = oy + Math.cos((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
_local6 = (-int(ox / 8)) + 128;
_local5 = (-int(oy / 8)) + 128;
}
if (_local3[1]) {
var _local17 = _angleY - _local3[1];
tempDiff = _local3[1];
} else {
tempDiff = _local7[1];
var _local17 = _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 _local17 = tempAngle - tempDiff;
speed = (-speed) * 0.8;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local3 == 1) {
objects.player._y = kh1 + (random(2) * _local9);
}
}
return(speed);
}
flyamount = 0;
pushed = 0;
trackFriction = 0.5;
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 _local2 = _local1 % 60;
var _local4 = int(_local1 / 60);
speedo.timec.text = (((("LAP TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local2 = _local1 % 60;
_local4 = int(_local1 / 60);
speedo.ttime.text = (((("TOT: TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + 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 _local8;
var _local7;
var _local10;
var _local9;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) and (flying == false)) {
if (((rotchange > -5) and (rotchange < 5)) and (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) and (flying == false)) {
if (((rotchange < 5) and (rotchange > -5)) and (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + turningCircle;
} else {
rotchange = rotchange - turningCircle;
}
}
}
}
if ((rotchange != 0) and (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) and (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) and (flying == false)) and (endRace != 1)) {
speed = speed + playersAccel;
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) and (speed > -1)) and (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) and (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) and (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) and (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local4 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local4;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local3 = (-_xcam) - _root.objects.ai4.xpos;
var _local2 = (-_zcam) - _root.objects.ai4.ypos;
var _local6 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
theeRot = (Math.atan2(_local2, _local3) * 180) / Math.PI;
ratio = 400 / _local6;
if (ratio < 1) {
_local3 = _local3 * ratio;
_local2 = _local2 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local3;
_zcam = (-_root.objects.ai4.ypos) - _local2;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local4;
var _local1;
_local4 = ((20 / _nbScans) * Math.PI) / 180;
_local1 = 0;
var _local2 = Math.sin;
var _local3 = Math.cos;
i = 0;
while (i < _nbScans) {
ground.createEmptyMovieClip(i, 100 + i);
ground[i]._x = (-ground._x) + (_resoDx * 0.5);
ground[i]._y = (-ground._y) + (i + 200);
_local1 = _local1 + _local4;
rayY = _local2(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local10;
var _local4;
var _local12;
var _local14;
var _local11;
var _local17;
var _local18;
var _local15;
var _local16;
var _local2;
var _local13;
_local15 = Math.sin;
_local16 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * Math.PI) / 180);
_local10 = (_resoDx * 0.5) / 500;
_local17 = 0;
_local12 = _local15((_angleY * Math.PI) / 180);
_local11 = _local16((_angleY * Math.PI) / 180);
var _local3 = 0;
while (_local3 < tArray.length) {
sortObject(objects["tree" + _local3]);
_local3++;
}
prepBushes();
sortBushes(boundaryDistance, 1, 5);
sortAllBushes();
_local13 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local14 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local8 = leCoses[_local1];
var _local7 = (_xcam - (_local12 * _local8)) - 1024;
var _local6 = (_zcam - (_local11 * _local8)) - 1024;
_local2.tx = (_local7 * _local2.a) + (_local6 * _local2.c);
_local2.ty = ((_local7 * _local2.b) + (_local6 * _local2.d)) + 70;
_local4 = _local10 * _local9;
var _local5 = _local4;
ground[_local1].beginBitmapFill(_local13, _local2, true, false);
ground[_local1].moveTo(-_local4, 0);
ground[_local1].lineTo(_local5, 0);
ground[_local1].lineTo(_local5, _scanSteps);
ground[_local1].lineTo(-_local4, _scanSteps);
ground[_local1].endFill();
}
}
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) and (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 810 MovieClip "speedo" in Frame 75
onClipEvent (load) {
this.swapDepths(4);
}
Frame 77
prevFrame();
Frame 90
cArray = [[34.45, 263.55], [36.3, 280.6], [42, 293], [49.65, 303.25], [62.95, 315.35], [81.25, 320], [109.8, 319.4], [128.7, 312.25], [139.55, 297.35], [141.7, 279.4], [142.35, 256.45], [136.75, 235.95], [121.85, 212.7], [109.8, 197.5], [104, 177], [104.5, 159.7], [116.6, 142], [144.2, 129.3], [166.5, 126.5], [187, 128.05], [202, 135], [217.35, 144.2], [234.1, 161.25], [240, 173.65], [239.1, 201.25], [236.3, 223.25], [220.8, 240], [210.25, 250.25], [204.95, 266.35], [205.9, 286.2], [215.8, 304.8], [229.15, 313.8], [247.15, 319.4], [272, 320], [290.25, 313.2], [309.15, 298.6], [316, 279.7], [317.85, 257.7], [317.55, 235.65], [318.45, 217.35], [321.55, 193.2], [325.6, 173.05], [323.1, 146.65], [320.95, 128.05], [315.05, 106.05], [312.25, 86.5], [311.35, 59.55], [305.45, 39.1], [296.45, 29.45], [277.85, 22.65], [261.1, 23.9], [242.8, 27.3], [227.6, 32.55], [207.15, 36.6], [186.35, 37.2], [169, 34.1], [151, 30], [129, 25], [109, 23], [86, 22], [67, 24], [50, 29], [35, 40], [23, 54], [17, 70], [13, 84], [13, 98], [13, 116], [18, 133], [23, 146], [29, 160], [36, 176], [37, 195], [35, 211], [34, 231], [34, 243]];
tArray = [[125, 149, 0], [106, 133, 0], [166, 137, 0], [175, 114, 25], [139, 143, 0], [236, 145, 0], [223, 132, 0], [299, 137, 0], [304, 210, 0], [301, 121, 0], [314, 133, 0], [195, 264, 0], [201, 247, 0], [221, 276, 0], [197, 294, 0], [206, 316, 0], [222, 324, 0], [304, 319, 0], [302, 281, 0], [317, 302, 0], [38, 307, 0], [47, 313, 0], [43, 266, 0], [10, 148, 0], [27, 180, 0], [39, 160, 0], [47, 278, 0], [64, 15, 0], [36, 25, 0], [215, 22, 0], [187, 45, 0], [193, 65, 0], [267, 13, 0], [258, 31, 0], [303, 18, 0], [319, 87, 0], [118, 177, 0], [133, 172, 0], [136, 215, -8], [131, 205, 0]];
bArray = [];
!!!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 doRain() {
rain._y = rain._y + 14;
if (rain._y > 0) {
rain._y = rain._y - 400;
}
}
rain.swapDepths(2003);
initCars();
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = 200;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
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();
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 * Math.PI) / 180);
rayZ = Math.cos((_angleY * Math.PI) / 180);
_xcam = _xcam - (rayX * speed);
_zcam = _zcam - (rayZ * speed);
if ((((_xcam < 176) and (_xcam > 120)) and (_zcam < 584)) and (_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 _local24 = ox - _xcam;
var _local23 = oy - _zcam;
var _local11 = -int(_xcam / 8);
var _local10 = -int(_zcam / 8);
_local11 = _local11 + 128;
_local10 = _local10 + 128;
var _local15 = speed / 15;
var _local25 = (speed / 2) + 3;
var _local19 = 0;
if (speed > 0) {
_local19 = 1;
}
var _local13 = ox + ((_xcam - ox) / 2);
var _local21 = oy + ((_zcam - oy) / 2);
var _local18 = (-int(_local13 / 8)) + 128;
var _local17 = (-int(_local21 / 8)) + 128;
var _local3 = _root.mapArray[_local11][_local10];
var _local7 = _root.mapArray[_local18][_local17];
breaking = 0;
if (_local3 == undefined) {
_local3 = 1;
}
if (((_local3 != 6) and (_local3 != 7)) and (_local3 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local3 == 4) or (_local3 == 5)) or (_local7 == 4)) or (_local7 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
}
}
if ((((_local3 == 6) or (_local3 == 7)) or (_local7 == 6)) or (_local7 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
}
}
if ((((_local3 == 8) or (_local3 == 9)) or (_local7 == 8)) or (_local7 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) or (bestTime == 0)) {
bestTime = lapTime;
var _local20 = lapTime % 100;
var _local12 = int(lapTime / 100);
var _local14 = _local12 % 60;
var _local22 = int(_local12 / 60);
speedo.best.text = (((("BEST LAP: " + sortZero(_local22)) + ":") + sortZero(_local14)) + ":") + sortZero(_local20);
}
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 * Math.PI) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * Math.PI) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local4 = objects.ai4;
objects.ai4.pos++;
_local4.dx = _local4.xpos - ((cArray[_local4.pos][0] * 8) - 1024);
_local4.dy = _local4.ypos - ((cArray[_local4.pos][1] * 8) - 1024);
_local4.dz = Math.sqrt((_local4.dx * _local4.dx) + (_local4.dy * _local4.dy));
_local4.ra = 0;
_local4.posCount = 0;
_local4.maxspeed = _local4.topSpeed;
_local4.pushed = 0;
trackCar = 1;
ahead = 0;
var _local2 = 1;
while (_local2 <= 3) {
if (objects["ai" + _local2].lapnum >= 4) {
ahead++;
}
_local2++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain._visible = 1;
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local3 == 0) or (_local3 == 4)) or (_local3 == 6)) or (_local3 == 8)) {
maxspeed = 2;
breaking = 0.25;
offroad = 1;
} else {
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local3[0] == 3) or (_local7[0] == 3)) {
var _local6 = (-int(ox / 8)) + 128;
var _local5 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local6][_local5][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
oy = oy + Math.cos((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
_local6 = (-int(ox / 8)) + 128;
_local5 = (-int(oy / 8)) + 128;
}
if (_local3[1]) {
var _local16 = _angleY - _local3[1];
tempDiff = _local3[1];
} else {
tempDiff = _local7[1];
var _local16 = _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 _local16 = tempAngle - tempDiff;
speed = (-speed) * 0.8;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local3 == 1) {
objects.player._y = kh1 + (random(2) * _local15);
}
}
return(speed);
}
flyamount = 0;
pushed = 0;
trackFriction = 0.5;
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 _local2 = _local1 % 60;
var _local4 = int(_local1 / 60);
speedo.timec.text = (((("Lap Time: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local2 = _local1 % 60;
_local4 = int(_local1 / 60);
speedo.ttime.text = (((("Tot. Time: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + 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 _local8;
var _local7;
var _local10;
var _local9;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) and (flying == false)) {
if (((rotchange > -5) and (rotchange < 5)) and (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) and (flying == false)) {
if (((rotchange < 5) and (rotchange > -5)) and (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + turningCircle;
} else {
rotchange = rotchange - turningCircle;
}
}
}
}
if ((rotchange != 0) and (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) and (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) and (flying == false)) and (endRace != 1)) {
speed = speed + playersAccel;
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) and (speed > -1)) and (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) and (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) and (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) and (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local4 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local4;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local3 = (-_xcam) - _root.objects.ai4.xpos;
var _local2 = (-_zcam) - _root.objects.ai4.ypos;
var _local6 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
theeRot = (Math.atan2(_local2, _local3) * 180) / Math.PI;
ratio = 400 / _local6;
if (ratio < 1) {
_local3 = _local3 * ratio;
_local2 = _local2 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local3;
_zcam = (-_root.objects.ai4.ypos) - _local2;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local4;
var _local1;
_local4 = ((20 / _nbScans) * Math.PI) / 180;
_local1 = 0;
var _local2 = Math.sin;
var _local3 = Math.cos;
i = 0;
while (i < _nbScans) {
ground.createEmptyMovieClip(i, 100 + i);
ground[i]._x = (-ground._x) + (_resoDx * 0.5);
ground[i]._y = (-ground._y) + (i + 200);
_local1 = _local1 + _local4;
rayY = _local2(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local10;
var _local4;
var _local12;
var _local14;
var _local11;
var _local17;
var _local18;
var _local15;
var _local16;
var _local2;
var _local13;
_local15 = Math.sin;
_local16 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * Math.PI) / 180);
_local10 = (_resoDx * 0.5) / 500;
_local17 = 0;
_local12 = _local15((_angleY * Math.PI) / 180);
_local11 = _local16((_angleY * Math.PI) / 180);
var _local3 = 0;
while (_local3 < tArray.length) {
sortObject(objects["tree" + _local3]);
_local3++;
}
prepBushes();
sortBushes(grassDistance, 0, 1);
sortAllBushes();
sortRamp();
_local13 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local14 < 0) {
continue;
}
var _local9 = dists[_local1];
var _local8 = leCoses[_local1];
var _local7 = (_xcam - (_local12 * _local8)) - 1024;
var _local6 = (_zcam - (_local11 * _local8)) - 1024;
_local2.tx = (_local7 * _local2.a) + (_local6 * _local2.c);
_local2.ty = ((_local7 * _local2.b) + (_local6 * _local2.d)) + 70;
_local4 = _local10 * _local9;
var _local5 = _local4;
ground[_local1].beginBitmapFill(_local13, _local2, true, false);
ground[_local1].moveTo(-_local4, 0);
ground[_local1].lineTo(_local5, 0);
ground[_local1].lineTo(_local5, _scanSteps);
ground[_local1].lineTo(-_local4, _scanSteps);
ground[_local1].endFill();
}
}
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();
doRain();
moveCars();
if ((ac == 1) and (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 810 MovieClip "speedo" in Frame 95
onClipEvent (load) {
this.swapDepths(2005);
}
Frame 97
prevFrame();
Frame 110
cArray = [[35.4, 265], [42.25, 282.9], [55, 298, 0], [84, 302, 0], [110.7, 299], [129.55, 292.1], [152.5, 287.5], [174.55, 287.95], [195.3, 298.3], [213.7, 299.75], [234, 302.65], [252, 311], [277.3, 313.45], [295.65, 313.45], [313.95, 314.5], [323.1, 311.45], [323.6, 298.2], [326, 279, 0], [331, 261, 0], [314, 247, 0], [295.15, 247.8], [283.4, 247.8], [268.65, 253.95], [248.8, 254.45], [235.6, 247.8], [224.4, 240.2], [219.3, 222.4], [218.8, 202], [226.45, 189.8], [246.3, 184.2], [262, 184], [276, 183], [286.55, 176.25], [303.75, 169.45], [319, 162], [327, 153], [328.15, 142.3], [320.55, 132.3], [311.35, 127.55], [294.95, 124.45], [279.9, 119.15], [268.45, 110.4], [261.1, 102.05], [259.15, 90.75], [264.05, 82.4], [282, 78], [299.45, 76.4], [308.85, 66.55], [309.75, 50.35], [301.7, 33.3], [290.45, 22.45], [275.6, 17.05], [260.3, 14.4], [245.05, 15.3], [229.75, 15.75], [220.75, 20.65], [215.8, 32.8], [215.35, 44.95], [217.15, 60.25], [224.8, 70.15], [228.4, 87.2], [230.65, 100.25], [235.15, 115.55], [246, 133, 0], [248, 150, 0], [241, 167, 0], [222, 175, 0], [209.05, 178.05], [197.8, 185.7], [183, 187.05], [166.8, 183.9], [153.75, 178.05], [147.45, 167.25], [147.45, 146.1], [147, 125.9], [151.5, 108.35], [157.8, 100.7], [169.95, 97.55], [179.85, 103.4], [184, 116], [198, 120], [207, 106], [207, 89], [200.95, 58.45], [193.75, 40.9], [179.85, 27], [161, 19], [146, 16], [123, 13], [96.2, 12.6], [76.9, 12.6], [64.3, 16.65], [55.3, 23.85], [51.7, 35.5], [57, 45], [70, 47], [71, 58], [67, 68], [59.8, 76.9], [47.65, 79.6], [31.9, 82.3], [21.6, 90.35], [18.9, 105.65], [19.8, 118.7], [33.25, 121.85], [55.3, 125], [72.85, 133.1], [85.4, 138.5], [106.1, 144.3], [117.35, 154.65], [122.3, 171.75], [124.1, 188.85], [123.2, 203.65], [133, 214], [147.9, 220.75], [169.05, 224.8], [181.65, 235.6], [185, 248], [186, 264], [176.7, 270.2], [154.65, 272], [138.9, 269.35], [124.1, 263.5], [118, 242], [115, 225], [105.2, 216.25], [89.45, 207.75], [71.05, 203.7], [51.7, 204.15], [35, 211], [30.55, 221.65], [31, 241]];
tArray = [];
bArray = [[58, 238, ["b2"]], [115, 279, ["b3"]], [211, 279, ["b4", "b5"]], [307, 283, []], [195, 198, ["b6", "b7"]], [295, 151, ["b9"]], [138, 187, ["b8"]], [120, 42, []], [249, 113, ["b10"]], [249, 35, []], [202, 7, ["b12"]], [225, 144, []], [152, 247, ["b14"]], [87, 180, ["b15"]], [7, 162, []], [247, 222, ["b17"]], [334, 208, []]];
!!!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
initCars();
function initIt() {
var _local1;
_resoDx = Stage.width;
_resoDy = 200;
ground._x = _resoDx * 0.5;
ground._y = _resoDy * 0.5;
_angleX = 0;
_angleY = 0;
_ycam = 20;
_xcam = 730;
_zcam = -820;
}
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();
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 * Math.PI) / 180);
rayZ = Math.cos((_angleY * Math.PI) / 180);
pushed = pushed * trackFriction;
_xcam = _xcam - (rayX * speed);
_zcam = _zcam - (rayZ * speed);
if (objects.player.fly <= 0) {
flying = false;
var _local24 = ox - _xcam;
var _local23 = oy - _zcam;
var _local12 = -int(_xcam / 8);
var _local11 = -int(_zcam / 8);
_local12 = _local12 + 128;
_local11 = _local11 + 128;
var _local9 = speed / 15;
var _local25 = (speed / 2) + 3;
var _local14 = 0;
if (speed > 0) {
_local14 = 1;
}
var _local15 = ox + ((_xcam - ox) / 2);
var _local21 = oy + ((_zcam - oy) / 2);
var _local19 = (-int(_local15 / 8)) + 128;
var _local18 = (-int(_local21 / 8)) + 128;
var _local3 = _root.mapArray[_local12][_local11];
var _local7 = _root.mapArray[_local19][_local18];
breaking = 0;
if (_local3 == undefined) {
_local3 = 1;
}
if (((_local3 != 6) and (_local3 != 7)) and (_local3 != 5)) {
if (pea._y != kh1) {
pea._y = kh1;
}
}
if ((((_local3 == 4) or (_local3 == 5)) or (_local7 == 4)) or (_local7 == 5)) {
if (checkPointReached == 0) {
checkPointReached = 1;
}
}
if ((((_local3 == 6) or (_local3 == 7)) or (_local7 == 6)) or (_local7 == 7)) {
if (checkPointReached == 1) {
checkPointReached = 2;
}
}
if ((((_local3 == 8) or (_local3 == 9)) or (_local7 == 8)) or (_local7 == 9)) {
if (checkPointReached == 2) {
checkPointReached = 0;
lapnum++;
if (lapnum > 1) {
if ((lapTime < bestTime) or (bestTime == 0)) {
bestTime = lapTime;
var _local20 = lapTime % 100;
var _local13 = int(lapTime / 100);
var _local16 = _local13 % 60;
var _local22 = int(_local13 / 60);
speedo.best.text = (((("BEST LAP: " + sortZero(_local22)) + ":") + sortZero(_local16)) + ":") + sortZero(_local20);
}
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 * Math.PI) / 180);
objects.ai4.ypos = (-_zcam) - Math.cos((objects.ai4.ang * Math.PI) / 180);
objects.ai4.pos = -1;
objects.ai4.topSpeed = 15;
objects.ai4.speed = speed;
objects.ai4.accel = 0.2;
var _local4 = objects.ai4;
objects.ai4.pos++;
_local4.dx = _local4.xpos - ((cArray[_local4.pos][0] * 8) - 1024);
_local4.dy = _local4.ypos - ((cArray[_local4.pos][1] * 8) - 1024);
_local4.dz = Math.sqrt((_local4.dx * _local4.dx) + (_local4.dy * _local4.dy));
_local4.ra = 0;
_local4.posCount = 0;
_local4.maxspeed = _local4.topSpeed;
_local4.pushed = 0;
trackCar = 1;
ahead = 0;
var _local2 = 1;
while (_local2 <= 3) {
if (objects["ai" + _local2].lapnum >= 4) {
ahead++;
}
_local2++;
}
resultPanel.place = positions[ahead];
if (ahead == 0) {
resultPanel.congrats._visible = 1;
resultPanel.congrats.gotoAndStop(2);
_root.levelsDone = _root.levelSelected;
saveCookie(_root.levelsDone);
} else {
resultPanel.tryagain.gotoAndStop(2);
resultPanel.tryagain._visible = 1;
}
} else {
speedo.lap.text = ("LAP " + lapnum) + "/3";
}
}
}
if ((((_local3 == 0) or (_local3 == 4)) or (_local3 == 6)) or (_local3 == 8)) {
objects.player._y = kh1 + (random(3) * _local9);
objects.player._rotation = ((random(7) - 3) * _local9) + ((random(5) - 2) * _local14);
maxspeed = 2;
breaking = 0.25;
offroad = 1;
} else {
grassplaying = 0;
objects.player._rotation = 0;
maxspeed = playersMaxSpeed;
offroad = 0;
}
if ((_local3[0] == 3) or (_local7[0] == 3)) {
var _local6 = (-int(ox / 8)) + 128;
var _local5 = (-int(oy / 8)) + 128;
while (_root.mapArray[_local6][_local5][0] == 3) {
ox = ox + Math.sin((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
oy = oy + Math.cos((_root.mapArray[_local6][_local5][1] * Math.PI) / 180);
_local6 = (-int(ox / 8)) + 128;
_local5 = (-int(oy / 8)) + 128;
}
if (_local3[1]) {
var _local17 = _angleY - _local3[1];
tempDiff = _local3[1];
} else {
tempDiff = _local7[1];
var _local17 = _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 _local17 = tempAngle - tempDiff;
speed = (-speed) * 0.8;
_xcam = ox;
_zcam = oy;
rayX = orx;
rayZ = ory;
}
if (_local3 == 1) {
objects.player._y = kh1 + (random(2) * _local9);
}
}
return(speed);
}
flyamount = 0;
trackFriction = 0.5;
pushed = 0;
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 _local2 = _local1 % 60;
var _local4 = int(_local1 / 60);
speedo.timec.text = (((("LAP TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + sortZero(_local3);
totalTime = totalTime + 4;
_local3 = totalTime % 100;
_local1 = int(totalTime / 100);
_local2 = _local1 % 60;
_local4 = int(_local1 / 60);
speedo.ttime.text = (((("TOT.TIME: " + sortZero(_local4)) + ":") + sortZero(_local2)) + ":") + 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 _local8;
var _local7;
var _local10;
var _local9;
vk = 0;
if (endRace != 1) {
if (Key.isDown(39)) {
dir = "right";
if ((ac == 1) and (flying == false)) {
if (((rotchange > -5) and (rotchange < 5)) and (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) and (flying == false)) {
if (((rotchange < 5) and (rotchange > -5)) and (speed != 0)) {
kartchange = kartchange + 0.5;
if (speed > 0) {
rotchange = rotchange + turningCircle;
} else {
rotchange = rotchange - turningCircle;
}
}
}
}
if ((rotchange != 0) and (flying == false)) {
rotchange = rotchange + ((-rotchange) / (20 - speed));
}
if ((kartchange != 0) and (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) and (flying == false)) and (endRace != 1)) {
speed = speed + playersAccel;
}
}
}
decelerate();
if (Key.isDown(40)) {
if (((ac == 1) and (speed > -1)) and (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) and (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) and (flying == false)) {
speed = speed - breaking;
}
}
_angleX = _angleX % 360;
_angleY = _angleY % 360;
vl = 0;
if ((ac == 1) and (endRace != 1)) {
speed = checkpos(_angleY, _nbMs, speed);
}
if (_root.trackCar == 1) {
var _local5 = (_root.objects.ai4.xpos + _xcam) * 0.002;
var _local4 = (_root.objects.ai4.ypos + _zcam) * 0.002;
_xcama = _xcama + _local5;
_zcama = _zcama + _local4;
_xcama = _xcama * 0.99;
_zcama = _zcama * 0.99;
_xcam = _xcam - _xcama;
_zcam = _zcam - _zcama;
var _local3 = (-_xcam) - _root.objects.ai4.xpos;
var _local2 = (-_zcam) - _root.objects.ai4.ypos;
var _local6 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
theeRot = (Math.atan2(_local2, _local3) * 180) / Math.PI;
ratio = 400 / _local6;
if (ratio < 1) {
_local3 = _local3 * ratio;
_local2 = _local2 * ratio;
_xcam = (-_root.objects.ai4.xpos) - _local3;
_zcam = (-_root.objects.ai4.ypos) - _local2;
}
_angleY = (-theeRot) - 90;
}
}
function initMode7() {
dists = [];
leCoses = [];
_scanSteps = 1;
_nbScans = 200;
var _local4;
var _local1;
_local4 = ((20 / _nbScans) * Math.PI) / 180;
_local1 = 0;
var _local2 = Math.sin;
var _local3 = Math.cos;
i = 0;
while (i < _nbScans) {
ground.createEmptyMovieClip(i, 100 + i);
ground[i]._x = (-ground._x) + (_resoDx * 0.5);
ground[i]._y = (-ground._y) + (i + 200);
_local1 = _local1 + _local4;
rayY = _local2(_local1);
dist = 20 / rayY;
dists.push(dist);
leCoses.push(_local3(_local1) * dist);
ground[i]._xscale = 50000 / dist;
i++;
}
}
function manageMode7() {
var _local1;
var _local9;
var _local3;
var _local11;
var _local13;
var _local10;
var _local16;
var _local17;
var _local14;
var _local15;
var _local2;
var _local12;
_local14 = Math.sin;
_local15 = Math.cos;
_local2 = new flash.geom.Matrix();
_local2.rotate((_angleY * Math.PI) / 180);
_local9 = (_resoDx * 0.5) / 500;
_local16 = 0;
_local11 = _local14((_angleY * Math.PI) / 180);
_local10 = _local15((_angleY * Math.PI) / 180);
prepBushes();
sortBushes(grassDistance, 0, 1);
sortAllBushes();
_local12 = groundBmp;
_local1 = -1;
while (_local1++ , _local1 < _nbScans) {
ground[_local1].clear();
if (_local13 < 0) {
continue;
}
var _local8 = dists[_local1];
var _local7 = leCoses[_local1];
var _local6 = (_xcam - (_local11 * _local7)) - 1024;
var _local5 = (_zcam - (_local10 * _local7)) - 1024;
_local2.tx = (_local6 * _local2.a) + (_local5 * _local2.c);
_local2.ty = ((_local6 * _local2.b) + (_local5 * _local2.d)) + 70;
_local3 = _local9 * _local8;
var _local4 = _local3;
ground[_local1].beginBitmapFill(_local12, _local2, true, false);
ground[_local1].moveTo(-_local3, 0);
ground[_local1].lineTo(_local4, 0);
ground[_local1].lineTo(_local4, _scanSteps);
ground[_local1].lineTo(-_local3, _scanSteps);
ground[_local1].endFill();
}
}
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) and (endRace != 1)) {
sortTimer();
}
}
};
rotchange = 0;
speed = 0;
kartchange = 0;
startEngine();
Instance of Symbol 810 MovieClip "speedo" in Frame 115
onClipEvent (load) {
this.swapDepths(4);
}
Frame 117
prevFrame();
Instance of Symbol 3 MovieClip in Symbol 10 MovieClip [light] Frame 1
onClipEvent (load) {
swapDepths(0);
}
Symbol 62 MovieClip Frame 197
if (_root.frame3Loaded != true) {
_root.alreadyLoaded = _root.getBytesLoaded();
_root.load._visible = 1;
} else {
_root.gotoAndStop(3);
}
stop();
Symbol 71 Button
on (release) {
_root.gotoAndStop(3);
}
Symbol 72 Button
on (release) {
_root.gotoAndStop(3);
}
Symbol 73 MovieClip Frame 1
stop();
Symbol 73 MovieClip Frame 10
stop();
Symbol 81 MovieClip Frame 1
var t = logo;
t.alphaTo = 0;
t.alpha = 0;
t.onRelease = function () {
getURL ("http://www.gamersenterprise.com/?game=3Drally", "_blank");
};
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(4605510, 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;
});
Symbol 96 MovieClip Frame 1
stop();
Symbol 131 MovieClip Frame 1
stop();
Symbol 141 MovieClip [ripple] Frame 1
this.myType = "ripple";
this.xpos = (this.oxpos + random(16)) - 8;
this.ypos = (this.oypos + random(16)) - 8;
Symbol 157 MovieClip Frame 1
stop();
Symbol 159 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 166 Button
on (release) {
gotoAndStop ("title");
}
Symbol 253 Button
on (release) {
playmoregames.removeMovieClip();
gotoAndStop ("title");
}
Symbol 274 Button
on (release) {
getURL ("mailto:iulian_ene87@yahoo.com", "_blank");
}
Symbol 275 Button
on (release) {
getURL ("http://www.fredheintz.com", "_blank");
}
Symbol 276 Button
on (release) {
getURL ("http://emisign.blogspot.com", "_blank");
}
Symbol 277 Button
on (release) {
getURL ("http://www.solution3.co.uk", "_blank");
}
Symbol 294 MovieClip Frame 1
stop();
blink = "0";
Symbol 294 MovieClip Frame 2
blink = "1";
Symbol 295 MovieClip Frame 1
if (Number(random(50)) == 1) {
if (Number(eyelids.blink) == 0) {
eyelids.play();
}
}
Symbol 295 MovieClip Frame 2
gotoAndPlay (1);
Symbol 312 MovieClip Frame 1
play();
Symbol 324 MovieClip Frame 1
stop();
Symbol 325 MovieClip Frame 1
h.gotoAndStop(this._name);
play();
forcex = 0;
forcey = 0;
Symbol 325 MovieClip Frame 2
aa = _xmouse - h._x;
bb = _ymouse - h._x;
if ((((Number(aa) > Number(-50)) and (Number(aa) < 50)) and (Number(bb) > Number(-50))) and (Number(bb) < 50)) {
gotoAndPlay (3);
} else {
gotoAndPlay (1);
}
Symbol 325 MovieClip Frame 3
aa = _xmouse - h._x;
bb = _ymouse - h._y;
if ((((Number(aa) > Number(-50)) and (Number(aa) < 50)) and (Number(bb) > Number(-50))) and (Number(bb) < 50)) {
value = Number(aa * aa) + Number(bb * bb);
rr = Math.sqrt(value);
} else {
rr = 0;
if ((Number(powerx) == 0) and (Number(powery) == 0)) {
gotoAndPlay (1);
}
}
powerx = h._x - (((aa / rr) * (25 + Number(50 - rr))) / (rr / 2));
powery = h._y - (((bb / rr) * (25 + Number(50 - rr))) / (rr / 2));
forcex = (Number(forcex) + Number((-h._x) / 2)) / 1.66;
forcey = (Number(forcey) + Number((-h._y) / 2)) / 1.66;
h._x = Number(powerx) + Number(forcex);
h._y = Number(powery) + Number(forcey);
Symbol 325 MovieClip Frame 4
gotoAndPlay (3);
Symbol 330 Button
on (release) {
getURL ("http://www.letsdesign.co.uk/?link=3drally", "_blank");
}
Symbol 335 MovieClip Frame 1
if (_root.levelSelected != 3) {
this._visible = 0;
}
Symbol 741 MovieClip Frame 1
ai1.id = 1;
ai2.id = 2;
ais1.id = 3;
ais2.id = 3;
Symbol 755 Button
on (release) {
if (_currentframe == 1) {
gotoAndStop (2);
_root.theCar = "ford";
}
}
Symbol 756 Button
on (release) {
if (_currentframe == 2) {
gotoAndStop (1);
_root.theCar = "toyota";
}
}
Symbol 757 MovieClip Frame 1
_root.theCar = "toyota";
stop();
Symbol 768 Button
on (release) {
if (_root.trackNeedsDrawing == true) {
_root.gotoAndStop("load" + _root.levelSelected);
} else {
_root.gotoAndStop("level" + _root.levelSelected);
}
}
Symbol 769 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)];
}
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++;
}
Instance of Symbol 757 MovieClip "cars" in Symbol 769 MovieClip Frame 1
/* no clip actions */
Symbol 778 MovieClip Frame 1
stop();
Symbol 780 Button
on (release) {
gotoAndStop ("track");
}
Symbol 803 MovieClip Frame 1
stop();
Symbol 806 MovieClip Frame 1
stop();
Symbol 809 MovieClip Frame 1
stop();
Symbol 810 MovieClip Frame 1
hand._rotation = -120;
handshad._rotation = -120;
checkpoint._visible = 0;
stop();
isPaused = 0;
noMusic = 0;
noSFX = 0;
if (_root.noMusic == 1) {
mButton.gotoAndStop(2);
}
if (_root.noSFX == 1) {
sButton.gotoAndStop(2);
}
pButton.onRelease = function () {
if (isPaused != 1) {
isPaused = 1;
_root.pauseGame();
this.gotoAndStop(2);
} else {
isPaused = 0;
_root.unPauseGame();
this.gotoAndStop(1);
}
};
mButton.onRelease = function () {
if (_root.noMusic != 1) {
_root.noMusic = 1;
_root.music.setVolume(0);
this.gotoAndStop(2);
} else {
_root.noMusic = 0;
_root.music.setVolume(100);
this.gotoAndStop(1);
}
};
sButton.onRelease = function () {
if (_root.noSFX != 1) {
_root.noSFX = 1;
_root.engine.setVolume(0);
this.gotoAndStop(2);
} else {
_root.noSFX = 0;
_root.engine.setVolume(15);
this.gotoAndStop(1);
}
};
Symbol 827 MovieClip [countdown] Frame 125
_root.startrace();
Symbol 827 MovieClip [countdown] Frame 146
this.removeMovieClip();
stop();
Symbol 837 MovieClip Frame 1
stop();
Symbol 840 MovieClip Frame 1
stop();
Symbol 841 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) and (_root[a] != _root.music)) and (_root[a] != _root.__mochibot__fe6c8b97)) and (a != "username")) and (a != "unlocked")) and (_root[a] != _level1)) and (a != "cookie")) {
delete _root[a];
_root[a].dispose();
_root[a].removeMovieClip();
}
}
this.removeMovieClip();
}
Symbol 844 Button
on (release) {
if (_root.cheat != 1) {
nextFrame();
} else {
gotoAndStop (5);
}
}
Symbol 852 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) and (_root[a] != _root.music)) and (_root[a] != _root.__mochibot__fe6c8b97)) and (a != "username")) and (a != "unlocked")) and (a != "cookie")) and (_root[a] != _level1)) {
delete _root[a];
_root[a].dispose();
_root[a].removeMovieClip();
}
}
this.removeMovieClip();
}
Symbol 855 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.jumpTo = _root.levelSelected;
_root.gotoAndStop("score");
for (a in _root) {
if ((((((((_root[a] != _root.musicMc) and (a != "jumpTo")) and (_root[a] != _root.music)) and (_root[a] != _root.__mochibot__fe6c8b97)) and (a != "username")) and (a != "unlocked")) and (_root[a] != _level1)) and (a != "cookie")) {
delete _root[a];
_root[a].dispose();
_root[a].removeMovieClip();
}
}
this.removeMovieClip();
}
Symbol 861 Button
on (release) {
gotoAndStop (2);
}
Symbol 869 MovieClip Frame 1
t.onRelease = function () {
getURL ("http://www.gamersenterprise.com/?game=3Drally", "_blank");
};
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();
Symbol 869 MovieClip Frame 2
_root.sendScores();
Symbol 869 MovieClip Frame 3
var millieseconds = (_root.totalTime % 100);
var totalseconds = int(_root.totalTime / 100);
var seconds = (totalseconds % 60);
var minutes = int(totalseconds / 60);
yourTime = (((_root.sortZero(minutes) + ":") + _root.sortZero(seconds)) + ":") + _root.sortZero(millieseconds);
tracks = ["Desert", "Snow", "Night", "Rain", "Forest"];
trackname = ("For the " + tracks[_root.levelSelected - 1]) + " track";