Frame 1
fscommand ("showmenu", false);
stopAllSounds();
Stage.showMenu = false;
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
percent = int((loaded / total) * 100);
_root.textload = percent + "%";
if (loaded == total) {
_root.gotoAndPlay(3);
}
Instance of Symbol 102 MovieClip in Frame 1
/* no clip actions */
Frame 2
gotoAndPlay (1);
Frame 3
snd = new Object();
snd.channels = new Array();
snd.loops = new Array();
snd.global = new Sound();
snd.global.setVolume(100);
snd.active = 1;
snd.actMc = 0;
snd.idMc = 0;
snd.mcs = new Array();
snd.channelsAmount = 8;
var i = 0;
while (i < snd.channelsAmount) {
snd.mcs[i] = _root.createEmptyMovieClip("sndMc" + this.idMc, this.idMc++);
snd.channels[i] = new Sound(snd.mcs[i]);
snd.channels[i].onSoundComplete = function () {
var _local1 = this;
_local1.playing = false;
_local1.locked = false;
_local1.fading = false;
_local1.fadeTo = 0;
_local1.fadeSpeed = 0;
};
snd.channels[i].playing = false;
snd.channels[i].id = i;
i++;
}
_root.createEmptyMovieClip("sndMcEvents", this.idMc++);
_root.sndMcEvents.onEnterFrame = function () {
with (_root.snd) {
var i = 0;
while (i < channelsAmount) {
if (channels[i].fading) {
var channel = channels[i];
var newVol = (channel.volume + (channel.fadeSpeed * 100));
newVol = ((channel.fadeSpeed > 0) ? (Math.min(channel.fadeTo, newVol)) : (Math.max(channel.fadeTo, newVol)));
channel.setVolume(channel.volume);
if (newVol == channel.volume) {
channel.fading = false;
}
channel.volume = newVol;
if ((newVol == 0) && (channel.fadeOutFlag)) {
channel.fadeOutFlag = false;
channel.stop();
channel.locked = false;
channel.playing = false;
channel.fading = false;
}
}
i++;
}
}
};
snd.playLoop = function (id, volume) {
var _local2 = volume;
var _local3 = id;
if (_local2 eq "") {
_local2 = 1;
}
var _local1 = this.getChannel();
_local1.attachSound(_local3);
_local1.start(0, 99999);
_local1.setVolume(Math.min(100, _local2 * 100));
_local1.volume = _local2 * 100;
_local1.locked = true;
_local1.libId = _local3;
_local1.playing = true;
this.loops[_local3] = _local1;
return(_local1);
};
snd.fadeChannel = function (channel, to, time) {
var _local1 = channel;
var _local2 = to;
if (_local2 == -1) {
_local1.fadeOutFlag = true;
_local2 = 0;
}
if (time == 0) {
_local1.volume = _local2 * 100;
_local1.setVolume(_local1.volume);
_local1.fading = false;
return(undefined);
}
_local1.fading = true;
_local1.fadeTo = Math.min(100, _local2 * 100);
_local1.fadeSpeed = (_local2 - _local1.volume) / time;
return(undefined);
};
snd.playEvent = function (id, volume) {
var _local2 = volume;
if (_local2 eq "") {
_local2 = 1;
}
var _local1 = this.getChannel();
_local1.attachSound(id);
_local1.start(0, 0);
_local1.setVolume(Math.min(100, _local2 * 100));
_local1.volume = _local2 * 100;
_local1.libId = id;
_local1.playing = true;
return(_local1);
};
snd.getChannel = function () {
var _local3 = this;
var oldestPos = -1;
var oldestId = -1;
var _local2 = 0;
while (_local2 < _local3.channels.length) {
var _local1 = _local3.channels[_local2];
if (!_local1.locked) {
if (_local1.playing) {
if (_local1.position > oldestPos) {
oldestPos = _local1.position;
oldestId = _local1.id;
}
} else {
return(_local3.channels[_local2]);
}
}
_local2++;
}
if (oldestId != -1) {
trace("return old: " + oldestId);
return(_local3.channels[oldestId]);
}
trace("##ERROR: SOUND : no free channel..");
return(undefined);
};
snd.stop = function (id) {
var _local2 = this;
var _local3 = id;
if (_local3 eq "") {
return(_local2.stopAll());
}
var _local1 = 0;
while (_local1 < _local2.channels.length) {
if (_local2.channels[_local1].libId == _local3) {
_local2.channels[_local1].stop();
_local2.channels[_local1].locked = false;
_local2.channels[_local1].playing = false;
_local2.channels[_local1].locked = false;
}
_local1++;
}
return(undefined);
};
snd.stopAll = function () {
var _local1 = this;
for (var _local2 in _local1.channels) {
_local1.channels[_local2].stop();
_local1.channels[_local2].locked = false;
_local1.channels[_local2].fading = false;
_local1.channels[_local2].playing = false;
}
};
sndChannelStart = _root.snd.playEvent("sndRaceStart");
_root.snd.fadeChannel(_root.sndChannelBeat, 1, 30);
stop();
Frame 5
moto = true;
Frame 6
_root.snd.fadeChannel(_root.sndChannelStart, -1, 10);
_root.snd.fadeChannel(_root.sndChannelMotors, -1, 10);
_root.snd.fadeChannel(_root.sndChannelBeat, 1, 0);
_root.snd.fadeChannel(_root.sndChannelBass, 1, 0);
reset = function () {
var _local1 = _root;
_local1.terrains = ["plain"];
_local1.statistics = new Array();
_local1.totalScore = 0;
_local1.races = 0;
for (var i in _local1.terrains) {
_local1.statistics[_local1.terrains[i]] = {score:-1, checkpoints:[], winner:0};
}
Mouse.show();
};
stopAllSounds();
Frame 7
String.numberFormat = function (num, digits) {
var _local1 = num;
var _local3 = String(int(_local1));
var _local2 = _local3.length - 4;
while (_local2 >= 0) {
_local3 = (_local3.substring(0, _local2 + 1) + ",") + _local3.substr(_local2 + 1);
_local2 = _local2 - 3;
}
if (int(digits) > 0) {
_local3 = _local3 + ".";
_local1 = String(int((_local1 - int(_local1)) * Math.pow(10, digits)));
while (_local1.length < digits) {
_local1 = "0" + _local1;
}
_local3 = _local3 + _local1;
}
return(_local3);
};
reset();
Frame 9
stop();
Frame 10
_root.snd.fadeChannel(_root.sndChannelBeat, -1, 30);
_root.snd.fadeChannel(_root.sndChannelBass, -1, 30);
Frame 11
_root.snd.stopAll();
_root.sndChannelMusic = _root.snd.playLoop("music0");
_root.sndChannelSqueal = _root.snd.playLoop("sndSqueal", 0);
_root.sndChannelMotors = _root.snd.playLoop("sndMotors", 0);
_root.snd.fadeChannel(_root.sndChannelMotors, 0.2, 20);
Mouse.hide();
stop();
Frame 12
prevFrame();
Frame 13
Mouse.show();
_root.snd.stopAll();
races++;
var checkArr = _root.statistics[_root.level].checkpoints;
var totalBonus = 0;
var totalTime = 0;
boniDisplay = "";
timesDisplay = "";
if (checkArr.length == 5) {
finishingBonusDisplay = "FINISHING BONUS: 50,000";
actScore = actScore + 50000;
} else {
finishingBonusDisplay = "";
}
_root.statistics[_root.level].score = _root.actScore;
_root.totalScore = _root.totalScore + _root.actScore;
var i = 0;
while (i < checkArr.length) {
var checkpoint = checkArr[i];
boniDisplay = boniDisplay + (String.numberFormat(checkpoint.bonus) + newline);
timesDisplay = timesDisplay + (String.numberFormat(checkpoint.time / 1000, 2) + "s\n");
totalTime = totalTime + checkpoint.time;
totalBonus = totalBonus + checkpoint.bonus;
i++;
}
var i = checkArr.length;
while (i < 5) {
boniDisplay = boniDisplay + "--\n";
timesDisplay = timesDisplay + "--\n";
i++;
}
boniDisplay = boniDisplay + String.numberFormat(totalBonus);
timesDisplay = timesDisplay + (String.numberFormat(totalTime / 1000, 2) + "s");
if (_root.moto) {
actScoreDisplay = "";
totalScoreDisplay = "";
totalScoreDisplay2 = "TOTAL SCORE: " + String.numberFormat(totalScore);
} else {
actScoreDisplay = "LEVEL SCORE: " + String.numberFormat(actScore);
totalScoreDisplay = "TOTAL SCORE: " + String.numberFormat(totalScore);
totalScoreDisplay2 = "";
}
stop();
stopAllSounds();
Frame 14
prevFrame();
Symbol 34 MovieClip Frame 1
stop();
Symbol 94 Button
on (release) {
getURL ("http://www.startgames.ws", "_blank");
}
Instance of Symbol 101 MovieClip "around" in Symbol 102 MovieClip Frame 1
onClipEvent (enterFrame) {
_rotation = (_rotation + 25);
}
Symbol 130 MovieClip Frame 161
_root.play();
Symbol 146 Button
on (release) {
_root.level = "plain";
_root.gotoAndPlay("startrr");
}
Symbol 151 Button
on (release) {
getURL ("http://www.startgames.ws", "_blank");
}
Symbol 156 Button
on (release) {
getURL ("http://www.startgames.ws/games_for_websites.html", "_blank");
}
Symbol 163 MovieClip Frame 1
function lvlRead(i, pointer) {
var _local1 = this;
var _local2 = pointer;
i = i % _local1.teAmount;
if (_local2 == undefined) {
_local1.lvlReadPointer++;
_local2 = _local1.lvlReadPointer;
}
_local2 = (_local2 + _local1.lvl.length) % _local1.lvl.length;
var _local3 = _local1.tes[i];
_local3.curve = _local1.lvl[_local2][0];
_local3.dekoL = _local1.lvl[_local2][1];
_local3.dekoR = _local1.lvl[_local2][2];
_local3.mc.swapDepths(_local1.teDepthCounter--);
_local3.mc.street.dekoL.gotoAndStop(_local1.lvl[_local2][1] + 1);
_local3.mc.street.dekoR.gotoAndStop(_local1.lvl[_local2][2] + 1);
}
function init() {
var _local1 = this;
_local1.phase = 0;
_local1.accelTimeStamp = 0;
bg.gotoAndStop(_local1.level);
if (!(_local1.level === "plain")) {
} else {
_local1.teAmount = 10;
_local1.teBotMaxX = 1.9;
_local1.trackWidth = 2.7;
_local1.streetWidth = 2.2;
_local1.greenFriction = 0.93;
}
_local1.teMcHeight = 100;
_local1.teHeight = 35;
_local1.teHeightScale = 0.8;
_local1.camX = 0;
_local1.scoreFlag = true;
_local1.pl.vx = 0;
_local1.pl.ax = 0.03;
_local1.pl.fx = 0.85;
_local1.pl.x = 0;
_local1.pl.y = -1;
_local1.pl.vz = 0;
_local1.pl.az = 0.005;
_local1.pl.fz = 0.98;
_local1.lvlReadPointer = -1;
_local1.teDepthCounter = 1000000 /* 0x0F4240 */;
_local1.spriteDepthCounter = 2000000 /* 0x1E8480 */;
_local1.pl.mc = _local1.attachMovie("bike", "bike", 3000000);
_local1.pl.mc._y = 155;
_local1.pl.mc.biker.sprite.tire.stop();
var _local3 = 0;
var _local2 = 0;
while (_local2 < _local1.teAmount) {
_local1.tes[_local2] = Array();
_local1.tes[_local2].mc = _local1.attachMovie("te", "track" + _local2, _local1.teDepthCounter--);
_local1.tes[_local2].col = new Color(_local1.tes[_local2].mc);
_local1.tes[_local2].mc.street.variant.gotoAndStop((_local1.level + "_") + _local3);
_local1.lvlRead(_local2);
_local1.tes[_local2].mc.grass.variant.gotoAndStop((_local1.level + "_") + _local3);
_local2++;
}
_local1.offTe = 0;
_local1.botcfg = {vzMax:0.15, az:0.005, ax:0.005, vzVariance:0.55};
_local2 = 0;
while (_local2 < 6) {
_local1.bots[_local2] = new Object();
_local1.bots[_local2].mc = _local1.attachMovie("bike", "bot" + _local2, _local1.spriteDepthCounter--);
_local1.bots[_local2].mc.biker.tire.gotoAndStop(1);
_local1.bots[_local2].col = new Color(_local1.bots[_local2].mc);
_local1.bots[_local2].vz = 0;
_local1.bots[_local2].az = _local1.botcfg.az;
_local1.bots[_local2].ax = _local1.botcfg.ax;
_local1.resetBot(_local1.bots[_local2]);
_local1.bots[_local2].x = _local1.botBases[_local2].x;
_local1.bots[_local2].z = _local1.botBases[_local2].z;
_local2++;
}
_local1.coltrans = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
}
function resetBot(bot) {
var _local1 = this;
var _local2 = bot;
_local2.x = ((_local1.teBotMaxX * Math.random()) * 2) - _local1.teBotMaxX;
_local2.mc.biker.gotoAndStop(Math.floor(Math.random() * 7) + 2);
_local2.vzMax = _local1.botcfg.vzMax + ((Math.random() * _local1.botcfg.vzMax) * _local1.botcfg.vzVariance);
}
function startBots() {
var _local1 = this;
for (var _local2 in _local1.bots) {
_local1.bots[_local2].mc.biker.tire.play();
}
}
function gameOver() {
var _local1 = _root;
_local1.actScore = int(_local1.osd.actScore);
_local1.gotoAndStop("raceover");
}
function botSort(a, b) {
if (a.z < b.z) {
return(-1);
}
if (a.z > b.z) {
return(1);
}
return(0);
}
function draw() {
var _local1 = this;
var curve;
var mc;
var offCurve = 0;
var distance;
var ti;
var _local2;
_local2 = (getTimer() - _local1.timestamp) / 50;
_local1.timestamp = getTimer();
if (_local2 > 200) {
return(undefined);
}
if (_local1.pl.vz > 0.1) {
_local1.pl.mc.biker.sprite.tire.play();
} else {
_local1.pl.mc.biker.sprite.tire.gotoAndStop(1);
}
if (Key.isDown(27) || (Key.isDown(8) && (_root.version eq ""))) {
_local1.gameOver();
}
if (Key.isDown(38)) {
if (_local1.phase == 1) {
_local1.pl.mc.biker.sprite.light.gotoAndStop("off");
if (_local1.accelTimeStamp > 0) {
var a = (getTimer() - _local1.accelTimeStamp);
if ((a > 0) || (a < -1000)) {
_local1.accelTimeStamp = 0;
} else {
_local1.pl.vz = _local1.pl.vz + (_local1.pl.az * _local2);
}
}
_local1.pl.vz = _local1.pl.vz + (_local1.pl.az * _local2);
_local1.distance = _local1.distance - (0.05 * _local2);
} else if ((_local1.phase == 0) && (_local1.keyAccelTokens > 0)) {
_local1.keyAccelTokens = 0;
_local1.accelTimeStamp = getTimer() + 1000;
}
} else {
_local1.pl.mc.biker.sprite.light.gotoAndStop("on");
_local1.keyAccelTokens = 1;
}
if (Key.isDown(40)) {
_local1.pl.vz = _local1.pl.vz * Math.pow(0.95, _local2);
}
if (_local1.phase >= 2) {
_local1.pl.vz = _local1.pl.vz * Math.pow(0.95, _local2);
} else {
_local1.pl.vz = _local1.pl.vz * Math.pow(_local1.pl.fz, _local2);
}
var volSqueal = 0;
if (Key.isDown(37) && (_local1.phase > 0)) {
volSqueal = Math.max(0, Math.abs(_local1.pl.vx) - 0.3);
_local1.pl.vx = _local1.pl.vx - (0.1 * _local2);
if (!Key.isDown(38)) {
_local1.pl.vx = _local1.pl.vx - (0.05 * _local2);
}
}
if (Key.isDown(39) && (_local1.phase > 0)) {
volSqueal = Math.max(0, Math.abs(_local1.pl.vx) - 0.3);
_local1.pl.vx = _local1.pl.vx + (0.1 * _local2);
if (!Key.isDown(38)) {
_local1.pl.vx = _local1.pl.vx + (0.05 * _local2);
}
}
if (volSqueal > 0) {
_root.snd.fadeChannel(_root.sndChannelSqueal, volSqueal * 0.53, 5);
} else {
_root.snd.fadeChannel(_root.sndChannelSqueal, volSqueal, 5);
}
if (_root.version == "") {
if (((!Key.isDown(16)) && (Key.isDown(34))) && (_local1.keyRightTokens > 0)) {
_local1.keyRightTokens = 0;
_local1.pl.vz = 0;
_local1.levedAlter(0, -1);
} else {
_local1.keyRightTokens = 1;
}
if (((!Key.isDown(16)) && (Key.isDown(46))) && (_local1.keyLeftTokens > 0)) {
_local1.keyLeftTokens = 0;
_local1.pl.vz = 0;
_local1.levedAlter(0, 1);
} else {
_local1.keyLeftTokens = 1;
}
if (Key.isDown(35) && (_local1.keyDownTokens > 0)) {
_local1.pl.vz = 0;
_local1.distance = int(_local1.distance) + 1.1;
_local1.keyDownTokens = 0;
} else {
_local1.keyDownTokens = 1;
}
if (Key.isDown(36) && (_local1.keyUpTokens > 0)) {
_local1.pl.vz = 0;
_local1.keyUpTokens = 0;
_local1.distance = int(_local1.distance) - 1;
} else {
_local1.keyUpTokens = 1;
}
}
_local1.pl.vx = _local1.pl.vx * Math.pow(_local1.pl.fx, _local2);
_local1.pl.mc.biker._rotation = (_local1.pl.mc.biker._rotation * 0.8) + (((_local1.pl.vx * Math.max(0.08, Math.abs(_local1.pl.vz))) * 330) * 0.2);
_local1.pl.mc.biker.sprite.gotoAndStop(Math.min(20, Math.max(1, int((_local1.pl.vx + 0.5) * 20))));
_local1._rotation = (_local1.pl.vx * Math.abs(_local1.pl.vz)) * 90;
_local1.distance = _local1.distance - (_local1.pl.vz * _local2);
_root.osd.actScore = _root.osd.actScore + ((_local1.pl.vz * _local2) * 5);
if (_local1.phase > 1) {
if ((_local1.phase == 2) || (_local1.phase == 3)) {
if (_local1.phase == 3) {
_local1.pl.vz = _local1.pl.vz * Math.pow(0.95, _local2);
}
if (_local1.pl.vz < 0.003) {
_local1.phase = 4;
_local1.gameOver();
} else if (_local1.pl.vz < 0.015) {
_local1.pl.vz * 0.5;
}
}
}
var control;
_local1.pl.x = Math.max(-1 * _local1.trackWidth, Math.min(_local1.trackWidth, _local1.pl.x));
control = 0.2;
if (_local1.level == "dirt") {
control = 0.15;
if (Math.abs(_local1.pl.x) > _local1.streetWidth) {
control = 0.12;
} else if (Math.abs(_local1.pl.x) > 1) {
control = 0.1;
_local1.pl.vz = _local1.pl.vz * Math.pow(0.997, _local2);
}
}
_local1.pl.x = _local1.pl.x + (((_local1.pl.vx * _local2) * control) * Math.max(0.7, Math.min(0.8, _local1.pl.vz * 10)));
_local1.pl.vz = Math.max(0, _local1.pl.vz - (Math.abs(_local1.pl.vx * 0.001) * _local2));
_local1.camX = _local1.pl.x * -100;
while (_local1.distance < 0) {
_local1.distance = _local1.distance + 1;
_local1.lvlRead(_local1.offTe);
_local1.offTe++;
_local1.scoreFlag = true;
}
while (_local1.distance > 1) {
_local1.lvlReadPointer--;
_local1.lvlRead(_local1.offTe, (_local1.lvlReadPointer - _local1.teAmount) + 1);
_local1.distance = _local1.distance - 1;
_local1.offTe--;
}
p = Math.pow(0.64, _local1.pl.y);
mc = _local1.pl.mc;
mc._y = p * 100;
mc._xscale = (mc._yscale = p * 100);
mc._x = ((_local1.pl.x * p) * 100) + _local1.camX;
var _local3 = 0;
while (_local3 < _local1.teAmount) {
te = _local1.tes[(_local3 + _local1.offTe) % _local1.teAmount];
mc = te.mc;
distance = (_local1.distance - 2) + _local3;
_local1.sfx(te, distance);
p = Math.pow(0.64, distance);
mc._y = p * 100;
scale = p * 100;
mc.street._xscale = scale;
mc.street._yscale = scale;
mc.grass._yscale = scale;
curve = te.curve;
if (_local3 == 0) {
x = _local1.camX * p;
curve = curve * _local1.distance;
} else {
x = spliceX;
}
if (_local3 == 0) {
var dx = (((_local1.pl.vz * te.curve) * 0.09) * _local2);
_local1.pl.x = _local1.pl.x + dx;
_local1.bg.shil._x = ((_local1.bg.shil._x + (dx * 60)) + 700) % 700;
}
if (_local3 == 1) {
if (Math.abs(_local1.pl.x) > (_local1.streetWidth + 0.1)) {
_local1.pl.vz = _local1.pl.vz * Math.pow(_local1.greenFriction, _local2);
if ((_local1.pl.x > 0) && (te.dekoR > 0)) {
_root.snd.playEvent("sndHitDeko", Math.abs(_local1.pl.vz) * 12);
_local1.pl.vz = _local1.pl.vz * Math.pow(0.7, _local2);
_local1.pl.vx = _local1.pl.vx - (0.5 * _local2);
} else if ((_local1.pl.x < 0) && (te.dekoL > 0)) {
_root.snd.playEvent("sndHitDeko", Math.abs(_local1.pl.vz) * 12);
_local1.pl.vz = _local1.pl.vz * Math.pow(0.7, _local2);
_local1.pl.vx = _local1.pl.vx + (0.5 * _local2);
}
}
if ((te.dekoL == 11) || (te.dekoL == 12)) {
if (_local1.scoreFlag == true) {
_root.statistics[_root.level].checkpoints.push({score:0, time:0});
_root.osd.score(false, te.dekoL == 12);
_local1.scoreFlag = false;
_local1.phase = 1;
}
if ((te.dekoL == 12) && (_root.version != "")) {
_root.statistics[_root.level].winner = true;
_local1.phase = 3;
}
}
}
mc.street._x = x;
_local1.bufferOffX[_local3] = x;
_local1.bufferCurve[_local3] = te.curve;
offCurve = offCurve + curve;
curve = (_local1.camX * 0.094) + offCurve;
spliceX = x - ((curve * 3.8) * p);
curve = Math.min(Math.max(71 - int(curve), 1), 141);
mc.street.gotoAndStop(curve);
_local3++;
}
_local1.bufferOffX[_local3] = _local1.bufferOffX[_local3 - 1];
var d;
var rot;
var strategy;
_local1.bots.sort(_local1.botSort);
var sndVolume = 0.5;
_local3 = 0;
while (_local3 < _local1.bots.length) {
_local3 = int(_local3);
bot = _local1.bots[_local3];
if (bot.z < 0) {
sndVolume = sndVolume + (Math.max(0, bot.z + 5) * 0.06);
} else {
sndVolume = sndVolume + (Math.max(0, 3 - bot.z) * 0.06);
}
if ((_local1.phase == 1) || (_local1.phase == 2)) {
bot.vz = Math.min(bot.vz + (bot.az * _local2), bot.vzMax);
} else {
bot.vz = bot.vz * Math.pow(0.96, _local2);
bot.vx = bot.vx * 0.5;
}
if ((_local1.phase == 0) || (_local1.phase == 4)) {
bot.vz = 0;
bot.vx = 0;
}
bot.z = bot.z + ((bot.vz - _local1.pl.vz) * _local2);
bot.x = bot.x + (bot.vx * _local2);
bot.vx = bot.vx * Math.pow(0.95, _local2);
mc = bot.mc;
if ((bot.z < -2) || (bot.z >= (_local1.teAmount - 3))) {
if (bot.z > (_local1.teAmount + 6)) {
bot.z = bot.z - (_local1.teAmount + 8);
}
if (bot.z < -5) {
bot.z = _local1.teAmount + (Math.random() * 5);
}
mc._visible = false;
} else {
mc._visible = true;
if (bot.z < -1) {
mc.swapDepths((4000000 - int(bot.z * 10000)) - _local3);
} else {
mc.swapDepths((2000000 - int(bot.z * 10000)) - _local3);
}
ti = (bot.z + 2) - _local1.distance;
distance = 1 - (ti - Math.floor(ti));
ti = Math.ceil(ti);
_local1.sfx(bot, bot.z);
curve = _local1.tes[(ti + _local1.offTe) % _local1.teAmount].curve;
rot = curve + (bot.vx * -100);
mc.biker._rotation = Math.max(Math.min((mc.biker._rotation * 0.9) + ((rot * -6.5) * 0.1), 33), -33);
p = Math.pow(0.64, bot.z);
mc._y = p * 100;
mc._x = (((bot.x * p) * 100) + (_local1.bufferOffX[ti] * distance)) + (_local1.bufferOffX[ti + 1] * (1 - distance));
mc._xscale = (mc._yscale = p * 100);
strategy = 0;
d = Math.abs(bot.x - _local1.pl.x);
if (d < 0.25) {
if (bot.z > -1) {
if (bot.z < -0.63) {
_root.snd.playEvent("sndHit", (_local1.pl.vz - bot.vz) * 10);
_local1.pl.vz = Math.min(_local1.pl.vz, bot.vz) * Math.pow(0.7, _local2);
}
} else if (bot.z > -1.37) {
_root.snd.playEvent("sndHit", (bot.vz - _local1.pl.vz) * 10);
bot.vz = Math.min(_local1.pl.vz, bot.vz) * Math.pow(0.7, _local2);
} else {
if (_local1.pl.x > 0) {
bot.vx = bot.vx - (bot.ax * _local2);
} else {
bot.vx = bot.vx + (bot.ax * _local2);
}
strategy = 11;
}
} else if (d < 0.5) {
if ((bot.z > -1.5) && (bot.z < -0.63)) {
_root.snd.playEvent("sndHitShoulder", Math.abs(_local1.pl.vx - bot.vx) * 10);
_local1.pl.vx = _local1.pl.vx * Math.pow(0.8, _local2);
if (_local1.pl.x > bot.x) {
bot.vx = Math.min(_local1.pl.vx * control, bot.vx) - (bot.ax * _local2);
strategy = 12;
} else {
bot.vx = Math.max(_local1.pl.vx * control, bot.vx) + (bot.ax * _local2);
strategy = 12;
}
}
}
if (Math.abs(bot.x) >= _local1.teBotMaxX) {
if (_local1.bot.x > 0) {
bot.vx = bot.vx - (bot.ax * _local2);
} else {
bot.vx = bot.vx + (bot.ax * _local2);
}
strategy = 20;
if (Math.abs(bot.x) > _local1.streetWidth) {
bot.vz = bot.vz * Math.pow(_local1.greenFriction, _local2);
}
if (_local1.level == "dirt") {
if ((Math.abs(_local1.bot.x) < _local1.streetWidth) && (Math.abs(_local1.bot.x) > 1)) {
_local1.bot.vz = _local1.bot.vz * Math.pow(0.987, _local2);
}
}
}
if (strategy == 0) {
if (_local3 < (_local1.bots.length - 1)) {
var j = (_local3 + 1);
while (j < _local1.bots.length) {
other = _local1.bots[j];
if ((Math.abs(bot.x - other.x) < 0.3) && ((other.z - bot.z) < 1)) {
if (bot.x > 0) {
bot.vx = bot.vx - (bot.ax * _local2);
} else {
bot.vx = bot.vx - (bot.ax * _local2);
}
bot.vz = bot.vz * Math.pow(0.95, _local2);
strategy = 30;
}
j++;
}
}
}
if (strategy == 0) {
bot.vx = bot.vx - (((bot.ax * _local2) * curve) / 15);
strategy = 40;
}
}
_local3++;
}
sndVolume = Math.min(0.8, sndVolume) * 0.4;
_root.snd.fadeChannel(_root.sndChannelAmbience, sndVolume, 10);
if (Key.isDown(36) || (Key.isDown(35))) {
_local1.levedPrint();
}
return(undefined);
}
function sfx(te, distance) {
var _local2 = this;
var _local1;
if (!(_local2.level === "plain")) {
} else {
_local1 = (1 - ((distance - 2) / (_local2.teAmount - 2))) * 100;
_local2.coltrans.ra = _local1;
_local2.coltrans.ga = _local1;
_local2.coltrans.ba = _local1;
_local1 = ((100 - _local1) / 100) * 255;
_local2.coltrans.rb = _local1;
_local2.coltrans.gb = _local1;
_local2.coltrans.bb = _local1;
te.col.setTransform(_local2.coltrans);
}
}
this.lvls = new Array();
this.lvls.plain = new Array([0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 5, 6], [0, 10, 1], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [1, 0, 7], [2, 0, 7], [3, 0, 7], [4, 0, 7], [3, 0, 7], [2, 0, 0], [1, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [1, 0, 0], [2, 0, 7], [4, 0, 7], [6, 0, 7], [8, 0, 7], [6, 0, 7], [4, 0, 0], [2, 0, 51], [1, 0, 52], [0, 0, 0], [0, 0, 0], [-2, 7, 0], [-4, 7, 0], [-5, 7, 0], [-4, 7, 0], [-2, 0, 0], [0, 0, 0], [2, 0, 7], [3, 0, 7], [4, 0, 7], [4, 0, 7], [4, 0, 7], [4, 0, 7], [4, 0, 7], [3, 0, 0], [2, 0, 0], [1, 0, 0], [0, 20, 0], [0, 0, 0], [0, 0, 0], [0, 21, 0], [1, 0, 7], [2, 0, 7], [3, 0, 7], [2, 0, 7], [1, 0, 0], [0, 2, 1], [-2, 0, 0], [-3, 7, 0], [-4, 7, 0], [-5, 7, 0], [-6, 7, 0], [-7, 7, 0], [-8, 7, 0], [-8, 7, 0], [-8, 7, 0], [-8, 7, 0], [-8, 7, 0], [-7, 7, 0], [-6, 7, 0], [-5, 7, 0], [-4, 0, 0], [-3, 0, 0], [-2, 0, 0], [-1, 0, 0], [0, 0, 0], [0, 55, 0], [0, 53, 0], [0, 0, 54], [0, 0, 0], [0, 58, 50], [0, 0, 51], [0, 59, 0], [0, 0, 0], [0, 4, 9], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [1, 0, 0], [2, 52, 7], [4, 55, 7], [6, 0, 7], [6, 0, 7], [6, 0, 7], [4, 51, 7], [2, 0, 0], [0, 0, 0], [-2, 7, 52], [-4, 7, 57], [-6, 7, 0], [-8, 7, 0], [-10, 7, 58], [-8, 7, 59], [-6, 7, 0], [-4, 7, 0], [2, 0, 0], [0, 0, 0], [0, 0, 52], [0, 53, 54], [0, 0, 0], [1, 57, 7], [2, 58, 7], [3, 56, 7], [2, 0, 7], [-2, 7, 0], [-5, 7, 0], [-8, 7, 0], [-10, 7, 0], [-8, 7, 0], [-7, 7, 0], [-6, 7, 0], [-5, 7, 0], [-4, 7, 0], [-3, 7, 0], [-2, 7, 54], [-3, 7, 53], [-3, 7, 0], [-3, 7, 52], [-3, 0, 0], [-2, 0, 0], [-1, 54, 53], [0, 0, 54], [0, 0, 0], [0, 11, 1], [0, 0, 0], [0, 54, 0], [0, 0, 0], [1, 0, 0], [1, 0, 0], [2, 0, 0], [2, 20, 0], [3, 0, 7], [3, 0, 7], [3, 0, 7], [3, 0, 7], [3, 0, 0], [2, 0, 22], [2, 0, 0], [2, 0, 0], [1, 0, 0], [1, 23, 0], [0, 0, 0], [-1, 0, 0], [-1, 0, 0], [-2, 3, 8], [-2, 0, 0], [-1, 0, 0], [0, 0, 0], [0, 0, 0], [0, 1, 2], [0, 0, 0], [1, 0, 0], [2, 0, 7], [3, 0, 7], [4, 51, 7], [5, 0, 7], [6, 54, 7], [7, 0, 7], [8, 57, 7], [9, 0, 7], [10, 0, 7], [9, 0, 7], [8, 0, 7], [7, 0, 7], [6, 0, 7], [5, 55, 7], [4, 0, 7], [4, 0, 7], [3, 0, 7], [3, 0, 7], [2, 0, 0], [2, 0, 0], [1, 0, 20], [1, 53, 0], [0, 0, 0], [0, 51, 0], [0, 0, 0], [0, 0, 20], [0, 0, 0], [-1, 0, 0], [-3, 7, 0], [-5, 7, 54], [-7, 7, 0], [-8, 7, 0], [-8, 7, 0], [-7, 7, 50], [-6, 7, 51], [-4, 0, 0], [-2, 57, 53], [-1, 0, 57], [0, 0, 0], [0, 0, 0], [0, 4, 9], [0, 0, 0], [0, 0, 51], [0, 0, 0], [0, 0, 0], [0, 23, 24], [0, 0, 0], [0, 51, 52], [0, 54, 0], [-2, 7, 54], [-4, 7, 55], [-6, 7, 0], [-8, 7, 0], [-6, 7, 54], [-4, 7, 0], [-2, 0, 57], [0, 58, 59], [2, 57, 54], [4, 56, 7], [6, 55, 7], [8, 0, 7], [6, 53, 7], [4, 51, 7], [2, 50, 0], [1, 52, 51], [0, 0, 0], [0, 0, 57], [0, 56, 0], [0, 58, 59], [1, 0, 57], [1, 55, 0], [2, 52, 53], [2, 0, 7], [3, 51, 7], [3, 0, 7], [5, 53, 7], [8, 56, 7], [10, 0, 7], [10, 52, 7], [10, 0, 7], [7, 57, 7], [4, 58, 7], [3, 0, 7], [2, 0, 7], [2, 56, 0], [2, 0, 0], [2, 0, 51], [2, 58, 0], [2, 59, 56], [2, 0, 0], [2, 52, 51], [1, 55, 0], [1, 0, 0], [0, 0, 0], [0, 3, 8], [0, 0, 0], [0, 0, 0], [-2, 7, 0], [-4, 7, 0], [-6, 7, 52], [-4, 7, 0], [-2, 55, 54], [0, 0, 56], [2, 57, 7], [4, 0, 7], [6, 59, 7], [8, 58, 7], [6, 0, 7], [4, 56, 7], [2, 0, 0], [0, 54, 55], [-2, 7, 0], [-4, 7, 52], [-6, 7, 0], [-8, 7, 51], [-10, 7, 0], [-8, 7, 0], [-6, 7, 50], [-4, 7, 0], [-2, 7, 0], [-2, 7, 52], [-2, 7, 53], [-3, 7, 0], [-4, 7, 54], [-5, 7, 0], [-7, 7, 0], [-9, 7, 56], [-10, 7, 55], [-10, 7, 0], [-10, 7, 0], [-9, 7, 0], [-9, 7, 0], [-7, 7, 0], [-5, 7, 0], [-2, 0, 0], [0, 51, 50], [0, 58, 59], [0, 57, 0], [0, 0, 0], [0, 0, 0], [0, 11, 1], [0, 0, 0], [-1, 0, 0], [-1, 0, 0], [-2, 55, 51], [-2, 0, 52], [-3, 0, 0], [-3, 53, 65], [-3, 7, 64], [-4, 7, 0], [-4, 7, 65], [-4, 7, 0], [-4, 7, 0], [-4, 7, 0], [-3, 0, 54], [-3, 51, 50], [-3, 0, 0], [-3, 52, 63], [-3, 55, 59], [-3, 65, 0], [-2, 0, 64], [-2, 0, 0], [-2, 56, 52], [-1, 61, 65], [0, 60, 63], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 100, 1], [-3, 7, 60], [-5, 7, 61], [-7, 7, 63], [-4, 7, 51], [-1, 65, 52], [2, 64, 65], [5, 0, 7], [8, 0, 7], [10, 0, 7], [12, 65, 7], [13, 64, 7], [10, 59, 7], [7, 0, 7], [3, 61, 0], [1, 0, 62], [0, 64, 63], [0, 65, 59], [2, 63, 0], [4, 58, 58], [7, 57, 7], [8, 0, 7], [5, 51, 7], [2, 61, 64], [-1, 65, 52], [-4, 7, 56], [-7, 7, 55], [-8, 7, 0], [-9, 7, 62], [-7, 7, 59], [-4, 7, 58], [-1, 64, 0], [2, 60, 61], [5, 64, 7], [7, 65, 7], [8, 50, 7], [7, 0, 7], [7, 51, 7], [7, 0, 7], [7, 65, 7], [5, 64, 7], [3, 65, 65], [2, 63, 62], [1, 62, 61], [0, 65, 64], [0, 64, 65], [0, 54, 55], [0, 0, 64], [0, 51, 54], [0, 0, 65], [0, 0, 64], [0, 0, 0], [0, 0, 0], [0, 21, 22], [0, 0, 65], [0, 64, 58], [3, 61, 60], [6, 63, 7], [9, 60, 7], [12, 62, 7], [11, 63, 7], [10, 64, 7], [9, 60, 7], [7, 61, 7], [5, 62, 7], [3, 64, 60], [2, 65, 64], [1, 0, 65], [0, 0, 0], [0, 23, 24], [0, 56, 65], [0, 64, 57], [3, 62, 61], [6, 60, 7], [9, 62, 7], [12, 63, 7], [11, 62, 7], [10, 63, 7], [7, 62, 7], [4, 61, 7], [2, 63, 64], [0, 60, 65], [0, 0, 0], [-3, 61, 65], [-6, 7, 64], [-9, 7, 0], [-6, 7, 50], [-3, 54, 52], [-2, 0, 54], [1, 59, 64], [2, 65, 51], [2, 0, 64], [2, 64, 65], [2, 61, 62], [2, 62, 63], [3, 65, 63], [3, 60, 61], [3, 100, 1], [3, 100, 1], [3, 100, 1], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 61, 63], [0, 63, 64], [0, 62, 62], [0, 61, 63], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 61, 50], [1, 63, 62], [2, 64, 65], [2, 65, 54], [2, 0, 0], [2, 0, 0], [1, 0, 0], [0, 0, 0], [0, 11, 1], [0, 0, 0], [0, 0, 64], [0, 54, 65], [0, 0, 64], [2, 0, 7], [3, 0, 7], [6, 65, 7], [3, 0, 7], [2, 64, 65], [0, 65, 64], [0, 20, 20], [0, 64, 0], [2, 0, 65], [4, 0, 7], [7, 0, 7], [4, 0, 7], [2, 21, 22], [0, 0, 65], [2, 65, 7], [3, 61, 7], [7, 55, 7], [6, 54, 7], [5, 0, 7], [2, 62, 63], [-2, 64, 51], [-3, 7, 0], [-5, 7, 52], [-4, 7, 0], [-3, 7, 58], [-2, 7, 59], [-3, 7, 51], [-7, 7, 0], [-3, 7, 60], [0, 65, 64], [0, 62, 0], [0, 63, 52], [0, 57, 55], [0, 59, 62], [0, 0, 58], [-3, 7, 60], [-6, 7, 55], [-8, 7, 59], [-7, 7, 63], [-5, 7, 57], [-3, 7, 64], [-1, 60, 61], [0, 63, 56], [0, 53, 52], [0, 0, 64], [2, 51, 0], [3, 65, 7], [4, 0, 7], [4, 0, 7], [4, 54, 7], [4, 54, 7], [4, 0, 7], [3, 0, 7], [3, 0, 7], [3, 0, 7], [3, 0, 7], [3, 0, 0], [0, 2, 1], [-3, 7, 0], [-6, 7, 0], [-9, 7, 0], [-12, 7, 55], [-13, 7, 56], [-12, 7, 0], [-10, 7, 58], [-8, 7, 59], [-5, 7, 51], [-2, 64, 0], [-1, 56, 52], [2, 0, 65], [4, 0, 7], [5, 0, 7], [4, 0, 7], [2, 55, 54], [1, 0, 0], [0, 59, 0], [0, 0, 58], [0, 58, 57], [0, 0, 53], [0, 0, 0], [3, 52, 7], [7, 51, 7], [9, 0, 7], [6, 54, 54], [3, 55, 56], [2, 56, 57], [0, 1, 2], [3, 52, 7], [5, 53, 7], [4, 54, 7], [2, 55, 7], [1, 59, 7], [2, 58, 7], [5, 54, 7], [7, 52, 7], [10, 50, 7], [12, 51, 7], [13, 59, 7], [10, 57, 7], [7, 56, 7], [5, 55, 7], [3, 50, 52], [1, 51, 53], [0, 56, 54], [0, 57, 58], [0, 59, 56], [0, 58, 59], [-3, 7, 52], [-5, 7, 53], [-6, 7, 52], [-6, 7, 51], [-5, 7, 53], [-5, 7, 58], [-4, 7, 59], [-4, 7, 58], [-3, 55, 57], [-3, 52, 56], [-2, 58, 59], [-2, 59, 52], [-1, 57, 53], [0, 52, 0], [0, 57, 54], [0, 54, 0], [0, 58, 53], [3, 0, 52], [6, 53, 7], [7, 55, 7], [5, 56, 7], [3, 57, 7], [2, 59, 56], [1, 58, 52], [0, 59, 53], [0, 57, 54], [0, 56, 52], [2, 57, 53], [3, 56, 7], [5, 58, 7], [4, 59, 7], [2, 51, 52], [1, 50, 53], [0, 59, 54], [0, 60, 55], [0, 54, 50], [0, 53, 0], [0, 0, 0], [0, 56, 64], [0, 0, 54], [0, 55, 65], [0, 58, 0], [0, 0, 56], [0, 52, 53], [0, 0, 54], [0, 58, 59], [0, 54, 54], [0, 0, 0], [0, 11, 1], [0, 0, 0], [0, 57, 54], [0, 56, 0], [0, 0, 0], [0, 0, 0], [0, 4, 9], [0, 0, 0], [0, 51, 52], [0, 54, 58], [0, 2, 1], [-1, 65, 57], [-3, 7, 64], [-6, 7, 0], [-8, 7, 65], [-10, 7, 0], [-11, 7, 0], [-11, 7, 53], [-11, 7, 52], [-10, 7, 0], [-9, 7, 0], [-7, 7, 51], [-6, 7, 58], [-5, 7, 0], [-8, 7, 59], [-11, 7, 0], [-13, 7, 0], [-10, 7, 52], [-7, 7, 0], [-3, 7, 53], [-2, 0, 57], [-1, 65, 64], [0, 0, 54], [0, 54, 0], [0, 0, 0], [0, 0, 64], [2, 65, 0], [5, 0, 0], [6, 0, 7], [6, 0, 7], [6, 0, 7], [5, 0, 7], [2, 0, 0], [1, 0, 0], [1, 23, 24], [1, 0, 0], [1, 0, 0], [2, 0, 0], [2, 0, 0], [2, 20, 20], [2, 64, 0], [2, 0, 0], [2, 0, 0], [2, 0, 0], [1, 23, 24], [0, 0, 0], [-1, 0, 65], [-2, 0, 0], [-2, 0, 0], [-2, 2, 1], [-2, 7, 0], [-3, 7, 0], [-3, 7, 0], [-3, 7, 0], [-6, 7, 0], [-9, 7, 0], [-11, 7, 0], [-12, 7, 0], [-12, 7, 0], [-12, 7, 0], [-10, 7, 0], [-8, 7, 0], [-6, 7, 0], [-4, 7, 0], [-2, 0, 0], [-1, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [2, 0, 0], [4, 0, 0], [6, 0, 7], [7, 0, 7], [7, 0, 7], [7, 0, 7], [7, 0, 7], [7, 0, 7], [7, 0, 7], [7, 0, 7], [5, 0, 7], [3, 0, 0], [2, 0, 0], [1, 0, 0], [0, 64, 0], [0, 61, 65], [0, 60, 62], [0, 100, 1], [1, 100, 1], [2, 100, 1], [3, 100, 1], [4, 100, 1], [5, 100, 1], [6, 100, 1], [7, 100, 1], [8, 100, 1], [9, 100, 1], [10, 100, 1], [8, 63, 7], [5, 62, 7], [2, 61, 7], [-1, 63, 65], [-4, 7, 64], [-7, 7, 0], [-9, 7, 54], [-11, 7, 0], [-8, 7, 0], [-5, 7, 64], [-3, 65, 0], [-1, 0, 63], [0, 64, 63], [0, 61, 60], [0, 63, 62], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 100, 1], [0, 0, 54], [0, 50, 0], [0, 0, 0], [0, 0, 0], [0, 20, 20], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 23, 24], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 12, 1], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 13, 14], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]);
this.level = _root.level;
this.lvl = this.lvls[this.level];
this.tes = new Array();
this.bufferOffX = new Array();
this.bufferCurve = new Array();
this.coltrans = new Object();
this.bots = new Array();
this.botBases = new Array();
this.botBases[0] = {x:-1, z:0};
this.botBases[1] = {x:0, z:0};
this.botBases[2] = {x:1, z:0};
this.botBases[3] = {x:-1, z:1};
this.botBases[4] = {x:0, z:1};
this.botBases[5] = {x:1, z:1};
this.pl = new Object();
init();
if (_root.version eq "") {
levedAlter = function (element, d, value, offset) {
var _local1 = this;
offset = int(offset);
var _local3 = _local1.lvl[(_local1.lvlReadPointer - 4) % _local1.lvl.length][element];
if (int(d) != 0) {
value = _local3 + d;
}
if (element > 0) {
if ((((((((value == 2) || (value == 15)) || (value == 16)) || (value == 17)) || (value == 10)) || (value == 11)) || (value == 12)) || (value == 100)) {
if (element == 1) {
_local1.levedAlter(2, 0, 1);
}
} else if ((((((((_local3 == 2) || (_local3 == 15)) || (_local3 == 16)) || (_local3 == 17)) || (_local3 == 10)) || (_local3 == 11)) || (_local3 == 12)) || (_local3 == 100)) {
if (element == 1) {
_local1.levedAlter(2, 0, 0);
}
}
}
_local1.lvl[((_local1.lvlReadPointer - 4) + offset) % _local1.lvl.length][element] = value;
_local1.levedPrint();
_local1.lvlReadPointer = _local1.lvlReadPointer - _local1.teAmount;
var _local2 = 0;
while (_local2 < _local1.teAmount) {
_local1.lvlRead((_local1.offTe + _local2) % _local1.teAmount);
_local2++;
}
};
levedRead = function (element, offset) {
var _local1 = this;
return(_local1.lvl[((_local1.lvlReadPointer - 4) + offset) % _local1.lvl.length][element]);
};
levedPrint = function () {
var _local1 = this;
var pos = (_local1.lvlReadPointer - 4);
var _local3 = 0;
var angle = 0;
var drawX = 125;
var drawY = 200;
var i = pos;
while (i < (pos + 12)) {
var _local2 = _root["block" + _local3];
if (i == pos) {
_local2.gotoAndStop(2);
} else {
_local2._alpha = 40;
}
var curve = _local1.lvl[i % _local1.lvl.length][0];
_local2._x = drawX;
_local2._y = drawY;
_local2._rotation = angle;
_local2.d0.gotoAndStop(_local1.lvl[i % _local1.lvl.length][1] + 1);
_local2.d1.gotoAndStop(_local1.lvl[i % _local1.lvl.length][2] + 1);
_local2.swapDepths(10000 - _local3);
angle = angle - curve;
drawY = drawY - (Math.cos((angle / 180) * 3.141593) * 15);
drawX = drawX + (Math.sin((angle / 180) * 3.141593) * 15);
_local3++;
i++;
}
var angle = 0;
var drawX = 125;
var drawY = 200;
var i = pos;
while (i > (pos - 12)) {
var _local2 = _root["block" + _local3];
if (i == pos) {
_local2.gotoAndStop(2);
} else {
_local2._alpha = 40;
}
var curve = _local1.lvl[i % _local1.lvl.length][0];
_local2._x = drawX;
_local2._y = drawY;
_local2._rotation = angle;
_local2.d0.gotoAndStop(_local1.lvl[i % _local1.lvl.length][1] + 1);
_local2.d1.gotoAndStop(_local1.lvl[i % _local1.lvl.length][2] + 1);
_local2.swapDepths(11000 + _local3);
angle = angle + curve;
drawY = drawY + (Math.cos((angle / 180) * 3.141593) * 15);
drawX = drawX - (Math.sin((angle / 180) * 3.141593) * 15);
_local3++;
i--;
}
};
Key.addListener(this);
this.onKeyDown = function () {
var _local1 = this;
var code = Key.getCode();
if ((code >= 48) && (code < 58)) {
_local1.levedInput = (_local1.levedInput + "") + (code - 48);
} else {
switch (code) {
case 220 :
_local1.levedInput = "";
return;
case 67 :
var _local3 = 0;
var polarity = 0;
polarity = int(_local1.levedRead(0, 0)) > 0;
while ((int(_local1.levedRead(0, _local3)) != 0) && (int(_local1.levedRead(0, _local3)) == polarity)) {
_local1.levedAlter(0, 0, 0, _local3);
_local3++;
}
_local3 = -1;
while ((int(_local1.levedRead(0, _local3)) != 0) && (int(_local1.levedRead(0, _local3)) == polarity)) {
_local1.levedAlter(0, 0, 0, _local3);
_local3--;
}
return;
case 68 :
_local1.levedDeko = int(_local1.levedInput);
return;
case 73 :
_local1.levedCurveIn = int(_local1.levedInput);
var curve = _local1.levedRead(0, 0);
_local3 = 0;
while (_local3 < _local1.levedCurveIn) {
var c = Math.round(curve * ((_local1.levedCurveIn - _local3) / _local1.levedCurveIn));
_local1.levedAlter(0, 0, c, -1 * _local3);
_local3++;
}
return;
case 76 :
_local3 = 0;
while (_local3 < 24) {
_root.attachMovie("block", "block" + _local3, 100 + _local3);
_root["block" + _local3]._xscale = (_root["block" + _local3]._yscale = 200);
_local3++;
}
_local1.levedPrint();
return;
case 79 :
_local1.levedCurveOut = int(_local1.levedInput);
var curve = _local1.levedRead(0, 0);
_local3 = 0;
while (_local3 < _local1.levedCurveOut) {
var c = Math.round(curve * ((_local1.levedCurveOut - _local3) / _local1.levedCurveOut));
_local1.levedAlter(0, 0, c, _local3);
_local3++;
}
return;
case 84 :
_local1.levedCurveThreshold = int(_local1.levedInput);
var curve = _local1.levedRead(0, 0);
_local3 = 0;
while (_local3 < _local1.levedCurveThreshold) {
_local1.levedAlter(0, 0, curve, _local3);
_local3++;
}
return;
case 88 :
var track = _local1.lvl;
_local3 = 0;
while (_local3 < track.length) {
var _local2 = track[_local3];
trace((((((("[" + _local2[0]) + ", ") + _local2[1]) + ", ") + _local2[2]) + "], ") + ((_local2.comment ne "") ? ("// " + _local2.comment) : ""));
_local3++;
}
return;
case 45 :
if (Key.isDown(16) && (Key.isDown(17))) {
_local1.levedDeko = _local1.levedRead(1, 0);
} else if (Key.isDown(16)) {
_local1.levedAlter(1, 1, 0);
_local1.levedDeko = _local1.levedRead(1, 0);
} else {
_local1.levedAlter(1, 0, int(_local1.levedDeko));
}
return;
case 33 :
if (Key.isDown(16) && (Key.isDown(17))) {
_local1.levedDeko = _local1.levedRead(2, 0);
} else if (Key.isDown(16)) {
_local1.levedAlter(2, 1, 0);
_local1.levedDeko = _local1.levedRead(2, 0);
} else {
_local1.levedAlter(2, 0, int(_local1.levedDeko));
}
return;
case 46 :
if (Key.isDown(16)) {
_local1.levedAlter(1, -1, 0);
_local1.levedDeko = _local1.levedRead(1, 0);
}
return;
case 34 :
if (Key.isDown(16)) {
_local1.levedAlter(2, -1, 0);
_local1.levedDeko = _local1.levedRead(2, 0);
}
return;
case 32 :
if (_local1.pl.vz == 0) {
_local1.pl.vz = 0.225;
} else {
_local1.pl.vz = 0;
}
return;
case 16 :
case 17 :
return;
}
}
};
}
Symbol 163 MovieClip Frame 2
draw();
Symbol 163 MovieClip Frame 3
gotoAndPlay (2);
Symbol 169 MovieClip Frame 1
stop();
Symbol 171 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 11
play();
Symbol 184 MovieClip Frame 12
if (Math.abs(_root.w.pl.vz) < 0.02) {
prevFrame();
}
Symbol 184 MovieClip Frame 13
gotoAndStop (1);
Symbol 184 MovieClip Frame 19
_root.snd.fadeChannel(_root.sndChannelMusic, 1, 15);
_root.snd.fadeChannel(_root.sndChannelMotor, 1, 15);
_root.snd.fadeChannel(_root.sndChannelSqueal, 1, 15);
Symbol 184 MovieClip Frame 63
gotoAndStop (1);
Symbol 184 MovieClip Frame 87
_root.snd.playEvent("sndMarks");
Symbol 184 MovieClip Frame 122
_root.snd.playEvent("sndSet");
Symbol 184 MovieClip Frame 157
_parent.go();
_root.snd.playEvent("sndGo");
_root.snd.fadeChannel(_root.sndChannelMotors, 0, 20);
_root.snd.playEvent("sndRaceStart", 0.5);
_root.sndChannelAmbience = _root.snd.playLoop("sndRaceAmbience", 0);
_root.snd.fadeChannel(_root.sndChannelAmbience, 0.5, 100);
Symbol 184 MovieClip Frame 169
gotoAndStop (1);
Symbol 192 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 1
function resetFps() {
this.frames = 0;
this.ms = getTimer();
}
function score(ifInit, ifFinish) {
var _local1 = this;
var _local3 = _root;
var resttime = Math.max(0, time - (getTimer() - timestamp));
timestamp = getTimer();
_local1.timeScore = getTimer();
if (!ifInit) {
var _local2 = Math.max(int(resttime), 0);
var checkpointId = _local3.statistics[_local3.level].checkpoints.length;
var multibonus = checkpointId;
_local2 = _local2 * multibonus;
_local1.actScore = _local1.actScore + _local2;
if (_local2 > 0) {
_local1.titles.bonus = (multibonus + " x Bonus: ") + _local2;
} else {
_local1.titles.bonus = "No Bonus";
}
var statsObj = _local3.statistics[_local3.level].checkpoints[_local3.statistics[_local3.level].checkpoints.length - 1];
statsObj.bonus = _local2;
statsObj.time = getTimer() - _local1.checkpointTimestamp;
_local1.checkpointTimestamp = getTimer();
if (ifFinish) {
_local3.snd.playEvent("sndFinish");
_local1.titles.title = "Finish!";
} else {
_local3.snd.playEvent("sndCheckpoint");
_local1.titles.title = "Checkpoint!";
}
trace("gap check!");
_local1.titles.gotoAndPlay("checkpoint");
} else {
_local1.checkpointTimestamp = getTimer();
_local1.time = 0;
resttime = 0;
}
_local1.time = resttime + 30000;
_local1.warn = 6;
}
function go() {
resetFps();
score(true);
_root.w.phase = 1;
_root.w.startBots();
this.gotoAndPlay("loop");
}
actScore = 0;
timeScore = -100000;
timeDisplay = 30;
timeDisplayTenth = ".0";
Symbol 201 MovieClip Frame 7
stop();
titles.gotoAndPlay("markssetgo");
Symbol 201 MovieClip Frame 8
mph = int(_root.w.pl.vz * 800);
tacho.gotoAndStop(int(_root.w.pl.vz * 380) + 1);
meter.gotoAndStop(int((this.pos / _root.w.lvl.length) * 100) + 1);
scoreD = int(actScore);
timeD = time - (getTimer() - timestamp);
if ((timeD < 0) && (_root.version ne "nkcheat")) {
timeD = 0;
if (_root.w.phase == 1) {
_root.w.phase = 2;
this.titles.title = "Time Out!";
this.titles.bonus = "";
_root.snd.fadeChannel(_root.sndChannelMusic, 0, 15);
_root.snd.fadeChannel(_root.sndChannelMotor, 0, 15);
_root.snd.fadeChannel(_root.sndChannelSqueal, 0, 15);
this.titles.gotoAndPlay("checkpoint");
_root.snd.playEvent("sndTimeout");
}
}
timeDisplay = int(timeD / 1000);
if (timeDisplay < 10) {
timeDisplay = "0" + timeDisplay;
}
timeDisplayTenth = "." + (int(timeD / 100) % 10);
if (timeDisplay < warn) {
if (warn > 1) {
_root.snd.playEvent("sndTimer");
}
mcTime.play();
warn--;
}
fps = Math.floor(((frames++) / (getTimer() - ms)) * 10000) / 10;
pos = _root.w.offTe;
if (Key.isDown(8)) {
timestamp = getTimer();
time = 30000;
resetFps();
}
Symbol 201 MovieClip Frame 9
gotoAndPlay (8);
Symbol 208 Button
on (press) {
_root.gotoAndPlay("my");
}
Symbol 210 Button
on (release) {
getURL ("http://www.startgames.ws", "_blank");
}