Combined Code
frame 1 {
var loadAmount = _totalframes;
if (_framesloaded == loadAmount) {
gotoAndPlay(5);
}
}
movieClip 3 {
}
movieClip 5 {
}
movieClip 11 {
}
frame 3 {
if (_framesloaded == loadAmount) {
gotoAndPlay(5);
} else {
total = Math.round(getBytesTotal() / 1024);
loaded = Math.round(getBytesLoaded() / 1024);
percent = Math.round((loaded / total) * 100);
bytesTotalOutput = total + 'k';
percentOutput = percent + '%';
loadBar._width = loadBarHousing._width * (percent / 100);
gotoAndPlay(2);
}
}
frame 5 {
tlap1 = 1;
tlap2 = 2;
saved = 0;
tNum = 'track1';
p1name = 'player 1';
p2name = 'player 2';
maxLaps = 10;
singleP = 0;
lightsP1 = 0;
lightsP2 = 0;
c1 = 0;
c2 = 0;
mct1 = new Object();
mct2 = new Object();
mct3 = new Object();
mct4 = new Object();
mct5 = new Object();
mct6 = new Object();
mct7 = new Object();
mct8 = new Object();
mct9 = new Object();
mct10 = new Object();
mct1 = {'ra': '70', 'rb': '0', 'ga': '70', 'gb': '46', 'ba': '70', 'bb': '0', 'aa': '100', 'ab': '0'};
mct2 = {'ra': '70', 'rb': '0', 'ga': '70', 'gb': '10', 'ba': '70', 'bb': '70', 'aa': '100', 'ab': '0'};
mct3 = {'ra': '70', 'rb': '70', 'ga': '70', 'gb': '0', 'ba': '70', 'bb': '0', 'aa': '100', 'ab': '0'};
mct4 = {'ra': '70', 'rb': '50', 'ga': '70', 'gb': '50', 'ba': '70', 'bb': '0', 'aa': '100', 'ab': '0'};
mct5 = {'ra': '70', 'rb': '0', 'ga': '70', 'gb': '50', 'ba': '70', 'bb': '80', 'aa': '100', 'ab': '0'};
mct6 = {'ra': '70', 'rb': '0', 'ga': '70', 'gb': '15', 'ba': '70', 'bb': '46', 'aa': '100', 'ab': '0'};
mct7 = {'ra': '70', 'rb': '10', 'ga': '70', 'gb': '0', 'ba': '70', 'bb': '10', 'aa': '100', 'ab': '0'};
mct8 = {'ra': '70', 'rb': '60', 'ga': '70', 'gb': '30', 'ba': '70', 'bb': '0', 'aa': '100', 'ab': '0'};
mct9 = {'ra': '70', 'rb': '0', 'ga': '70', 'gb': '70', 'ba': '70', 'bb': '0', 'aa': '100', 'ab': '0'};
mct10 = {'ra': '70', 'rb': '80', 'ga': '70', 'gb': '90', 'ba': '70', 'bb': '40', 'aa': '100', 'ab': '0'};
}
frame 6 {
function p1color(name) {
t1c.setTransform(name);
n1c.setTransform(name);
n1ca.setTransform(name);
}
function p2color(name) {
t2c.setTransform(name);
n2c.setTransform(name);
n2ca.setTransform(name);
}
stop();
turnRate = 6;
maxSpeed = 5;
startRace = 0;
p1time = 0;
p1total = 0;
p2time = 0;
p2total = 0;
lights._alpha = 0;
lights2._alpha = 0;
lights._x = -1000;
lights2._x = -1000;
t1c = new Color(truck);
n1c = new Color(options.scores.names);
n1ca = new Color(vs.p1);
t2c = new Color(truck2);
n2c = new Color(options.scores.names2);
n2ca = new Color(vs.p2);
}
movieClip 17 {
frame 2 {
if (_root.startRace == 1) {
} else {
gotoAndPlay(1);
}
}
}
movieClip 21 {
}
instance truck of movieClip 21 {
onClipEvent (load) {
angle = 0;
speed = 0;
maxSpeed = 0;
turnRate = 0;
accelRate = 0.25;
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2) && _xscale == 100 && _root.truck2._xscale == 100) {
_root.truck.speed -= 2;
_root.truck2.speed -= 2;
if (_root.truck.speed < 0) {
_root.truck.speed = 0;
}
if (_root.truck2.speed < 0) {
_root.truck2.speed = 0;
}
if (_root.truck2._y < _y - 10) {
_y = _y + 5;
_root.truck2._y -= 5;
}
if (_y + 10 < _root.truck2._y) {
_y = _y - 5;
_root.truck2._y += 5;
}
if (_root.truck2._x < _x - 10) {
_x = _x + 5;
_root.truck2._x -= 5;
}
if (_x + 10 < _root.truck2._x) {
_x = _x - 5;
_root.truck2._x += 5;
}
}
if (_xscale == 100 && _root.startRace == 1) {
turnRate = _root.turnRate;
} else {
turnRate = 0;
}
angle += turn;
_rotation = angle;
if (0 < speed && accel < 0 || speed < maxSpeed && 0 < accel) {
speed += accel;
}
if (_x < 20 && _rotation < 0 || 630 < _x && 0 < _rotation || _y < 20 && (_rotation < 90 && -90 < _rotation) || 340 < _y && (_rotation < -90 || 90 < _rotation)) {
} else {
_x = _x + Math.sin(angle * 0.0174532925199433) * speed;
_y = _y - Math.cos(angle * 0.0174532925199433) * speed;
}
_root.lights._rotation = this._rotation;
if (_root.lights._alpha < 20) {
_root.lights._x = -1000;
} else {
_root.lights._x = this._x;
_root.lights._y = this._y;
}
}
onClipEvent (keyDown) {
pressed = Key.getCode();
if (pressed == 37) {
turn = -turnRate;
} else {
if (pressed == 39) {
turn = turnRate;
} else {
if (pressed == 38) {
accel = accelRate;
} else {
if (pressed == 40) {
accel = -accelRate;
}
}
}
}
updateAfterEvent();
}
onClipEvent (keyUp) {
pressed = Key.getCode();
if (pressed == 37 || pressed == 39) {
turn = 0;
} else {
if (pressed == 38 || pressed == 40) {
accel = -accelRate;
}
}
updateAfterEvent();
}
}
movieClip 22 {
}
instance truck2 of movieClip 22 {
onClipEvent (load) {
angle = 0;
speed = 0;
maxSpeed = 0;
turnRate = 0;
accelRate = 0.25;
}
onClipEvent (enterFrame) {
if (_root.singleP == 1) {
_x = -2000;
_root.p2cf = 1;
} else {
if (_xscale == 100 && _root.startRace == 1) {
turnRate = _root.turnRate;
} else {
turnRate = 0;
}
angle += turn;
_rotation = angle;
if (0 < speed && accel < 0 || speed < maxSpeed && 0 < accel) {
speed += accel;
}
if (_x < 20 && _rotation < 0 || 630 < _x && 0 < _rotation || _y < 20 && (_rotation < 90 && -90 < _rotation) || 340 < _y && (_rotation < -90 || 90 < _rotation)) {
} else {
_x = _x + Math.sin(angle * 0.0174532925199433) * speed;
_y = _y - Math.cos(angle * 0.0174532925199433) * speed;
}
_root.lights2._rotation = this._rotation;
if (_root.lights2._alpha < 20) {
_root.lights2._x = -1000;
} else {
_root.lights2._x = this._x;
_root.lights2._y = this._y;
}
}
}
onClipEvent (keyDown) {
pressed = Key.getCode();
if (pressed == 65) {
turn = -turnRate;
} else {
if (pressed == 68) {
turn = turnRate;
} else {
if (pressed == 87) {
accel = accelRate;
} else {
if (pressed == 83) {
accel = -accelRate;
}
}
}
}
updateAfterEvent();
}
onClipEvent (keyUp) {
pressed = Key.getCode();
if (pressed == 65 || pressed == 68) {
turn = 0;
} else {
if (pressed == 87 || pressed == 83) {
accel = -accelRate;
}
}
updateAfterEvent();
}
}
movieClip 24 {
}
movieClip 31 {
}
movieClip 33 {
}
movieClip 35 {
frame 1 {
stop();
a = 0;
}
frame 25 {
if (a == 2) {
stop();
delete a;
} else {
gotoAndPlay(2);
}
}
}
movieClip 36 {
frame 1 {
stop();
a = 0;
}
frame 25 {
if (a == 2) {
stop();
delete a;
} else {
gotoAndPlay(2);
}
}
}
movieClip 37 {
}
button 39 {
on (keyPress '\') {
if (_root.lightsP1 == 0) {
_root.lights._alpha = 70;
_root.lightsP1 = 1;
} else {
_root.lights._alpha = 0;
_root.lightsP1 = 0;
}
}
on (keyPress 'q') {
if (_root.lightsP2 == 0) {
_root.lights2._alpha = 70;
_root.lightsP2 = 1;
} else {
_root.lights2._alpha = 0;
_root.lightsP2 = 0;
}
}
}
button 47 {
on (press) {
gotoAndStop(6);
}
}
button 52 {
on (release) {
tNum = 'track1';
_root.tNum = tNum;
glow._x = -190.1;
}
}
button 56 {
on (release) {
tNum = 'track2';
_root.tNum = tNum;
glow._x = -49;
}
}
button 59 {
on (release) {
tNum = 'track3';
_root.tNum = tNum;
glow._x = 97;
}
}
movieClip 64 {
}
movieClip 65 {
}
button 70 {
on (press) {
if (maxLaps == 20) {
} else {
++maxLaps;
++_root.maxLaps;
}
}
}
button 71 {
on (press) {
if (maxLaps == 1) {
} else {
--maxLaps;
--_root.maxLaps;
}
}
}
button 75 {
on (release) {
if (length(p1name) < 3) {
eName.gotoAndPlay('name1');
} else {
if (length(p2name) < 3 && _root.singleP != 1) {
eName.gotoAndPlay('name2');
} else {
if (_root.singleP == 1) {
_root.p2name = '';
} else {
_root.p2name = p2name;
_root.truck2.lap = tLap2;
}
_root.p1name = p1name;
_root.truck.lap = tLap1;
_root.gotoAndPlay(_root.tNum);
}
}
}
}
button 80 {
on (press) {
if (tlap1 == 9) {
} else {
++tlap1;
if (tlap1 == tlap2) {
++tlap1;
if (tlap1 >= 10) {
tlap1 = 8;
}
}
_root.tlap1 = tlap1;
}
}
}
button 81 {
on (press) {
if (tlap1 == 1) {
} else {
--tlap1;
if (tlap1 == tlap2) {
--tlap1;
if (tlap1 < 1) {
tlap1 = 2;
}
}
_root.tlap1 = tlap1;
}
}
}
button 83 {
on (press) {
if (tlap2 == 9) {
} else {
++tlap2;
if (tlap2 == tlap1) {
++tlap2;
if (tlap2 >= 10) {
tlap2 = 8;
}
}
_root.tlap2 = tlap2;
}
}
}
button 84 {
on (press) {
if (tlap2 == 1) {
} else {
--tlap2;
if (tlap2 == tlap1) {
--tlap2;
if (tlap2 < 1) {
tlap2 = 2;
}
}
_root.tlap2 = tlap2;
}
}
}
movieClip 90 {
}
movieClip 92 {
}
button 93 {
on (release) {
if (_root.lightsP2 == 0) {
_root.lights2._alpha = 70;
_root.lightsP2 = 1;
l2._alpha = 100;
} else {
_root.lights2._alpha = 0;
_root.lightsP2 = 0;
l2._alpha = 0;
}
}
}
button 94 {
on (release) {
if (_root.lightsP1 == 0) {
_root.lights._alpha = 70;
_root.lightsP1 = 1;
l1._alpha = 100;
} else {
_root.lights._alpha = 0;
_root.lightsP1 = 0;
l1._alpha = 0;
}
}
}
button 96 {
on (release) {
_root.p1color(_root.mct1);
_root.c1 = 1;
}
}
button 98 {
on (release) {
_root.p1color(_root.mct2);
_root.c1 = 2;
}
}
button 99 {
on (release) {
_root.p1color(_root.mct3);
_root.c1 = 3;
}
}
button 100 {
on (release) {
_root.p1color(_root.mct4);
_root.c1 = 4;
}
}
button 101 {
on (release) {
_root.p1color(_root.mct5);
_root.c1 = 5;
}
}
button 102 {
on (release) {
_root.p2color(_root.mct6);
_root.c2 = 6;
}
}
button 103 {
on (release) {
_root.p2color(_root.mct7);
_root.c2 = 7;
}
}
button 104 {
on (release) {
_root.p2color(_root.mct8);
_root.c2 = 8;
}
}
button 105 {
on (release) {
_root.p2color(_root.mct9);
_root.c2 = 9;
}
}
button 106 {
on (release) {
_root.p2color(_root.mct10);
_root.c2 = 10;
}
}
button 109 {
on (release) {
if (_root.singleP == 0) {
_root.singleP = 1;
sP._alpha = 100;
} else {
_root.singleP = 0;
sP._alpha = 0;
}
}
}
movieClip 111 {
}
movieClip 112 {
}
movieClip 116 {
}
movieClip 119 {
}
movieClip 128 {
frame 1 {
stop();
}
frame 35 {
gotoAndStop(1);
}
}
button 132 {
on (press) {
gotoAndStop(1);
}
}
button 136 {
on (release) {
clearEm();
tm = 1;
gotoAndStop(8);
}
}
button 138 {
on (release) {
clearEm();
tm = 2;
gotoAndStop(9);
}
}
button 140 {
on (release) {
clearEm();
tm = 3;
gotoAndStop(10);
}
}
button 143 {
on (release) {
getURL('http://www.vfov.com', '_blank');
}
}
movieClip 149 {
}
movieClip 150 {
frame 15 {
if (_parent.name0 == 'retrieving' && _parent.done == 1) {
_parent.name0 = 'Nobody!';
_parent.time0 = '0:00:000';
}
}
}
movieClip 152 {
}
movieClip 153 {
}
movieClip 154 {
}
button 157 {
on (release) {
lc = 1;
getScores();
}
}
button 158 {
on (release) {
lc = 2;
getScores();
}
}
button 159 {
on (release) {
lc = 3;
getScores();
}
}
button 160 {
on (release) {
lc = 4;
getScores();
}
}
button 161 {
on (release) {
lc = 5;
getScores();
}
}
button 162 {
on (release) {
lc = 6;
getScores();
}
}
button 163 {
on (release) {
lc = 7;
getScores();
}
}
button 164 {
on (release) {
lc = 8;
getScores();
}
}
button 165 {
on (release) {
lc = 9;
getScores();
}
}
button 166 {
on (release) {
lc = 13;
getScores();
}
}
button 167 {
on (release) {
lc = 14;
getScores();
}
}
button 168 {
on (release) {
lc = 15;
getScores();
}
}
button 169 {
on (release) {
lc = 16;
getScores();
}
}
button 170 {
on (release) {
lc = 17;
getScores();
}
}
button 171 {
on (release) {
lc = 18;
getScores();
}
}
button 172 {
on (release) {
lc = 19;
getScores();
}
}
button 173 {
on (release) {
lc = 12;
getScores();
}
}
button 174 {
on (release) {
lc = 11;
getScores();
}
}
button 175 {
on (release) {
lc = 10;
getScores();
}
}
button 176 {
on (release) {
lc = 20;
getScores();
}
}
movieClip 178 {
}
movieClip 198 {
frame 1 {
stop();
maxLaps = _root.maxLaps;
tlap1 = _root.tlap1;
tlap2 = _root.tlap2;
if (_root.c1 == 1) {
_root.p1color(_root.mct1);
}
if (_root.c1 == 2) {
_root.p1color(_root.mct2);
}
if (_root.c1 == 3) {
_root.p1color(_root.mct3);
}
if (_root.c1 == 4) {
_root.p1color(_root.mct4);
}
if (_root.c1 == 5) {
_root.p1color(_root.mct5);
}
if (_root.c2 == 6) {
_root.p2color(_root.mct6);
}
if (_root.c2 == 7) {
_root.p2color(_root.mct7);
}
if (_root.c2 == 8) {
_root.p2color(_root.mct8);
}
if (_root.c2 == 9) {
_root.p2color(_root.mct9);
}
if (_root.c2 == 10) {
_root.p2color(_root.mct10);
}
if (_root.tNum == 'track2') {
glow._x = -49;
} else {
if (_root.tNum == 'track3') {
glow._x = 97;
} else {
tNum = 'track1';
glow._x = -190.1;
}
}
if (_root.singleP == 1) {
sP._alpha = 100;
} else {
sP._alpha = 0;
}
if (_root.lightsP1 == 1) {
l1._alpha = 100;
} else {
l1._alpha = 0;
}
if (_root.lightsP2 == 1) {
l2._alpha = 100;
} else {
l2._alpha = 0;
}
if (_root.p1name != 'player 1') {
p1name = _root.p1name;
}
if (_root.p2name != 'player 2') {
p2name = _root.p2name;
}
if (!length(p1name)) {
Selection.setFocus('p1name');
} else {
if (!length(p2name) && _root.singleP != 1) {
Selection.setFocus('p2name');
}
}
if (_root.lightsP1 == 1) {
_root.lights._alpha = 70;
}
if (_root.lightsP2 == 1) {
_root.lights2._alpha = 70;
}
}
frame 6 {
function clearEm() {
done = 0;
name0 = '';
name1 = '';
name2 = '';
time0 = '';
time1 = '';
time2 = '';
}
function goTitle() {
if (tm == 1) {
track = 'Track 1';
}
if (tm == 2) {
track = 'Track 2';
}
if (tm == 3) {
track = 'Track 3';
}
}
function getScores() {
done = 0;
name0 = 'retrieving';
name1 = '';
name2 = '';
time0 = 'scores...';
time1 = '';
time2 = '';
a = '&blah=' + (getTimer() + Math.random(10000000) + 1);
if (tm == 1) {
this.loadVariables('http://www.vfov.com/race/getdb1.php?id=' add lc + a, 'GET');
track = 'Track 1 Laps: ' + lc + ' Top 3';
} else {
if (tm == 2) {
this.loadVariables('http://www.vfov.com/race/getdb2.php?id=' add lc + a, 'GET');
track = 'Track 2 Laps: ' + lc + ' Top 3';
} else {
if (tm == 3) {
this.loadVariables('http://www.vfov.com/race/getdb3.php?id=' add lc + a, 'GET');
track = 'Track 3 Laps: ' + lc + ' Top 3';
}
}
}
}
clearEm();
}
instance of movieClip 152 {
onClipEvent (load) {
gotoAndPlay(10);
}
}
instance of movieClip 153 {
onClipEvent (load) {
gotoAndPlay(5);
}
}
frame 8 {
goTitle();
}
frame 9 {
goTitle();
}
frame 10 {
goTitle();
}
}
movieClip 199 {
}
movieClip 222 {
frame 1 {
stop();
}
frame 17 {
name0 = 'retrieving';
time0 = 'times...';
name1 = '';
time1 = '';
name2 = '';
time2 = '';
a = '&blah=' + (getTimer() + Math.random(10000000) + 1);
if (_root.tNum == 'track1') {
this.loadVariables('http://www.vfov.com/race/getdb1.php?id=' add _root.maxLaps + a, 'GET');
track = 'Track 1 Laps: ' + _root.maxLaps + ' Top 3';
} else {
if (_root.tNum == 'track2') {
this.loadVariables('http://www.vfov.com/race/getdb2.php?id=' add _root.maxLaps + a, 'GET');
track = 'Track 2 Laps: ' + _root.maxLaps + ' Top 3';
} else {
if (_root.tNum == 'track3') {
this.loadVariables('http://www.vfov.com/race/getdb3.php?id=' add _root.maxLaps + a, 'GET');
track = 'Track 3 Laps: ' + _root.maxLaps + ' Top 3';
}
}
}
}
frame 19 {
if (done == 1) {
delete done;
} else {
gotoAndPlay(18);
}
}
frame 25 {
stop();
if (name0 == 'retrieving') {
name0 = 'Nobody!';
time0 = '0:00:000';
}
}
frame 26 {
laps = _root.maxLaps;
p1name = _root.p1name;
p1time = _root.p1time;
p1total = _root.p1total;
p2name = _root.p2name;
p2time = _root.p2time;
p2total = _root.p2total;
endData = 'laps=' + laps + '&p1name=' + p1name + '&p1time=' + p1time + '&p1total=' + p1total + '&p2name=' + p2name + '&p2time=' + p2time + '&p2total=' + p2total + '&singleP=' + _root.singleP + '&blah=' + (getTimer() + Math.random(10000000) + 1);
}
frame 37 {
if (_root.saved == 1) {
status = 'already saved';
gotoAndPlay(41);
} else {
if (_root.singleP == 1) {
status = 'saving time...';
} else {
status = 'saving times...';
}
if (_root.tNum == 'track1') {
this.loadVariables('http://www.vfov.com/race/putdb1.php?' add endData, 'GET');
} else {
if (_root.tNum == 'track2') {
this.loadVariables('http://www.vfov.com/race/putdb2.php?' add endData, 'GET');
} else {
if (_root.tNum == 'track3') {
this.loadVariables('http://www.vfov.com/race/putdb3.php?' add endData, 'GET');
}
}
}
}
}
frame 40 {
if (done == 1) {
delete done;
if (_root.singleP == 1) {
status = 'time saved';
} else {
status = 'times saved';
}
_root.saved = 1;
} else {
gotoAndPlay(39);
}
}
}
frame 11 {
hitB1 = 0;
hitB2 = 0;
hitJ1 = 0;
hitJ2 = 0;
hitP1 = 0;
hitP2 = 0;
lapP1 = 0;
lapP2 = 0;
cp1p1 = 0;
cp2p1 = 0;
cp1p2 = 0;
cp2p2 = 0;
p1cf = 0;
p2cf = 0;
truck._x = 52.9;
truck._y = 320;
truck._rotation = 0;
truck.angle = 0;
vs.p1.p1name = p1name;
vs.p1lap = 'lap: 0';
if (singleP != 1) {
truck2._x = 91.8;
truck2._y = 320;
truck2._rotation = 0;
truck2.angle = 0;
vs.p2lap = 'lap: 0';
vs.p2.p2name = p2name;
} else {
truck._x = 72;
}
}
movieClip 225 {
frame 1 {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100) {
if (2 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100) {
if (2 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 228 {
}
movieClip 229 {
frame 1 {
function jumpDown(sm) {
_root.lights._xscale -= sm;
_root.lights._yscale -= sm;
_root.truck._xscale -= sm;
_root.truck._yscale -= sm;
_root.truck._alpha -= 10;
_root.lights._alpha -= 10;
if (_root.truck._x < 335) {
_root.truck._alpha -= 20;
_root.lights._alpha -= 20;
}
}
stop();
}
frame 4 {
jumpDown(10);
}
frame 5 {
jumpDown(10);
}
frame 6 {
jumpDown(10);
}
frame 7 {
jumpDown(10);
}
frame 8 {
jumpDown(10);
}
frame 9 {
jumpDown(10);
}
frame 10 {
jumpDown(10);
}
frame 11 {
jumpDown(10);
}
frame 12 {
_root.truck._alpha = 0;
_root.lights._alpha = 0;
}
frame 39 {
_root.truck._alpha = 100;
if (_root.lightsP1 == 1) {
_root.lights._alpha = 70;
}
_root.hitP1 = 0;
_root.truck._x = 280;
if (330 < _root.truck._y) {
_root.truck._y = 330;
}
if (_root.truck._y < 270) {
_root.truck._y = 270;
}
_root.truck._xscale = 100;
_root.truck._yscale = 100;
_root.truck._rotation = -90;
_root.truck.angle = -90;
_root.lights._x = -1000;
_root.lights._xscale = 100;
_root.lights._yscale = 100;
_root.truck.speed = 0;
if (_root.startRace == 0) {
_root.truck._x = 52.9;
_root.truck._y = 320;
_root.truck._rotation = 0;
_root.truck.angle = 0;
_root.truck2._x = 91.8;
_root.truck2._y = 320;
_root.truck2._rotation = 0;
_root.truck2.angle = 0;
}
}
}
movieClip 230 {
frame 1 {
function jumpDown(sm) {
_root.lights2._xscale -= sm;
_root.lights2._yscale -= sm;
_root.truck2._xscale -= sm;
_root.truck2._yscale -= sm;
_root.truck2._alpha -= 10;
_root.lights2._alpha -= 10;
if (_root.truck2._x < 335) {
_root.truck2._alpha -= 20;
_root.lights2._alpha -= 20;
}
}
stop();
}
frame 4 {
jumpDown(10);
}
frame 5 {
jumpDown(10);
}
frame 6 {
jumpDown(10);
}
frame 7 {
jumpDown(10);
}
frame 8 {
jumpDown(10);
}
frame 9 {
jumpDown(10);
}
frame 10 {
jumpDown(10);
}
frame 11 {
jumpDown(10);
}
frame 12 {
_root.truck2._alpha = 0;
_root.lights2._alpha = 0;
}
frame 39 {
_root.truck2._alpha = 100;
if (_root.lightsP2 == 1) {
_root.lights2._alpha = 70;
}
_root.hitP2 = 0;
_root.truck2._x = 280;
if (330 < _root.truck2._y) {
_root.truck2._y = 330;
}
if (_root.truck2._y < 270) {
_root.truck2._y = 270;
}
_root.truck2._xscale = 100;
_root.truck2._yscale = 100;
_root.truck2._rotation = -90;
_root.truck2.angle = -90;
_root.lights2._x = -1000;
_root.lights2._xscale = 100;
_root.lights2._yscale = 100;
_root.truck2.speed = 0;
if (_root.startRace == 0) {
_root.truck._x = 52.9;
_root.truck._y = 320;
_root.truck._rotation = 0;
_root.truck.angle = 0;
_root.truck2._x = 91.8;
_root.truck2._y = 320;
_root.truck2._rotation = 0;
_root.truck2.angle = 0;
}
}
}
movieClip 232 {
frame 1 {
if (this.hitTest(_root.truck)) {
if (3 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2)) {
if (3 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 233 {
frame 1 {
if (this.hitTest(_root.truck)) {
if (3 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2)) {
if (3 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 234 {
frame 1 {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100) {
if (1 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100) {
if (1 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 235 {
frame 1 {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100) {
if (1 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100) {
if (1 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 237 {
frame 1 {
if (this.hitTest(_root.truck)) {
if (3 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2)) {
if (3 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 238 {
frame 1 {
if (this.hitTest(_root.truck)) {
if (3 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2)) {
if (3 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 240 {
}
movieClip 241 {
}
movieClip 242 {
frame 1 {
stop();
}
}
movieClip 243 {
frame 1 {
stop();
}
frame 2 {
_root.truck.speed += 2;
}
frame 50 {
_root.hitB1 = 0;
}
}
movieClip 244 {
frame 1 {
stop();
}
frame 2 {
_root.truck2.speed += 2;
}
frame 50 {
_root.hitB2 = 0;
}
}
movieClip 246 {
}
movieClip 247 {
frame 1 {
function jumpUp(big) {
_root.lights._xscale = big;
_root.lights._yscale = big;
_root.truck._xscale = big;
_root.truck._yscale = big;
}
function jumpDown(sm) {
_root.lights._xscale = sm;
_root.lights._yscale = sm;
_root.truck._xscale = sm;
_root.truck._yscale = sm;
}
stop();
}
frame 2 {
jumpUp(100.1);
}
frame 5 {
jumpUp(105);
}
frame 6 {
jumpUp(110);
}
frame 7 {
jumpUp(115);
}
frame 8 {
jumpUp(120);
}
frame 9 {
jumpUp(125);
}
frame 10 {
jumpUp(130);
}
frame 11 {
jumpUp(135);
}
frame 12 {
jumpUp(140);
}
frame 13 {
jumpUp(143);
}
frame 14 {
jumpUp(145);
}
frame 18 {
jumpDown(143);
}
frame 19 {
jumpDown(140);
}
frame 20 {
jumpDown(135);
}
frame 21 {
jumpDown(130);
}
frame 22 {
jumpDown(125);
}
frame 23 {
jumpDown(120);
}
frame 24 {
jumpDown(115);
}
frame 25 {
jumpDown(110);
}
frame 26 {
jumpDown(105);
}
frame 27 {
jumpDown(100);
}
frame 29 {
_root.truck.turnRate = _root.turnRate;
}
frame 115 {
_root.hitJ1 = 0;
}
}
movieClip 248 {
frame 1 {
function jumpUp(big) {
_root.lights2._xscale = big;
_root.lights2._yscale = big;
_root.truck2._xscale = big;
_root.truck2._yscale = big;
}
function jumpDown(sm) {
_root.lights2._xscale = sm;
_root.lights2._yscale = sm;
_root.truck2._xscale = sm;
_root.truck2._yscale = sm;
}
stop();
}
frame 2 {
jumpUp(100.1);
}
frame 5 {
jumpUp(105);
}
frame 6 {
jumpUp(110);
}
frame 7 {
jumpUp(115);
}
frame 8 {
jumpUp(120);
}
frame 9 {
jumpUp(125);
}
frame 10 {
jumpUp(130);
}
frame 11 {
jumpUp(135);
}
frame 12 {
jumpUp(140);
}
frame 13 {
jumpUp(143);
}
frame 14 {
jumpUp(145);
}
frame 18 {
jumpDown(143);
}
frame 19 {
jumpDown(140);
}
frame 20 {
jumpDown(135);
}
frame 21 {
jumpDown(130);
}
frame 22 {
jumpDown(125);
}
frame 23 {
jumpDown(120);
}
frame 24 {
jumpDown(115);
}
frame 25 {
jumpDown(110);
}
frame 26 {
jumpDown(105);
}
frame 27 {
jumpDown(100);
}
frame 29 {
_root.truck2.turnRate = _root.turnRate;
}
frame 115 {
_root.hitJ2 = 0;
}
}
movieClip 250 {
}
movieClip 252 {
frame 1 {
if (this.hitTest(_root.truck2)) {
if (_root.lapP2 == 0) {
_root.lapP2 = 1;
_root.cp1p2 = 1;
_root.vs.p2lap = 'lap: 1';
_root.truck2.lap = _root.lapP2;
}
}
if (this.hitTest(_root.truck)) {
if (_root.lapP1 == 0) {
_root.lapP1 = 1;
_root.cp1p1 = 1;
_root.vs.p1lap = 'lap: 1';
_root.truck.lap = _root.lapP1;
}
}
}
}
movieClip 253 {
}
movieClip 254 {
}
movieClip 257 {
}
movieClip 258 {
instance oil of movieClip 228 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.hitP1 != 1 && _root.truck._xscale == 100) {
_root.hitP1 = 1;
_root.track.pit1.gotoAndPlay(2);
}
if (this.hitTest(_root.truck2) && _root.hitP2 != 1 && _root.truck2._xscale == 100) {
_root.hitP2 = 1;
_root.track.pit2.gotoAndPlay(2);
}
}
}
instance booster of movieClip 242 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.hitB1 != 1 && _root.startRace == 1) {
_root.hitB1 = 1;
_root.track.boost1.gotoAndPlay(2);
gotoAndPlay(2);
}
if (this.hitTest(_root.truck2) && _root.hitB2 != 1 && _root.startRace == 1) {
_root.hitB2 = 1;
_root.track.boost2.gotoAndPlay(2);
gotoAndPlay(2);
}
}
}
instance of movieClip 246 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.hitJ1 != 1 && _root.truck._xscale == 100 && _root.startRace == 1 && 4 < _root.truck.speed) {
_root.truck.turnRate = 0;
_root.hitJ1 = 1;
_parent.jp1.gotoAndPlay(2);
}
if (this.hitTest(_root.truck2) && _root.hitJ2 != 1 && _root.truck2._xscale == 100 && _root.startRace == 1 && 4 < _root.truck2.speed) {
_root.truck2.turnRate = 0;
_root.hitJ2 = 1;
_parent.jp2.gotoAndPlay(2);
}
}
}
instance line1 of movieClip 250 {
onClipEvent (load) {
function flagGreen(name) {
myColorTransform = {'ra': '0', 'rb': '0', 'ga': '0', 'gb': '120', 'ba': '0', 'bb': '0', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function flagWhite(name) {
myColorTransform = {'ra': '0', 'rb': '255', 'ga': '0', 'gb': '255', 'ba': '0', 'bb': '255', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function flagCheck(name) {
myColorTransform = {'ra': '100', 'rb': '0', 'ga': '100', 'gb': '0', 'ba': '100', 'bb': '0', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function raceOver() {
_root.truck.maxSpeed = 0;
_root.truck2.maxSpeed = 0;
_root.truck.speed = 0;
_root.truck2.speed = 0;
_root.startRace = 0;
}
myColor = new Color(_root.vs.flag1);
myColor2 = new Color(_root.vs.flag2);
myColorTransform = new Object();
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.lapP1 == 0) {
_root.lapP1 = 1;
_root.cp1p1 = 1;
_root.vs.p1lap = 'lap: 1';
} else {
if (_root.cp3p1 == 1 && _root.p1cf == 0) {
++_root.lapP1;
_root.cp1p1 = 0;
_root.cp2p1 = 0;
_root.cp3p1 = 0;
_root.vs.p1lap = 'lap: ' + _root.lapP1;
} else {
_root.cp1p1 = 1;
}
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.lapP2 == 0) {
_root.lapP2 = 1;
_root.cp1p2 = 1;
_root.vs.p2lap = 'lap: 1';
} else {
if (_root.cp3p2 == 1 && _root.p2cf == 0) {
++_root.lapP2;
_root.cp1p2 = 0;
_root.cp2p2 = 0;
_root.cp3p2 = 0;
_root.vs.p2lap = 'lap: ' + _root.lapP2;
} else {
_root.cp1p2 = 1;
}
}
}
if (_root.lapP1 == _root.maxLaps) {
_root.vs.p1lap = 'last lap';
flagWhite(myColor);
_root.vs.flag1._x = -105;
_root.vs.flag1.play();
}
if (_root.lapP2 == _root.maxLaps) {
_root.vs.p2lap = 'last lap';
flagWhite(myColor2);
_root.vs.flag2._x = 105;
_root.vs.flag2.play();
}
if (_root.maxLaps < _root.lapP1) {
flagCheck(myColor);
_root.vs.flag1.gotoAndStop(1);
if (_root.p2cf == 1) {
raceOver();
_root.winText.gotoAndPlay('p1lose');
} else {
if (_root.p1cf == 0) {
_root.p1cf = 1;
_root.vs.p1lap = 'winner!';
_root.winText.gotoAndPlay('p1win');
}
}
}
if (_root.maxLaps < _root.lapP2) {
flagCheck(myColor2);
_root.vs.flag2.gotoAndStop(1);
if (_root.p1cf == 1) {
raceOver();
_root.winText.gotoAndPlay('p2lose');
} else {
if (_root.p2cf == 0) {
_root.p2cf = 1;
_root.vs.p2lap = 'winner!';
_root.winText.gotoAndPlay('p2win');
}
}
}
}
}
instance line2 of movieClip 253 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.cp1p1 == 1) {
_root.cp2p1 = 1;
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.cp1p2 == 1) {
_root.cp2p2 = 1;
}
}
}
}
instance line3 of movieClip 254 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.cp2p1 == 1) {
_root.cp3p1 = 1;
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.cp2p2 == 1) {
_root.cp3p2 = 1;
}
}
}
}
}
movieClip 260 {
}
movieClip 262 {
}
movieClip 264 {
}
movieClip 266 {
}
movieClip 268 {
}
movieClip 271 {
}
movieClip 272 {
}
movieClip 273 {
frame 1 {
stop();
}
frame 2 {
_root.vs.flag1._x = -1000;
_root.vs.flag2._x = -1000;
_root.truck.maxSpeed = 0;
_root.truck2.maxSpeed = 0;
if (_root.singleP == 1) {
_root.vs.p2lap = '';
}
}
frame 29 {
if (a < 6) {
gotoAndPlay(22);
a = Number(a) + 1;
} else {
delete a;
}
}
frame 36 {
if (a < 6) {
gotoAndPlay(30);
a = Number(a) + 1;
} else {
delete a;
}
}
frame 37 {
function flagGreen(name) {
myColorTransform = {'ra': '0', 'rb': '0', 'ga': '0', 'gb': '120', 'ba': '0', 'bb': '0', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
_root.truck.maxSpeed = _root.maxSpeed;
_root.truck.turnRate = 6;
_root.startRace = 1;
_root.vs.flag1._x = -105;
if (_root.singleP != 1) {
_root.truck2.maxSpeed = _root.maxSpeed;
_root.truck2.turnRate = 6;
_root.vs.flag2._x = 105;
}
myColor = new Color(_root.vs.flag1);
myColor2 = new Color(_root.vs.flag2);
flagGreen(myColor);
flagGreen(myColor2);
}
frame 73 {
_root.vs.flag1._x = -1000;
_root.vs.flag2._x = -1000;
}
}
movieClip 276 {
}
movieClip 278 {
}
movieClip 280 {
}
movieClip 284 {
frame 1 {
if (_parent.waiting == 1) {
gotoAndPlay(27);
} else {
gotoAndPlay(1);
}
}
frame 7 {
if (_parent.waiting == 1) {
gotoAndPlay(27);
}
}
frame 17 {
if (_parent.waiting == 1) {
gotoAndPlay(27);
}
}
}
movieClip 286 {
}
movieClip 288 {
frame 1 {
if (this.hitTest(_root.truck)) {
_root.truck.speed -= 2;
if (_root.truck.speed < 0) {
_root.truck.speed = 0;
}
_root.truck.angle -= random(100) - 50;
}
if (this.hitTest(_root.truck2)) {
_root.truck2.speed -= 2;
if (_root.truck2.speed < 0) {
_root.truck2.speed = 0;
}
_root.truck2.angle -= random(100) - 50;
}
}
}
movieClip 289 {
frame 1 {
gotoAndPlay(611);
}
frame 99 {
gotoAndPlay(611);
}
frame 199 {
gotoAndPlay(611);
}
frame 319 {
gotoAndPlay(611);
}
frame 375 {
waiting = 1;
}
frame 450 {
delete waiting;
}
frame 794 {
aF = new Array('num1', 'num2', 'num3', 'num4', 'num4', 'num4', 'end');
gotoAndPlay(aF[random(7)]);
}
}
movieClip 291 {
}
movieClip 294 {
}
movieClip 295 {
frame 1 {
if (this.hitTest(_root.truck) || this.hitTest(_root.truck2) || this.hitTest(_root.barrier)) {
gotoAndPlay(13);
}
}
frame 3 {
if (this.hitTest(_root.truck) || this.hitTest(_root.truck2) || this.hitTest(_root.barrier)) {
gotoAndPlay(13);
}
}
frame 5 {
if (this.hitTest(_root.truck) || this.hitTest(_root.truck2) || this.hitTest(_root.barrier)) {
gotoAndPlay(13);
}
}
frame 7 {
if (this.hitTest(_root.truck) || this.hitTest(_root.truck2) || this.hitTest(_root.barrier)) {
gotoAndPlay(13);
}
}
frame 9 {
if (this.hitTest(_root.truck) || this.hitTest(_root.truck2) || this.hitTest(_root.barrier)) {
gotoAndPlay(13);
}
}
frame 11 {
if (this.hitTest(_root.truck) || this.hitTest(_root.truck2) || this.hitTest(_root.barrier)) {
gotoAndPlay(13);
}
}
frame 12 {
gotoAndPlay(1);
}
frame 23 {
stop();
}
}
movieClip 297 {
frame 1 {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100) {
_root.truck.speed -= 0.5;
if (_root.truck.speed < 0) {
_root.truck.speed = 0;
}
if (_root.truck._x < _x - 5) {
if (_x < 620) {
this._x += 5;
}
this._rotation = random(30) - 15;
}
if (_x + 5 < _root.truck._x) {
if (30 < _x) {
this._x -= 5;
}
this._rotation = random(30) - 15;
}
if (_root.truck._y < _y - 5) {
if (_y < 357) {
this._y += 5;
}
this._rotation = random(30) - 15;
}
if (_y + 5 < _root.truck._y) {
if (35 < _y) {
this._y -= 5;
}
this._rotation = random(30) - 15;
}
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100) {
_root.truck2.speed -= 0.5;
if (_root.truck2.speed < 0) {
_root.truck2.speed = 0;
}
if (_root.truck2._x < _x - 5) {
if (_x < 620) {
this._x += 5;
}
this._rotation = random(30) - 15;
}
if (_x + 5 < _root.truck2._x) {
if (30 < _x) {
this._x -= 5;
}
this._rotation = random(30) - 15;
}
if (_root.truck2._y < _y - 5) {
if (_y < 357) {
this._y += 5;
}
this._rotation = random(30) - 15;
}
if (_y + 5 < _root.truck2._y) {
if (35 < _y) {
this._y -= 5;
}
this._rotation = random(30) - 15;
}
}
}
}
movieClip 298 {
frame 1 {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100) {
_root.truck.speed -= 0.5;
if (_root.truck.speed < 0) {
_root.truck.speed = 0;
}
if (_root.truck._x < _x - 5) {
if (_x < 620) {
this._x += 5;
}
this._rotation = random(30) - 15;
}
if (_x + 5 < _root.truck._x) {
if (30 < _x) {
this._x -= 5;
}
this._rotation = random(30) - 15;
}
if (_root.truck._y < _y - 5) {
if (_y < 357) {
this._y += 5;
}
this._rotation = random(30) - 15;
}
if (_y + 5 < _root.truck._y) {
if (35 < _y) {
this._y -= 5;
}
this._rotation = random(30) - 15;
}
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100) {
_root.truck2.speed -= 0.5;
if (_root.truck2.speed < 0) {
_root.truck2.speed = 0;
}
if (_root.truck2._x < _x - 5) {
if (_x < 620) {
this._x += 5;
}
this._rotation = random(30) - 15;
}
if (_x + 5 < _root.truck2._x) {
if (30 < _x) {
this._x -= 5;
}
this._rotation = random(30) - 15;
}
if (_root.truck2._y < _y - 5) {
if (_y < 357) {
this._y += 5;
}
this._rotation = random(30) - 15;
}
if (_y + 5 < _root.truck2._y) {
if (35 < _y) {
this._y -= 5;
}
this._rotation = random(30) - 15;
}
}
}
}
movieClip 300 {
frame 1 {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100) {
_root.truck.speed -= 2;
if (_root.truck.speed < 0) {
_root.truck.speed = 0;
}
if (_root.truck._x < _x - 5) {
if (_x < 620) {
this._x += 10;
}
this._rotation = random(30) - 15;
}
if (_x + 5 < _root.truck._x) {
if (30 < _x) {
this._x -= 10;
}
this._rotation = random(30) - 15;
}
if (_root.truck._y < _y - 10) {
if (_y < 357) {
this._y += 2;
}
this._rotation = random(30) - 15;
}
if (_y + 10 < _root.truck._y) {
if (35 < _y) {
this._y -= 2;
}
this._rotation = random(30) - 15;
}
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100) {
_root.truck2.speed -= 2;
if (_root.truck2.speed < 0) {
_root.truck2.speed = 0;
}
if (_root.truck2._x < _x - 5) {
if (_x < 620) {
this._x += 10;
}
this._rotation = random(30) - 15;
}
if (_x + 5 < _root.truck2._x) {
if (30 < _x) {
this._x -= 10;
}
this._rotation = random(30) - 15;
}
if (_root.truck2._y < _y - 10) {
if (_y < 357) {
this._y += 2;
}
this._rotation = random(30) - 15;
}
if (_y + 10 < _root.truck2._y) {
if (35 < _y) {
this._y -= 2;
}
this._rotation = random(30) - 15;
}
}
}
}
button 306 {
on (release) {
_root.truck.maxSpeed = 0;
_root.truck2.maxSpeed = 0;
_root.truck.speed = 0;
_root.truck2.speed = 0;
_root.startRace = 0;
_root.lapP1 = 0;
_root.lapP2 = 0;
_root.cp1p1 = 0;
_root.cp2p1 = 0;
_root.cp3p1 = 0;
_root.cp1p2 = 0;
_root.cp2p2 = 0;
_root.cp3p2 = 0;
_root.gotoAndPlay(_root.tNum);
}
}
button 310 {
on (release) {
_root.gotoAndPlay('menu');
}
}
button 311 {
on (release) {
delete sc;
_root.saved = 0;
_root.scores.gotoAndStop(1);
_root.gotoAndPlay(_root.tNum);
gotoAndStop(1);
}
}
button 315 {
on (release) {
delete sc;
_root.scores.gotoAndPlay('saving');
}
}
button 316 {
on (release) {
delete sc;
_root.saved = 0;
_root.scores.gotoAndStop(1);
_root.gotoAndPlay('menu');
}
}
button 320 {
on (release) {
if (sc != 1) {
_root.scores.gotoAndPlay('best');
sc = 1;
}
}
}
movieClip 321 {
frame 1 {
stop();
}
frame 2 {
winText = _root.p1name + ' wins the race!';
_root.p1time = _root.theTimer.timer;
_root.p1total = _root.theTimer.timer5;
timeText = 'Time: ' + _root.p1time;
_root.vs.p1lap = _root.p1time;
}
frame 6 {
gotoAndStop(1);
}
frame 7 {
_root.p1time = _root.theTimer.timer;
_root.p1total = _root.theTimer.timer5;
_root.vs.p1lap = _root.p1time;
winText = '';
timeText = '';
gotoAndPlay(24);
}
frame 12 {
gotoAndStop(1);
}
frame 13 {
winText = _root.p2name + ' wins the race!';
_root.p2time = _root.theTimer.timer;
_root.p2total = _root.theTimer.timer5;
timeText = 'Time: ' + _root.p2time;
_root.vs.p2lap = _root.p2time;
}
frame 18 {
gotoAndStop(1);
}
frame 19 {
_root.p2time = _root.theTimer.timer;
_root.p2total = _root.theTimer.timer5;
_root.vs.p2lap = _root.p2time;
winText = '';
timeText = '';
gotoAndPlay(24);
}
frame 29 {
stop();
}
}
movieClip 324 {
frame 1 {
function doMins() {
if (time >= 60) {
i = 1;
while (59 < time) {
time -= 60;
mins = i;
++i;
}
}
if (length(time) < 2) {
time = '0' + time;
}
if (length(secs) < 3) {
time = '0' + time;
}
}
function cutTimer() {
if (length(time) == 1) {
secs = substring(time, 1, 3);
time = 0;
mins = 0;
} else {
if (length(time) == 2) {
secs = substring(time, 1, 3);
time = 0;
mins = 0;
} else {
if (length(time) == 3) {
secs = substring(time, 1, 3);
time = 0;
mins = 0;
} else {
if (length(time) == 4) {
secs = substring(time, 2, 3);
time = substring(time, 0, 1);
mins = 0;
} else {
if (length(time) == 5) {
secs = substring(time, 3, 3);
time = substring(time, 0, 2);
} else {
if (length(time) == 6) {
secs = substring(time, 4, 3);
time = substring(time, 0, 3);
} else {
if (length(time) == 7) {
secs = substring(time, 5, 3);
time = substring(time, 0, 4);
} else {
if (length(time) == 8) {
secs = substring(time, 6, 3);
time = substring(time, 0, 5);
}
}
}
}
}
}
}
}
doMins();
}
time2 = getTimer();
}
frame 2 {
if ((_root.lapP1 >= 1 || _root.lapP2 >= 1) && _root.startRace == 1) {
time = getTimer() - time2;
timer5 = time / 1000;
cutTimer();
timer = mins + ':' + time + ':' + secs;
} else {
gotoAndPlay(1);
}
}
frame 3 {
time = getTimer() - time2;
timer5 = time / 1000;
cutTimer();
timer = mins + ':' + time + ':' + secs;
gotoAndPlay(2);
}
}
movieClip 325 {
frame 1 {
_root.winText.winText = 'Best Time:';
_root.winText.timeText = 'retrieving...';
a = '&blah=' + (getTimer() + Math.random(10000000) + 1);
if (_root.tNum == 'track1') {
this.loadVariables('http://www.vfov.com/race/getdb1.php?id=' add _root.maxLaps + a, 'GET');
} else {
if (_root.tNum == 'track2') {
this.loadVariables('http://www.vfov.com/race/getdb2.php?id=' add _root.maxLaps + a, 'GET');
} else {
if (_root.tNum == 'track3') {
this.loadVariables('http://www.vfov.com/race/getdb3.php?id=' add _root.maxLaps + a, 'GET');
}
}
}
}
frame 5 {
if (done == 1) {
done = 0;
} else {
gotoAndPlay(2);
}
}
frame 6 {
if (!length(time0)) {
} else {
_root.winText.timeText = time0;
}
}
frame 12 {
if (_root.winText.timeText == 'retrieving...') {
_root.winText.timeText = 'Nobody!';
}
stop();
}
}
frame 15 {
stopLight.gotoAndPlay(2);
stop();
}
frame 16 {
hitB1 = 0;
hitB2 = 0;
hitJ1 = 0;
hitJ2 = 0;
hitP1 = 0;
hitP2 = 0;
lapP1 = 0;
lapP2 = 0;
cp1p1 = 0;
cp2p1 = 0;
cp3p1 = 0;
cp1p2 = 0;
cp2p2 = 0;
cp3p2 = 0;
p1cf = 0;
p2cf = 0;
truck._x = 52.9;
truck._y = 320;
truck._rotation = 0;
truck.angle = 0;
vs.p1.p1name = p1name;
vs.p1lap = 'lap: 0';
if (singleP != 1) {
truck2._x = 91.8;
truck2._y = 320;
truck2._rotation = 0;
truck2.angle = 0;
vs.p2lap = 'lap: 0';
vs.p2.p2name = p2name;
} else {
truck._x = 72;
}
}
movieClip 328 {
frame 1 {
if (this.hitTest(_root.truck)) {
if (3 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2)) {
if (3 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 329 {
frame 1 {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100) {
if (1 < _root.truck.speed) {
_root.truck.speed -= 1;
}
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100) {
if (1 < _root.truck2.speed) {
_root.truck2.speed -= 1;
}
}
}
}
movieClip 330 {
frame 1 {
stop();
}
}
movieClip 331 {
frame 1 {
stop();
}
frame 2 {
_root.truck.speed += 2;
}
frame 50 {
_root.hitB1 = 0;
}
}
movieClip 332 {
frame 1 {
function jumpUp(big) {
_root.lights2._xscale = big;
_root.lights2._yscale = big;
_root.truck2._xscale = big;
_root.truck2._yscale = big;
}
function jumpDown(sm) {
_root.lights2._xscale = sm;
_root.lights2._yscale = sm;
_root.truck2._xscale = sm;
_root.truck2._yscale = sm;
}
stop();
}
frame 2 {
jumpUp(100.1);
}
frame 5 {
jumpUp(105);
}
frame 6 {
jumpUp(110);
}
frame 7 {
jumpUp(115);
}
frame 8 {
jumpUp(120);
}
frame 9 {
jumpUp(125);
}
frame 10 {
jumpUp(130);
}
frame 11 {
jumpUp(135);
}
frame 12 {
jumpUp(140);
}
frame 13 {
jumpUp(143);
}
frame 14 {
jumpUp(145);
}
frame 18 {
jumpDown(143);
}
frame 19 {
jumpDown(140);
}
frame 20 {
jumpDown(135);
}
frame 21 {
jumpDown(130);
}
frame 22 {
jumpDown(125);
}
frame 23 {
jumpDown(120);
}
frame 24 {
jumpDown(115);
}
frame 25 {
jumpDown(110);
}
frame 26 {
jumpDown(105);
}
frame 27 {
jumpDown(100);
}
frame 29 {
_root.truck2.turnRate = _root.turnRate;
}
frame 115 {
_root.hitJ2 = 0;
}
}
movieClip 333 {
}
movieClip 334 {
}
movieClip 335 {
frame 1 {
g = 0;
g2 = random(20) + 20;
}
frame 20 {
if (g == g2) {
g = 0;
} else {
++g;
gotoAndPlay(2);
}
}
instance of movieClip 334 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100 && _root.startRace == 1 && 3 < _root.truck.speed) {
_root.truck.turnRate = 0;
_parent._parent.jp1.gotoAndPlay(2);
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100 && _root.startRace == 1 && 3 < _root.truck2.speed) {
_root.truck2.turnRate = 0;
_parent._parent.jp2.gotoAndPlay(2);
}
}
}
}
movieClip 337 {
instance of movieClip 328 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.truck._xscale == 100) {
_root.truck.speed = 0;
}
if (this.hitTest(_root.truck2) && _root.truck2._xscale == 100) {
_root.truck2.speed = 0;
}
}
}
instance booster of movieClip 330 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.hitB1 != 1 && _root.startRace == 1) {
_root.hitB1 = 1;
_parent.boost1.gotoAndPlay(2);
gotoAndPlay(2);
}
if (this.hitTest(_root.truck2) && _root.hitB2 != 1 && _root.startRace == 1) {
_root.hitB2 = 1;
_parent.boost2.gotoAndPlay(2);
gotoAndPlay(2);
}
}
}
instance of movieClip 246 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.hitJ1 != 1 && _root.truck._xscale == 100 && _root.startRace == 1 && 4 < _root.truck.speed) {
_root.truck.turnRate = 0;
_root.hitJ1 = 1;
_parent.jp1.gotoAndPlay(2);
}
if (this.hitTest(_root.truck2) && _root.hitJ2 != 1 && _root.truck2._xscale == 100 && _root.startRace == 1 && 4 < _root.truck2.speed) {
_root.truck2.turnRate = 0;
_root.hitJ2 = 1;
_parent.jp2.gotoAndPlay(2);
}
}
}
instance line1 of movieClip 333 {
onClipEvent (load) {
function flagGreen(name) {
myColorTransform = {'ra': '0', 'rb': '0', 'ga': '0', 'gb': '120', 'ba': '0', 'bb': '0', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function flagWhite(name) {
myColorTransform = {'ra': '0', 'rb': '255', 'ga': '0', 'gb': '255', 'ba': '0', 'bb': '255', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function flagCheck(name) {
myColorTransform = {'ra': '100', 'rb': '0', 'ga': '100', 'gb': '0', 'ba': '100', 'bb': '0', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function raceOver() {
_root.truck.maxSpeed = 0;
_root.truck2.maxSpeed = 0;
_root.truck.speed = 0;
_root.truck2.speed = 0;
_root.startRace = 0;
}
myColor = new Color(_root.vs.flag1);
myColor2 = new Color(_root.vs.flag2);
myColorTransform = new Object();
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.lapP1 == 0) {
_root.lapP1 = 1;
_root.cp1p1 = 1;
_root.vs.p1lap = 'lap: 1';
} else {
if (_root.cp3p1 == 1 && _root.p1cf == 0) {
++_root.lapP1;
_root.cp1p1 = 0;
_root.cp2p1 = 0;
_root.cp3p1 = 0;
_root.vs.p1lap = 'lap: ' + _root.lapP1;
} else {
_root.cp1p1 = 1;
}
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.lapP2 == 0) {
_root.lapP2 = 1;
_root.cp1p2 = 1;
_root.vs.p2lap = 'lap: 1';
} else {
if (_root.cp3p2 == 1 && _root.p2cf == 0) {
++_root.lapP2;
_root.cp1p2 = 0;
_root.cp2p2 = 0;
_root.cp3p2 = 0;
_root.vs.p2lap = 'lap: ' + _root.lapP2;
} else {
_root.cp1p2 = 1;
}
}
}
if (_root.lapP1 == _root.maxLaps) {
_root.vs.p1lap = 'last lap';
flagWhite(myColor);
_root.vs.flag1._x = -105;
_root.vs.flag1.play();
}
if (_root.lapP2 == _root.maxLaps) {
_root.vs.p2lap = 'last lap';
flagWhite(myColor2);
_root.vs.flag2._x = 105;
_root.vs.flag2.play();
}
if (_root.maxLaps < _root.lapP1) {
flagCheck(myColor);
_root.vs.flag1.gotoAndStop(1);
if (_root.p2cf == 1) {
raceOver();
_root.winText.gotoAndPlay('p1lose');
} else {
if (_root.p1cf == 0) {
_root.p1cf = 1;
_root.vs.p1lap = 'winner!';
_root.winText.gotoAndPlay('p1win');
}
}
}
if (_root.maxLaps < _root.lapP2) {
flagCheck(myColor2);
_root.vs.flag2.gotoAndStop(1);
if (_root.p1cf == 1) {
raceOver();
_root.winText.gotoAndPlay('p2lose');
} else {
if (_root.p2cf == 0) {
_root.p2cf = 1;
_root.vs.p2lap = 'winner!';
_root.winText.gotoAndPlay('p2win');
}
}
}
}
}
instance line2 of movieClip 253 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.cp1p1 == 1) {
_root.cp2p1 = 1;
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.cp1p2 == 1) {
_root.cp2p2 = 1;
}
}
}
}
instance line3 of movieClip 254 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.cp2p1 == 1) {
_root.cp3p1 = 1;
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.cp2p2 == 1) {
_root.cp3p2 = 1;
}
}
}
}
}
frame 21 {
stopLight.gotoAndPlay(2);
stop();
}
frame 22 {
hitB1 = 0;
hitB2 = 0;
hitJ1 = 0;
hitJ2 = 0;
hitP1 = 0;
hitP2 = 0;
lapP1 = 0;
lapP2 = 0;
cp1p1 = 0;
cp2p1 = 0;
cp3p1 = 0;
cp1p2 = 0;
cp2p2 = 0;
cp3p2 = 0;
p1cf = 0;
p2cf = 0;
truck._x = 52.9;
truck._y = 320;
truck._rotation = 0;
truck.angle = 0;
vs.p1.p1name = p1name;
vs.p1lap = 'lap: 0';
if (singleP != 1) {
truck2._x = 91.8;
truck2._y = 320;
truck2._rotation = 0;
truck2.angle = 0;
vs.p2lap = 'lap: 0';
vs.p2.p2name = p2name;
} else {
truck._x = 72;
}
}
movieClip 341 {
instance booster of movieClip 330 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.hitB1 != 1 && _root.startRace == 1) {
_root.hitB1 = 1;
_parent.boost1.gotoAndPlay(2);
gotoAndPlay(2);
}
if (this.hitTest(_root.truck2) && _root.hitB2 != 1 && _root.startRace == 1) {
_root.hitB2 = 1;
_parent.boost2.gotoAndPlay(2);
gotoAndPlay(2);
}
}
}
instance of movieClip 246 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck) && _root.hitJ1 != 1 && _root.truck._xscale == 100 && _root.startRace == 1 && 4 < _root.truck.speed) {
_root.truck.turnRate = 0;
_root.hitJ1 = 1;
_parent.jp1.gotoAndPlay(2);
}
if (this.hitTest(_root.truck2) && _root.hitJ2 != 1 && _root.truck2._xscale == 100 && _root.startRace == 1 && 4 < _root.truck2.speed) {
_root.truck2.turnRate = 0;
_root.hitJ2 = 1;
_parent.jp2.gotoAndPlay(2);
}
}
}
instance line1 of movieClip 333 {
onClipEvent (load) {
function flagGreen(name) {
myColorTransform = {'ra': '0', 'rb': '0', 'ga': '0', 'gb': '120', 'ba': '0', 'bb': '0', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function flagWhite(name) {
myColorTransform = {'ra': '0', 'rb': '255', 'ga': '0', 'gb': '255', 'ba': '0', 'bb': '255', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function flagCheck(name) {
myColorTransform = {'ra': '100', 'rb': '0', 'ga': '100', 'gb': '0', 'ba': '100', 'bb': '0', 'aa': '70', 'ab': '0'};
name.setTransform(myColorTransform);
}
function raceOver() {
_root.truck.maxSpeed = 0;
_root.truck2.maxSpeed = 0;
_root.truck.speed = 0;
_root.truck2.speed = 0;
_root.startRace = 0;
}
myColor = new Color(_root.vs.flag1);
myColor2 = new Color(_root.vs.flag2);
myColorTransform = new Object();
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.lapP1 == 0) {
_root.lapP1 = 1;
_root.cp1p1 = 1;
_root.vs.p1lap = 'lap: 1';
} else {
if (_root.cp3p1 == 1 && _root.p1cf == 0) {
++_root.lapP1;
_root.cp1p1 = 0;
_root.cp2p1 = 0;
_root.cp3p1 = 0;
_root.vs.p1lap = 'lap: ' + _root.lapP1;
} else {
_root.cp1p1 = 1;
}
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.lapP2 == 0) {
_root.lapP2 = 1;
_root.cp1p2 = 1;
_root.vs.p2lap = 'lap: 1';
} else {
if (_root.cp3p2 == 1 && _root.p2cf == 0) {
++_root.lapP2;
_root.cp1p2 = 0;
_root.cp2p2 = 0;
_root.cp3p2 = 0;
_root.vs.p2lap = 'lap: ' + _root.lapP2;
} else {
_root.cp1p2 = 1;
}
}
}
if (_root.lapP1 == _root.maxLaps) {
_root.vs.p1lap = 'last lap';
flagWhite(myColor);
_root.vs.flag1._x = -105;
_root.vs.flag1.play();
}
if (_root.lapP2 == _root.maxLaps) {
_root.vs.p2lap = 'last lap';
flagWhite(myColor2);
_root.vs.flag2._x = 105;
_root.vs.flag2.play();
}
if (_root.maxLaps < _root.lapP1) {
flagCheck(myColor);
_root.vs.flag1.gotoAndStop(1);
if (_root.p2cf == 1) {
raceOver();
_root.winText.gotoAndPlay('p1lose');
} else {
if (_root.p1cf == 0) {
_root.p1cf = 1;
_root.vs.p1lap = 'winner!';
_root.winText.gotoAndPlay('p1win');
}
}
}
if (_root.maxLaps < _root.lapP2) {
flagCheck(myColor2);
_root.vs.flag2.gotoAndStop(1);
if (_root.p1cf == 1) {
raceOver();
_root.winText.gotoAndPlay('p2lose');
} else {
if (_root.p2cf == 0) {
_root.p2cf = 1;
_root.vs.p2lap = 'winner!';
_root.winText.gotoAndPlay('p2win');
}
}
}
}
}
instance line2 of movieClip 253 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.cp1p1 == 1) {
_root.cp2p1 = 1;
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.cp1p2 == 1) {
_root.cp2p2 = 1;
}
}
}
}
instance line3 of movieClip 254 {
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck)) {
if (_root.cp2p1 == 1) {
_root.cp3p1 = 1;
}
}
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.truck2)) {
if (_root.cp2p2 == 1) {
_root.cp3p2 = 1;
}
}
}
}
}
frame 27 {
stopLight.gotoAndPlay(2);
stop();
}