Frame 1
play();
loadframe = 24;
loadfinished = "menuload";
Instance of Symbol 57 MovieClip "session" in Frame 1
onClipEvent (load) {
result = 0;
loadVariables ("/bin/getSessionStatus.php", this, "GET");
onEnterFrame = function () {
result = int(result);
gotoAndStop(result + 1);
};
}
Frame 2
play();
Instance of Symbol 65 MovieClip "preloaderGrfx" in Frame 2
//component parameters
onClipEvent (initialize) {
mcLoader = "_root";
}
onClipEvent (load) {
this.percent.display = "0%";
this.percent._x = 260;
this.loaderbar._xscale = 0;
this.loadText = "LOADING";
this.initialized = true;
}
onClipEvent (enterFrame) {
if (this.initialized) {
this.percent.display = _parent.displayLoaded + "%";
this.percent._x = (260 + _parent.displayLoaded) - 0.5;
this.loaderbar._xscale = _parent.displayLoaded;
}
}
Frame 3
gotoAndPlay(_currentframe - 1);
displayLoaded = Math.floor((getBytesLoaded() / getBytesTotal()) * 100);
ifFrameLoaded (loadframe) {
gotoAndStop(loadfinished);
}
Frame 9
function newSound(name) {
var soundholder = soundboard.createEmptyMovieClip("SoundClip_" + soundnum, soundnum);
tsound = (soundboard["Sound_" + soundnum] = new Sound(soundholder));
tsound.attachSound(name);
soundnum++;
return(tsound);
}
function newMusic(name) {
var soundholder = soundboard.createEmptyMovieClip("MusicClip", 0);
tsound = (soundboard.music = new Sound(soundholder));
tsound.attachSound(name);
return(tsound);
}
if (soundboard == undefined) {
sounds = 1;
musics = 1;
soundnum = 1;
soundboard = createEmptyMovieClip("soundboard", 64);
}
if (thequality == undefined) {
thequality = "low";
}
_quality = "high";
onEnterFrame = null;
c0.stop();
c1.stop();
sdeath.stop();
srocketlaunch.stop();
sJump.stop();
sLand.stop();
sTurbo.stop();
sClick.stop();
sCheckpoint.stop();
sSkid.stop();
sWinner.stop();
sLoser.stop();
sTurboGet.stop();
sRocketGet.stop();
s1.stop();
s2.stop();
s3.stop();
sGo.stop();
music.stop();
music = newMusic("music0");
music.setVolume(50);
if (musics) {
music.start(0, 99999);
}
fps.removeMovieClip("");
world.removeMovieClip("");
over.removeMovieClip("");
display.removeMovieClip("");
Frame 10
function setMap(str) {
mapd = str.split("|");
AIlev = Math.min(100, int(mapd[0])) / 100;
ocar = int(mapd[1]);
tileset = mapd[2];
mapa = mapd[3].split("#");
mapname = unescape(mapd[4]);
var y = 0;
while (y < mapa.length) {
mapa[y] = mapa[y].split(";");
var x = 0;
while (x < mapa[y].length) {
mapa[y][x] = mapa[y][x].split(",");
var z = 0;
while (z < mapa[y][x].length) {
mapa[y][x][z] = int(mapa[y][x][z]);
z++;
}
x++;
}
y++;
}
}
function starterMap() {
if (importer != null) {
maparr[startmap] = importer;
}
setMap(maparr[startmap]);
if (tileset == "n") {
loadframe = 85;
mapframe = "ngamestart";
} else if (tileset == "i") {
loadframe = 100;
mapframe = "igamestart";
} else {
loadframe = 70;
mapframe = "dgamestart";
}
if (getBytesLoaded() >= getBytesTotal()) {
if (carSetup == undefined) {
gotoAndStop (50);
} else {
gotoAndStop(mapframe);
}
} else {
loadfinished = "code";
gotoAndPlay (2);
}
}
stop();
_quality = "high";
Stage.scaleMode = "noScale";
secretpopup = "";
pcar = 0;
score = 0;
grandtotaltime = 0;
startmap = 0;
maparrn = new Array();
maparrn[0] = "80|2|n|31,0;32,0;4,0;8,0;5,0;1,0;2,0#1,0;3,0;9,0;33,0;9,0;3,0;31,0#4,0;8,0;6,3;1,0;7,2;8,0;5,0#14,0;32,0;31,0;2,0;3,0;31,0;24,0#7,0;8,0;5,2;33,0;4,1;8,0;6,0#31,0;3,0;9,0;34,0;9,0;3,0;33,0#32,0;33,0;7,0;8,0;6,0;1,0;2,0|Mean%20Streets";
maparrn[1] = "80|1|n|2,0;4,0;13,0;25,0;5,0;3,0;34,0;3,0#31,0;9,0;3,0;32,0;9,0;4,0;25,0;5,0#4,0;6,0;33,0;4,0;6,0;16,0;31,0;9,0#9,1;34,0;1,0;7,0;5,0;7,0;5,0;18,0#26,0;3,0;2,0;4,0;6,0;4,0;6,0;2,0#7,0;5,0;33,0;7,0;5,0;7,0;5,0;28,0#1,0;9,0;32,0;1,0;7,0;25,3;6,0;9,1#31,0;7,0;11,0;8,2;8,0;23,0;8,0;6,0|NostrumX%27s%20Getaway";
maparrn[2] = "90|3|n|4,0;8,0;5,0;3,0;33,0;31,0;4,0;8,0;5,0#9,0;4,1;10,0;5,1;1,0;4,3;10,0;5,3;9,0#9,0;9,3;26,0;9,3;32,0;9,1;26,0;9,1;9,0#9,0;7,1;10,0;6,1;1,0;7,3;10,0;6,3;9,0#14,0;31,0;9,0;34,0;3,0;33,0;9,0;34,0;24,0#9,0;1,0;7,0;8,0;15,0;8,0;6,0;1,0;9,0#9,0;2,0;3,0;1,0;3,0;32,0;1,0;31,0;9,0#7,0;8,0;17,0;31,0;27,0;8,0;8,0;8,0;6,0|Alien%20Alley%20Ambush";
maparrn[3] = "90|0|n|4,0;11,0;8,0;11,0;5,0;32,0;4,0;5,0;31,0;1,0#7,0;5,2;2,0;33,0;26,0;3,0;30,0;26,0;2,0;3,0#4,0;6,0;32,0;3,0;7,0;8,1;29,0;9,2;19,0;5,0#7,3;5,0;4,0;13,1;5,0;1,0;20,0;7,0;13,0;6,0#33,0;26,0;9,0;34,0;26,0;4,0;6,0;33,0;31,0;32,0#31,0;18,0;30,0;4,0;6,0;9,0;31,0;3,0;1,0;2,0#4,0;8,0;11,0;6,0;34,0;24,0;34,0;1,0;1,0;1,0#9,0;28,0;20,0;31,0;3,0;26,0;2,0;1,0;3,0;1,0#26,0;7,32;6,0;4,0;5,0;9,0;32,0;3,0;1,0;1,0#7,0;11,0;8,0;6,0;7,1;6,0;1,0;31,0;1,0;1,0|Wonder%20Wall%20City";
maparrn[4] = "90|4|n|34,0;4,0;5,0;1,0;4,0;13,2;5,0;34,0#4,0;6,3;9,0;32,0;30,0;2,0;7,0;5,0#7,0;5,0;26,0;1,0;3,0;31,0;4,0;6,0#4,3;6,0;9,1;33,0;20,0;34,0;9,1;33,0#26,0;2,0;7,0;29,0;12,0;19,0;6,0;1,0#7,32;25,0;5,0;2,0;7,0;5,0;3,0;2,0#3,0;4,2;6,0;1,0;4,0;6,0;4,0;5,0#1,0;7,0;5,0;33,0;12,0;31,0;9,2;26,0#4,0;5,0;7,0;17,0;9,0;27,0;6,0;14,0#26,0;9,1;31,0;2,0;24,0;32,0;4,0;6,0#16,2;7,0;25,0;11,0;6,0;3,0;7,0;5,0#7,0;29,0;33,0;19,3;29,0;3,0;19,3;6,0|Black%20Hole%20Blues";
maparrn[5] = "100|0|n|4,0;8,0;5,0;32,0;4,0;25,0;8,0;5,0;31,0;33,0;4,0;5,0#9,0;34,0;30,0;3,0;9,0;4,0;17,0;12,0;27,0;25,0;6,0;9,0#7,0;8,1;25,0;21,0;6,0;26,0;34,0;9,0;3,0;32,0;2,0;14,32#32,0;31,0;20,0;31,0;33,0;7,0;25,0;6,0;4,0;25,0;5,0;9,0#4,0;8,2;6,0;3,0;1,0;31,0;2,0;3,0;9,0;2,0;7,0;6,0#26,0;1,0;4,0;8,0;5,0;4,0;25,0;29,0;12,32;19,0;5,0;33,0#9,0;3,0;26,0;32,0;9,0;14,32;31,0;33,0;26,0;32,0;26,0;34,0#7,0;29,0;9,0;19,0;6,0;7,0;8,0;5,0;7,0;25,0;6,0;3,0#31,0;2,0;7,0;8,0;11,0;11,0;8,0;6,0;1,0;31,0;1,0;3,0|Power%20Pie%20500";
maparrn[6] = "100|3|n|2,0;4,0;8,0;8,0;17,0;27,0;21,0;8,0;5,0;2,0#31,0;7,0;8,0;8,1;5,0;4,0;8,1;8,0;6,0;3,0#32,0;1,0;33,0;34,0;9,2;9,2;31,0;32,0;34,0;33,0#4,0;25,0;13,2;8,0;6,0;7,0;8,0;8,2;25,0;5,0#7,0;8,0;25,0;8,0;5,0;4,0;8,0;25,0;8,0;6,0#1,0;4,3;8,0;25,0;6,0;7,0;25,0;8,0;5,3;3,0#34,0;7,0;25,0;8,0;5,3;4,3;8,0;25,0;6,0;32,0#3,0;31,0;4,0;25,0;6,2;7,1;25,0;5,0;2,0;1,0#1,0;2,0;7,0;8,3;11,0;11,0;8,3;6,0;34,0;33,0|Evilgold%27s%20Run";
maparrd = new Array();
maparrd[0] = "50|3|d|3,0;1,0;4,0;8,0;5,0#1,0;32,0;9,0;2,0;14,2#4,0;29,0;9,3;19,0;6,0#9,1;31,0;26,0;1,0;33,0#7,0;21,0;6,0;34,0;3,0|The%20Dig";
maparrd[1] = "60|2|d|4,0;15,0;5,0;34,0;3,0#9,0;32,0;26,0;1,0;31,0#18,0;1,0;7,0;25,0;5,0#31,0;3,0;2,0;3,0;9,2#28,0;1,0;4,0;21,0;6,0#14,0;33,0;9,1;34,0;32,0#7,2;25,0;6,0;33,0;1,0|Adelgar%20Gorge";
maparrd[2] = "70|0|d|4,0;8,0;17,0;3,0;27,0;8,0;5,0#9,0;2,0;1,0;31,0;1,0;34,0;9,1#9,2;3,0;4,0;8,0;5,0;1,0;14,0#30,0;1,0;9,0;31,0;18,0;3,0;9,0#33,0;1,0;7,0;8,2;11,0;8,0;6,0#20,0;34,0;1,0;3,0;28,0;1,0;1,0#7,0;8,0;23,0;8,3;6,0;32,0;33,0|HillPaul%20Crater";
maparrd[3] = "85|4|d|4,0;8,0;5,0;33,0;1,0;3,0;4,0;8,32;5,0#9,0;2,0;9,0;1,0;1,0;1,0;9,0;31,0;9,0#9,1;3,0;16,2;34,0;2,0;3,0;26,0;33,0;9,0#7,0;25,0;10,0;25,0;21,0;8,0;10,0;13,1;6,0#3,0;1,0;9,0;33,0;1,0;1,0;26,0;32,0;1,0#1,0;31,0;9,0;1,0;1,0;34,0;9,0;1,0;3,0#4,0;29,0;12,0;19,0;8,0;11,0;6,0;31,0;1,0#9,2;3,0;16,0;3,0;1,0;33,0;1,0;1,0;1,0#7,0;8,0;6,0;32,0;1,0;1,0;1,0;1,0;1,0|Strange%20Frontiers";
maparrd[4] = "90|1|d|4,0;8,0;5,0;3,0;33,0;4,0;11,0;5,0#9,0;32,0;26,0;1,0;3,0;9,0;34,0;9,0#26,0;1,0;18,0;1,0;1,0;30,0;3,0;14,2#24,0;1,0;2,0;3,0;1,0;31,0;1,0;26,0#9,32;33,0;28,0;1,0;3,0;20,0;2,0;9,0#7,0;29,0;26,0;19,0;29,32;26,0;19,0;6,0#3,0;31,0;9,0;1,0;34,0;9,0;32,0;1,0#1,0;33,0;7,0;11,2;13,1;6,0;1,0;33,0|The%20Wastelands";
maparrd[5] = "95|0|d|1,0;1,0;1,0;3,0;4,0;25,0;11,0;25,0;5,0#3,0;1,0;3,0;1,0;9,0;1,0;2,0;4,0;6,0#1,0;34,0;1,0;2,0;22,0;1,0;33,0;7,32;5,0#1,0;3,0;4,0;5,0;9,0;34,0;1,0;4,0;6,0#1,0;1,0;12,0;7,0;6,0;3,0;1,0;16,0;3,0#3,0;33,0;7,0;8,0;5,0;1,0;3,0;26,0;1,0#1,0;4,0;8,0;17,0;9,1;27,3;5,0;30,0;3,0#3,0;26,0;31,0;4,0;6,0;1,0;7,0;8,32;5,0#4,32;6,0;3,0;7,0;5,0;3,0;34,0;20,0;9,0#9,0;3,0;2,0;4,0;6,0;4,0;8,1;6,0;14,0#7,0;5,0;1,0;7,32;5,0;26,0;31,0;4,0;6,0#3,0;7,0;25,0;15,0;6,0;7,0;25,0;6,0;2,0|Million%20Mile%20Desert";
maparrd[6] = "95|1|d|4,0;5,0;31,0;1,0;3,0;34,0;1,0;3,0;32,0#14,0;30,0;2,0;3,0;32,0;3,0;33,0;4,0;5,0#7,0;11,0;8,0;25,0;5,0;31,0;2,0;18,0;26,0#32,0;20,0;4,0;25,0;6,3;34,0;4,0;11,0;6,2#4,0;6,0;7,3;25,0;8,0;5,0;9,0;28,0;3,0#7,2;5,0;3,0;4,0;8,0;6,3;24,0;7,0;5,1#4,0;6,0;31,0;9,0;1,0;32,0;9,2;31,0;12,0#7,0;15,0;29,0;12,3;19,2;29,0;12,0;19,0;6,0#3,0;1,0;2,0;7,0;8,0;8,1;6,0;2,0;3,0|Lonewolf%20Mesa";
maparri = new Array();
maparri[0] = "80|1|i|1,0;4,0;25,0;21,0;25,0;8,0;5,0;1,0#4,0;6,2;31,0;33,0;4,0;8,2;6,0;34,0#26,0;2,0;1,0;31,0;18,0;1,0;31,0;1,0#9,1;4,0;15,0;29,0;3,0;19,0;25,0;5,3#7,0;6,0;31,0;1,0;28,0;1,0;32,0;26,0#31,0;32,0;1,0;31,0;7,0;13,1;11,0;6,0|Sunken%20Ruins";
maparri[1] = "85|2|i|1,0;2,0;4,0;8,0;29,0;32,0;19,0;25,0;5,0;34,0#4,0;23,0;6,1;1,0;31,0;33,0;1,0;31,0;7,0;5,0#9,0;34,0;1,0;34,0;3,0;1,0;31,0;1,0;4,0;6,1#26,0;1,0;31,0;1,0;31,0;1,0;33,0;31,0;7,0;5,0#7,0;8,0;17,3;33,0;27,0;17,2;34,0;27,0;13,2;6,0|DarkVisor%27s%20Delite";
maparri[2] = "90|0|i|33,0;4,0;11,0;5,0;31,0;1,0;31,0#33,0;9,0;34,0;9,0;1,0;31,0;34,0#4,1;10,0;5,1;9,0;33,0;1,0;31,0#9,3;9,0;9,3;9,0;1,0;31,0;1,0#7,1;10,0;6,1;7,0;8,0;5,0;31,0#1,0;14,0;31,0;32,0;31,0;16,0;1,0#31,0;18,0;1,0;33,0;4,3;10,0;5,3#1,0;2,0;31,0;34,0;9,1;9,0;9,1#31,0;28,0;1,0;31,0;7,3;10,0;6,3#32,0;9,0;31,0;1,0;31,0;9,0;1,0#31,0;9,0;34,0;31,0;1,0;9,0;31,0#33,0;9,0;31,0;3,0;31,0;9,0;1,0#31,0;7,0;11,0;21,0;8,0;6,0;33,0|UT%20Island";
maparri[3] = "95|2|i|34,0;1,0;4,0;21,0;25,0;5,0;34,0;31,0#4,0;11,0;6,0;32,0;1,0;7,2;25,0;5,0#26,0;31,0;4,0;25,0;5,0;31,0;1,0;9,0#9,1;33,0;9,0;34,0;9,0;33,0;31,0;26,0#26,0;31,0;18,0;31,0;7,0;25,0;8,0;6,32#7,0;8,0;8,32;29,0;34,0;19,0;8,0;5,0#31,0;2,0;28,0;1,0;31,0;33,0;31,0;12,2#34,0;31,0;7,1;25,0;13,0;25,0;8,0;6,0|Atlantis%202%2E0";
maparri[4] = "95|1|i|4,0;11,0;5,0;4,0;5,0;34,0;1,0;3,0;31,0;4,0;5,0#26,0;4,0;6,0;26,1;26,0;32,0;33,0;4,0;5,2;26,0;26,0#9,1;9,2;4,0;6,0;24,0;1,0;4,0;6,0;7,0;6,0;16,1#26,0;7,0;6,0;4,0;6,0;3,0;12,0;33,0;34,0;1,0;30,0#7,0;11,0;5,0;7,3;11,0;25,0;6,0;32,0;31,0;2,0;3,0#4,0;17,2;9,0;27,0;8,0;5,0;4,0;8,0;11,0;5,0;20,3#26,0;2,0;26,0;1,0;31,0;12,0;26,2;33,0;4,0;6,0;30,0#7,0;25,0;6,0;34,0;3,0;12,0;7,0;5,0;7,0;5,0;31,0#33,0;31,0;4,0;25,0;15,1;6,0;31,0;12,0;34,0;26,0;20,3#3,0;34,0;26,0;2,0;3,0;1,0;32,0;9,0;4,2;6,0;9,0#2,0;32,0;7,0;17,0;31,0;27,0;8,32;6,0;7,0;25,0;6,0|Fathoms%20Five";
maparri[5] = "97|4|i|4,0;13,0;25,0;5,0;37,0;38,0;38,0;39,0;31,0;32,0#7,0;8,3;29,0;9,0;19,0;15,32;29,0;19,0;15,0;5,0#4,0;8,0;5,0;7,0;11,2;25,0;5,0;33,0;4,0;6,0#12,0;2,0;7,0;25,0;5,0;4,0;6,0;4,0;6,0;31,0#12,1;4,0;25,32;5,0;14,0;14,0;4,0;6,1;34,0;1,0#30,0;12,0;1,0;7,0;6,0;26,0;26,0;4,0;5,0;31,0#33,0;12,0;31,0;33,0;1,0;18,0;30,0;16,2;26,0;1,0#20,0;7,0;21,0;8,0;17,0;32,0;27,0;10,0;10,0;5,0#16,0;4,0;5,1;4,0;5,0;28,0;20,0;7,3;10,0;6,3#7,0;6,0;7,0;6,0;7,0;6,2;7,0;15,1;6,0;3,0|Elleg%27Drak%27s%20Revenge";
maparri[6] = "100|4|i|4,0;25,0;5,3;4,0;5,3;4,0;5,0;3,0#14,0;3,0;7,0;6,3;7,0;6,3;30,0;33,0#7,0;11,2;5,0;31,0;2,0;4,0;8,2;5,0#4,0;8,1;6,0;4,0;25,0;6,0;20,0;26,0#7,0;5,0;32,0;18,0;1,0;31,0;30,0;12,0#34,0;7,0;17,0;3,0;27,0;21,0;8,1;6,0#31,0;33,0;31,0;28,0;31,0;33,0;20,0;31,0#1,0;31,0;1,0;9,32;32,0;31,0;9,0;1,0#31,0;32,0;34,0;7,0;13,0;25,0;6,3;3,0|Poison%20Eva%27s%20Peril";
sClick = newSound("sClick");
sRollOver = newSound("sRollOver");
maparr = maparrd;
gId = 6;
getHighScores = function () {
gotoAndStop (15);
if (_level1024.loaded == 1) {
_level1024.doGetScores(gId);
}
clearInterval(highscoresi);
};
sendHighScore = function () {
gotoAndStop (16);
if (_level1024.loaded == 1) {
_level1024.dosubmit(score, gId);
}
clearInterval(highscoresi);
};
if (highscores == undefined) {
loadMovieNum ("hsmodule.swf", 1024);
highscores = 1024;
} else {
_level1024.clear_screen();
}
Frame 15
highscoresi = setInterval(getHighScores, 100);
Frame 17
stop();
if (thequality == "low") {
qs.gotoAndStop(1);
} else if (thequality == "medium") {
qs.gotoAndStop(2);
} else {
qs.gotoAndStop(3);
}
if (sounds) {
ss.gotoAndStop(1);
} else {
ss.gotoAndStop(2);
}
Frame 21
stop();
Frame 25
call("menuload");
upsell.displayUpsellPage();
stop();
Frame 28
stop();
Frame 30
stop();
Instance of Symbol 215 MovieClip in Frame 30
onClipEvent (load) {
this.gfx._visible = 0;
this.hitArea = this.gfx;
this.onRelease = function () {
if (this.useHandCursor) {
_root.maparr = _root.maparrn;
_root.gotoAndStop("carselect");
}
};
this.onRollOver = function () {
_root.trackdescription = "Only registered Superdudes are eligible to race on all three tracks.\nGo to www.superdudes.net to join today!";
};
this.useHandCursor = 0;
_root.blanker1._alpha = 50;
}
onClipEvent (enterFrame) {
if (_root.session.result != 0) {
this.useHandCursor = 1;
_root.blanker1._alpha = 0;
this.onRollOver = function () {
if (_root.sounds) {
_root.sRollover.start();
}
this.gotoAndStop(2);
_root.trackdescription = "This sprawling metropolis is built on the edge of a black hole, plunging it into perpetual night. Only the fearless race here.";
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
}
}
Instance of Symbol 215 MovieClip in Frame 30
onClipEvent (load) {
this.gfx._visible = 0;
this.hitArea = this.gfx;
this.onRelease = function () {
if (this.useHandCursor) {
_root.maparr = _root.maparri;
_root.gotoAndStop("carselect");
}
};
this.onRollOver = function () {
_root.trackdescription = "Only registered Superdudes are eligible to race on all three tracks.\nGo to www.superdudes.net to join today!";
};
this.useHandCursor = 0;
_root.blanker2._alpha = 50;
}
onClipEvent (enterFrame) {
if (_root.session.result != 0) {
this.useHandCursor = 1;
_root.blanker2._alpha = 0;
this.onRollOver = function () {
this.gotoAndStop(2);
if (_root.sounds) {
_root.sRollover.start();
}
_root.trackdescription = "Recently discovered by a team of astro-archaeologists, these submerged ruins present some of the most challenging racing conditions anywhere.";
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
}
}
Frame 35
call("menuload");
if (place != undefined) {
if (place == 1) {
cscore = cscore + 1000;
score = score + cscore;
startmap++;
command = "next race";
if (startmap >= (maparr.length - 1)) {
if (secrettrack) {
if (startmap >= maparr.length) {
gotoAndStop (40);
}
} else {
gotoAndStop (40);
}
} else if ((startmap >= 3) && (session.result == 0)) {
command = "end game";
}
} else {
command = "retry";
if (place == 2) {
}
}
}
totaltime = totaltime / 1000;
grandtotaltime = grandtotaltime + totaltime;
times = totaltime.toString();
mili = times.substr(times.indexOf(".") + 1, 1);
mins = Math.floor(totaltime / 60);
secs = Math.floor(totaltime) - (mins * 60);
secs = secs.toString();
while (secs.length < 2) {
secs = "0" + secs;
}
if (place == 1) {
ci.gotoAndStop(pcar + 1);
if (switchcars) {
ci.gfx.nextFrame();
}
pd = "You came in 1st place!\n\n\n";
} else {
ci._visible = 0;
pd = "Too Slow! You must place 1st\nto qualify for the next race.\n\n";
}
pd = pd + "Track: ";
pd = pd + mapname;
pd = pd + (((((("\nTime: " + mins) + ".") + secs) + ".") + mili) + "\n\n");
if (place == 1) {
pd2 = ((("x" + turbos) + ": +") + (turbos * 100)) + " Knuggs\n";
pd2 = pd2 + (((("x" + rockets) + ": +") + (rockets * 100)) + " Knuggs\n");
} else {
pd2 = "x0: +0 Knuggs\n";
pd2 = pd2 + "x0: +0 Knuggs\n";
}
pd2 = pd2 + "\nTotal Knuggs: ";
pd2 = pd2 + score;
nextTrack = function () {
if (startmap != -1) {
if ((startmap >= 3) && (session.result == 0)) {
gotoAndStop (25);
} else {
setMap(maparr[startmap]);
if (carSetup == undefined) {
gotoAndStop (50);
} else {
gotoAndStop(mapframe);
}
}
} else {
gotoAndStop (10);
}
};
Instance of Symbol 244 MovieClip "ci" in Frame 35
onClipEvent (enterFrame) {
gfx._rotation = gfx._rotation + 5;
}
Frame 40
times = grandtotaltime.toString();
mili = times.substr(times.indexOf(".") + 1, 1);
mins = Math.floor(grandtotaltime / 60);
secs = Math.floor(grandtotaltime) - (mins * 60);
secs = secs.toString();
while (secs.length < 2) {
secs = "0" + secs;
}
pd = "Congratulations!\nYou won the";
if (tileset == "n") {
pd = pd + " Asteroid Rally ";
} else if (tileset == "d") {
pd = pd + " Black Hole City ";
} else {
pd = pd + " Elleg'Drak Ruins ";
}
pd = pd + "circuit.\n\n";
if (tileset == "n") {
pd = pd + "Secret Code: rallyx";
pd3 = "Unlock the Secret Bonus Track in each circuit!";
} else if (tileset == "d") {
pd = pd + "Secret Code: ikea";
pd3 = "Enable Alternate Color Cars for your racer!";
} else {
pd = pd + "Secret Code: agresso";
pd3 = "Enable Maximum AI for opponent cars!";
}
if (hardmode == 1) {
pd3 = pd3 + "\nHard mode: +2500 Knuggs!";
score = score + 2500;
} else if (hardmode == 2) {
pd3 = pd3 + "\nExtra-Hard mode: +5000 Knuggs!!!";
score = score + 5000;
} else if (easymode == 1) {
pd3 = pd3 + "\nEasy mode: -2500 Knuggs.";
score = score - 2500;
}
pd2 = (((("Total Time: " + mins) + ".") + secs) + ".") + mili;
pd2 = pd2 + "\nTotal Knuggs:";
pd2 = pd2 + score;
Frame 50
function copyArray(arr, w, h) {
var tmp = new Array();
var y = 0;
while (y < height) {
tmp[y] = new Array();
var x = 0;
while (x < width) {
tmp[y][x] = new Array();
tmp[y][x][0] = arr[y][x][0];
tmp[y][x][1] = arr[y][x][1];
x++;
}
y++;
}
return(tmp);
}
function drawMap(arr, clipname, depth, tileset, startdepth, realmap, hidden) {
if (realmap) {
width = arr[0].length;
height = arr.length;
map = copyArray(arr, width, height);
powerups = new Array();
}
var holder = createEmptyMovieClip(clipname, depth);
var y = 0;
while (y < (sth + 1)) {
var x = 0;
while (x < (stw + 1)) {
var temp = holder.attachMovie(tileset, (("tile_" + y) + "_") + x, (startdepth + (y * width)) + x);
holder[(("tilepointer_" + y) + "_") + x] = temp;
temp._y = (y * tileHeight) - 1;
temp._x = (x * tileWidth) - 1;
temp.gotoAndStop(arr[y][x][0] + 1);
if (hidden) {
temp._visible = 0;
}
x++;
}
y++;
}
if (realmap) {
entityDepth = width * height;
powerups = new Array();
poweruptime = 160;
if (addDirs(map)) {
}
}
if (hidden) {
temp._visible = 0;
}
return(holder);
}
function crop(num, plus, max) {
var temp = (num + plus);
while (temp > max) {
temp = temp - max;
}
return(temp);
}
function addDirs(arr) {
var dx;
var dy;
var dr;
var ok;
var starts = 0;
checkpoints = 0;
waypoints = 0;
jumps = new Array();
var y = 0;
while (y < height) {
var x = 0;
while (x < width) {
if ((arr[y][x][0] >= (startss + 1)) && (arr[y][x][0] <= (startss + 4))) {
dx = (sx = x);
dy = (sy = y);
sr = (arr[y][x][0] - startss) - 1;
if ((arr[y][x][0] - startss) == 1) {
dr = 2;
} else if ((arr[y][x][0] - startss) == 2) {
dr = 3;
} else if ((arr[y][x][0] - startss) == 3) {
dr = 0;
} else if ((arr[y][x][0] - startss) == 4) {
dr = 1;
}
starts++;
if (starts > 1) {
return(0);
}
entityDepth++;
var temp = world.attachMovie("Startgate", "Checkpoint_" + (checkpoints++), entityDepth);
temp._x = (dx * tileWidth) + (tileWidth / 2);
temp._y = (dy * tileHeight) + (tileHeight / 2);
temp._rotation = crop(directions[arr[dy][dx][0]][dr], 2, 4) * 90;
sr = temp._rotation;
temp._visible = 0;
temp.waynum = 0;
}
if (arr[y][x][1] != 0) {
powerups.push({ons:1, ticks:poweruptime, x:x, y:y});
}
x++;
}
y++;
}
var d = (width * height);
while ((dr != -1) && (d != 0)) {
var j = 0;
entityDepth++;
var temp = world.attachMovie("wayPoint", "wayPoint_" + (waypoints++), entityDepth);
temp._x = (dx * tileWidth) + (tileWidth / 2);
temp._y = (dy * tileHeight) + (tileHeight / 2);
if ((arr[dy][dx][0] >= 4) && (arr[dy][dx][0] <= 7)) {
if (arr[dy][dx][0] == 4) {
temp._x = temp._x + 20;
temp._y = temp._y + 20;
} else if (arr[dy][dx][0] == 5) {
temp._x = temp._x - 20;
temp._y = temp._y + 20;
} else if (arr[dy][dx][0] == 6) {
temp._x = temp._x - 20;
temp._y = temp._y - 20;
} else {
temp._x = temp._x + 20;
temp._y = temp._y - 20;
}
}
temp._rotation = crop(directions[arr[dy][dx][0]][dr], 2, 4) * 90;
temp._visible = 0;
temp.num = waypoints - 1;
temp.waynum = waypoints - 1;
if ((arr[dy][dx][0] >= 13) && (arr[dy][dx][0] <= 16)) {
entityDepth++;
var temp = world.attachMovie("Checkpoint", "Checkpoint_" + (checkpoints++), entityDepth);
temp._x = (dx * tileWidth) + (tileWidth / 2);
temp._y = (dy * tileHeight) + (tileHeight / 2);
temp._rotation = crop(directions[arr[dy][dx][0]][dr], 2, 4) * 90;
temp._visible = 0;
temp.waynum = waypoints - 1;
}
dr = directions[arr[dy][dx][0]][dr];
if (dr > 3) {
dr = dr - 4;
j = dr + 1;
entityDepth++;
var temp = world.attachMovie("Jump", "Jump_" + entityDepth, entityDepth);
temp._x = (dx * tileWidth) + (tileWidth / 2);
temp._y = (dy * tileHeight) + (tileHeight / 2);
temp._rotation = crop(dr, 2, 4) * 90;
temp._visible = 0;
temp.reset = waypoints;
world["waypoint_" + (waypoints - 1)].isjump = 1;
jumps.push([dx, dy, temp]);
temp.waynum = waypoints - 1;
}
do {
if (dr == 0) {
dx--;
} else if (dr == 1) {
dy--;
} else if (dr == 2) {
dx++;
} else if (dr == 3) {
dy++;
}
} while (((((j && (directions[arr[dy][dx][0]][dr] == -1)) && (dx >= 0)) && (dy >= 0)) && (dx < width)) && (dy < height));
if ((dx == sx) && (dy == sy)) {
ok++;
break;
}
d--;
}
return(ok);
}
function getWorldPos(clip, pos, xscroll, yscroll) {
if (xscroll) {
pos[0] = Math.floor((-clip._x) / tileWidth);
}
if (yscroll) {
pos[1] = Math.floor((-clip._y) / tileHeight);
}
}
function scrollMap(clip, arr, pos, bounds, xscroll, yscroll, hold) {
if (hold) {
if (clip._x < ((-(width * tileWidth)) + sw)) {
clip._x = (-(width * tileWidth)) + sw;
}
if (clip._x > 0) {
clip._x = 0;
}
if (clip._y < ((-(height * tileHeight)) + sh)) {
clip._y = (-(height * tileHeight)) + sh;
}
if (clip._y > 0) {
clip._y = 0;
}
}
var oldpos = new Array(pos[0], pos[1]);
getWorldPos(clip, pos, xscroll, yscroll);
if (oldpos[0] != pos[0]) {
if (oldpos[0] < pos[0]) {
while (oldpos[0] != pos[0]) {
var dy = bounds[1];
var ty = oldpos[1];
var ly = 0;
while (ly < (sth + 1)) {
clip[(("tile_" + dy) + "_") + bounds[0]]._x = clip[(("tile_" + dy) + "_") + bounds[0]]._x + ((stw + 1) * tileWidth);
clip[(("tile_" + dy) + "_") + bounds[0]].gotoAndStop(arr[ty][(oldpos[0] + stw) + 1][0] + 1);
clip[(("tilepointer_" + ty) + "_") + ((oldpos[0] + stw) + 1)] = clip[(("tile_" + dy) + "_") + bounds[0]];
dy++;
if (dy > sth) {
dy = 0;
}
ty++;
ly++;
}
oldpos[0]++;
bounds[0]++;
if (bounds[0] > stw) {
bounds[0] = 0;
}
}
} else {
while (oldpos[0] != pos[0]) {
var dl = (bounds[0] - 1);
if (dl < 0) {
dl = stw;
}
var dy = bounds[1];
var ty = oldpos[1];
var ly = 0;
while (ly < (sth + 1)) {
clip[(("tile_" + dy) + "_") + dl]._x = clip[(("tile_" + dy) + "_") + dl]._x - ((stw + 1) * tileWidth);
clip[(("tile_" + dy) + "_") + dl].gotoAndStop(arr[ty][oldpos[0] - 1][0] + 1);
clip[(("tilepointer_" + ty) + "_") + (oldpos[0] - 1)] = clip[(("tile_" + dy) + "_") + dl];
dy++;
if (dy > sth) {
dy = 0;
}
ty++;
ly++;
}
oldpos[0]--;
bounds[0]--;
if (bounds[0] < 0) {
bounds[0] = stw;
}
}
}
}
if (oldpos[1] != pos[1]) {
if (oldpos[1] < pos[1]) {
while (oldpos[1] != pos[1]) {
var dx = bounds[0];
var tx = oldpos[0];
var lx = 0;
while (lx < (stw + 1)) {
clip[(("tile_" + bounds[1]) + "_") + dx]._y = clip[(("tile_" + bounds[1]) + "_") + dx]._y + ((sth + 1) * tileWidth);
clip[(("tile_" + bounds[1]) + "_") + dx].gotoAndStop(arr[(oldpos[1] + sth) + 1][tx][0] + 1);
clip[(("tilepointer_" + ((oldpos[1] + sth) + 1)) + "_") + tx] = clip[(("tile_" + bounds[1]) + "_") + dx];
dx++;
if (dx > stw) {
dx = 0;
}
tx++;
lx++;
}
oldpos[1]++;
bounds[1]++;
if (bounds[1] > sth) {
bounds[1] = 0;
}
}
} else {
while (oldpos[1] != pos[1]) {
var dl = (bounds[1] - 1);
if (dl < 0) {
dl = sth;
}
var dx = bounds[0];
var tx = oldpos[0];
var lx = 0;
while (lx < (stw + 1)) {
clip[(("tile_" + dl) + "_") + dx]._y = clip[(("tile_" + dl) + "_") + dx]._y - ((sth + 1) * tileWidth);
clip[(("tile_" + dl) + "_") + dx].gotoAndStop(arr[oldpos[1] - 1][tx][0] + 1);
clip[(("tilepointer_" + (oldpos[1] - 1)) + "_") + tx] = clip[(("tile_" + dl) + "_") + dx];
dx++;
if (dx > stw) {
dx = 0;
}
tx++;
lx++;
}
oldpos[1]--;
bounds[1]--;
if (bounds[1] < 0) {
bounds[1] = sth;
}
}
}
}
}
function scroll() {
world._x = (-player._x) + (sw / 2);
world._y = (-player._y) + (sh / 2);
return(1);
}
function powerup() {
if (!this.inPlace) {
if (!((((this.x < worldpos[0]) || (this.y < worldpos[1])) || (this.x > (worldpos[0] + stw))) || (this.y > (worldpos[1] + sth)))) {
this._visible = 1;
var tries = 0;
do {
xc = ((this.x * tileWidth) + random(tileWidth / 2)) + (tileWidth / 4);
yc = ((this.y * tileHeight) + random(tileHeight / 2)) + (tileHeight / 4);
tries++;
} while (hitCheck(xc, yc) && (tries < 25));
if (tries >= 24) {
this.removeMovieClip("");
}
this._x = xc;
this._y = yc;
this.inPlace = 1;
}
} else {
got = null;
if (this.hitTest(player.gfx) && (!player.jump)) {
got = player;
}
if (this.hitTest(opponent.gfx) && (!opponent.jump)) {
got = opponent;
}
if (got != null) {
if (this._currentframe == 1) {
if ((got == player) && (got.power < got.maxpower)) {
got.power++;
if (sounds) {
sTurboGet.start();
}
// unexpected jump
}
return(undefined);
}
if (this._currentframe == 2) {
if (got.rockets < got.maxrockets) {
got.rockets++;
if ((got == player) && (sounds)) {
sRocketGet.start();
}
// unexpected jump
}
return(undefined);
}
if (this._currentframe == 3) {
if (got == player) {
cscore = cscore + 250;
if (sounds) {
sKnuggGet.start();
}
} else {
return(undefined);
}
}
this.parent.knugggotten++;
this.parent.ons = 1;
this.removeMovieClip("");
}
if ((((this.x < worldpos[0]) || (this.y < worldpos[1])) || (this.x > (worldpos[0] + stw))) || (this.y > (worldpos[1] + sth))) {
this._visible = 0;
} else {
this._visible = 1;
}
}
}
_quality = thequality;
stop();
directions = new Array();
directions[0] = [-1, -1, -1, -1];
directions[1] = [-1, -1, -1, -1];
directions[2] = [-1, -1, -1, -1];
directions[3] = [-1, -1, -1, -1];
directions[4] = [3, 2, -1, -1];
directions[5] = [-1, 0, 3, -1];
directions[6] = [-1, -1, 1, 0];
directions[7] = [1, -1, -1, 2];
directions[8] = [0, -1, 2, -1];
directions[9] = [-1, 1, -1, 3];
directions[10] = [0, 1, 2, 3];
directions[11] = [0, -1, 2, -1];
directions[12] = [-1, 1, -1, 3];
directions[13] = [-1, -1, 2, -1];
directions[14] = [-1, -1, -1, 3];
directions[15] = [0, -1, -1, -1];
directions[16] = [-1, 1, -1, -1];
directions[17] = [-1, -1, 6, -1];
directions[18] = [-1, -1, -1, 7];
directions[19] = [4, -1, -1, -1];
directions[20] = [-1, 5, -1, -1];
directions[21] = [-1, -1, 2, -1];
directions[22] = [-1, -1, -1, 3];
directions[23] = [0, -1, -1, -1];
directions[24] = [-1, 1, -1, -1];
directions[25] = [0, -1, 2, -1];
directions[26] = [-1, 1, -1, 3];
directions[27] = [-1, -1, 2, -1];
directions[28] = [-1, -1, -1, 3];
directions[29] = [0, -1, -1, -1];
directions[30] = [-1, 1, -1, -1];
directions[31] = [-1, -1, -1, -1];
directions[32] = [-1, -1, -1, -1];
directions[33] = [-1, -1, -1, -1];
directions[34] = [-1, -1, -1, -1];
directions[35] = [-1, -1, -1, -1];
directions[36] = [-1, -1, -1, -1];
directions[37] = [-1, -1, -1, -1];
directions[38] = [-1, -1, -1, -1];
directions[39] = [-1, -1, -1, -1];
directions[40] = [-1, -1, -1, -1];
directions[41] = [-1, -1, -1, -1];
directions[42] = [-1, -1, -1, -1];
directions[43] = [-1, -1, -1, -1];
var startss = 20;
fps.mapname = mapname;
sw = 400;
sh = 400;
tileWidth = (tileHeight = 150);
stw = Math.ceil(sw / tileWidth);
sth = Math.ceil(sh / tileHeight);
spw = stw * tileWidth;
sph = sth * tileHeight;
p180 = 0.0174532925199433 /* Math.PI/180 */;
shadowdepth = 5000;
maxshadowdepth = 7499;
sdepth = shadowdepth;
normaldepth = 7500;
maxnormaldepth = 9999;
ndepth = normaldepth;
soverdepth = 12500;
maxsoverdepth = 14999;
sodepth = soverdepth;
overdepth = 15000;
maxoverdepth = 17499;
odepth = overdepth;
accelKey = 38;
decelKey = 40;
leftKey = 37;
rightKey = 39;
jumpKey = 13;
handbrakeKey = 32;
fineTurnKey = 69;
rocketKey = 82;
boostKey = 84;
play();
Frame 51
function carSetup(name, into, AI, accel, maxspeed, turnspeed, friction, jumppower, jumpcontrol, wheels, mass, handbrakespeed, maxhandbrake, maxrockets, maxpower) {
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
var clip = into.attachMovie(name, "Car_" + ndepth, ndepth);
clip.xspeed = 0;
clip.yspeed = 0;
clip.speed = 0;
clip.maxspeed = maxspeed;
clip.maxrevspeed = (-clip.maxspeed) / 2;
clip.turnspeed = turnspeed;
clip.accel = accel / 10;
clip.rot = 0;
clip.friction = friction / 100;
clip.jumppower = jumppower;
clip.jump = 0;
clip.jumptime = 0;
clip.jumpmaxtime = 0;
clip.jumpcontrol = jumpcontrol / 10;
if ((sdepth++) > maxshadowdepth) {
sdepth = shadowdepth;
}
clip.wheels = wheels;
clip.skid = 0;
clip.left = 0;
clip.right = 0;
clip.shadow = into.attachMovie(name + "_shadow", clip._name + "_shadow", sdepth);
clip.powertime = 0;
if (!AI) {
clip.frame = carFrame;
clip.time = 0;
clip.laptime = Number.POSITIVE_INFINITY;
clip.totaltime = 0;
} else {
clip.frame = carAIFrame;
clip.nextway = 1;
clip.target = world["Waypoint_" + clip.nextway];
}
clip.nextcheck = 0;
clip.lap = 0;
clip.power = 0;
clip.rockets = 0;
clip.rocket = 0;
clip.mass = mass;
clip.handbrakespeed = handbrakespeed;
clip.maxhandbrake = maxhandbrake;
clip.handbrake = 1;
clip.maxrockets = maxrockets;
clip.maxpower = maxpower;
return(clip);
}
function hitCheck(x, y) {
var checkx = (x + world._x);
var checky = (y + world._y);
var tilex = Math.floor(x / tileWidth);
var tiley = Math.floor(y / tileHeight);
var checkt = collision[(("tilepointer_" + tiley) + "_") + tilex];
if (checkt.hitTest(checkx, checky, 1)) {
return(1);
}
return(0);
}
function carNoControl() {
this.flashing = 1;
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
var starta = 0;
var enda = 8;
var col = 0;
var i = starta;
while (i < enda) {
var check = this["a" + i];
var point = {x:check._x, y:check._y};
this.localToGlobal(point);
point.x = point.x - world._x;
point.y = point.y - world._y;
if (hitCheck(point.x, point.y)) {
col++;
break;
}
i++;
}
if (col) {
this._x = this._x - this.xspeed;
this._y = this._y - this.yspeed;
this.xspeed = this.xspeed * -0.25;
this.yspeed = this.yspeed * -0.25;
}
this.shadow._x = (this._x + 4) + ((this.jumpmaxtime / 2) * ((100 - this.shadow._alpha) / 100));
this.shadow._y = (this._y + 4) + ((this.jumpmaxtime / 2) * ((100 - this.shadow._alpha) / 100));
this.shadow._rotation = this.rot;
this.x = Math.floor(this._x / tileWidth);
this.y = Math.floor(this._y / tileHeight);
if ((((this.x < worldpos[0]) || (this.y < worldpos[1])) || (this.x > (worldpos[0] + stw))) || (this.y > (worldpos[1] + sth))) {
this._visible = 0;
this.shadow._visible = 0;
this.xspeed = (this.yspeed = (this.speed = 0));
} else {
this._visible = 1;
this.shadow._visible = 1;
}
}
function clipTest(one, two) {
if ((((!two.flashing) && (!two.jump)) && (one.a1.hitTest(two.gfx))) && (one.speed > 0)) {
if (one.mass > two.mass) {
if (random(10) > 5) {
two._x = two._x + (one.speed * Math.cos((this.rot + 45) * p180));
two._y = two._y + (one.speed * Math.sin((this.rot + 45) * p180));
} else {
two._x = two._x + (one.speed * Math.cos((this.rot - 45) * p180));
two._y = two._y + (one.speed * Math.sin((this.rot - 45) * p180));
}
} else {
one.speed = Math.min(one.speed, two.speed) * 0.5;
}
if ((one == player) && (sounds)) {
c1.start();
}
one.powertime = 0;
}
}
function clipFlashing(clip) {
if (clip.flashing) {
clip.speed = (clip.xspeed = (clip.yspeed = 0));
clip.powertime = 0;
clip.flashing--;
if (clip.jumpflashing) {
if (!clip.flashing) {
clip.jumpflashing = 0;
clip.skid = 0;
clip._x = clip.jumpReset._x;
clip._y = clip.jumpReset._y;
clip._rotation = (clip.rot = clip.jumpReset._rotation);
}
return(undefined);
}
if ((clip.flashing % 4) == 1) {
clip._visible = 0;
}
if ((clip.flashing % 4) == 0) {
clip._visible = 1;
}
return(1);
}
}
function makeSkids(clip, draw) {
var i = 0;
while (i < clip.wheels) {
var check = clip["s" + i];
var point = {x:check._x, y:check._y};
clip.localToGlobal(point);
check.x = point.x - world._x;
check.y = point.y - world._y;
i++;
}
}
function carFrame() {
if (clipFlashing(this)) {
return(undefined);
}
this.x = Math.floor(this._x / tileWidth);
this.y = Math.floor(this._y / tileHeight);
if (!this.jump) {
makeSkids(this);
if (!this.nocontrol) {
this.rotdif;
if (Key.isDown(fineTurnKey)) {
if (Key.isDown(leftKey)) {
this.rotdif = (-Math.min(this.turnspeed, this.turnspeed * (this.speed / this.maxspeed))) / 2;
this.left++;
if (this.right > 0) {
this.handbrake = 1;
}
this.right = 0;
}
if (Key.isDown(rightKey)) {
this.rotdif = Math.min(this.turnspeed, this.turnspeed * (this.speed / this.maxspeed)) / 2;
if (this.left > 0) {
this.handbrake = 1;
}
this.left = 0;
this.right++;
}
} else {
if (Key.isDown(leftKey)) {
this.rotdif = -Math.min(this.turnspeed, this.turnspeed * (this.speed / this.maxspeed));
this.left++;
if (this.right > 0) {
this.handbrake = 1;
}
this.right = 0;
}
if (Key.isDown(rightKey)) {
this.rotdif = Math.min(this.turnspeed, this.turnspeed * (this.speed / this.maxspeed));
if (this.left > 0) {
this.handbrake = 1;
}
this.left = 0;
this.right++;
}
}
if ((!Key.isDown(leftKey)) && (!Key.isDown(rightKey))) {
this.left = 0;
this.right = 0;
}
if (Key.isDown(accelKey)) {
if (this.speed < 0) {
this.speed = this.speed + (this.accel * 2);
} else if (this.powertime) {
this.speed = this.speed + (this.accel * 2);
} else {
this.speed = this.speed + this.accel;
}
}
if (this.speed > this.maxspeed) {
if (!this.powertime) {
this.speed = Math.max(this.maxspeed, this.speed - 1);
} else {
this.speed = Math.min(this.speed, this.maxspeed * 1.5);
}
}
if (Key.isDown(decelKey)) {
this.speed = Math.max(this.maxrevspeed, this.speed - this.accel);
}
if (this.rockets) {
if (Key.isDown(rocketKey)) {
if (this.rocket == 0) {
this.rocket = 1;
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
attachRockets(this, opponent);
this.rockets--;
if (sounds) {
sRocketLaunch.start();
}
}
} else {
this.rocket = 0;
}
}
fps.rockets.gotoAndStop(this.rockets + 1);
if (this.power && (!this.powertime)) {
if (Key.isDown(boostKey)) {
this.powertime = 64;
this.power--;
if (sounds) {
sTurbo.start();
}
this.speed = this.maxspeed * 1.5;
this.skid = this.skid + 10;
}
}
if (this.powertime > 0) {
this.powertime--;
}
fps.turbos.gotoAndStop(this.power + 1);
this.jumpnow = 0;
var i = 0;
while (i < jumps.length) {
if ((((this.x == jumps[i][0]) && (this.y == jumps[i][1])) && (this.gfx.hitTest(jumps[i][2]))) && (this.speed >= (this.maxspeed / 2))) {
this.jumpnow = 1;
this.jumpreset = world["waypoint_" + jumps[i][2].reset];
break;
}
i++;
}
if (this.jumpnow) {
if (sounds) {
sJump.start();
}
jumpNowStart(this);
}
} else {
this.nocontrol--;
}
this.rot = this.rot + this.rotdif;
this.rotdif = 0;
this.rot = (this.rot + 360) % 360;
this.rotd = (this.rotd + 360) % 360;
this.dif = this.rot - this.rotd;
this.dif = ((this.dif > 179) ? (-360 + this.dif) : (this.dif));
this.dif = ((this.dif < -179) ? (360 + this.dif) : (this.dif));
if (Key.isDown(handbrakeKey)) {
if (this.speed > (this.maxspeed / 2)) {
this.handbrake = this.handbrake + this.handbrakespeed;
if (this.handbrake > this.maxhandbrake) {
this.handbrake = this.maxhandbrake;
}
this.skid++;
}
if (this.handbrake > (this.maxhandbrake / 2)) {
this.speed = this.speed * 0.94;
}
} else if ((this.speed >= (this.maxspeed - 1)) && ((this.left > 15) || (this.right > 15))) {
if (this.handbrake > 3) {
this.handbrake--;
} else if (this.handbrake < 3) {
this.handbrake++;
}
} else {
this.handbrake--;
if (this.handbrake < 1) {
this.handbrake = 1;
}
}
this.rotd = this.rotd + (this.dif / this.handbrake);
if (Math.abs(this.speed) > 0.3) {
this.xspeed = this.speed * Math.cos(this.rotd * p180);
this.yspeed = this.speed * Math.sin(this.rotd * p180);
} else {
this.xspeed = (this.yspeed = 0);
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this._rotation = this.rot;
if (Key.isDown(8) && (this.lap > 0)) {
this.flashing = 20;
this.jump = 0;
this.skid = 0;
this.speed = 0;
this.xspeed = (this.yspeed = 0);
this._x = this.lastCheck._x;
this._y = this.lastCheck._y;
this.rot = (this._rotation = this.lastCheck._rotation);
}
this.speed = this.speed * this.friction;
var starta = 0;
var enda = 8;
if (this.speed > 0) {
enda = 5;
} else if (!Key.isDown(handbrakeKey)) {
starta = 3;
}
var col = 0;
var i = starta;
while (i < enda) {
var check = this["a" + i];
var point = {x:check._x, y:check._y};
this.localToGlobal(point);
point.x = point.x - world._x;
point.y = point.y - world._y;
if (hitCheck(point.x, point.y)) {
col++;
break;
}
i++;
}
if (col) {
this.handbrake = 1;
if (this.speed > (this.maxspeed - (this.maxspeed / 4))) {
if (sounds) {
c0.start();
}
}
this.skid = 3;
var lhit = 0;
var rhit = 0;
var check = this.mh;
var point = {x:check._x, y:check._y};
this.localToGlobal(point);
point.x = point.x - world._x;
point.y = point.y - world._y;
if (hitCheck(point.x, point.y)) {
lhit = (rhit = 1);
} else {
var check = this.lh;
var point = {x:check._x, y:check._y};
this.localToGlobal(point);
point.x = point.x - world._x;
point.y = point.y - world._y;
if (hitCheck(point.x, point.y)) {
lhit = 1;
}
var check = this.rh;
var point = {x:check._x, y:check._y};
this.localToGlobal(point);
point.x = point.x - world._x;
point.y = point.y - world._y;
if (hitCheck(point.x, point.y)) {
rhit = 1;
}
}
if ((this.speed <= 0) || (lhit && (rhit))) {
this._x = this._x - (this.xspeed * 1.2);
this._y = this._y - (this.yspeed * 1.2);
if (this.speed < 0) {
this.speed = this.speed * -0.35;
} else {
this.speed = Math.min(this.speed, this.maxspeed) * -0.35;
}
} else if (lhit) {
this._x = this._x - this.xspeed;
this._y = this._y - this.yspeed;
this.speed = Math.min(this.speed, this.maxspeed) * 0.85;
this.rot = (this._rotation = this._rotation + (this.turnspeed * (this.speed / this.maxspeed)));
} else if (rhit) {
this._x = this._x - this.xspeed;
this._y = this._y - this.yspeed;
this.speed = Math.min(this.speed, this.maxspeed) * 0.85;
this.rot = (this._rotation = this._rotation - (this.turnspeed * (this.speed / this.maxspeed)));
}
if (Key.isDown(handbrakekey)) {
this.speed = this.speed * 0.2;
}
}
clipTest(this, opponent);
if (((this.left > 10) || (this.right > 10)) && (!Key.isDown(fineTurnKey))) {
this.skid++;
}
if (this.skid > 0) {
var i = 0;
while (i < this.wheels) {
var check = this["s" + i];
var point = {x:check._x, y:check._y};
this.localToGlobal(point);
var temp = over.draw.attachMovie("skid", "skid_" + (over.draw.skids++), over.draw.skids++);
temp.lineStyle(2, 0, 100);
temp.moveTo(check.x - temp._x, check.y - temp._y);
temp.lineTo((point.x - world._x) - temp._x, (point.y - world._y) - temp._y);
i++;
}
this.skid--;
if (sounds) {
sSkid.setVolume(100);
}
} else {
sSkid.setVolume(0);
}
} else {
sSkid.setVolume(0);
this.jumptime++;
if (this.jumptime > this.jumpmaxtime) {
this.rotdif = 0;
this.jump = 0;
makeSkids(this);
this.skid = 3;
this._xscale = (this._yscale = 100);
this.handbrake = 1;
this.shadow._alpha = 100;
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
if ((sdepth++) > maxshadowdepth) {
sdepth = shadowdepth;
}
this.shadow.swapDepths(sdepth);
this.swapDepths(ndepth);
var col = 0;
var i = 0;
while (i < 8) {
var check = this["a" + i];
var point = {x:check._x, y:check._y};
this.localToGlobal(point);
point.x = point.x - world._x;
point.y = point.y - world._y;
if (hitCheck(point.x, point.y)) {
col++;
break;
}
i++;
}
if (((((this._x < 0) || (this._y < 0)) || (this._x > (width * tileWidth))) || (this._y > (height * tileHeight))) || (col)) {
if (sounds) {
sDeath.start();
}
this.flashing = 30;
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
var temp = over.attachMovie("Explosion", "Explosion_" + ndepth, ndepth);
temp._x = this._x;
temp._y = this._y;
this.jumpflashing = 1;
} else if ((this.a1.hitTest(opponent.gfx) && (!opponent.jump)) && (!opponent.flashing)) {
this.flashing = 20;
} else {
makeSkids(this);
if (sounds) {
sLand.start();
}
}
} else if (this.jumptime < (this.jumpmaxtime / 2)) {
this._xscale = (this._yscale = 100 + ((this.jumpmaxheight * this.jumptime) / (this.jumpmaxtime / 2)));
this.shadow._alpha = 100 - ((this.jumpmaxheight * this.jumptime) / (this.jumpmaxtime / 2));
} else {
this._xscale = (this._yscale = (100 + this.jumpmaxheight) - ((this.jumpmaxheight * (this.jumptime - (this.jumpmaxtime / 2))) / (this.jumpmaxtime / 2)));
this.shadow._alpha = (100 - this.jumpmaxheight) + ((this.jumpmaxheight * (this.jumptime - (this.jumpmaxtime / 2))) / (this.jumpmaxtime / 2));
}
if (Key.isDown(leftKey)) {
this.rot = this.rot - ((this.turnspeed * (this.speed / this.maxspeed)) * this.jumpcontrol);
}
if (Key.isDown(rightKey)) {
this.rot = this.rot + ((this.turnspeed * (this.speed / this.maxspeed)) * this.jumpcontrol);
}
this.xspeed = this.speed * Math.cos(this.rot * p180);
this.yspeed = this.speed * Math.sin(this.rot * p180);
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this._rotation = this.rot;
}
this.shadow._x = (this._x + 4) + ((this.jumpmaxtime / 2) * ((100 - this.shadow._alpha) / 100));
this.shadow._y = (this._y + 4) + ((this.jumpmaxtime / 2) * ((100 - this.shadow._alpha) / 100));
this.shadow._rotation = this.rot;
this.shadow._xscale = (this.shadow._yscale = 100 + ((this._xscale - 100) / 2));
totaltime = getTimer() - this.totaltime;
if (this.gfx.hitTest(world["Checkpoint_" + this.nextcheck])) {
this.lastCheck = world["Checkpoint_" + this.nextcheck];
if (this.lap > 0) {
if (sounds) {
sCheckpoint.start();
}
display.gotoAndPlay("checkpoint");
}
if (this.nextcheck == 0) {
this.time = getTimer();
this.laptime = this.time - this.lastlap;
this.lastlap = this.time;
this.lap++;
if (this.lap > 1) {
display.gotoAndPlay("lap" + this.lap);
}
if (this.lap > 3) {
this.lap = 3;
display.gotoAndPlay("finish");
rockets = this.rockets;
turbos = this.power;
cscore = cscore + (rockets * 100);
cscore = cscore + (turbos * 100);
this.onEnterFrame = carNoControl;
sSkid.stop();
if (place == 0) {
place = 1;
if (sounds) {
sWinner.start();
}
} else if (sounds) {
sLoser.start();
}
} else if (this.lap > 1) {
cscore = cscore + 100;
}
} else {
cscore = cscore + 100;
}
this.nextcheck++;
if (this.nextcheck >= checkpoints) {
this.nextcheck = 0;
}
}
bmpText("k", 6, score);
fps.lap.gotoAndStop(this.lap + 1);
fps.lap2.gotoAndStop(4);
if (this.lap < 2) {
this.laptime = Number.POSITIVE_INFINITY;
this.bestlap = Number.POSITIVE_INFINITY;
} else if (this.laptime < this.bestlap) {
this.bestlap = this.laptime;
}
bmpTime("t", totaltime / 1000);
bmpTime("b", this.bestlap / 1000);
}
play();
Frame 52
function jumpNowStart(clip) {
clip.jumpmaxtime = Math.abs(Math.floor(clip.jumppower * (clip.speed / clip.maxspeed)));
if (clip.jumpmaxtime > 0) {
clip.speed = Math.max(clip.maxspeed, 8);
clip.jump = 1;
clip.jumpmaxheight = clip.jumpmaxtime * 2;
clip.jumptime = 0;
if ((sodepth++) > maxsoverdepth) {
sodepth = soverdepth;
}
clip.shadow.swapDepths(sodepth);
if ((odepth++) > maxoverdepth) {
odepth = overdepth;
}
clip.swapDepths(odepth);
}
}
function checkSide(clip, clipcheck) {
var pointchecks = 8;
var points = 0;
var check = clipcheck;
var point = {x:check._x, y:check._y};
clip.localToGlobal(point);
point.x = point.x - world._x;
point.y = point.y - world._y;
var pointxdif = (9 * Math.cos((clip.rot + check._rotation) * p180));
var pointydif = (9 * Math.sin((clip.rot + check._rotation) * p180));
var i = 1;
while (i < pointchecks) {
if (hitCheck(point.x + (pointxdif * i), point.y + (pointydif * i))) {
points = i;
if (hitCheck(point.x + (pointxdif * (i - 1)), point.y + (pointydif * (i - 1)))) {
points = i - 1;
break;
}
break;
}
check.gotoAndStop(1);
i = i + 2;
}
return(points);
}
function attachRockets(clip, clip2) {
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
var temp = over.attachMovie("rocket", "rocket_" + ndepth, ndepth);
temp.xspeed = (2 * clip.maxspeed) * Math.cos(clip.rot * p180);
temp.yspeed = (2 * clip.maxspeed) * Math.sin(clip.rot * p180);
temp._x = clip._x + temp.xspeed;
temp._y = clip._y + temp.yspeed;
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
var temp2 = over.attachMovie("rocket", "rocket_" + ndepth, ndepth);
temp2.xspeed = (2 * clip.maxspeed) * Math.cos((clip.rot + 5) * p180);
temp2.yspeed = (2 * clip.maxspeed) * Math.sin((clip.rot + 5) * p180);
temp2._x = clip._x + temp2.xspeed;
temp2._y = clip._y + temp2.yspeed;
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
var temp3 = over.attachMovie("rocket", "rocket_" + ndepth, ndepth);
temp3.xspeed = (2 * clip.maxspeed) * Math.cos((clip.rot - 5) * p180);
temp3.yspeed = (2 * clip.maxspeed) * Math.sin((clip.rot - 5) * p180);
temp3._x = clip._x + temp3.xspeed;
temp3._y = clip._y + temp3.yspeed;
temp.target = clip2;
temp.parent = clip;
temp2.target = clip2;
temp2.parent = clip;
temp3.target = clip2;
temp3.parent = clip;
temp.onEnterFrame = (temp2.onEnterFrame = (temp3.onEnterFrame = rocketFrame));
}
function rocketFrame() {
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (this.hitTest(this.target.gfx) && (!this.target.jump)) {
if (this.parent == player) {
cscore = cscore + 250;
}
this.target.jump = 1;
this.target.jumpmaxtime = this.target.jumppower;
this.target.jumptime = 0;
this.target.jumpmaxheight = this.target.jumpmaxtime * 2;
this.target.speed = (this.target.xspeed = (this.target.yspeed = 0));
if ((sodepth++) > maxsoverdepth) {
sodepth = soverdepth;
}
this.target.shadow.swapDepths(sodepth);
if ((odepth++) > maxoverdepth) {
odepth = overdepth;
}
this.target.swapDepths(odepth);
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
var temp = over.attachMovie("Explosion", "Explosion_" + ndepth, ndepth);
temp._x = this._x;
temp._y = this._y;
if (sounds) {
sDeath.start();
}
this.removeMovieClip("");
}
this.x = Math.floor(this._x / tileWidth);
this.y = Math.floor(this._y / tileHeight);
if ((((this.x < worldpos[0]) || (this.y < worldpos[1])) || (this.x > (worldpos[0] + stw))) || (this.y > (worldpos[1] + sth))) {
this._visible = 0;
} else {
this._visible = 1;
}
if ((((this.x < 0) || (this.y < 0)) || (this.x > width)) || (this.y > height)) {
this.removeMovieClip("");
}
}
function bmpTime(namestart, time) {
var ass = time.toString();
var mili = ass.substr(ass.indexOf(".") + 1, 1);
var mins = Math.floor(time / 60);
var secs = (Math.floor(time) - (mins * 60));
bmpText(namestart, 2, mins);
bmpText(namestart + "2", 2, secs);
fps[namestart + "30"].gotoAndStop(int(mili) + 1);
}
function bmpText(namestart, numspots, num) {
var tmp = num.toString();
while (tmp.length < numspots) {
tmp = "0" + tmp;
}
var i = 0;
while (i < numspots) {
fps[namestart + i].gotoAndStop(int(tmp.charAt(i)) + 1);
i++;
}
}
function dist(clip, clip2) {
var dy = (clip2._y - clip._y);
var dx = (clip2._x - clip._x);
return(Math.sqrt((dx * dx) + (dy * dy)));
}
function CarAIFrame() {
if (clipFlashing(this)) {
return(undefined);
}
if (!this.jump) {
this.destrot = (360 - ((Math.atan2(this._x - this.target._x, this._y - this.target._y) * 180) / Math.PI)) - 90;
this.destrot = (this.destrot + 360) % 360;
this.rot = (this.rot + 360) % 360;
this.dist = dist(this, this.target);
if (((this.dist < 55) || (Math.abs(this.rot - this.destrot) > 20)) || (this.lasttarget.isJump)) {
if ((Math.abs(this.rot - this.destrot) > 340) || (Math.abs(this.rot - this.destrot) < 20)) {
if ((this.t++) > 15) {
this.randturn = 0 + random(2);
this.t = 0;
}
if (this.randturn) {
this.rot = this.rot + 0.5;
} else {
this.rot = this.rot - 0.5;
}
r = 0;
l = 0;
} else if (((this.rot < this.destrot) && ((this.destrot - this.rot) < 180)) || (((this.destrot - this.rot) < -180) && (this.destrot < 100))) {
this.rot = this.rot + Math.min(this.turnspeed, (this.turnspeed * this.speed) / this.maxspeed);
r++;
l = 0;
} else if ((this.rot > this.destrot) || (((this.destrot - this.rot) > 180) && (this.destrot > 260))) {
this.rot = this.rot - Math.min(this.turnspeed, (this.turnspeed * this.speed) / this.maxspeed);
r = 0;
l++;
}
} else {
if ((this.t++) > 15) {
this.randturn = 0 + random(2);
this.t = 0;
}
if (this.randturn) {
this.rot = this.rot + 0.5;
} else {
this.rot = this.rot - 0.5;
}
}
if (this._visible) {
var pointchecks = 8;
var pointleft = 0;
var pointright = 0;
pointleft = checkSide(this, this.lv);
pointright = checkSide(this, this.rv);
if (pointleft) {
this.rot = this.rot + ((this.turnspeed * 2) * (1 - (pointleft / pointchecks)));
}
if (pointright) {
this.rot = this.rot - ((this.turnspeed * 2) * (1 - (pointright / pointchecks)));
}
}
clipTest(opponent, player);
this.jumpnow = 0;
var i = 0;
while (i < jumps.length) {
if ((((this.x == jumps[i][0]) && (this.y == jumps[i][1])) && (this.gfx.hitTest(jumps[i][2]))) && (this.speed >= (this.maxspeed / 2))) {
this.jumpnow = 1;
this.jumpreset = world["waypoint_" + jumps[i][2].reset];
break;
}
i++;
}
if (this.jumpnow) {
jumpNowStart(this);
} else if (this.powertime) {
this.speed = Math.min(this.speed + (this.accel * 2), this.maxspeed * 1.5);
} else {
this.speed = Math.min(this.speed + this.accel, this.maxspeed);
}
this._rotation = this.rot;
if (this.power && (!this.powertime)) {
this.powertime = 64;
this.power--;
}
if (this.powertime > 0) {
this.powertime--;
}
if (this.rockets && (!this.rocket)) {
if (player.gfx.hitTest(this.r) || (player.gfx.hitTest(this.rl))) {
this.rocket = 1;
}
}
if (this.rocket) {
attachRockets(this, player);
if (sounds) {
sRocketLaunch.start();
}
this.rockets--;
this.rocket = 0;
}
this.xspeed = this.speed * Math.cos(this.rot * p180);
this.yspeed = this.speed * Math.sin(this.rot * p180);
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this.speed = this.speed * this.friction;
} else {
this.destrot = (360 - ((Math.atan2(this._x - this.target._x, this._y - this.target._y) * 180) / Math.PI)) - 90;
this.destrot = (this.destrot + 360) % 360;
this.rot = (this.rot + 360) % 360;
this.dist = dist(this, this.target);
if (Math.abs(this.rot - this.destrot) < 15) {
} else if (((this.rot < this.destrot) && ((this.destrot - this.rot) < 180)) || (((this.destrot - this.rot) < -180) && (this.destrot < 100))) {
this.rot = this.rot + (Math.min(this.turnspeed, (this.turnspeed * this.speed) / this.maxspeed) * this.jumpcontrol);
r++;
l = 0;
} else if ((this.rot > this.destrot) || (((this.destrot - this.rot) > 180) && (this.destrot > 260))) {
this.rot = this.rot - (Math.min(this.turnspeed, (this.turnspeed * this.speed) / this.maxspeed) * this.jumpcontrol);
r = 0;
l++;
}
this.jumptime++;
if (this.jumptime > this.jumpmaxtime) {
this.rotdif = 0;
this.jump = 0;
this.skid = 3;
this._xscale = (this._yscale = 100);
this.shadow._alpha = 100;
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
if ((sdepth++) > maxshadowdepth) {
sdepth = shadowdepth;
}
this.shadow.swapDepths(sdepth);
this.swapDepths(ndepth);
var col = 0;
var i = 0;
while (i < 8) {
var check = this["a" + i];
var point = {x:check._x, y:check._y};
this.localToGlobal(point);
point.x = point.x - world._x;
point.y = point.y - world._y;
if (hitCheck(point.x, point.y)) {
col++;
break;
}
i++;
}
if (((((this._x < 0) || (this._y < 0)) || (this._x > (width * tileWidth))) || (this._y > (height * tileHeight))) || (col)) {
this.flashing = 30;
if (sounds) {
sDeath.start();
}
if ((ndepth++) > maxnormaldepth) {
ndepth = normaldepth;
}
var temp = over.attachMovie("Explosion", "Explosion_" + ndepth, ndepth);
temp._x = this._x;
temp._y = this._y;
this.jumpflashing = 1;
this.nextway = this.jumpReset.waynum;
this.target = world["Waypoint_" + this.nextway];
if ((this.nextway++) >= waypoints) {
this.nextway = 0;
this.target = world["Waypoint_" + this.nextway];
}
}
if ((this.a1.hitTest(player.gfx) && (!player.jump)) && (!player.flashing)) {
this.flashing = 20;
}
} else if (this.jumptime < (this.jumpmaxtime / 2)) {
this._xscale = (this._yscale = 100 + ((this.jumpmaxheight * this.jumptime) / (this.jumpmaxtime / 2)));
this.shadow._alpha = 100 - ((this.jumpmaxheight * this.jumptime) / (this.jumpmaxtime / 2));
} else {
this._xscale = (this._yscale = (100 + this.jumpmaxheight) - ((this.jumpmaxheight * (this.jumptime - (this.jumpmaxtime / 2))) / (this.jumpmaxtime / 2)));
this.shadow._alpha = (100 - this.jumpmaxheight) + ((this.jumpmaxheight * (this.jumptime - (this.jumpmaxtime / 2))) / (this.jumpmaxtime / 2));
}
this.xspeed = this.speed * Math.cos(this.rot * p180);
this.yspeed = this.speed * Math.sin(this.rot * p180);
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this._rotation = this.rot;
}
this.shadow._x = (this._x + 4) + ((this.jumpmaxtime / 2) * ((100 - this.shadow._alpha) / 100));
this.shadow._y = (this._y + 4) + ((this.jumpmaxtime / 2) * ((100 - this.shadow._alpha) / 100));
this.shadow._rotation = this.rot;
this.shadow._xscale = (this.shadow._yscale = 100 + ((this._xscale - 100) / 2));
if (this.gfx.hitTest(world["Checkpoint_" + this.nextcheck])) {
this.lastCheck = world["Checkpoint_" + this.nextcheck];
if (this.nextcheck == 0) {
this.lap++;
if (this.lap > 3) {
this.onEnterFrame = carNoControl;
if (place == 0) {
place = 2;
}
}
}
this.nextcheck++;
if (this.nextcheck >= checkpoints) {
this.nextcheck = 0;
}
this.nextway = this.lastCheck.waynum;
this.target = world["Waypoint_" + this.nextway];
if ((this.nextway++) >= waypoints) {
this.nextway = 0;
this.target = world["Waypoint_" + this.nextway];
}
}
if (dist(this, this.target) < 75) {
this.lasttarget = this.target;
this.target = world["Waypoint_" + this.nextway];
if ((this.nextway++) >= waypoints) {
this.nextway = 0;
this.target = world["Waypoint_" + this.nextway];
}
}
this.x = Math.floor(this._x / tileWidth);
this.y = Math.floor(this._y / tileHeight);
if ((((this.x < worldpos[0]) || (this.y < worldpos[1])) || (this.x > (worldpos[0] + stw))) || (this.y > (worldpos[1] + sth))) {
this._visible = 0;
this.shadow._visible = 0;
} else {
this._visible = 1;
this.shadow._visible = 1;
}
}
gotoAndStop(mapframe);
Frame 65
function scrollAndUpdate() {
if (scroll()) {
collision._x = world._x;
collision._y = world._y;
over._x = world._x;
over._y = world._y;
scrollMap(world, map, worldpos, worldbounds, 1, 1, 1);
scrollMap(collision, map, collisionpos, collisionbounds, 1, 1, 1);
scrollMap(over, map, overpos, overbounds, 1, 1, 1);
}
}
_quality = thequality;
bmpText("k", 6, score);
fps.lap2.gotoAndStop(4);
if (((tileset != "d") && (tileset != "n")) && (tileset != "i")) {
tileset = "d";
}
world = drawMap(mapa, "world", 1, tileset + "tiles", 0, 1, 0);
worldpos = [0, 0];
worldbounds = [0, 0];
over = drawMap(map, "over", 2, tileset + "over", 10000, 0, 0);
overpos = [0, 0];
overbounds = [0, 0];
over.createEmptyMovieClip("draw", 4500);
collision = drawMap(map, "collision", 0, "collision", 0, 0, 1);
collisionpos = new Array(0, 0);
collisionbounds = new Array(0, 0);
music.stop();
if (tileset == "n") {
music = newMusic("music2");
music.setVolume(50);
} else if (tileset == "i") {
music = newMusic("music3");
music.setVolume(50);
} else {
music = newMusic("music1");
music.setVolume(50);
}
if (musics) {
music.start(0, 99999);
}
c0 = newSound("sSmallCrash");
c1 = newSound("sBigCrash");
sdeath = newSound("sDeath");
srocketlaunch = newSound("sRocketLaunch");
sJump = newSound("sJump");
sLand = newSound("sLand");
sTurbo = newSound("sTurbo");
sClick = newSound("sClick");
sCheckpoint = newSound("sCheckPoint");
sSkid = newSound("sSkid");
sWinner = newSound("sWinner");
sLoser = newSound("sLoser");
sSkid.setVolume(0);
sSkid.start(0, 999999);
s1 = newSound("s1");
s2 = newSound("s2");
s3 = newSound("s3");
sgo = newSound("sgo");
sTurboGet = newSound("sTurboGet");
sRocketGet = newSound("sRocketGet");
sKnuggGet = newSound("sKnuggGet");
turbos = (rockets = 0);
turboboost = -1;
knugggotten = 0;
cscore = 0;
display = attachMovie("Display", "Displayer", 4);
display.onEnterFrame = function () {
if (display.go) {
if ((turboboost == 1) && (sounds)) {
sTurbo.start();
}
player.onEnterFrame = player.frame;
player.totaltime = getTimer();
opponent.onEnterFrame = opponent.frame;
this.onEnterFrame = null;
} else if (Key.isDown(accelKey)) {
if (turboboost == -1) {
if (turbotime) {
player.speed = player.maxspeed * 1.5;
player.powertime = 7;
player.skid = 5;
turboboost = 1;
} else {
turboboost = 0;
}
}
}
};
carname = "Car" + pcar;
if ((pcar == 4) || (crazycars)) {
player = carSetup(carname, over, 0, 5, 8.5, 9.2, 100, 40, 8, 0, 2, 2, 16, 0, 2);
} else if ((pcar == 0) || (pcar == undefined)) {
player = carSetup(carname, over, 0, 5, 8.1, 7, 95, 40, 1, 6, 4, 2, 16, 4, 4);
} else if (pcar == 1) {
player = carSetup(carname, over, 0, 4.5, 8.2, 8, 97, 40, 2, 4, 3, 2, 16, 3, 3);
} else if (pcar == 2) {
player = carSetup(carname, over, 0, 10, 7.8, 10, 98, 40, 4, 3, 1, 2, 16, 2, 2);
} else if (pcar == 3) {
player = carSetup(carname, over, 0, 4.8, 8, 6.8, 95, 40, 1, 4, 5, 2, 16, 5, 5);
}
player._x = ((sx * tileWidth) + (tileWidth / 2)) + (25 * Math.cos((sr + 90) * p180));
player._y = ((sy * tileHeight) + (tileHeight / 2)) + (25 * Math.sin((sr + 90) * p180));
player._rotation = (player.rot = sr);
player.shadow._x = player._x + 4;
player.shadow._y = player._y + 4;
player.shadow._rotation = player._rotation;
if (hardmode) {
if (hardmode == 1) {
AIlev = 1;
} else {
AIlev = 1.2;
}
}
if (easymode) {
AIlev = 0.5;
}
if ((ocar == 0) || (ocar == undefined)) {
opponent = carSetup("Car0", over, 1, 5, 8.1 * AIlev, 7, 95, 40, 1, 6, 4, 2, 16, 4, 4);
} else if (ocar == 1) {
opponent = carSetup("Car1", over, 1, 4.5, 8.2 * AIlev, 8, 97, 40, 2, 4, 3, 2, 16, 3, 3);
} else if (ocar == 2) {
opponent = carSetup("Car2", over, 1, 10, 7.8 * AIlev, 10, 98, 40, 4, 3, 1, 2, 16, 2, 2);
} else if (ocar == 3) {
opponent = carSetup("Car3", over, 1, 4.8, 8 * AIlev, 6.8, 95, 40, 1, 4, 5, 2, 16, 5, 5);
} else if (ocar == 4) {
opponent = carSetup("Car4", over, 1, 5, 8.5 * AIlev, 9.2, 100, 40, 8, 0, 2, 2, 16, 0, 2);
}
if (switchcars) {
player.gfx.nextFrame();
} else if (pcar == ocar) {
opponent.gfx.nextFrame();
}
opponent._x = ((sx * tileWidth) + (tileWidth / 2)) + (25 * Math.cos((sr - 90) * p180));
opponent._y = ((sy * tileHeight) + (tileHeight / 2)) + (25 * Math.sin((sr - 90) * p180));
opponent._rotation = (opponent.rot = sr);
opponent.shadow._x = opponent._x + 4;
opponent.shadow._y = opponent._y + 4;
opponent.shadow._rotation = opponent._rotation;
first = 1;
fps.swapDepths(10000);
place = 0;
Key.addListener(this);
scrollAndUpdate();
onEnterFrame = function () {
if (Key.isDown(77)) {
if (k77) {
musics = !musics;
if (musics) {
music.start(0, 99999);
} else {
music.stop();
}
k77 = 0;
}
} else {
k77 = 1;
}
if (Key.isDown(83)) {
if (k83) {
sounds = !sounds;
k83 = 0;
}
} else {
k83 = 1;
}
scrollAndUpdate();
var i = 0;
while (i < powerups.length) {
var p = powerups[i];
if (p.ons) {
p.ticks++;
if (p.ticks > poweruptime) {
if ((sdepth++) > maxshadowdepth) {
sdepth = shadowndepth;
}
var temp = over.attachMovie("Powerup", (("Powerup_" + p.y) + "_") + p.x, sdepth);
temp._x = -100;
temp._y = -100;
temp._visible = 0;
temp.x = p.x;
temp.y = p.y;
temp.inPlace = 0;
temp.parent = p;
if (map[p.y][p.x][1] == 32) {
temp.gotoAndStop(random(temp._totalframes) + 1);
} else {
temp.gotoAndStop(map[p.y][p.x][1]);
}
temp.onEnterFrame = powerup;
if ((temp._currentframe == 3) && (p.knugggotten >= 3)) {
if (map[p.y][p.x][1] == 3) {
temp.removeMovieClip("");
} else {
temp.gotoAndStop(2);
}
}
p.ticks = 0;
p.ons = 0;
}
}
i++;
}
};
play();
Frame 66
gotoAndStop (67);
Frame 67
stop();
Frame 68
gotoAndStop (67);
Frame 80
call("dgamestart");
Frame 81
gotoAndStop (82);
Frame 82
stop();
Frame 83
gotoAndStop (82);
Frame 95
call("dgamestart");
Frame 96
gotoAndStop (97);
Frame 97
stop();
Frame 98
gotoAndStop (97);
Symbol 21 Button
on (release) {
_root.gotoAndStop("menu");
_parent.clearScreen();
}
Symbol 24 Button
on (release) {
getURL ("/join/index.php?ref=knugg_rally", "_blank");
}
Symbol 52 MovieClip Frame 25
gotoAndPlay (15);
Instance of Symbol 60 MovieClip "percent" in Symbol 65 MovieClip Frame 1
onClipEvent (enterFrame) {
this._x = (260 + _parent.percentloaded) - 0.5;
}
Symbol 94 Button
on (release) {
if (getBytesTotal() >= getBytesLoaded()) {
gotoAndStop (30);
} else {
loadframe = 34;
loadfinished = "levelselect";
gotoAndStop (2);
}
if (sounds) {
sClick.start();
}
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 98 Button
on (release) {
gotoAndStop (17);
if (sounds) {
sClick.start();
}
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 102 Button
on (release) {
gotoAndStop (21);
if (sounds) {
sClick.start();
}
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 106 Button
on (release) {
gotoAndStop (15);
if (sounds) {
sClick.start();
}
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 111 Button
on (release, keyPress "<Enter>") {
if (secretcode.length <= 1) {
Selection.setFocus(secretcodebox);
return(undefined);
}
if (secretcode.toLowerCase() == "ikea") {
if (switchcars == undefined) {
switchcars = 1;
} else {
switchcars = !switchcars;
}
if (switchcars == 1) {
secretpopup = "Alternate color cars enabled";
} else {
secretpopup = "Alternate color cars disabled";
}
if (sounds) {
sClick.stop();
sClick.start();
}
}
if (secretcode.toLowerCase() == "agresso") {
if (hardmode == undefined) {
hardmode = 1;
} else if (hardmode != 1) {
hardmode = 1;
} else {
hardmode = 0;
}
if (hardmode) {
secretpopup = "Hard mode enabled";
easymode = 0;
} else {
secretpopup = "Hard mode disabled";
}
if (sounds) {
sClick.stop();
sClick.start();
}
}
if (secretcode.toLowerCase() == "rallyx") {
secrettrack = 1;
secretpopup = "Secret tracks unlocked";
if (sounds) {
sClick.stop();
sClick.start();
}
}
if (secretcode.toLowerCase() == "iopred") {
secretpopup = "iopred is the yellow ninja ";
if (hardmode == undefined) {
hardmode = 2;
} else if (hardmode != 2) {
hardmode = 2;
} else {
hardmode = 0;
}
if (hardmode) {
secretpopup = secretpopup + "(Extra Hard mode enabled)";
easymode = 0;
} else {
secretpopup = secretpopup + "(Extra Hard mode disabled)";
}
if (sounds) {
sClick.stop();
sClick.start();
}
}
if (secretcode.toLowerCase() == "infrarat") {
secretpopup = "Infrarat is multi-dimensional ";
if (easymode == undefined) {
easymode = 1;
} else {
easymode = !easymode;
}
if (easymode == 1) {
secretpopup = secretpopup + "(Easy mode enabled)";
hardmode = 0;
} else {
secretpopup = secretpopup + "(Easy mode disabled)";
}
if (sounds) {
sClick.stop();
sClick.start();
}
}
if (secretcode.toLowerCase() == "strawberrybattle") {
if (crazycars == undefined) {
crazycars = 1;
} else {
crazycars = !crazycars;
}
if (crazycars == 1) {
secretpopup = "Mentat clearance sale mode enabled";
} else {
secretpopup = "Mentat clearance sale mode disabled";
}
if (sounds) {
sClick.stop();
sClick.start();
}
}
if (secretcode.toLowerCase() == "stun-v") {
secretpopup = "All codes reset";
easymode = 0;
hardmode = 0;
switchcars = 0;
secrettrack = 0;
if (sounds) {
sClick.stop();
sClick.start();
}
}
if ((secretcode.toLowerCase() == "boost") || (secretcode.toLowerCase() == "turbo")) {
secretpopup = "Accelerate just before 'Go!' for a turbo start";
if (sounds) {
sClick.stop();
sClick.start();
}
}
if ((secretcode.toLowerCase() == "creator") || (secretcode.toLowerCase() == "programmer")) {
secretpopup = "Programmed by Chris \"iopred\" Rhodes";
if (sounds) {
sClick.stop();
sClick.start();
}
}
secretcode = "";
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 114 MovieClip Frame 1
function createUpsellPage() {
attachMovie("superdudes_UpsellScreen", "upsellMC", 1);
upsellMC._x = Stage.width / 2;
upsellMC._y = Stage.height / 2;
upsellMC._visible = false;
}
function createBackground() {
this.createEmptyMovieClip("backgroundMC", 0);
backgroundMC._alpha = 0;
with (backgroundMC) {
beginFill(997247, 100);
lineTo(Stage.width, 0);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 0);
endFill();
}
backgroundMC.onPress = function () {
};
backgroundMC.useHandCursor = false;
}
function clearScreen() {
removeMovieClip("upsellMC");
removeMovieClip("backgroundMC");
_quality = prevQuality;
backgroundMC._visible = false;
backgroundMC._alpha = 0;
upsellMC._visible = false;
if (this.onEnterFrame != undefined) {
delete this.onEnterFrame;
}
}
function displayUpsellPage() {
createUpsellPage();
createBackground();
prevQuality = _quality;
_quality = "Low";
this.onEnterFrame = function () {
if (backgroundMC._alpha < 100) {
backgroundMC._alpha = backgroundMC._alpha + 5;
} else {
upsellMC._visible = true;
_quality = prevQuality;
delete this.onEnterFrame;
}
};
}
hs_url = "/bin/getSessionStatus.php";
game_id = 6;
Symbol 120 Button
on (release) {
_level1024.clear_screen();
gotoAndStop (10);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 123 Button
on (release) {
_level1024.clear_screen();
gotoAndStop (10);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 128 Button
on (release) {
sounds = 1;
musics = 1;
music.start(0, 99999);
ss.gotoAndStop(1);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 132 Button
on (release) {
musics = 0;
music.stop();
sounds = 0;
ss.gotoAndStop(2);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 136 Button
on (release) {
thequality = "low";
qs.gotoAndStop(1);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 140 Button
on (release) {
thequality = "medium";
qs.gotoAndStop(2);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 144 Button
on (release) {
thequality = "high";
qs.gotoAndStop(3);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 158 Button
on (release) {
_level1024.clear_screen();
nextFrame();
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 165 Button
on (release) {
_level1024.clear_screen();
prevFrame();
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 171 Button
on (rollOver) {
cs.gotoAndStop(2);
cname = "Stun-V";
cstat = "Max Rockets: 4\nMax Turbos: 4\nMass: 2500\nTop Speed: 192";
cs.gotoAndStop(2);
cdescription = "The Stun-V is the pinnacle of Knugg Rally technology, with reasonable speed and good storage capacity. Its unique six-wheeled design helps this racer hug the track even at high speeds.";
cj1.play();
if (sounds) {
sRollover.start();
}
}
on (release) {
pcar = 0;
starterMap();
}
Symbol 172 Button
on (rollOver) {
cs.gotoAndStop(5);
cname = "Vortek";
cstat = "Max Rockets: 3\nMax Turbos: 3\nMass: 2000\nTop Speed: 194";
cdescription = "The Vortek features a state-of-the-art quantum effect engine, giving it incredible power but low acceleration. A good all-around vehicle, the Vortek has been a favorite of Knugg Rally racers for years.";
cj4.play();
if (sounds) {
sRollover.start();
}
}
on (release) {
pcar = 1;
starterMap();
}
Symbol 173 Button
on (rollOver) {
cs.gotoAndStop(4);
cname = "Axcel";
cstat = "Max Rockets: 2\nMax Turbos: 2\nMass: 1000 \nTop Speed: 186";
cdescription = "The designers of the Axcel had only one goal in mind: acceleration! The Axcel is always first out of the starting gate, but its ultra-lightweight construction limits its top speed and cargo capacity.";
cj3.play();
if (sounds) {
sRollover.start();
}
}
on (release) {
pcar = 2;
starterMap();
}
Symbol 174 Button
on (rollOver) {
cs.gotoAndStop(1);
cname = "Agresso";
cstat = "Max Rockets: 5\nMax Turbos: 5\nMass: 3000\nTop Speed: 190";
cdescription = "The Agresso is a slow indestructible tank of a vehicle, for when you feel like running over your problems instead of going around them. A roomy interior gives you plenty of space for Rockets and Turbos.";
cj0.play();
if (sounds) {
sRollover.start();
}
}
on (release) {
pcar = 3;
starterMap();
}
Symbol 175 Button
on (rollOver) {
cs.gotoAndStop(3);
cname = "Mentat";
cstat = "Max Rockets: 0\nMax Turbos: 2\nMass: 1500\nTop Speed: 200";
cdescription = "The Mentat is a revolutionary leap in Superdudes technology, offering unparalleled speed and handling. Floating effortlessly above the track, the Mentat\u00EDs weakness is its complete lack of weapons.";
cj2.play();
if (sounds) {
sRollover.start();
}
}
on (release) {
pcar = 4;
starterMap();
}
Symbol 183 MovieClip Frame 1
stop();
Symbol 190 Button
on (release) {
_level1024.clear_screen();
gotoAndStop (30);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 193 MovieClip Frame 1
stop();
Symbol 194 MovieClip Frame 1
stop();
Symbol 197 MovieClip Frame 1
stop();
Symbol 198 MovieClip Frame 1
stop();
Symbol 201 MovieClip Frame 1
stop();
Symbol 202 MovieClip Frame 1
stop();
Symbol 205 MovieClip Frame 1
stop();
Symbol 206 MovieClip Frame 1
stop();
Symbol 209 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 1
stop();
Symbol 212 Button
on (rollOver) {
trackdescription = "The Nimoy Asteroid Cluster is a favorite place to race. Make sure to bring your own oxygen, and watch out for the mining equipment!";
if (sounds) {
sRollover.start();
}
}
on (release) {
maparr = maparrd;
gotoAndStop (28);
}
Symbol 215 MovieClip Frame 1
stop();
Symbol 225 Button
on (release) {
_parent._parent.nextTrack();
}
on (rollOver) {
if (_root.sounds) {
_root.sRollover.start();
}
}
Symbol 229 Button
on (release) {
_parent._parent.nextTrack();
}
on (rollOver) {
if (_root.sounds) {
_root.sRollover.start();
}
}
Symbol 230 MovieClip Frame 1
stop();
Symbol 231 Button
on (release) {
_level1024.clear_screen();
if (_root.session.result != 0) {
_root.gotoAndStop("menu");
} else {
_root.gotoAndStop("upsell");
}
}
on (rollOver) {
if (_root.sounds) {
_root.sRollover.start();
}
}
Symbol 235 Button
on (release) {
_parent.highscoresi = setInterval(_parent.sendHighScore, 100);
}
Symbol 236 MovieClip Frame 1
if ((_parent.score != 0) && (_parent.session.result != 0)) {
nextFrame();
} else {
stop();
}
if (_parent.place != 1) {
nt.gotoAndStop(2);
}
Symbol 236 MovieClip Frame 2
stop();
if (_parent.place != 1) {
nt.gotoAndStop(2);
}
Symbol 245 Button
on (release) {
highscoresi = setInterval(sendHighScore, 100);
}
on (rollOver) {
if (sounds) {
sRollover.start();
}
}
Symbol 253 MovieClip [Explosion] Frame 31
stop();
removeMovieClip("");
Symbol 273 MovieClip [Display] Frame 1
tn.mapname = _parent.mapname;
if (_parent.sounds) {
_parent.s3.start();
}
Symbol 273 MovieClip [Display] Frame 30
if (_parent.sounds) {
_parent.s2.start();
}
Symbol 273 MovieClip [Display] Frame 60
if (_parent.sounds) {
_parent.s1.start();
}
Symbol 273 MovieClip [Display] Frame 85
_root.turbotime = 1;
Symbol 273 MovieClip [Display] Frame 90
_root.turbotime = 0;
if (_parent.sounds) {
_parent.sgo.start();
}
go = 1;
Symbol 273 MovieClip [Display] Frame 120
stop();
Symbol 273 MovieClip [Display] Frame 140
stop();
Symbol 273 MovieClip [Display] Frame 160
stop();
Symbol 273 MovieClip [Display] Frame 180
stop();
Symbol 273 MovieClip [Display] Frame 200
stop();
Symbol 273 MovieClip [Display] Frame 250
stop();
_root.gotoAndStop("endrace");
_root.onEnterFrame = null;
Symbol 295 MovieClip [Skid] Frame 50
this.removeMovieClip("");
Symbol 357 MovieClip Frame 1
stop();
Symbol 365 Button
on (release) {
_parent.place = 3;
if (_parent.session.result != 0) {
_parent.gotoAndStop("endrace");
} else {
_parent.gotoAndStop("upsell");
}
}
Symbol 386 MovieClip Frame 1
stop();
Symbol 407 MovieClip Frame 1
stop();