Frame 27
stop();
Frame 28
stop();
Frame 29
stop();
Frame 30
_root.gotoAndPlay("mainmenu2");
Frame 32
_root.gotoAndPlay("mainmenu2");
Frame 92
stop();
Instance of Symbol 71 MovieClip "lights" in Frame 92
onClipEvent (load) {
startime = 0;
}
onClipEvent (enterFrame) {
startime++;
if (startime == 15) {
_root.lights.gotoAndStop(2);
}
if (startime == 30) {
_root.lights.gotoAndStop(3);
}
if (startime == 45) {
_root.gotoAndPlay("startrace2");
}
}
Frame 93
stop();
Instance of Symbol 74 MovieClip "player" in Frame 93
onClipEvent (load) {
_rotation = 0;
thrdir = _rotation;
move = 0;
keyup = false;
avgspd = 0;
ttlspd = 0;
ttlfrm = 0;
cpa = 0;
cpb = 0;
cpc = 0;
cporder = 0;
lappy = 0;
lapa = 0;
laptimer = 0;
_global.time1 = 0;
_global.time2 = 0;
_global.time3 = 0;
_global.wallhit = 0;
}
onClipEvent (enterFrame) {
if (move >= 0) {
_root.needle._rotation = (180 * move) / 21;
}
if (_root.needle._rotation >= 180) {
_root.needle._rotation = 180;
}
if (move > 0) {
if (move < 1) {
move = 0;
}
}
thrdir = _rotation;
if (Key.isDown(32)) {
_root.player.gotoAndStop(2);
if (Math.abs(move) >= 3) {
move = move - (3 * (move / Math.abs(move)));
} else if (move < 3) {
if (move > -3) {
move = 0;
}
}
} else {
_root.player.gotoAndStop(1);
}
if (Key.isDown(39)) {
if (move != 0) {
_rotation = (_rotation + 8.18181818181818);
}
}
if (Key.isDown(37)) {
if (move != 0) {
_rotation = (_rotation - 8.18181818181818);
}
}
if (Key.isDown(38)) {
keyup = true;
if (move < 21) {
move = move + ((21 - move) / 8);
} else if (move >= 21) {
move = 21;
}
} else if (move > 0) {
move = move - 0.7;
} else {
keyup = false;
}
if (Key.isDown(40)) {
if (move > -6) {
move = move - 1.1;
}
} else if (move < 0) {
move = move + 0.8;
}
if (Key.isDown(77)) {
_root.gotoAndPlay("mainmenu2");
}
x = Math.sin(thrdir * (Math.PI/180)) * move;
y = (Math.cos(thrdir * (Math.PI/180)) * move) * -1;
if ((_x + x) <= 18.5) {
_x = 530;
} else if ((_x + x) >= 531) {
_x = 19;
}
if ((_y + y) <= 18.5) {
_y = 380;
} else if ((_y + y) >= 381) {
_y = 19;
}
if (_root.track.hitTest(_x + x, _y + y, true)) {
_root.track._x = _root.track._x - x;
_root.track._y = _root.track._y - y;
} else {
_global.wallhit = _global.wallhit + 1;
move = move * -0.6;
}
if (_root.track.checkpoint1.hitTest(_x + x, _y + y, true)) {
if (cpa != 1) {
cpc = cpb;
cpb = cpa;
cpa = 1;
}
}
if (_root.track.checkpoint2.hitTest(_x + x, _y + y, true)) {
if (cpa != 2) {
cpc = cpb;
cpb = cpa;
cpa = 2;
}
}
if (_root.track.checkpoint3.hitTest(_x + x, _y + y, true)) {
if (cpa != 3) {
cpc = cpb;
cpb = cpa;
cpa = 3;
}
}
if (((cpa == 3) && (cpb == 2)) && (cpc == 1)) {
lappy = lappy + 1;
cpc = 4;
}
if (((cpa == 1) && (cpb == 2)) && (cpc == 3)) {
lappy = lappy - 1;
cpc = 4;
}
if (lappy > lapa) {
lapa = lappy;
if (lapa == 2) {
_global.time1 = int((laptimer / 12) * 10) / 10;
}
if (lapa == 3) {
_global.time2 = int((laptimer / 12) * 10) / 10;
}
if (lapa == 4) {
_global.time3 = int((laptimer / 12) * 10) / 10;
_global.avgspd = avgspd;
_root.gotoAndPlay("finishrace");
}
laptimer = 0;
}
if (lapa == 1) {
laptimer++;
timeval = int((laptimer / 12) * 10) / 10;
timestr = timeval.toString();
if (timestr.indexOf(".") == -1) {
timestr = timestr + ".0";
}
_root.lap1time.text = "Lap 1: " + timestr;
}
if (lapa == 2) {
laptimer++;
timeval = int((laptimer / 12) * 10) / 10;
timestr = timeval.toString();
if (timestr.indexOf(".") == -1) {
timestr = timestr + ".0";
}
_root.lap2time.text = "Lap 2: " + timestr;
}
if (lapa == 3) {
laptimer++;
timeval = int((laptimer / 12) * 10) / 10;
timestr = timeval.toString();
if (timestr.indexOf(".") == -1) {
timestr = timestr + ".0";
}
_root.lap3time.text = "Lap 3: " + timestr;
}
ttlfrm++;
ttlspd = ttlspd + Math.abs(move);
avgspd = int(((ttlspd / ttlfrm) * 5.71428571428571) * 1000) / 1000;
_root.avgspdtxt.text = avgspd;
_root.lapnumb.text = lappy + "/3";
}
Frame 94
stop();
Instance of Symbol 74 MovieClip "player" in Frame 94
onClipEvent (load) {
_rotation = 0;
thrdir = _rotation;
move = 0;
keyup = false;
}
onClipEvent (enterFrame) {
if (move >= 0) {
_root.needle._rotation = (180 * move) / 21;
}
if (_root.needle._rotation >= 180) {
_root.needle._rotation = 180;
}
if (move > 0) {
if (move < 1) {
move = 0;
}
}
thrdir = _rotation;
if (Key.isDown(32)) {
_root.player.gotoAndStop(2);
if (Math.abs(move) >= 3) {
move = move - (3 * (move / Math.abs(move)));
} else if (move < 3) {
if (move > -3) {
move = 0;
}
}
} else {
_root.player.gotoAndStop(1);
}
if (Key.isDown(39)) {
if (move != 0) {
_rotation = (_rotation + 8.18181818181818);
}
}
if (Key.isDown(37)) {
if (move != 0) {
_rotation = (_rotation - 8.18181818181818);
}
}
if (Key.isDown(38)) {
keyup = true;
if (move < 21) {
move = move + ((21 - move) / 8);
} else if (move >= 21) {
move = 21;
}
} else if (move > 0) {
move = move - 0.7;
} else {
keyup = false;
}
if (Key.isDown(40)) {
if (move > -6) {
move = move - 1.1;
}
} else if (move < 0) {
move = move + 0.8;
}
if (Key.isDown(77)) {
_root.gotoAndPlay("mainmenu2");
}
x = Math.sin(thrdir * (Math.PI/180)) * move;
y = (Math.cos(thrdir * (Math.PI/180)) * move) * -1;
if ((_x + x) <= 18.5) {
_x = 530;
} else if ((_x + x) >= 531) {
_x = 19;
}
if ((_y + y) <= 18.5) {
_y = 380;
} else if ((_y + y) >= 381) {
_y = 19;
}
if (!_root.track.hitTest(_x + x, _y + y, true)) {
_x = (_x + x);
_y = (_y + y);
} else {
move = move * -0.6;
}
}
Frame 95
timeval = _global.time1;
timestr = timeval.toString();
if (timestr.indexOf(".") == -1) {
timestr = timestr + ".0";
}
_root.lap1.text = timestr + "s";
timeval = _global.time2;
timestr = timeval.toString();
if (timestr.indexOf(".") == -1) {
timestr = timestr + ".0";
}
_root.lap2.text = timestr + "s";
timeval = _global.time3;
timestr = timeval.toString();
if (timestr.indexOf(".") == -1) {
timestr = timestr + ".0";
}
_root.lap3.text = timestr + "s";
_root.hits.text = _global.wallhit;
_root.avspd.text = Math.round(_global.avgspd) + " kmph";
totaltime = (_global.time1 + _global.time2) + _global.time3;
timestr = totaltime.toString();
if (timestr.indexOf(".") == -1) {
timestr = timestr + ".0";
}
_root.laptotal.text = timestr + "s";
_root.buntatext.text = "Nice race, kid!";
if (_global.wallhit > 5) {
_root.buntatext.text = _root.buntatext.text + " You hit the walls far too much, but that can be corrected if you just brake more often.";
}
if (_global.avgspd > 110) {
_root.buntatext.text = _root.buntatext.text + " Excellent speeds. I saw the way you handled those curves. You have expert precision.";
}
if (totaltime > 150) {
_root.buntatext.text = _root.buntatext.text + " Work harder to improve your time.";
}
if ((totaltime > 120) && (totaltime <= 150)) {
_root.buntatext.text = _root.buntatext.text + " Your times are impressive. Try to perfect that time, and you might beat my personal best.";
}
if (totaltime <= 120) {
_root.buntatext.text = _root.buntatext.text + " That was an amazing run. Now, try to beat my best time: 101.6 seconds";
}
if (totaltime < 101.6) {
_root.buntatext.text = "Incredible! You have perfected this course. Not only have you impressed me, but you have beaten my best time of 101.6 seconds. You are truly an amazing driver!";
}
stop();
Symbol 11 Button
on (release) {
_root.play();
}
Symbol 12 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 12 MovieClip Frame 2
gotoAndPlay (1);
Symbol 27 Button
on (release) {
_root.gotoAndStop("startrace1");
}
Symbol 30 Button
on (release) {
_root.gotoAndStop("testdrive");
}
Symbol 33 Button
on (release) {
_root.gotoAndStop("instructionspage1");
}
Symbol 36 Button
on (release) {
_root.gotoAndPlay("options");
}
Symbol 52 Button
on (release) {
gotoAndStop ("menuready");
}
Symbol 57 Button
on (release) {
_root.gotoAndPlay("stopmusic");
}
Symbol 60 Button
on (release) {
_root.gotoAndPlay("playmusic");
}
Symbol 71 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 2
stop();
Symbol 71 MovieClip Frame 3
stop();
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 2
stop();
Symbol 87 MovieClip Frame 12
this.time++;
this.gotoAndPlay(1);
Symbol 117 Button
on (release) {
_root.gotoAndPlay("mainmenu2");
}