Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("aead93de", this, 10301, true);
stop();
onEnterFrame = function () {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
delete onEnterFrame;
_root.play();
} else {
var _local2 = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
preloader._xscale = _local2;
}
};
Frame 2
stop();
var garrage = false;
var selCar = 1;
var SD = 0.96;
music.gotoAndPlay(2);
carData_array = new Array();
var i = 0;
while (i <= 20) {
carData_array[i] = new Array();
i++;
}
carData_array[0].BRAKE_POWER = 0.4;
carData_array[0].MAX_SPEED = 8;
carData_array[0].MAX_SPEED_REVERSE = 3;
carData_array[0].ACCELERATION = 0.4;
carData_array[0].REVERSE_ACCELERATION = 0.2;
carData_array[0].ROAD_WIPEOUT_THRESHOLD = 110;
carData_array[0].GRASS_WIPEOUT_THRESHOLD = 80;
carData_array[0].TYRES = 1;
carData_array[0].MAKE = "LOL";
carData_array[0].TORQUE = "400,0Nm";
carData_array[0].POWER = "281kW";
carData_array[0].WEIGHT = "1,198";
carData_array[1].BRAKE_POWER = 0.4;
carData_array[1].MAX_SPEED = 4.2;
carData_array[1].MAX_SPEED_REVERSE = 2.5;
carData_array[1].ACCELERATION = 0.42;
carData_array[1].REVERSE_ACCELERATION = 0.2;
carData_array[1].ROAD_WIPEOUT_THRESHOLD = 105;
carData_array[1].GRASS_WIPEOUT_THRESHOLD = 70;
carData_array[1].TYRES = 1;
carData_array[1].MAKE = "101xs";
carData_array[1].TORQUE = "335,0Nm";
carData_array[1].POWER = "295kW";
carData_array[1].WEIGHT = "3,043";
carData_array[2].BRAKE_POWER = 0.4;
carData_array[2].MAX_SPEED = 4.2;
carData_array[2].MAX_SPEED_REVERSE = 2.5;
carData_array[2].ACCELERATION = 0.38;
carData_array[2].REVERSE_ACCELERATION = 0.2;
carData_array[2].ROAD_WIPEOUT_THRESHOLD = 108;
carData_array[2].GRASS_WIPEOUT_THRESHOLD = 60;
carData_array[2].TYRES = 1;
carData_array[2].MAKE = "DADSON";
carData_array[2].TORQUE = "210,0Nm";
carData_array[2].POWER = "214kW";
carData_array[2].WEIGHT = "3,120";
carData_array[3].BRAKE_POWER = 0.5;
carData_array[3].MAX_SPEED = 4.8;
carData_array[3].MAX_SPEED_REVERSE = 2.5;
carData_array[3].ACCELERATION = 0.5;
carData_array[3].REVERSE_ACCELERATION = 0.2;
carData_array[3].ROAD_WIPEOUT_THRESHOLD = 120;
carData_array[3].GRASS_WIPEOUT_THRESHOLD = 90;
carData_array[3].TYRES = 1;
carData_array[3].MAKE = "XBOX";
carData_array[3].TORQUE = "507,0Nm";
carData_array[3].POWER = "442kW";
carData_array[3].WEIGHT = "2,245";
carData_array[4].BRAKE_POWER = 0.42;
carData_array[4].MAX_SPEED = 4.2;
carData_array[4].MAX_SPEED_REVERSE = 2.5;
carData_array[4].ACCELERATION = 0.5;
carData_array[4].REVERSE_ACCELERATION = 0.2;
carData_array[4].ROAD_WIPEOUT_THRESHOLD = 110;
carData_array[4].GRASS_WIPEOUT_THRESHOLD = 85;
carData_array[4].TYRES = 1;
carData_array[4].MAKE = "FJORD";
carData_array[4].TORQUE = "493,0Nm";
carData_array[4].POWER = "413kW";
carData_array[4].WEIGHT = "2,850";
carData_array[5].BRAKE_POWER = 0.4;
carData_array[5].MAX_SPEED = 4.2;
carData_array[5].MAX_SPEED_REVERSE = 2.5;
carData_array[5].ACCELERATION = 0.4;
carData_array[5].REVERSE_ACCELERATION = 0.2;
carData_array[5].ROAD_WIPEOUT_THRESHOLD = 110;
carData_array[5].GRASS_WIPEOUT_THRESHOLD = 80;
carData_array[5].TYRES = 1;
carData_array[5].MAKE = "KIDNEY";
carData_array[5].TORQUE = "289,0Nm";
carData_array[5].POWER = "344kW";
carData_array[5].WEIGHT = "2,425";
carData_array[6].BRAKE_POWER = 0.4;
carData_array[6].MAX_SPEED = 4.2;
carData_array[6].MAX_SPEED_REVERSE = 2.5;
carData_array[6].ACCELERATION = 0.5;
carData_array[6].REVERSE_ACCELERATION = 0.2;
carData_array[6].ROAD_WIPEOUT_THRESHOLD = 101;
carData_array[6].GRASS_WIPEOUT_THRESHOLD = 70;
carData_array[6].TYRES = 1;
carData_array[6].MAKE = "LOL";
carData_array[6].TORQUE = "350,0Nm";
carData_array[6].POWER = "295kW";
carData_array[6].WEIGHT = "2,641";
carData_array[7].BRAKE_POWER = 0.4;
carData_array[7].MAX_SPEED = 4.8;
carData_array[7].MAX_SPEED_REVERSE = 3;
carData_array[7].ACCELERATION = 0.3;
carData_array[7].REVERSE_ACCELERATION = 0.2;
carData_array[7].ROAD_WIPEOUT_THRESHOLD = 105;
carData_array[7].GRASS_WIPEOUT_THRESHOLD = 70;
carData_array[7].TYRES = 1;
carData_array[7].MAKE = "MINIMAL";
carData_array[7].TORQUE = "200,0Nm";
carData_array[7].POWER = "145kW";
carData_array[7].WEIGHT = "2,254";
carData_array[8].BRAKE_POWER = 0.4;
carData_array[8].MAX_SPEED = 5.1;
carData_array[8].MAX_SPEED_REVERSE = 3;
carData_array[8].ACCELERATION = 0.45;
carData_array[8].REVERSE_ACCELERATION = 0.2;
carData_array[8].ROAD_WIPEOUT_THRESHOLD = 110;
carData_array[8].GRASS_WIPEOUT_THRESHOLD = 70;
carData_array[8].TYRES = 1;
carData_array[8].MAKE = "MUZDA";
carData_array[8].TORQUE = "255,0Nm";
carData_array[8].POWER = "217kW";
carData_array[8].WEIGHT = "2,831";
carData_array[9].BRAKE_POWER = 0.4;
carData_array[9].MAX_SPEED = 5.5;
carData_array[9].MAX_SPEED_REVERSE = 3;
carData_array[9].ACCELERATION = 0.5;
carData_array[9].REVERSE_ACCELERATION = 0.2;
carData_array[9].ROAD_WIPEOUT_THRESHOLD = 120;
carData_array[9].GRASS_WIPEOUT_THRESHOLD = 90;
carData_array[9].TYRES = 1;
carData_array[9].MAKE = "NIMI";
carData_array[9].TORQUE = "163,0Nm";
carData_array[9].POWER = "155kW";
carData_array[9].WEIGHT = "2,730";
carData_array[10].BRAKE_POWER = 0.4;
carData_array[10].MAX_SPEED = 5.5;
carData_array[10].MAX_SPEED_REVERSE = 3;
carData_array[10].ACCELERATION = 0.3;
carData_array[10].REVERSE_ACCELERATION = 0.2;
carData_array[10].ROAD_WIPEOUT_THRESHOLD = 100;
carData_array[10].GRASS_WIPEOUT_THRESHOLD = 70;
carData_array[10].TYRES = 1;
carData_array[10].MAKE = "POSHE";
carData_array[10].TORQUE = "247,0Nm";
carData_array[10].POWER = "258kW";
carData_array[10].WEIGHT = "2,998";
carData_array[11].BRAKE_POWER = 0.4;
carData_array[11].MAX_SPEED = 5;
carData_array[11].MAX_SPEED_REVERSE = 3;
carData_array[11].ACCELERATION = 0.4;
carData_array[11].REVERSE_ACCELERATION = 0.2;
carData_array[11].ROAD_WIPEOUT_THRESHOLD = 105;
carData_array[11].GRASS_WIPEOUT_THRESHOLD = 75;
carData_array[11].TYRES = 1;
carData_array[11].MAKE = "EYELINE";
carData_array[11].TORQUE = "280,0Nm";
carData_array[11].POWER = "270kW";
carData_array[11].WEIGHT = "3,435";
leaveSkidMarks = true;
Frame 11
function chooseTyre(selTyre, frame, val) {
_root.SD = val;
var _local3 = 1;
while (_local3 <= 3) {
this["txt" + _local3].gotoAndStop(frame);
_local3++;
}
this["txt" + selTyre].gotoAndStop(1);
}
function carEffect() {
var _local1 = new mx.transitions.Tween(chooseCar_mc, "_x", mx.transitions.easing.Regular.easeOut, 50, 87.3, 8, false);
var _local2 = new mx.transitions.Tween(car_pro, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 1, true);
_local1.onMotionFinished = function () {
choose_Sound.gotoAndPlay(2);
};
}
stop();
garrage = true;
chooseCar_mc.gotoAndStop(_root.selCar);
car_pro.gotoAndStop(_root.selCar);
var tween_handlerin1 = (new mx.transitions.Tween(chooseCar_mc, "_x", mx.transitions.easing.Regular.easeOut, -150, 87.3, 15, false));
var tween_handlerin2 = (new mx.transitions.Tween(car_pro, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 1, true));
Frame 20
function setCarPosition() {
trackRace_mc.car1.gotoAndStop(_root.selCar);
trackRace_mc.car1._x = 640;
trackRace_mc.car1._y = 422;
trackRace_mc.car1._rotation = 0;
keyCapCode = 0;
trackRace_mc.car1.currentSpeed = 0;
trackRace_mc.car1.heading = 0;
trackRace_mc.car1.direction = 0;
trackRace_mc.car1.directionLatency = 0;
trackRace_mc.car1.steeringPosition = 0;
trackRace_mc.car1.startX = trackRace_mc.car1._x;
trackRace_mc.car1.startY = trackRace_mc.car1._y;
initialTime = getTimer();
_root.lapTime = initialTime;
_root.timeElapsed = 0;
_root.lastlaptime = 0;
_root.lastlaptimeTXT = 0;
_root.bestLapTXT = 0;
}
garrage = false;
trackRace_mc.car1.code = "player";
var totalLaps = 5;
var acceleration = 0.4;
var speedDecay = SD;
var rotationStep = 20;
var maxSpeed = 20;
var backSpeed = 1;
var currentCheckpoint1 = 1;
var currentLap1 = 0;
var checkpoints = 2;
trackRace_mc.ready_mc.gotoAndPlay(2);
var currentLapTXT = "1/5";
var bestLapTXT = 0;
var totalTimeTXT = 0;
var damage = false;
var timeElapsed = 0;
var lastlaptime = 0;
var oldMilliseconds = null;
setCarPosition();
stop();
function step(who) {
if (trackRace_mc["car" + who].hitTest(_root["checkpoint" + _root["currentCheckpoint" + who]])) {
if (_root["currentCheckpoint" + who] == 1) {
if (_root["currentLap" + who] != 0) {
_root.setBestLap();
}
if (_root["currentLap" + who] == _root.totalLaps) {
_root.finishAni_mc.gotoAndPlay(2);
_root.gotoAndStop(44);
garrage = true;
} else {
_root["currentLap" + who]++;
if (_root["currentLap" + who] > 1) {
_root.setLastLap();
}
}
_root.currentLapTXT = _root["currentLap" + who] + "/5";
}
_root["currentCheckpoint" + who]++;
if (_root["currentCheckpoint" + who] > _root.checkpoints) {
_root["currentCheckpoint" + who] = 1;
}
}
}
function setTimes() {
timeElapsed = getTimer() - _root.initialTime;
milliseconds = timeElapsed;
seconds = Math.floor(milliseconds / 1000);
minutes = Math.floor(seconds / 60);
minutesTXT = minutes;
secondsTXT = seconds - (minutes * 60);
tensTXT = Math.round((milliseconds - (seconds * 1000)) / 10);
if (minutesTXT < 10) {
minutesTXT = "0" + minutesTXT;
}
if (secondsTXT < 10) {
secondsTXT = "0" + secondsTXT;
}
if (tensTXT < 10) {
tensTXT = "0" + tensTXT;
}
_root.totalTimeTXT = (((minutesTXT + ".") + secondsTXT) + ".") + tensTXT;
}
function setBestLap() {
bestTime = getTimer() - _root.lapTime;
milliseconds = bestTime;
if ((oldMilliseconds > milliseconds) || (oldMilliseconds == null)) {
oldMilliseconds = milliseconds;
seconds = Math.floor(milliseconds / 1000);
minutes = Math.floor(seconds / 60);
minutesTXT = minutes;
secondsTXT = seconds - (minutes * 60);
tensTXT = Math.round((milliseconds - (seconds * 1000)) / 10);
if (minutesTXT < 10) {
minutesTXT = "0" + minutesTXT;
}
if (secondsTXT < 10) {
secondsTXT = "0" + secondsTXT;
}
if (tensTXT < 10) {
tensTXT = "0" + tensTXT;
}
_root.bestLapTXT = (((minutesTXT + ".") + secondsTXT) + ".") + tensTXT;
}
_root.lapTime = getTimer();
}
function setLastLap() {
lastlaptime = _root.timeElapsed - _root.lastlaptime;
milliseconds = lastlaptime;
seconds = Math.floor(milliseconds / 1000);
minutes = Math.floor(seconds / 60);
minutesTXT = minutes;
secondsTXT = seconds - (minutes * 60);
tensTXT = Math.round((milliseconds - (seconds * 1000)) / 10);
if (minutesTXT < 10) {
minutesTXT = "0" + minutesTXT;
}
if (secondsTXT < 10) {
secondsTXT = "0" + secondsTXT;
}
if (tensTXT < 10) {
tensTXT = "0" + tensTXT;
}
_root.lastlaptimeTXT = (((minutesTXT + ".") + secondsTXT) + ".") + tensTXT;
}
keyCapture_array = new Array();
keyPlayback_str = "0000000000000444444444455555444444444455554444466666666664444446666666666666666444466666444444444455555555555555444444555555555555555444445555555444444444666666444444666666666666666666664444444444446666666666444444444466664444444444444444445555555555444444444444446666644446666666644444666666444444444555555544444444555444444444666444446666666666666666666666444444444444555554444444444444445555555555555555554444444000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000undefined";
keyPlayback_array = keyPlayback_str.split("");
for (i in keyPlayback_array) {
if (keyPlayback_array[i] == "A") {
keyPlayback_array[i] = 10;
} else if (keyPlayback_array[i] == "B") {
keyPlayback_array[i] = 11;
} else if (keyPlayback_array[i] == "C") {
keyPlayback_array[i] = 12;
} else if (keyPlayback_array[i] == "D") {
keyPlayback_array[i] = 13;
} else if (keyPlayback_array[i] == "E") {
keyPlayback_array[i] = 14;
} else if (keyPlayback_array[i] == "F") {
keyPlayback_array[i] = 15;
} else {
keyPlayback_array[i] = Number(keyPlayback_array[i]);
}
}
Frame 29
initialTime = getTimer();
lapTime = initialTime;
trackRace_mc.car1.carNumber = 1;
trackRace_mc.car1.setCarStats(trackRace_mc.car1.carNumber);
play();
Instance of Symbol 166 MovieClip "stepper" in Frame 29
onClipEvent (load) {
speed1 = 0;
}
onClipEvent (enterFrame) {
_root.setTimes();
_root.step(1);
}
Frame 32
trackRace_mc.car1.updatePosition();
Frame 33
if (!garrage) {
gotoAndPlay ("gameloop");
} else {
stop();
gotoAndPlay ("finish");
}
Frame 44
stop();
finishAni_mc.gotoAndPlay(2);
Symbol 11 MovieClip [car] Frame 1
#initclip 6
Object.registerClass("car", DriftingCar);
#endinitclip
stop();
Symbol 11 MovieClip [car] Frame 2
stop();
Symbol 11 MovieClip [car] Frame 3
stop();
Symbol 11 MovieClip [car] Frame 4
stop();
Symbol 17 Button
on (release) {
getURL ("http://www.hypercargames.com", "_blank");
}
Symbol 179 MovieClip [__Packages.DriftingCar] Frame 0
class DriftingCar extends MovieClip
{
var currentSpeed, heading, direction, directionLatency, steeringPosition, gotoAndStop, carNumber, startX, _x, startY, _y, BRAKE_POWER, MAX_SPEED, MAX_SPEED_REVERSE, ACCELERATION, REVERSE_ACCELERATION, ROAD_WIPEOUT_THRESHOLD, GRASS_WIPEOUT_THRESHOLD, tyres, _rotation, turningLeft, turningRight, accelerating, braking, wipeOutThreshold, lostIt, steeringResponse;
function DriftingCar () {
super();
currentSpeed = 0;
heading = 0;
direction = 0;
directionLatency = 0;
steeringPosition = 0;
gotoAndStop(carNumber);
startX = _x;
startY = _y;
BRAKE_POWER = _root.carData_array[carNumber].BRAKE_POWER;
MAX_SPEED = _root.carData_array[carNumber].MAX_SPEED;
MAX_SPEED_REVERSE = _root.carData_array[carNumber].MAX_SPEED_REVERSE;
ACCELERATION = _root.carData_array[carNumber].ACCELERATION;
REVERSE_ACCELERATION = _root.carData_array[carNumber].REVERSE_ACCELERATION;
ROAD_WIPEOUT_THRESHOLD = _root.carData_array[carNumber].ROAD_WIPEOUT_THRESHOLD;
GRASS_WIPEOUT_THRESHOLD = _root.carData_array[carNumber].GRASS_WIPEOUT_THRESHOLD;
tyres = _root.carData_array[carNumber].TYRES;
}
function updatePosition() {
var newXPosition = (_x + (Math.sin((direction * 3.14159265359) / 180) * currentSpeed));
var newYPosition = (_y - (Math.cos((direction * 3.14159265359) / 180) * currentSpeed));
_x = newXPosition;
_y = newYPosition;
x = _x;
y = _y;
_rotation = heading;
turningLeft = false;
turningRight = false;
if (_root.ghostPlayback) {
if (_root.keyPlayback_array[_root.gameTicks] & 1) {
turningLeft = true;
}
if (_root.keyPlayback_array[_root.gameTicks] & 2) {
turningRight = true;
}
if (_root.keyPlayback_array[_root.gameTicks] & 4) {
if (accelerating == false) {
var acceleratorHit = true;
} else {
var acceleratorHit = false;
}
accelerating = true;
} else {
if (accelerating == true) {
var acceleratorRelease = true;
} else {
var acceleratorRelease = false;
}
accelerating = false;
}
if (_root.keyPlayback_array[_root.gameTicks] & 8) {
braking = true;
} else {
braking = false;
}
} else {
if (Key.isDown(37)) {
turningLeft = true;
}
if (Key.isDown(39)) {
turningRight = true;
}
if (Key.isDown(38)) {
if (_root.gameTicks == 1) {
_root.engineUp_sound.start(audioStartPointUp, 1);
}
if (accelerating == false) {
var acceleratorHit = true;
} else {
var acceleratorHit = false;
}
accelerating = true;
} else {
if (accelerating == true) {
var acceleratorRelease = true;
} else {
var acceleratorRelease = false;
}
accelerating = false;
}
if (Key.isDown(40)) {
braking = true;
} else {
braking = false;
}
}
if ((0 != ((0 != acceleratorHit) & (0 != (!_root.raceStarted)))) & (0 != (!_root.garage))) {
_root.startBonus = (10 - _root.gameTicks) * 1000;
if ((0 != ((0 != (_root.startBonus <= 0)) | (0 != _root.garage))) | (0 != _root.donutChallenge)) {
_root.startBonus = "";
} else {
_root.bonusPoints(_root.startBonus);
}
_root.raceStarted = true;
}
if (_root.gameTicks > 60) {
_root.startBonus = "";
}
var audioStartPointUp = ((currentSpeed / MAX_SPEED) * 3);
var audioStartPointDown = (3 - audioStartPointUp);
if (acceleratorHit) {
_root.engineDown_sound.stop();
_root.idle_sound.stop();
_root.engineUp_sound.stop();
_root.engineUp_sound.start(audioStartPointUp, 1);
}
if (acceleratorRelease) {
_root.engineUp_sound.stop();
_root.topSpeed_sound.stop();
_root.engineDown_sound.stop();
_root.engineDown_sound.start(audioStartPointDown, 1);
}
if (loseIt) {
_root.engineUp_sound.stop();
_root.topSpeed_sound.stop();
_root.engineDown_sound.stop();
_root.engineDown_sound.start(audioStartPointDown, 1);
loseIt = false;
}
if (onGrass) {
wipeOutThreshold = GRASS_WIPEOUT_THRESHOLD;
} else {
wipeOutThreshold = ROAD_WIPEOUT_THRESHOLD;
}
if (!(((__reg0 = tyres)) === 1)) {
if (__reg0 === 2) {
wipeOutThreshold = wipeOutThreshold + 10;
} else if (__reg0 === 3) {
wipeOutThreshold = wipeOutThreshold + 5;
}
}
if (onBump) {
currentSpeed = currentSpeed * Math.random();
wipeOutThreshold = BUMP_WIPEOUT_THRESHOLD;
}
if (!lostIt) {
if (accelerating) {
if (currentSpeed < MAX_SPEED) {
currentSpeed = currentSpeed + ACCELERATION;
}
} else if (braking) {
if (currentSpeed > 0) {
currentSpeed = currentSpeed - BRAKE_POWER;
currentSpeed >= 0;
} else {
reversing = true;
currentSpeed = currentSpeed - REVERSE_ACCELERATION;
}
} else if ((0 != (currentSpeed > 0)) & (0 != (!lostIt))) {
reversing = false;
currentSpeed = currentSpeed - FRICTION;
if (currentSpeed < 0) {
currentSpeed = 0;
}
}
}
if (lostIt) {
currentSpeed = currentSpeed - WIPE_OUT_FRICTION;
}
if (lostIt) {
if (steeringPosition > 0) {
turningRight = true;
} else {
turningLeft = true;
}
}
if (turningLeft) {
if (steeringPosition > (-STEERING_MAX)) {
steeringPosition = steeringPosition - STEERING_RATE_OF_CHANGE;
}
} else if (turningRight) {
if (steeringPosition < STEERING_MAX) {
steeringPosition = steeringPosition + STEERING_RATE_OF_CHANGE;
}
} else {
if (steeringPosition > 0) {
steeringPosition = steeringPosition - STEERING_RATE_OF_CHANGE;
} else if (steeringPosition < 0) {
steeringPosition = steeringPosition + STEERING_RATE_OF_CHANGE;
}
if (Math.abs(steeringPosition) < STEERING_RATE_OF_CHANGE) {
steeringPosition = 0;
}
}
heading = heading + ((currentSpeed / MAX_SPEED) * steeringPosition);
heading = Math.round(heading);
steeringResponse = (DRIFT - ((currentSpeed / MAX_SPEED) * 2)) + ((directionLatency / 90) * 4);
if (!lostIt) {
if (direction < heading) {
direction = direction + steeringResponse;
directionLatency = heading - direction;
} else if (direction > heading) {
direction = direction - steeringResponse;
directionLatency = direction - heading;
}
}
if (currentSpeed < 0) {
if (currentSpeed < (-MAX_SPEED_REVERSE)) {
currentSpeed = -MAX_SPEED_REVERSE;
}
if ((0 != (currentSpeed < (-FRICTION))) & (0 != (!reversing))) {
currentSpeed = 0;
} else {
currentSpeed = currentSpeed + FRICTION;
}
}
if (currentSpeed <= 0) {
direction = heading;
directionLatency = 0;
lostIt = false;
accelerating = false;
}
if ((0 != (directionLatency > SKIDMARK_THRESHOLD)) & (0 != (!lostIt))) {
currentSkidmarkDepth++;
_root.newClipName = "tracks" + currentSkidmarkDepth;
if (_root.leaveSkidMarks) {
if (onGrass) {
_root.trackRace_mc.tracks_grass.duplicateMovieClip(_root.newClipName, currentSkidmarkDepth);
} else {
_root.trackRace_mc.tracks_road.duplicateMovieClip(_root.newClipName, currentSkidmarkDepth);
}
var skidAmount = (directionLatency - SKIDMARK_THRESHOLD);
eval ("_root.trackRace_mc." + _root.newClipName)._x = _x;
eval ("_root.trackRace_mc." + _root.newClipName)._y = _y;
if (direction < heading) {
eval ("_root.trackRace_mc." + _root.newClipName)._rotation = direction - SKIDMARK_ADJUSTMENT;
} else {
eval ("_root.trackRace_mc." + _root.newClipName)._rotation = direction + SKIDMARK_ADJUSTMENT;
}
eval ("_root.trackRace_mc." + _root.newClipName)._alpha = skidAmount;
var isskid = true;
_root.screech_sound.setVolume(skidAmount);
}
}
if (!lostIt) {
var speedBleed = ((SPEED_BLEED_STRENGTH * Math.abs(directionLatency)) / SPEED_BLEED_MAX);
if (speedBleed > SPEED_BLEED_STRENGTH) {
speedBleed = SPEED_BLEED_STRENGTH;
}
if (speedBleed < 0.1) {
speedBleed = 0;
}
currentSpeed = currentSpeed - speedBleed;
}
var pivotShift = (((wipeOutThreshold - Math.abs(directionLatency)) / wipeOutThreshold) * 23);
_root.originalCar.car._y = -39 + pivotShift;
if ((0 != (directionLatency > SKIDMARK_THRESHOLD)) & (0 != (!lostIt))) {
if (!drifting) {
_root.trackRace_mc.video_mc.gotoAndPlay("car");
_root.currentDrift = 0;
_root.screech_sound.setVolume(0);
_root.screech_sound.start(0, 999);
drifting = true;
if (noDriftTimer > MULTIPLIER_TIMEOUT) {
driftTimer = 0;
}
}
driftTimer++;
noDriftTimer = 0;
_root.driftScoreMultiplier = Math.round(driftTimer / _root.DRIFT_SCORE_MULTIPLIER_INTERVAL);
if (_root.driftScoreMultiplier > 1) {
_root.driftScoreMultiplier_str = _root.driftScoreMultiplier + "X";
} else {
_root.driftScoreMultiplier_str = "";
}
if (((__reg0 = tyres)) === 1) {
var tyreBonus = 0;
} else if (__reg0 === 2) {
var tyreBonus = 10;
} else if (__reg0 === 3) {
var tyreBonus = 20;
}
_root.currentDrift = _root.currentDrift + Math.round((_root.driftScoreMultiplier * 2) * ((directionLatency - SKIDMARK_THRESHOLD) + tyreBonus));
if ((0 != (_root.currentDrift > 0)) & (0 != (!_root.garage))) {
_root.currentDrift_str = _root.convertNumberDisplay(_root.currentDrift);
} else {
_root.currentDrift_str = "";
}
} else {
_root.screech_sound.stop();
noDriftTimer++;
if (drifting) {
_root.trackRace_mc.video_mc.gotoAndPlay("turn");
if (_root.donutChallenge) {
_root.score = _root.currentDrift;
} else {
_root.score = _root.score + _root.currentDrift;
}
_root.currentDrift = 0;
_root.currentDrift_str = "";
_root.driftScoreMultiplier_str = "";
if (_root.donutChallenge == undefined) {
if (_root.bestDonut < _root.score) {
_root.bestDonut = _root.score;
_root.so.data.bestDonut = _root.score;
}
if (_root.trackRace_mc.car1.currentSkidmarkDepth > 0) {
_root.removeskid_mc.gotoAndPlay(2);
}
}
}
drifting = false;
_root.screech_sound.setVolume(0);
}
_root.directionLatency = directionLatency;
if ((0 != (Math.abs(directionLatency) > wipeOutThreshold)) & (0 != (!lostIt))) {
loseIt = true;
lostIt = true;
}
if ((0 != (heading > 360)) & (0 != (direction > 360))) {
heading = heading - 360;
direction = direction - 360;
}
if ((0 != (heading < 0)) & (0 != (direction < 0))) {
heading = heading + 360;
direction = direction + 360;
}
}
function setCarStats(param_carNumber) {
BRAKE_POWER = _root.carData_array[param_carNumber].BRAKE_POWER;
MAX_SPEED = _root.carData_array[param_carNumber].MAX_SPEED;
MAX_SPEED_REVERSE = _root.carData_array[param_carNumber].MAX_SPEED_REVERSE;
ACCELERATION = _root.carData_array[param_carNumber].ACCELERATION;
REVERSE_ACCELERATION = _root.carData_array[param_carNumber].REVERSE_ACCELERATION;
ROAD_WIPEOUT_THRESHOLD = _root.carData_array[param_carNumber].ROAD_WIPEOUT_THRESHOLD;
GRASS_WIPEOUT_THRESHOLD = _root.carData_array[param_carNumber].GRASS_WIPEOUT_THRESHOLD;
tyres = _root.carData_array[carNumber].TYRES;
}
var STEERING_RATE_OF_CHANGE = 1;
var STEERING_MAX = 8;
var STEERING_RANDOM_ELEMENT = 2;
var FRICTION = 0.1;
var STEERING_SNAP = 10;
var SKIDMARK_THRESHOLD = 50;
var SKIDMARK_LIMIT = 500;
var SKIDMARK_ADJUSTMENT = 8;
var MOUSE_DISTANCE_LIMIT = 200;
var WIPE_OUT_FRICTION = 0.2;
var SPEED_BLEED_STRENGTH = 0.3;
var SPEED_BLEED_MAX = 60;
var MULTIPLIER_TIMEOUT = 30;
var DRIFT = 3;
var drifting = false;
var onGrass = false;
var onBump = false;
var x = 0;
var y = 0;
var targetSpeed = 0;
var currentSkidmarkDepth = 0;
var lastGateHit = 0;
var driftTimer = 0;
var noDriftTimer = 0;
var reversing = false;
var loseIt = false;
var BUMP_WIPEOUT_THRESHOLD = 5;
}
Symbol 180 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 181 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 182 MovieClip [__Packages.mx.transitions.Tween] Frame 0
class mx.transitions.Tween
{
var obj, prop, begin, useSeconds, _listeners, addListener, prevTime, _time, looping, _duration, broadcastMessage, isPlaying, _fps, prevPos, _pos, change, _intervalID, _startTime;
function Tween (obj, prop, func, begin, finish, duration, useSeconds) {
mx.transitions.OnEnterFrameBeacon.init();
if (!arguments.length) {
return;
}
this.obj = obj;
this.prop = prop;
this.begin = begin;
position = (begin);
this.duration = (duration);
this.useSeconds = useSeconds;
if (func) {
this.func = func;
}
this.finish = (finish);
_listeners = [];
addListener(this);
start();
}
function set time(t) {
prevTime = _time;
if (t > duration) {
if (looping) {
rewind(t - _duration);
update();
broadcastMessage("onMotionLooped", this);
} else {
if (useSeconds) {
_time = _duration;
update();
}
stop();
broadcastMessage("onMotionFinished", this);
}
} else if (t < 0) {
rewind();
update();
} else {
_time = t;
update();
}
//return(time);
}
function get time() {
return(_time);
}
function set duration(d) {
_duration = (((d == null) || (d <= 0)) ? (_global.Infinity) : (d));
//return(duration);
}
function get duration() {
return(_duration);
}
function set FPS(fps) {
var _local2 = isPlaying;
stopEnterFrame();
_fps = fps;
if (_local2) {
startEnterFrame();
}
//return(FPS);
}
function get FPS() {
return(_fps);
}
function set position(p) {
setPosition(p);
//return(position);
}
function setPosition(p) {
prevPos = _pos;
obj[prop] = (_pos = p);
broadcastMessage("onMotionChanged", this, _pos);
updateAfterEvent();
}
function get position() {
return(getPosition());
}
function getPosition(t) {
if (t == undefined) {
t = _time;
}
return(func(t, begin, change, _duration));
}
function set finish(f) {
change = f - begin;
//return(finish);
}
function get finish() {
return(begin + change);
}
function continueTo(finish, duration) {
begin = position;
this.finish = (finish);
if (duration != undefined) {
this.duration = (duration);
}
start();
}
function yoyo() {
continueTo(begin, time);
}
function startEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.addListener(this);
} else {
_intervalID = setInterval(this, "onEnterFrame", 1000 / _fps);
}
isPlaying = true;
}
function stopEnterFrame() {
if (_fps == undefined) {
_global.MovieClip.removeListener(this);
} else {
clearInterval(_intervalID);
}
isPlaying = false;
}
function start() {
rewind();
startEnterFrame();
broadcastMessage("onMotionStarted", this);
}
function stop() {
stopEnterFrame();
broadcastMessage("onMotionStopped", this);
}
function resume() {
fixTime();
startEnterFrame();
broadcastMessage("onMotionResumed", this);
}
function rewind(t) {
_time = ((t == undefined) ? 0 : (t));
fixTime();
update();
}
function fforward() {
time = (_duration);
fixTime();
}
function nextFrame() {
if (useSeconds) {
time = ((getTimer() - _startTime) / 1000);
} else {
time = (_time + 1);
}
}
function onEnterFrame() {
nextFrame();
}
function prevFrame() {
if (!useSeconds) {
time = (_time - 1);
}
}
function toString() {
return("[Tween]");
}
function fixTime() {
if (useSeconds) {
_startTime = getTimer() - (_time * 1000);
}
}
function update() {
position = (getPosition(_time));
}
static var version = "1.1.0.52";
static var __initBeacon = mx.transitions.OnEnterFrameBeacon.init();
static var __initBroadcaster = mx.transitions.BroadcasterMX.initialize(mx.transitions.Tween.prototype, true);
function func(t, b, c, d) {
return(((c * t) / d) + b);
}
}
Symbol 183 MovieClip [__Packages.mx.transitions.easing.Regular] Frame 0
class mx.transitions.easing.Regular
{
function Regular () {
}
static function easeIn(t, b, c, d) {
t = t / d;
return(((c * t) * t) + b);
}
static function easeOut(t, b, c, d) {
t = t / d;
return((((-c) * t) * (t - 2)) + b);
}
static function easeInOut(t, b, c, d) {
t = t / (d / 2);
if (t < 1) {
return((((c / 2) * t) * t) + b);
}
t--;
return((((-c) / 2) * ((t * (t - 2)) - 1)) + b);
}
static var version = "1.1.0.52";
}
Symbol 20 MovieClip Frame 1
stop();
Symbol 20 MovieClip Frame 2
play();
Symbol 20 MovieClip Frame 42
gotoAndStop (1);
Symbol 22 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 2
play();
Symbol 22 MovieClip Frame 26
gotoAndStop (1);
Symbol 24 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 2
play();
Symbol 24 MovieClip Frame 13
gotoAndStop (1);
Symbol 27 MovieClip Frame 1
stop();
Symbol 27 MovieClip Frame 2
play();
Symbol 27 MovieClip Frame 15
gotoAndStop (1);
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 2
play();
Symbol 29 MovieClip Frame 208
gotoAndPlay (2);
Symbol 31 MovieClip Frame 1
stop();
Symbol 31 MovieClip Frame 2
play();
Symbol 31 MovieClip Frame 9
gotoAndStop (1);
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 2
play();
Symbol 33 MovieClip Frame 24
gotoAndStop (1);
Symbol 41 Button
on (release) {
this.gotoAndPlay("readyset");
start_Sound.gotoAndPlay(2);
}
Symbol 59 Button
on (release) {
getURL ("http://www.hypercargames.com", "_blank");
}
Symbol 68 Button
on (release) {
_root.gotoAndPlay("readyset");
start_Sound.gotoAndPlay(2);
}
Symbol 70 Button
on (release) {
_root.chooseTyre(1, 2, 0.93);
doneSound.gotoAndPlay(2);
}
Symbol 72 Button
on (release) {
_root.chooseTyre(2, 2, 0.95);
doneSound.gotoAndPlay(2);
}
Symbol 74 Button
on (release) {
_root.chooseTyre(3, 2, 0.96);
doneSound.gotoAndPlay(2);
}
Symbol 78 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 2
stop();
Symbol 81 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 2
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 2
stop();
Symbol 93 MovieClip Frame 1
stop();
_root.selCar = 1;
Symbol 93 MovieClip Frame 2
stop();
_root.selCar = 2;
Symbol 93 MovieClip Frame 3
stop();
_root.selCar = 3;
Symbol 93 MovieClip Frame 4
stop();
_root.selCar = 4;
Symbol 113 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 2
stop();
Symbol 113 MovieClip Frame 3
stop();
Symbol 113 MovieClip Frame 4
stop();
Symbol 118 Button
on (release) {
if (chooseCar_mc._currentframe == chooseCar_mc._totalframes) {
chooseCar_mc.gotoAndStop(1);
car_pro.gotoAndStop(1);
} else {
chooseCar_mc.gotoAndStop(chooseCar_mc._currentframe + 1);
car_pro.gotoAndStop(car_pro._currentframe + 1);
}
_root.carEffect();
}
Symbol 131 Button
on (release) {
var tween_handlerin3 = (new mx.transitions.Tween(_root.trackRace_mc, "_x", mx.transitions.easing.Regular.easeOut, 0, -800, 8, false));
_root.garrage = true;
tween_handlerin3.onMotionFinished = function () {
_root.driveCar_Sound.gotoAndPlay(2);
_root.gotoAndStop("selectCar");
};
}
Symbol 137 Button
on (release) {
_root.gotoAndPlay("readySet");
_root.plyAgn_Sound.gotoAndPlay(2);
}
Symbol 155 MovieClip Frame 1
stop();
Symbol 155 MovieClip Frame 2
play();
Symbol 155 MovieClip Frame 50
_root.soundmc.engineStart.start(0, 1);
_root.soundmc.engineLoop.start(0, 9999);
_root.soundmc.engineLoop.setVolume(40);
var w = 1;
_root["speed" + w] = 0;
_root.play();
Symbol 155 MovieClip Frame 72
stop();
keyCapCode = 0;
Instance of Symbol 120 MovieClip "terrain" in Symbol 162 MovieClip Frame 1
/* no clip actions */
Instance of Symbol 11 MovieClip [car] "car1" in Symbol 162 MovieClip Frame 1
onClipEvent (enterFrame) {
this.swapDepths(_root.getNextHighestDepth());
var point = {x:this._x, y:this._y};
_root.trackRace_mc.localToGlobal(point);
if (_parent.track_bumps.hitTest(point.x, point.y, true)) {
this.onBump = true;
} else {
this.onBump = false;
}
var point = {x:this._x, y:this._y};
_root.trackRace_mc.localToGlobal(point);
if (_parent.road.hitTest(point.x, point.y, true)) {
_root.gotoAndPlay("readySet");
}
var i = 1;
var point = {x:this._x, y:this._y};
_root.game_mc.localToGlobal(point);
if (_parent.grass.hitTest(point.x, point.y, true)) {
this.onGrass = true;
} else {
this.onGrass = false;
}
}
Symbol 165 MovieClip Frame 1
stop();
Symbol 165 MovieClip Frame 2
play();
Symbol 165 MovieClip Frame 35
var i = 1;
while (i <= _root.trackRace_mc.car1.currentSkidmarkDepth) {
eval ("_root.trackRace_mc.tracks" + i).removeMovieClip();
i++;
}
Symbol 168 Button
on (release) {
_root.gotoAndPlay("readySet");
_root.plyAgn_Sound.gotoAndPlay(2);
}
Symbol 173 Button
on (release) {
getURL ("http://www.hypercargames.com", "_blank");
}
Symbol 178 MovieClip Frame 25
stop();