Frame 1
function umenu1() {
getURL ("http://www.armorgames.com", "_BLANK");
}
function umenu2() {
getURL ("http://www.rustygames.com", "_BLANK");
}
function umenu3() {
getURL ("http://www.rustygames.com/highscores", "_BLANK");
}
function umenu4() {
}
function umenu5() {
_root.qual = 0;
}
function umenu6() {
_root.qual = 1;
}
function umenu7() {
_root.qual = 2;
}
function umenu8() {
_root.qual = 3;
}
function saveTrops() {
var _local2 = SharedObject.getLocal("FlashRacers");
_root.savefile.data.gptrop = _root.gptrop;
_root.savefile.data.strop = _root.strop;
_root.savefile.data.cretrop = _root.cretrop;
_root.savefile.data.ctrop1 = _root.ctrop1;
_root.savefile.data.ctrop2 = _root.ctrop2;
_root.savefile.data.ctrop3 = _root.ctrop3;
_root.savefile.data.ctrop4 = _root.ctrop4;
_root.savefile.data.ctrop5 = _root.ctrop5;
_root.savefile.flush();
}
var MENU = new ContextMenu();
MENU.hideBuiltInItems();
var Functioned = new ContextMenuItem("Armor games", umenu1);
var Functioned2 = new ContextMenuItem("Rusty games", umenu2);
var Functioned3 = new ContextMenuItem("Highscores", umenu3);
var Functioned4 = new ContextMenuItem("Quality", umenu4);
var Functioned5 = new ContextMenuItem("Low", umenu5);
var Functioned6 = new ContextMenuItem("Medium", umenu6);
var Functioned7 = new ContextMenuItem("High", umenu7);
var Functioned8 = new ContextMenuItem("Auto", umenu8);
MENU.customItems.push(Functioned);
MENU.customItems.push(Functioned2);
MENU.customItems.push(Functioned3);
MENU.customItems.push(Functioned4);
MENU.customItems.push(Functioned5);
MENU.customItems.push(Functioned6);
MENU.customItems.push(Functioned7);
MENU.customItems.push(Functioned8);
Functioned4.separatorBefore = true;
_root.menu = MENU;
stop();
onEnterFrame = null;
var freeracelaps = 4;
var savefile = SharedObject.getLocal("FlashRacers");
if (savefile.data.gptrop == undefined) {
_root.gptrop = 0;
} else {
_root.gptrop = savefile.data.gptrop;
}
if (savefile.data.strop == undefined) {
_root.strop = 0;
} else {
_root.strop = savefile.data.strop;
}
if (savefile.data.ctrop1 == undefined) {
_root.ctrop1 = false;
} else {
_root.ctrop1 = savefile.data.ctrop1;
}
if (savefile.data.ctrop2 == undefined) {
_root.ctrop2 = false;
} else {
_root.ctrop2 = savefile.data.ctrop2;
}
if (savefile.data.ctrop3 == undefined) {
_root.ctrop3 = false;
} else {
_root.ctrop3 = savefile.data.ctrop3;
}
if (savefile.data.ctrop4 == undefined) {
_root.ctrop4 = false;
} else {
_root.ctrop4 = savefile.data.ctrop4;
}
if (savefile.data.ctrop5 == undefined) {
_root.ctrop5 = false;
} else {
_root.ctrop5 = savefile.data.ctrop5;
}
if (savefile.data.cretrop == undefined) {
_root.cretrop = false;
} else {
_root.cretrop = savefile.data.cretrop;
}
stop();
_root.saveTrops();
if (_root.loadedmovie) {
_root.play();
}
pldm128947 = new LoadVars();
pldm128947.mv = _level0._url;
pldm128947.md = "bfa6d6928033b2b1848e7ef962c9332e";
pldm128947.mid = 53;
pldm128947.sendAndLoad("http://bot.armorstudios.com/track.php", pldm128947, "POST");
System.security.allowDomain("bot.armorstudios.com", "www.armorstudios.com");
loadMovieNum ("http://bot.armorstudios.com/globalbar.swf?barmd2569=bfa6d6928033b2b1848e7ef962c9332e&barid2569=53", 1520);
Instance of Symbol 82 MovieClip in Frame 1
onClipEvent (load) {
var oldt = getTimer();
var lasttime = 1;
}
onClipEvent (enterFrame) {
this._xscale = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (this._xscale == 100) {
_root.begin.gotoAndStop(2);
}
if (Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100) == (this.percentage + 1)) {
this.lasttime = getTimer() - this.oldt;
this.oldt = getTimer();
}
this.percentage = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
this.estimated = Math.ceil(((100 - this.percentage) * this.lasttime) / 1000);
_root.loadstat.htmlText = ((((((this.percentage + "% Loaded<br>Estimated load time:") + this.estimated) + "<br>") + _root.getBytesLoaded()) + "/") + _root.getBytesTotal()) + " bytes loaded";
}
Instance of Symbol 174 MovieClip "begin" in Frame 1
on (press) {
if (this._currentframe == 2) {
_root.loadedmovie = true;
_root.gotoAndStop("intro");
}
}
Frame 2
function changetext() {
switch (_root.carno) {
case 1 :
_root.cartext2 = "Dashing Dan";
_root.cartext = "Dashing Dan is rumored to have been adopted and raised amongst the knights of Ireland until he made safe passage to America. He enjoys jumping out of airplanes and eating 7 solid meals a day. It is also rumored that Dashing Dan is not after a trophy, but is secretly trying to win the affections of 'The Real McCoy'. He might look like a prep school drop out, but don't be deceived by appearances.";
_root.cartext3 = "Blue Thunder";
break;
case 2 :
_root.cartext2 = "Mad-dog Murphy";
_root.cartext = "Mad Dog Murphy was born and raised in the plateaus of Irvine. As an only child he took to racing cars as a young kid and now owns and operates the largest underground network around. When he's not mad-dogging you on the course he can be found chilaxing in a Hot Tub or contemplating 101 uses for his 50inch DLP-TV.";
_root.cartext3 = "Brown Titan";
break;
case 3 :
_root.cartext2 = "The Real McCoy";
_root.cartext = "The Real McCoy is far from the many impostors trying to steal her beauty and fame. She was raised a lily among thorns, and her wit and intelligence are matched by none. When she's not on the track she can be found cheering on the USC trojans or working on her trigger finger. She'll leave you light years behind as she buzzes by you on the track and you might not like 'them apples' but she will gladly leave you with apple sauce.";
_root.cartext3 = "Flashing Rose";
break;
case 4 :
_root.cartext2 = "Woody";
_root.cartext = "Wood, Woodster or Woody. This main street circuit racer goes by all of the above. When he's not busy tickling the Ivory, he can be found spinning out opponents on the streets. He also likes to show off his dance moves after a glass or two of champaign";
_root.cartext3 = "The Bullet";
break;
case 5 :
_root.cartext2 = "Krazy Kenny";
_root.cartext = "Krazy Kenny will own you. Don't be fooled by his cute smile. When he's not on the track he can be found earning his 5th level 60 character in WOW. He won't be pulling any LeRoy Jenkins, so watch out!";
_root.cartext3 = "Flying Beatle";
break;
case 6 :
_root.cartext2 = "J-Zinger";
_root.cartext = "J-Zinger is the master of all trades. He will zing you, brand you, and leave you in the dust. Don't let his real name fool you; Terry is only a cover up of his true Irish roots. When he's not spending time with his lady, he can be found campaigning for Bono. It's also rumored that J-Zinger will be naming his first child Robert Smith, after the famous band from the 80's";
_root.cartext3 = "Blood Viper";
break;
case 7 :
_root.cartext2 = "Terrible Timmy";
_root.cartext = "Terrible Timmy is a teddy bear at heart, but a roaring lion on the race track. When he's not passing you on the finishing lap, he can be found studying the many famous theologians throughout history. Watch out, and make sure to carry a concordance at all times";
_root.cartext3 = "Comet No. 5";
}
}
stop();
if (_root.characterselected) {
_root.play();
}
var carno = 1;
_root.cartext2 = "Name";
_root.cartext = "Synopsis";
_root.cartext3 = "Car";
changetext();
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop4");
_root.bgm.start(0, 100);
Instance of Symbol 194 MovieClip in Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(_root.carno);
}
Instance of Symbol 218 MovieClip in Frame 2
onClipEvent (enterFrame) {
this.gotoAndStop(_root.carno);
}
Frame 3
var currentgptrack = 1;
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop4");
_root.bgm.start(0, 100);
function GotoAndStop(labels) {
_root.gotoAndStop(labels);
}
function clearAll() {
_root.onEnterFrame = null;
for (d in _root) {
_root[d].swapDepths(_root.getNextHighestDepth());
_root[d].removeMovieClip();
}
}
function clearAll2() {
_root.onEnterFrame = null;
for (d in _root) {
_root[d].swapDepths(_root.getNextHighestDepth());
_root[d].removeMovieClip();
}
_root.play();
}
stop();
var pauser = false;
var quotes1 = ["Ha ha you suck", "You loser!", "just quit now wuss", "Get off the track", "Next time learn how to drive", "Ha ha ha ha ha ha", "Who's laughing now?"];
var quotes2 = ["Ahhh you'll pay for this", "You're paying for that!", "I'll get you next time", "Oh darn", "You little punk", "Mommy!", "I will be avenged", "Ahhhh!!"];
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var qual = 3;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
onEnterFrame = function () {
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
stop();
RealTime = setInterval(function () {
_root.hudamm = _root.car.ammo + "/100";
_root.hudwep = "";
switch (_root.car.weapon) {
case 5 :
_root.hudwep = "Booster";
break;
case 2 :
_root.hudwep = "MG";
break;
case 7 :
_root.hudwep = "Rocket";
break;
case 1 :
_root.hudwep = "Barrel";
break;
case 6 :
_root.hudwep = "Laser";
break;
case 3 :
_root.hudwep = "Oil";
break;
case 4 :
_root.hudwep = "Glue";
}
var _local2 = new Date();
hours = _local2.getHours();
minutes = _local2.getMinutes();
_root.RealTime = ((hours + ":") + ((minutes < 10) ? "0" : "")) + minutes;
}, 1000);
var difficulty = 0;
var map = "map1";
function pickchars() {
_root.car.gotoAndStop(_root.carno);
jj = false;
rand = random(7) + 1;
j = 0;
while (j < _root.players.length) {
if (rand == _root.players[j]) {
jj = true;
break;
}
j++;
}
if (jj) {
_root.pickchars();
} else {
_root.players.push(rand);
_root["opp" + i] = rand;
_root["car" + i].gotoAndStop(_root["opp" + i]);
if (_root.i < 3) {
_root.i++;
_root.pickchars();
}
}
}
var opp0 = _root.carno;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
Instance of Symbol 228 MovieClip "tracks" in Frame 3
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 230 MovieClip "bn12" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "tutorial";
_root.cam.action.desc.text = "New to the game? Play this first to figure out what's what";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip "bn1" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.characterselected = false;
_root.car.got = 1;
_root.cam.action.desc.text = "Reselect your character";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip "bn3" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "selecttt";
_root.cam.action.desc.text = "Race against the world and compete for the best times on each map";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip "bn5" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
if (!this.hitting) {
this.hitting = true;
getURL ("http://www.rustygames.com", "_blank");
}
} else {
this.hitting = false;
}
}
Instance of Symbol 230 MovieClip "bn6" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
if (!this.hitting) {
this.hitting = true;
getURL ("http://www.rustygames.com/highscores", "_blank");
}
} else {
this.hitting = false;
}
}
Instance of Symbol 230 MovieClip "bn7" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
if (!this.hitting) {
this.hitting = true;
getURL ("http://www.armorgames.com", "_blank");
}
} else {
this.hitting = false;
}
}
Instance of Symbol 230 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = 13;
_root.car.dif = 0;
_root.cam.action.desc.text = "Race on all the tracks and gain points in gran prix mode! (Easy)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = 13;
_root.car.dif = 1;
_root.cam.action.desc.text = "Race on all the tracks and gain points in gran prix mode! (Normal)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = 13;
_root.car.dif = 2;
_root.cam.action.desc.text = "Race on all the tracks and gain points in gran prix mode! (Hard)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "storyBegin";
_root.car.dif = 0;
_root.cam.action.desc.text = "Play as Jake and race to become world champ! (Easy)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip "bn10" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "storyBegin";
_root.car.dif = 1;
_root.cam.action.desc.text = "Play as Jake and race to become world champ! (Normal)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "storyBegin";
_root.car.dif = 2;
_root.cam.action.desc.text = "Play as Jake and race to become world champ! (Hard)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip "bn4" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "trophies";
_root.cam.action.desc.text = "View your awards you have earnt so far";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "selectfr";
_root.car.dif = 0;
_root.cam.action.desc.text = "Practice your skills on a track of your choice. (Easy)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "selectfr";
_root.car.dif = 1;
_root.cam.action.desc.text = "Practice your skills on a track of your choice. (Normal)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "selectfr";
_root.car.dif = 2;
_root.cam.action.desc.text = "Practice your skills on a track of your choice. (Hard)";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip "bn9" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "selectch";
_root.cam.action.desc.text = "Complete various challenges for awards";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 230 MovieClip "bn8" in Frame 3
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.car.got = "credits";
_root.cam.action.desc.text = "View the credits. Watch from beginning to end for a special suprise";
_root.cam.action.pressd.text = "Press Enter to begin";
}
}
Instance of Symbol 239 MovieClip "car" in Frame 3
onClipEvent (keyDown) {
if (Key.isDown(13)) {
_root.difficulty = this.dif;
_root.gotoAndStop(this.got);
}
}
onClipEvent (load) {
this.gotoAndStop(_root.carno);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
onClipEvent (mouseUp) {
this.mosD = false;
}
onClipEvent (enterFrame) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
if (Key.isDown(65)) {
this.weapon++;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 260 MovieClip "cam" in Frame 3
onClipEvent (load) {
this.carwatch = "";
}
Instance of Symbol 290 MovieClip in Frame 3
onClipEvent (load) {
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 4
stop();
Instance of Symbol 296 MovieClip in Frame 4
on (release) {
_root.difis.gotoAndStop(2);
_root.difis.modes = "tutorial";
_root.difis._alpha = 100;
}
on (rollOver) {
_root.desc.text = "It is strongly advised you take this tutorial before trying to race with the big boys!";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 298 MovieClip in Frame 4
on (release) {
_root.difis.modes = "selectfr";
_root.difis._alpha = 100;
}
on (rollOver) {
_root.desc.text = "Free race mode allows you to race on any track you want for some good practice";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 300 MovieClip in Frame 4
on (release) {
_root.difis.modes = "storyBegin";
_root.difis._alpha = 100;
}
on (rollOver) {
_root.desc.text = "You play as a new racer called Jake. You must prove your abilities in this ultimate challenge!";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 302 MovieClip in Frame 4
on (release) {
_root.difis.gotoAndStop(2);
_root.difis.modes = "selecttt";
_root.difis._alpha = 100;
}
on (rollOver) {
_root.desc.text = "Compete against the world and become a true champ by beating the fastes time!";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 304 MovieClip in Frame 4
on (release) {
_root.difis.modes = 13;
_root.difis._alpha = 100;
}
on (rollOver) {
_root.desc.text = "Race in all tracks gaining points as you go. Prepare yourself for an action-packed ride!";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 306 MovieClip in Frame 4
on (release) {
_root.difis.gotoAndStop(2);
_root.difis.modes = "selectch";
_root.difis._alpha = 100;
}
on (rollOver) {
_root.desc.text = "Complete various challenges to win awards";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 308 MovieClip in Frame 4
on (release) {
_root.gotoAndStop("trophies");
}
on (rollOver) {
_root.desc.text = "View the awards you have received throughout the game";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 310 MovieClip in Frame 4
on (release) {
_root.gotoAndStop("credits");
}
on (rollOver) {
_root.desc.text = "View the credits. Watch them from beginning to end for a special suprise";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 312 MovieClip in Frame 4
on (release) {
_root.characterselected = false;
_root.gotoAndStop(1);
}
on (rollOver) {
_root.desc.text = "Reselect your character";
}
on (rollOut) {
_root.desc.text = "";
}
Instance of Symbol 322 MovieClip in Frame 4
on (release) {
_root.prevFrame();
}
Instance of Symbol 325 MovieClip in Frame 4
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Instance of Symbol 327 MovieClip in Frame 4
on (release) {
getURL ("http://www.rustygames.com", "_blank");
}
Frame 5
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop1");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = _root.freeracelaps;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop(1);
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 346 MovieClip "tracks" in Frame 5
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 5
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 5
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 423 MovieClip "car1" in Frame 5
onClipEvent (load) {
this.gotoAndStop(_root.opp1);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car2" in Frame 5
onClipEvent (load) {
this.gotoAndStop(_root.opp2);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car3" in Frame 5
onClipEvent (load) {
this.gotoAndStop(_root.opp3);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car" in Frame 5
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 5
onClipEvent (load) {
this.trackf = 1;
this.carwatch = "";
}
Frame 6
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop2");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = _root.freeracelaps;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop(1);
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 522 MovieClip "tracks" in Frame 6
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 6
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 6
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car1" in Frame 6
onClipEvent (load) {
this.gotoAndStop(_root.opp1);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car2" in Frame 6
onClipEvent (load) {
this.gotoAndStop(_root.opp2);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car3" in Frame 6
onClipEvent (load) {
this.gotoAndStop(_root.opp3);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 6
onClipEvent (load) {
this.trackf = 2;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 7
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = _root.freeracelaps;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop(1);
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 530 MovieClip "tracks" in Frame 7
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 7
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps++;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 7
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 7
onClipEvent (load) {
this.trackf = 3;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 8
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop8");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = _root.freeracelaps;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 8;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop(1);
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 535 MovieClip "tracks" in Frame 8
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 8
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 8
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 8
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 8
onClipEvent (load) {
this.trackf = 4;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 9
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop6");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = _root.freeracelaps;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop(1);
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 540 MovieClip "tracks" in Frame 9
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip "yea" in Frame 9
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 143 MovieClip "tele1" in Frame 9
onClipEvent (load) {
this.parent = 4;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele2" in Frame 9
onClipEvent (load) {
this.parent = 3;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele3" in Frame 9
onClipEvent (load) {
this.parent = 2;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele4" in Frame 9
onClipEvent (load) {
this.parent = 1;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele5" in Frame 9
onClipEvent (load) {
this.parent = 3;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 9
onClipEvent (load) {
this.trackf = 5;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 10
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = _root.freeracelaps;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop(1);
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 545 MovieClip "tracks" in Frame 10
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 354 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 10
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 10
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 10
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 10
onClipEvent (load) {
this.trackf = 6;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 11
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop5");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = _root.freeracelaps;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function weapon2o(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root.tracks[target]._x - xa, _root.tracks[target]._y - ya), _x:_root.tracks[target]._x, _y:_root.tracks[target]._y, par:target, _rotation:(-Math.atan2(_root.tracks[target]._x - _root._xmouse, _root.tracks[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._alpha--;
if (this._alpha < 80) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.play();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop(1);
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 348 MovieClip in Frame 11
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 11
onClipEvent (load) {
this.trackf = 7;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 12
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop7");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = _root.freeracelaps;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function weapon2o(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root.tracks[target]._x - xa, _root.tracks[target]._y - ya), _x:_root.tracks[target]._x, _y:_root.tracks[target]._y, par:target, _rotation:(-Math.atan2(_root.tracks[target]._x - _root._xmouse, _root.tracks[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._alpha--;
if (this._alpha < 80) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.play();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 22;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop(1);
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 348 MovieClip in Frame 12
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 12
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 12
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 12
onClipEvent (load) {
this.trackf = 8;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 13
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop1");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 3) {
_root.gotoAndStop("gppoints");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 346 MovieClip "tracks" in Frame 13
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 13
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 13
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 13
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 13
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 13
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 13
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 13
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 13
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car1" in Frame 13
onClipEvent (load) {
this.gotoAndStop(_root.opp1);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car2" in Frame 13
onClipEvent (load) {
this.gotoAndStop(_root.opp2);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car3" in Frame 13
onClipEvent (load) {
this.gotoAndStop(_root.opp3);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 13
onClipEvent (load) {
this.trackf = 1;
this.carwatch = "";
}
Frame 14
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop2");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 3) {
_root.gotoAndStop("gppoints");
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 522 MovieClip "tracks" in Frame 14
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 14
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 14
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car1" in Frame 14
onClipEvent (load) {
this.gotoAndStop(_root.opp1);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car2" in Frame 14
onClipEvent (load) {
this.gotoAndStop(_root.opp2);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car3" in Frame 14
onClipEvent (load) {
this.gotoAndStop(_root.opp3);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 14
onClipEvent (load) {
this.trackf = 2;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 15
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 3) {
_root.gotoAndStop("gppoints");
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 530 MovieClip "tracks" in Frame 15
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 15
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps++;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 15
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 15
onClipEvent (load) {
this.trackf = 3;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 16
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop8");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 8;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 3) {
_root.gotoAndStop("gppoints");
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 535 MovieClip "tracks" in Frame 16
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 16
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 16
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 16
onClipEvent (load) {
this.trackf = 4;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 17
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop6");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 3) {
_root.gotoAndStop("gppoints");
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 540 MovieClip "tracks" in Frame 17
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip "yea" in Frame 17
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 143 MovieClip "tele1" in Frame 17
onClipEvent (load) {
this.parent = 4;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele2" in Frame 17
onClipEvent (load) {
this.parent = 3;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele3" in Frame 17
onClipEvent (load) {
this.parent = 2;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele4" in Frame 17
onClipEvent (load) {
this.parent = 1;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele5" in Frame 17
onClipEvent (load) {
this.parent = 3;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 17
onClipEvent (load) {
this.trackf = 5;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 18
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 4;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 3) {
_root.gotoAndStop("gppoints");
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 545 MovieClip "tracks" in Frame 18
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 354 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 18
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 18
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 18
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 18
onClipEvent (load) {
this.trackf = 6;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 19
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop5");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 4;
function weapon2o(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root.tracks[target]._x - xa, _root.tracks[target]._y - ya), _x:_root.tracks[target]._x, _y:_root.tracks[target]._y, par:target, _rotation:(-Math.atan2(_root.tracks[target]._x - _root._xmouse, _root.tracks[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._alpha--;
if (this._alpha < 80) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.play();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 3) {
_root.gotoAndStop("gppoints");
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 348 MovieClip in Frame 19
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 19
onClipEvent (load) {
this.trackf = 7;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 20
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop7");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
function weapon2o(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root.tracks[target]._x - xa, _root.tracks[target]._y - ya), _x:_root.tracks[target]._x, _y:_root.tracks[target]._y, par:target, _rotation:(-Math.atan2(_root.tracks[target]._x - _root._xmouse, _root.tracks[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._alpha--;
if (this._alpha < 80) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.play();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var _local5 = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
_local5[3] = 1;
}
return(_local5);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 22;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 3) {
_root.gotoAndStop("gppoints");
}
_root.places = [];
for (d in _root) {
if (d.slice(0, 3) == "car") {
_root.places.push({nam:d, place:_root[d].place});
}
}
_root.places.sortOn("place", Array.DESCENDING | Array.NUMERIC);
i = 0;
while (i < 5) {
if (_root.places[i].nam == "car") {
_root.position = i + 1;
}
i++;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 348 MovieClip in Frame 20
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 20
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 20
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 20
onClipEvent (load) {
this.trackf = 8;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 21
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop1");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 6;
var opp2 = 3;
var opp3 = 1;
var maxlaps = 4;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
if (_root.finished[0] == 0) {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 0;
_root.gotoAndStop("levelfinished");
} else {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 1;
_root.gotoAndStop("levelfinished");
}
this.onEnterFrame = null;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 346 MovieClip "tracks" in Frame 21
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 21
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 21
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 21
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 21
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 21
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 21
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 21
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 21
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car1" in Frame 21
onClipEvent (load) {
this.gotoAndStop(_root.opp1);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car2" in Frame 21
onClipEvent (load) {
this.gotoAndStop(_root.opp2);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car3" in Frame 21
onClipEvent (load) {
this.gotoAndStop(_root.opp3);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 21
onClipEvent (load) {
this.trackf = 1;
this.carwatch = "";
}
Frame 22
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop8");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 3;
var opp2 = 5;
var opp3 = 6;
var maxlaps = 4;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 8;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
if (_root.finished[0] == 0) {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 0;
_root.gotoAndStop("levelfinished");
} else {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 1;
_root.gotoAndStop("levelfinished");
}
this.onEnterFrame = null;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 535 MovieClip "tracks" in Frame 22
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 22
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 22
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 423 MovieClip "car1" in Frame 22
onClipEvent (load) {
this.gotoAndStop(_root.opp1);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car2" in Frame 22
onClipEvent (load) {
this.gotoAndStop(_root.opp2);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 423 MovieClip "car3" in Frame 22
onClipEvent (load) {
this.gotoAndStop(_root.opp3);
var laps = 0;
var place = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = _root.dif3;
var decc = 0.95;
var inc;
var hits = new Array();
var node;
var nodenum = 1;
var noderot;
var recharge = false;
var weapon = 0;
var ammo = 0;
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
var goalRotation = ((-Math.atan2(this._x - _root[this.node]._x, this._y - _root[this.node]._y)) * 57.2957795130823);
if (goalRotation != this._rotation) {
this.speed = this.speed * 0.97;
if ((Math.abs(this.speed) * 0.5) > 35) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
var maxRotation = Math.abs(this.speed * _root.dif2);
var ang2 = (goalRotation - _rotation);
ang2 = ang2 + ((ang2 < -180) ? 360 : (((ang2 > 180) ? -360 : 0)));
_rotation = (_rotation + Math.max(-maxRotation, Math.min(ang2, maxRotation)));
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
_root.speedometer.needle._rotation = 12 * this.speed;
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.skidspeed--;
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
}
if (this.health <= 0) {
this.health = 0;
this.recharge = true;
}
if (this.recharge) {
this.speed = -2;
this.health++;
if (this.health >= 100) {
this.health = 100;
this.recharge = false;
}
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
a = this._x - _root[d]._x;
b = this._y - _root[d]._y;
if (((a * a) + (b * b)) < 160000) {
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
_root.weapon2(this._name, _root[d]._x, _root[d]._y);
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
_root.weapon5(this._name, _root[d]._x, _root[d]._y);
}
}
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 22
onClipEvent (load) {
this.trackf = 4;
this.carwatch = "";
}
Frame 23
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 5;
var opp2 = 3;
var opp3 = 1;
var maxlaps = 3;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
if (_root.finished[0] == 0) {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 0;
_root.gotoAndStop("levelfinished");
} else {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 1;
_root.gotoAndStop("levelfinished");
}
this.onEnterFrame = null;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 530 MovieClip "tracks" in Frame 23
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 23
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps++;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 23
onClipEvent (load) {
this.trackf = 3;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 24
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop2");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 1;
var opp2 = 6;
var opp3 = 4;
var maxlaps = 4;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
if (_root.finished[0] == 0) {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 0;
_root.gotoAndStop("levelfinished");
} else {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 1;
_root.gotoAndStop("levelfinished");
}
this.onEnterFrame = null;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 522 MovieClip "tracks" in Frame 24
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 24
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 24
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 24
onClipEvent (load) {
this.trackf = 2;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 25
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop6");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 4;
var opp2 = 6;
var opp3 = 2;
var maxlaps = 3;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
if (_root.finished[0] == 0) {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 0;
_root.gotoAndStop("levelfinished");
} else {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 1;
_root.gotoAndStop("levelfinished");
}
this.onEnterFrame = null;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 540 MovieClip "tracks" in Frame 25
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip "yea" in Frame 25
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 25
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 143 MovieClip "tele1" in Frame 25
onClipEvent (load) {
this.parent = 4;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele2" in Frame 25
onClipEvent (load) {
this.parent = 3;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele3" in Frame 25
onClipEvent (load) {
this.parent = 2;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele4" in Frame 25
onClipEvent (load) {
this.parent = 1;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele5" in Frame 25
onClipEvent (load) {
this.parent = 3;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 25
onClipEvent (load) {
this.trackf = 5;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 26
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 2;
var opp2 = 1;
var opp3 = 7;
var maxlaps = 4;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
if (_root.finished[0] == 0) {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 0;
_root.gotoAndStop("levelfinished");
} else {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 1;
_root.gotoAndStop("levelfinished");
}
this.onEnterFrame = null;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 545 MovieClip "tracks" in Frame 26
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 354 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 26
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 26
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 26
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 26
onClipEvent (load) {
this.trackf = 6;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 27
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop5");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 7;
var opp2 = 6;
var opp3 = 4;
var maxlaps = 4;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function weapon2o(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root.tracks[target]._x - xa, _root.tracks[target]._y - ya), _x:_root.tracks[target]._x, _y:_root.tracks[target]._y, par:target, _rotation:(-Math.atan2(_root.tracks[target]._x - _root._xmouse, _root.tracks[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._alpha--;
if (this._alpha < 80) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.play();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
if (_root.finished[0] == 0) {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 0;
_root.gotoAndStop("levelfinished");
} else {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 1;
_root.gotoAndStop("levelfinished");
}
this.onEnterFrame = null;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 348 MovieClip in Frame 27
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 27
onClipEvent (load) {
this.trackf = 7;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 28
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop7");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 5;
var opp2 = 1;
var opp3 = 7;
var maxlaps = 3;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function weapon2o(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root.tracks[target]._x - xa, _root.tracks[target]._y - ya), _x:_root.tracks[target]._x, _y:_root.tracks[target]._y, par:target, _rotation:(-Math.atan2(_root.tracks[target]._x - _root._xmouse, _root.tracks[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._alpha--;
if (this._alpha < 80) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.play();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, widths, heights, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 22;
stop();
var pauser = true;
var pauser2 = true;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
i = 1;
while (i < 4) {
if (_root["car" + i].laps >= _root.maxlaps) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
}
i++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
if (_root.finished[0] == 0) {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 0;
_root.gotoAndStop("levelfinished");
} else {
_root.nextleveltrack = _root.currentgptrack;
_root.currentgptrack++;
_root.gameover = 1;
_root.gotoAndStop("levelfinished");
}
this.onEnterFrame = null;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 348 MovieClip in Frame 28
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 28
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 28
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 28
onClipEvent (load) {
this.trackf = 8;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Instance of Symbol 565 MovieClip in Frame 29
on (press) {
_root.gotoAndPlay(1);
}
Instance of Symbol 570 MovieClip in Frame 29
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
}
Frame 30
clearALL();
_root.currentgptrack = 1;
_root.gameover = false;
stop();
Instance of Symbol 602 MovieClip in Frame 30
on (press) {
_root.gotoAndPlay(1);
}
Frame 31
stop();
_root.clearAll();
_root.gotoAndStop(((this._currentframe - 1) + ((_root.currentgptrack * 2) - 1)) - _root.gameover);
Instance of Symbol 602 MovieClip in Frame 31
on (press) {
_root.gotoAndPlay(1);
}
Frame 47
play();
Frame 226
stop();
Frame 227
_root.clearAll();
_root.play();
Frame 228
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop4");
_root.bgm.start(0, 100);
stop();
i = 0;
while (i < 4) {
if (_root.finished[i] == 0) {
_root.finishedposition1 = i;
}
if (_root.finished[i] == 1) {
_root.finishedposition2 = i;
}
if (_root.finished[i] == 2) {
_root.finishedposition3 = i;
}
if (_root.finished[i] == 3) {
_root.finishedposition4 = i;
}
i++;
}
_root.gppoints1 = 3 - _root.finishedposition1;
_root.finishedst = _root.finishedposition1 + 1;
switch (_root.finishedposition1) {
case 0 :
_root.stplace = "st!";
break;
case 1 :
_root.stplace = "nd!";
break;
case 2 :
_root.stplace = "rd!";
break;
case 3 :
_root.stplace = "th!";
}
_root.gppoints2 = 3 - _root.finishedposition2;
_root.gppoints3 = 3 - _root.finishedposition3;
_root.gppoints4 = 3 - _root.finishedposition4;
_root.totalpoints1 = _root.totalpoints1 + _root.gppoints1;
_root.totalpoints2 = _root.totalpoints2 + _root.gppoints2;
_root.totalpoints3 = _root.totalpoints3 + _root.gppoints3;
_root.totalpoints4 = _root.totalpoints4 + _root.gppoints4;
var sortGpArray = new Array();
i = 1;
while (i < 5) {
_root.sortGpArray.push({name:i, points:_root["totalpoints" + i]});
i++;
}
_root.sortGpArray.sortOn("points", Array.DESCENDING | Array.NUMERIC);
_root.currentgptrack++;
_root.opp0;
Instance of Symbol 457 MovieClip in Frame 228
onClipEvent (enterFrame) {
this.gotoAndStop(_root["opp" + (_root.sortGpArray[0].name - 1)]);
switch (_root["opp" + (_root.sortGpArray[0].name - 1)]) {
case 1 :
_root.tableGp1 = "Dashing Dan";
break;
case 2 :
_root.tableGp1 = "Mad-Dog Murphey";
break;
case 3 :
_root.tableGp1 = "The Real McCoy";
break;
case 4 :
_root.tableGp1 = "Woody";
break;
case 5 :
_root.tableGp1 = "Krazy Kenny";
break;
case 6 :
_root.tableGp1 = "J-zinger";
break;
case 7 :
_root.tableGp1 = "Terrible Timmy";
}
_root.tableGp1b = _root["gppoints" + _root.sortGpArray[0].name];
_root.tableGp1c = _root.sortGpArray[0].points;
}
Instance of Symbol 457 MovieClip in Frame 228
onClipEvent (enterFrame) {
this.gotoAndStop(_root["opp" + (_root.sortGpArray[1].name - 1)]);
switch (_root["opp" + (_root.sortGpArray[1].name - 1)]) {
case 1 :
_root.tableGp2 = "Dashing Dan";
break;
case 2 :
_root.tableGp2 = "Mad-Dog Murphey";
break;
case 3 :
_root.tableGp2 = "The Real McCoy";
break;
case 4 :
_root.tableGp2 = "Woody";
break;
case 5 :
_root.tableGp2 = "Krazy Kenny";
break;
case 6 :
_root.tableGp2 = "J-zinger";
break;
case 7 :
_root.tableGp2 = "Terrible Timmy";
}
_root.tableGp2b = _root["gppoints" + _root.sortGpArray[1].name];
_root.tableGp2c = _root.sortGpArray[1].points;
}
Instance of Symbol 457 MovieClip in Frame 228
onClipEvent (enterFrame) {
this.gotoAndStop(_root["opp" + (_root.sortGpArray[2].name - 1)]);
switch (_root["opp" + (_root.sortGpArray[2].name - 1)]) {
case 1 :
_root.tableGp3 = "Dashing Dan";
break;
case 2 :
_root.tableGp3 = "Mad-Dog Murphey";
break;
case 3 :
_root.tableGp3 = "The Real McCoy";
break;
case 4 :
_root.tableGp3 = "Woody";
break;
case 5 :
_root.tableGp3 = "Krazy Kenny";
break;
case 6 :
_root.tableGp3 = "J-zinger";
break;
case 7 :
_root.tableGp3 = "Terrible Timmy";
}
_root.tableGp3b = _root["gppoints" + _root.sortGpArray[2].name];
_root.tableGp3c = _root.sortGpArray[2].points;
}
Instance of Symbol 457 MovieClip in Frame 228
onClipEvent (enterFrame) {
this.gotoAndStop(_root["opp" + (_root.sortGpArray[3].name - 1)]);
switch (_root["opp" + (_root.sortGpArray[3].name - 1)]) {
case 1 :
_root.tableGp4 = "Dashing Dan";
break;
case 2 :
_root.tableGp4 = "Mad-Dog Murphey";
break;
case 3 :
_root.tableGp4 = "The Real McCoy";
break;
case 4 :
_root.tableGp4 = "Woody";
break;
case 5 :
_root.tableGp4 = "Krazy Kenny";
break;
case 6 :
_root.tableGp4 = "J-zinger";
break;
case 7 :
_root.tableGp4 = "Terrible Timmy";
}
_root.tableGp4b = _root["gppoints" + _root.sortGpArray[3].name];
_root.tableGp4c = _root.sortGpArray[3].points;
}
Frame 229
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop1");
_root.bgm.start(0, 100);
var trackno = 1;
var opp0 = _root.carno;
var maxlaps = 3;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
var timer = 0;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (!_root.pauser) {
_root.timer++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop("submit");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 346 MovieClip "tracks" in Frame 229
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 229
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 229
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 229
onClipEvent (load) {
this.trackf = 1;
this.carwatch = "";
}
Frame 230
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop2");
_root.bgm.start(0, 100);
var trackno = 3;
var opp0 = _root.carno;
var maxlaps = 2;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
var timer = 0;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (!_root.pauser) {
_root.timer++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop("submit");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 522 MovieClip "tracks" in Frame 230
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 230
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 230
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 230
onClipEvent (load) {
this.trackf = 2;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 231
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var trackno = 3;
var opp0 = _root.carno;
var maxlaps = 3;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
var timer = 0;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (!_root.pauser) {
_root.timer++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop("submit");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 530 MovieClip "tracks" in Frame 231
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 231
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps++;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 231
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 231
onClipEvent (load) {
this.trackf = 3;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 232
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop8");
_root.bgm.start(0, 100);
var trackno = 4;
var opp0 = _root.carno;
var maxlaps = 3;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 8;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
var timer = 0;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (!_root.pauser) {
_root.timer++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop("submit");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 535 MovieClip "tracks" in Frame 232
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 232
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 232
onClipEvent (load) {
this.trackf = 4;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 233
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop6");
_root.bgm.start(0, 100);
var trackno = 5;
var opp0 = _root.carno;
var maxlaps = 2;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
var timer = 0;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (!_root.pauser) {
_root.timer++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop("submit");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 540 MovieClip "tracks" in Frame 233
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip "yea" in Frame 233
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 143 MovieClip "tele1" in Frame 233
onClipEvent (load) {
this.parent = 4;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele2" in Frame 233
onClipEvent (load) {
this.parent = 3;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele3" in Frame 233
onClipEvent (load) {
this.parent = 2;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele4" in Frame 233
onClipEvent (load) {
this.parent = 1;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 143 MovieClip "tele5" in Frame 233
onClipEvent (load) {
this.parent = 3;
this.timed = 0;
}
onClipEvent (enterFrame) {
if (this.teleported) {
this.timed++;
if (this.timed >= 30) {
this.timed = 0;
this.teleported = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
if (!this._parent["tele" + this.parent].teleported) {
_root[car]._x = this._parent["tele" + this.parent]._x;
_root[car]._y = this._parent["tele" + this.parent]._y;
}
this._parent["tele" + this.parent].teleported = true;
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 233
onClipEvent (load) {
this.trackf = 5;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 234
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var trackno = 6;
var opp0 = _root.carno;
var maxlaps = 2;
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
var timer = 0;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (!_root.pauser) {
_root.timer++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop("submit");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 545 MovieClip "tracks" in Frame 234
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 549 MovieClip in Frame 234
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 234
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 234
onClipEvent (load) {
this.trackf = 6;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 235
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop5");
_root.bgm.start(0, 100);
var trackno = 7;
var opp0 = _root.carno;
var maxlaps = 2;
function weapon2o(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root.tracks[target]._x - xa, _root.tracks[target]._y - ya), _x:_root.tracks[target]._x, _y:_root.tracks[target]._y, par:target, _rotation:(-Math.atan2(_root.tracks[target]._x - _root._xmouse, _root.tracks[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._alpha--;
if (this._alpha < 80) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.play();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
var timer = 0;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (!_root.pauser) {
_root.timer++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop("submit");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 348 MovieClip in Frame 235
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 235
onClipEvent (load) {
this.trackf = 7;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 236
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop7");
_root.bgm.start(0, 100);
var trackno = 8;
var opp0 = _root.carno;
var maxlaps = 3;
function weapon2o(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root.tracks[target]._x - xa, _root.tracks[target]._y - ya), _x:_root.tracks[target]._x, _y:_root.tracks[target]._y, par:target, _rotation:(-Math.atan2(_root.tracks[target]._x - _root._xmouse, _root.tracks[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._alpha--;
if (this._alpha < 80) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.play();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 22;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
var timer = 0;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (!_root.pauser) {
_root.timer++;
}
if (_root.car.laps >= _root.maxlaps) {
if (!_root.car.finishedrace) {
_root.finished.push(0);
_root.car.finishedrace = true;
_root.cam.carwatch = "1";
} else if (_root.car.speed > 0) {
_root.car.speed--;
} else {
_root.car.speed = 0;
}
}
if (_root.finished.length > 0) {
_root.gotoAndStop("submit");
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 348 MovieClip in Frame 236
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 236
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 236
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 517 MovieClip "cam" in Frame 236
onClipEvent (load) {
this.trackf = 8;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 237
function submit() {
if ((_root.score != 0) && (_root.username != "")) {
pldm128948 = new LoadVars();
pldm128948.namevar = _root.username;
pldm128948.scorevar = pldmcrypt.encodeNum(_root.score);
pldm128948.mid = 62 + _root.trackno;
pldm128948.pro = "2865b46663e6d9a9170acda5132157d0";
pldm128948.sendAndLoad("http://bot.armorstudios.com/hs.php", pldm128948, "POST");
getURL ("http://www.rustygames.com/highscores", "_blank");
_root.score = 0;
_root.username = "";
_root.gotoAndStop(1);
}
}
stop();
_root.onEnterFrame = null;
var username = "";
_root.score = _root.timer;
Frame 238
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop1");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (_root.car.nodenum >= 10) {
_root.gotoAndPlay(1);
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 346 MovieClip "tracks" in Frame 238
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 238
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 238
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 238
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 238
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 238
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 238
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 238
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 238
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 30;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 737 MovieClip "car2" in Frame 238
onClipEvent (load) {
var health = 5;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.targetalive = true;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 747 MovieClip "cam" in Frame 238
onClipEvent (load) {
this.trackf = 1;
this.carwatch = "";
}
Frame 239
stop();
Instance of Symbol 755 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Bronze trophy. Aquired by completing Story mode on easy difficulty.";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (_root.strop < 1) {
this._visible = false;
}
}
Instance of Symbol 759 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Silver trophy. Aquired by completing Story mode on normal difficulty.";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (_root.strop < 2) {
this._visible = false;
}
}
Instance of Symbol 763 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Gold trophy. Aquired by completing Story mode on hard difficulty.";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (_root.strop < 3) {
this._visible = false;
}
}
Instance of Symbol 766 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Gold trophy. Aquired by completing Gran Prix mode on hard difficulty.";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (_root.gptrop < 3) {
this._visible = false;
}
}
Instance of Symbol 769 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Silver trophy. Aquired by completing Gran Prix mode on normal difficulty.";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (_root.gptrop < 2) {
this._visible = false;
}
}
Instance of Symbol 772 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Bronze trophy. Aquired by completing Gran Prix mode on easy difficulty.";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (_root.gptrop < 1) {
this._visible = false;
}
}
Instance of Symbol 775 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Platinum trophey. Aquired by watching the ending credits";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (!_root.cretrop) {
this._visible = false;
}
}
Instance of Symbol 775 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Challenge trophey. Aquired by completing a challenge";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (!_root.ctrop4) {
this._visible = false;
}
}
Instance of Symbol 775 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Challenge trophey. Aquired by completing a challenge";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (!_root.ctrop3) {
this._visible = false;
}
}
Instance of Symbol 775 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Challenge trophey. Aquired by completing a challenge";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (!_root.ctrop2) {
this._visible = false;
}
}
Instance of Symbol 775 MovieClip in Frame 239
on (rollOver) {
_root.tropyex = "Challenge trophey. Aquired by completing a challenge";
}
on (rollOut) {
_root.tropyex = "";
}
onClipEvent (load) {
if (!_root.ctrop1) {
this._visible = false;
}
}
Instance of Symbol 230 MovieClip in Frame 239
on (release) {
_root.gotoAndStop(1);
}
Frame 240
play();
Instance of Symbol 570 MovieClip in Frame 241
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp1);
}
Instance of Symbol 570 MovieClip in Frame 243
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp2);
}
Instance of Symbol 570 MovieClip in Frame 245
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp0);
}
Frame 287
stop();
Frame 288
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop1");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
var boxes = 0;
var chaltime = 450;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (_root.boxes >= 27) {
_root.ctrop1 = true;
_root.gotoAndStop("chalcomp");
_root.onEnterFrame = null;
}
if (_root.chaltime <= 0) {
_root.gotoAndStop("gameover");
} else if (!_root.pauser) {
_root.chaltime--;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 346 MovieClip "tracks" in Frame 288
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip in Frame 288
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._x < this._x) && (this["rem" + d] > this._x)) {
_root[d].laps++;
}
if ((_root[d]._x > this._x) && (this["rem" + d] < this._x)) {
_root[d].laps--;
}
}
this["rem" + d] = _root[d]._x;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 354 MovieClip in Frame 288
onClipEvent (enterFrame) {
if (this.hitTest(_root.car)) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 423 MovieClip "car" in Frame 288
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 792 MovieClip "cam" in Frame 288
onClipEvent (load) {
this.trackf = 1;
this.carwatch = "";
}
Frame 289
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop1");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 3;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if ((d.slice(0, 2) == "ba") || (d == "tracks")) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
var boxes = 0;
var chaltime = 600;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (_root.boxes >= 29) {
_root.ctrop3 = true;
_root.gotoAndStop("chalcomp");
_root.onEnterFrame = null;
}
if (_root.chaltime <= 0) {
_root.gotoAndStop("gameover");
} else if (!_root.pauser) {
_root.chaltime--;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 737 MovieClip "ba1" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba2" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba3" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba5" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba4" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba6" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba7" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba8" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba9" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba10" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba11" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba12" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba13" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba14" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba16" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba17" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba15" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba18" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba19" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba20" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba21" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba22" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba24" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba26" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba25" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba23" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba27" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba29" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 737 MovieClip "ba28" in Frame 289
onClipEvent (load) {
var health = 1;
}
onClipEvent (enterFrame) {
if (this.health <= 0) {
_root.boxes++;
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
}
Instance of Symbol 423 MovieClip "car" in Frame 289
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 2;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 801 MovieClip "cam" in Frame 289
onClipEvent (load) {
this.trackf = 1;
this.carwatch = "";
}
Frame 290
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop6");
_root.bgm.start(0, 100);
var opp0 = 8;
var opp1 = 4;
var opp2 = 6;
var opp3 = 2;
var maxlaps = 3;
players = [];
players.push(_root.opp0);
players.push(_root.opp1);
players.push(_root.opp2);
players.push(_root.opp3);
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
var boxes = 0;
var chaltime = 400;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (_root.car.laps >= 3) {
_root.ctrop2 = true;
_root.gotoAndStop("chalcomp");
_root.onEnterFrame = null;
}
if (_root.chaltime <= 0) {
_root.gotoAndStop("gameover");
} else if (!_root.pauser) {
_root.chaltime--;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 540 MovieClip "tracks" in Frame 290
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 348 MovieClip "yea" in Frame 290
onClipEvent (enterFrame) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (this.hitTest(_root[d]._x, _root[d]._y, 0)) {
this["hits" + d] = true;
} else {
if (this["hits" + d]) {
this["hits" + d] = false;
if ((_root[d]._y > this._y) && (this["rem" + d] < this._y)) {
_root[d].laps--;
}
if ((_root[d]._y < this._y) && (this["rem" + d] > this._y)) {
_root[d].laps++;
}
}
this["rem" + d] = _root[d]._y;
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 290
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = 5;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 290
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = 5;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 290
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = 5;
}
}
}
}
}
}
Instance of Symbol 423 MovieClip "car" in Frame 290
onClipEvent (load) {
this.gotoAndStop(_root.opp0);
var place = 0;
var laps = 0;
var health = 100;
var wid = (this._width * 0.5);
var hei = (this._height * 0.5);
var speed = 1;
var max_speed = 70;
var acc = 1;
var max_acc = 2;
var decc = 0.95;
var inc;
var hits = new Array();
var weapon = 0;
var ammo = 100;
var currkey = 1;
var node;
var nodenum = 1;
}
onClipEvent (mouseDown) {
if (!_root.pauser) {
this.mosD = true;
switch (this.weapon) {
case 5 :
_root.weapon1(this._name);
break;
case 7 :
_root.weapon3(this._name, _root._xmouse, _root._ymouse);
break;
case 1 :
_root.weapon4(this._name);
break;
case 3 :
_root.weapon6(this._name);
break;
case 4 :
_root.weapon7(this._name);
}
}
}
onClipEvent (mouseUp) {
if (!_root.pauser) {
this.mosD = false;
}
}
onClipEvent (enterFrame) {
if (!_root.pauser) {
this.place = (this.laps * (_root.maxnodes + 1)) + this.nodenum;
this.node = "n" + this.nodenum;
if (_root[this.node].hitTest(this._x, this._y, 1)) {
_root.position = 4;
for (d in _root) {
if (_root[d].place < this.place) {
_root.position--;
_root.cam.posi.text = _root.position;
}
}
this.nodenum++;
}
if (this.nodenum > _root.maxnodes) {
this.nodenum = 1;
}
this.ang = (-this._rotation) * (Math.PI/180);
if (!this.hitwall) {
if (Key.isDown(38) || (Key.isDown(87))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.inc = (this.max_speed - this.speed) * 0.1;
((this.inc < this.acc) ? ((this.inc = this.acc)) : ((this.inc = this.inc)));
((this.inc > this.max_acc) ? ((this.inc = this.max_acc)) : ((this.inc = this.inc)));
this.speed = this.speed + this.inc;
} else if (Key.isDown(40) || (Key.isDown(83))) {
if (this.cars._currentframe != 3) {
this.cars.gotoAndStop(2);
}
this.speed = this.speed - this.acc;
} else {
this.cars.gotoAndStop(1);
}
if (Key.isDown(37) || (Key.isDown(65))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation - Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (Key.isDown(39) || (Key.isDown(68))) {
if ((Math.abs(this.speed) * 0.5) > 13) {
if (_root._quality == "HIGH") {
this.cars.gotoAndStop(3);
_root.skid(this._x + (Math.sin(this.ang) * this.speed), this._y + (Math.cos(this.ang) * this.speed), this._rotation);
}
}
this._rotation = this._rotation + Math.abs(this.speed * 0.3);
this.speed = this.speed * 0.96;
} else if (this.cars._currentframe == 3) {
this.cars.gotoAndStop(2);
}
this.ang = (-this._rotation) * (Math.PI/180);
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
this.speed = this.speed * this.decc;
if (this.speed < ((-this.max_speed) * 0.5)) {
this.speed = (-this.max_speed) * 0.5;
}
if (this.speed > this.max_speed) {
this.speed = this.max_speed;
}
}
this.hits = _root.boxTest("tracks", this._x, this._y, this.wid, this.hei, this.ang);
if ((((this.hits[0] + this.hits[1]) + this.hits[2]) + this.hits[3]) > 0) {
if (this.speed < 0) {
if ((this.hits[0] + this.hits[1]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
}
} else if ((this.hits[2] + this.hits[3]) > 0) {
} else if (!this.hitwall) {
this.speed = -this.speed;
this.hitwall = true;
setTimeout(function () {
if (_root.car.hitwall) {
_root.car.speed = -_root.car.speed;
_root.car.hitwall = false;
}
}, 3000);
}
if ((this.speed < 0) && (this.speed > -1)) {
this.speed = -2;
}
if ((this.speed > 0) && (this.speed < 1)) {
this.speed = 2;
}
this._x = this._x - (Math.sin(this.ang) * this.speed);
this._y = this._y - (Math.cos(this.ang) * this.speed);
} else {
this.hitwall = false;
}
if (this.speed > 30) {
_root.myBlur.blurX = (Math.sin(this.ang) * this.speed) - 30;
_root.myBlur.blurY = (Math.cos(this.ang) * this.speed) - 30;
this.filters = [_root.myBlur];
} else {
_root.myBlur.blurY = 0;
_root.myBlur.blurX = 0;
this.filters = [_root.myBlur];
}
if (this.skidspeed > 0) {
this.speed = this.speed * 0.5;
this._x = this._x + (Math.sin(this.skidang) * this.skidspeed);
this._y = this._y + (Math.cos(this.skidang) * this.skidspeed);
this.skidspeed = this.skidspeed - 3;
}
this.weapons.gotoAndStop(this.weapon);
if (this.ammo <= 0) {
this.ammo = 0;
this.weapon = 0;
}
if (this.weapon == 2) {
this.weapons._rotation = (90 - (Math.atan2(this._x - _root._xmouse, this._y - _root._ymouse) * 57.2957795130823)) - this._rotation;
if (this.mosD) {
_root.weapon2(this._name, _root._xmouse, _root._ymouse);
}
} else {
this.weapons._rotation = 90;
}
if (this.weapon == 6) {
if (this.mosD) {
_root.weapon5(this._name);
}
}
if (this.health <= 0) {
this.health = 0;
this.speed = 0;
}
if (this.health >= 100) {
this.health = 100;
}
if (Key.isDown(32) == this.currkey) {
this.health = this.health + 3;
if (this.currkey == 0) {
this.currkey = 1;
} else {
this.currkey = 0;
}
}
} else {
this.mosD = false;
}
if (this.weapon == 0) {
this.weapons.gotoAndStop(1);
this.weapons._visible = false;
} else {
this.weapons._visible = true;
}
}
Instance of Symbol 810 MovieClip "cam" in Frame 290
onClipEvent (load) {
this.trackf = 1;
this.carwatch = "";
}
Frame 291
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop3");
_root.bgm.start(0, 100);
var opp0 = _root.carno;
var maxlaps = 2;
players = [];
players.push(_root.carno);
i = 1;
pickchars();
function qualfunction() {
setTimeout(function () {
_root.qualfunction();
switch (_root.qual) {
case 0 :
_root._quality = "LOW";
break;
case 1 :
_root._quality = "MEDIUM";
break;
case 2 :
_root._quality = "HIGH";
break;
case 3 :
if (_root.avefps > 15) {
if (_root._quality == "MEDIUM") {
_root._quality = "HIGH";
}
if (_root._quality == "LOW") {
_root._quality = "MEDIUM";
}
}
if (_root.avefps >= 13) {
break;
}
if (_root._quality == "MEDIUM") {
_root._quality = "LOW";
}
if (_root._quality != "HIGH") {
break;
}
_root._quality = "MEDIUM";
}
}, 1000);
}
function skid(x, y, a) {
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("skid", "skid" + j, j, {_x:x, _y:y, _rotation:a});
}
function boxTest(obj, xs, ys, heights, widths, ang) {
var arr = [0, 0, 0, 0, 0, 0, 0, 0];
if (_root.debug1) {
_root.createEmptyMovieClip("dd", 100000);
with (_root.dd) {
lineStyle(1, 16711680, 100);
moveTo(xs, ys);
lineTo((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths));
}
_root.createEmptyMovieClip("tt", 100001);
with (_root.tt) {
lineStyle(1, 255, 100);
moveTo(xs, ys);
lineTo(xs + (Math.sin(ang - (Math.PI/2)) * widths), ys + (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs - (Math.sin(ang - (Math.PI/2)) * widths), ys - (Math.cos(ang - (Math.PI/2)) * widths));
lineTo(xs + (Math.sin(ang) * heights), ys + (Math.cos(ang) * heights));
lineTo(xs - (Math.sin(ang) * heights), ys - (Math.cos(ang) * heights));
}
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[0] = 1;
}
if (_root[obj].hitTest((xs - (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys - (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[1] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) - (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) - (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[2] = 1;
}
if (_root[obj].hitTest((xs + (Math.sin(ang) * heights)) + (Math.sin(ang - (Math.PI/2)) * widths), (ys + (Math.cos(ang) * heights)) + (Math.cos(ang - (Math.PI/2)) * widths), 1)) {
arr[3] = 1;
}
return(arr);
}
function weapon1(target) {
if (!_root.pauser) {
_root[target].speed = _root[target].speed + 5;
_root[target].ammo = _root[target].ammo - 5;
_root[target].weapons.wep.gotoAndStop(2);
}
if (_root[target].ammo >= 0) {
setTimeout(function () {
weapon1(target);
}, 100);
}
}
function weapon2(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 2;
j = _root.getNextHighestDepth();
_root[target].weapons.wep.play();
_root.attachMovie("bullet", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target, _rotation:(-Math.atan2(_root[target]._x - _root._xmouse, _root[target]._y - _root._ymouse)) * 57.2957795130823});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
this._alpha--;
if (this._alpha < 90) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 50);
this._y = this._y - (Math.cos(this.ang) * 50);
for (d in _root) {
if (_root[d].hitTest(this._x, this._y, 1)) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
_root[d].health = _root[d].health - 2;
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360), _xscale:30, _yscale:30});
this._alpha = this._alpha - 10;
}
}
}
}
}
}
};
}
function weapon3(target, xa, ya) {
_root[target].ammo = _root[target].ammo - 100;
j = _root.getNextHighestDepth();
_root.attachMovie("homing", "b" + j, j, {ang:Math.atan2(_root[target]._x - xa, _root[target]._y - ya), _x:_root[target]._x, _y:_root[target]._y, par:target});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
j = _root.getNextHighestDepth();
_root.attachMovie("Smoke", "b" + j, j, {_x:this._x, _y:this._y, _rotation:random(360)});
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this._alpha = this._alpha - 100;
}
if (this._alpha < 50) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
} else {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x - (Math.sin(this.ang) * 30);
this._y = this._y - (Math.cos(this.ang) * 30);
for (d in _root) {
if ((Math.pow(_root[d]._x - _root[this.par]._x, 2) + Math.pow(_root[d]._y - _root[this.par]._y, 2)) < 1000000000000) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
this.ang = Math.atan2(this._x - _root[d]._x, this._y - _root[d]._y);
if (_root[d].hitTest(this._x, this._y, 1)) {
_root[d].health = _root[d].health - 70;
this._alpha = this._alpha - 50;
}
}
}
}
}
}
}
};
}
function weapon4(target) {
_root[target].ammo = _root[target].ammo - 35;
j = _root.getNextHighestDepth();
_root.attachMovie("mine", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target, speed:20, ang:_root[target].ang - ((Math.PI/2) - random(Math.PI))});
_root["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
this._rotation = (-this.ang) * 57.2957795130823;
this._x = this._x + (Math.sin(this.ang) * this.speed);
this._y = this._y + (Math.cos(this.ang) * this.speed);
if (_root.tracks.hitTest(this._x, this._y, 1)) {
this.speed = -this.speed;
}
this.speed = this.speed * 0.98;
if ((this.speed < 5) && (this.speed > 0)) {
this.speed = 5;
}
if ((this.speed > -5) && (this.speed < 0)) {
this.speed = -5;
}
if (this.speed < 15) {
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (_root[d].hitTest(this)) {
_root[d].health = _root[d].health - 20;
this.play();
this.onEnterFrame = null;
}
}
}
}
}
};
}
function weapon5(par) {
_root[par].ammo--;
j = _root.getNextHighestDepth();
_root.createEmptyMovieClip(("w" + par) + "laser", j);
_root[("w" + par) + "laser"].par = par;
_root[("w" + par) + "laser"].maxdis = 1000000000000;
_root[("w" + par) + "laser"].dip = false;
_root[("w" + par) + "laser"].onEnterFrame = function () {
if (!_root.pauser) {
wep5arr = [];
if (this.dip) {
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
a = _root[this.par]._x - _root[d]._x;
b = _root[this.par]._y - _root[d]._y;
dist = (a * a) + (b * b);
if (d == this.targets) {
this.maxdis = dist;
}
wep5arr.push([d, dist]);
}
}
}
i = 0;
while (i < wep5arr.length) {
if (wep5arr[i][1] < this.maxdis) {
this.dist2 = Math.sqrt(wep5arr[i][1]) * 0.5;
this.maxdis = wep5arr[i][1];
this.targets = wep5arr[i][0];
break;
}
i++;
}
_root[this.targets].health = _root[this.targets].health - 0.7;
this.clear();
this.lineStyle(2 + random(4), 16711680, 50);
this.moveTo(_root[this.par]._x, _root[this.par]._y);
this.ang4 = Math.atan2(_root[this.par]._x - _root[this.targets]._x, _root[this.par]._y - _root[this.targets]._y);
this.ang4 = this.ang4 + (-1.5707963267949 + random(Math.PI));
this.curveTo(_root[this.par]._x - (Math.sin(this.ang4) * this.dist2), _root[this.par]._y - (Math.cos(this.ang4) * this.dist2), _root[this.targets]._x, _root[this.targets]._y);
this.dip = true;
}
};
}
function weapon6(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("oil", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].rand = 3 - (random(2) * 6);
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d]._rotation = _root[d]._rotation + this.rand;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
function weapon7(target) {
_root[target].ammo = _root[target].ammo - 50;
j = _root.skider.getNextHighestDepth();
_root.skider.attachMovie("glue", "b" + j, j, {_x:_root[target]._x, _y:_root[target]._y, par:target});
_root.skider["b" + j].onEnterFrame = function () {
if (!_root.pauser) {
if (this._alpha <= 0) {
this.swapDepths(_root.skider.getNextHighestDepth());
this.removeMovieClip();
}
for (d in _root) {
if (d.slice(0, 3) == "car") {
if (d != this.par) {
if (this.hitTest(_root[d]._x, _root[d]._y)) {
if (_root[d].speed > 2) {
_root[d].speed = 2;
this._alpha = this._alpha - 5;
}
}
}
}
}
}
};
}
var maxnodes = 10;
var boxes = 0;
var chaltime = 600;
stop();
var pauser = true;
var pauser2 = true;
var currentgptrack = 1;
_root.qualfunction();
switch (_root.difficulty) {
case 0 :
var dif2 = 0.3;
var dif3 = 2;
break;
case 1 :
var dif2 = 0.4;
var dif3 = 2.5;
break;
case 2 :
var dif2 = 0.5;
var dif3 = 3;
}
var myBlur = (new flash.filters.BlurFilter(0, 0, 100));
_root.myBlur.blurX = 0;
var avefps = 30;
var fpsarr = [30, 30, 30];
var fps = 30;
var dt = getTimer();
var totalpoints1 = 0;
var totalpoints2 = 0;
var totalpoints3 = 0;
var totalpoints4 = 0;
var finished = [];
onEnterFrame = function () {
if (_root.car.laps >= 2) {
_root.ctrop4 = true;
_root.nextFrame();
_root.onEnterFrame = null;
}
if ((_root.chaltime <= 0) || (_root.car.health <= 0)) {
_root.gotoAndPlay(1);
} else if (!_root.pauser) {
_root.chaltime--;
}
k = 0;
while (k < 4) {
r = 0;
while (r < 4) {
j = r;
if (j == 0) {
j = "";
}
i = k;
if (i == 0) {
i = "";
}
if (("car" + j) != ("car" + i)) {
_root["car" + i].hits = _root.boxTest("car" + j, _root["car" + i]._x, _root["car" + i]._y, _root["car" + i].wid, _root["car" + i].hei, _root["car" + i].ang);
if ((((_root["car" + i].hits[0] + _root["car" + i].hits[1]) + _root["car" + i].hits[2]) + _root["car" + i].hits[3]) > 0) {
_root["car" + i].skidang = Math.atan2(_root["car" + i]._x - _root["car" + j]._x, _root["car" + i]._y - _root["car" + j]._y);
_root["car" + j].skidang = Math.atan2(_root["car" + j]._x - _root["car" + i]._x, _root["car" + j]._y - _root["car" + i]._y);
_root["car" + i].skidspeed = (_root["car" + j].skidspeed = 10);
}
}
r++;
}
k++;
}
fps = (1 / (getTimer() - dt)) * 1000;
dt = getTimer();
fpsarr.push(fps);
avefps = Math.round(((fpsarr[0] + fpsarr[1]) + fpsarr[2]) / 3);
fpsarr.splice(0, 1);
};
Instance of Symbol 545 MovieClip "tracks" in Frame 291
onClipEvent (load) {
this.cacheAsBitmap = true;
}
Instance of Symbol 354 MovieClip in Frame 291
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 291
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 354 MovieClip in Frame 291
onClipEvent (enterFrame) {
if (this._currentframe == 1) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car])) {
if (_root[car].weapon == 0) {
this.play();
_root[car].ammo = 100;
_root[car].weapon = random(7) + 1;
}
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 291
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m1l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 549 MovieClip in Frame 291
onClipEvent (load) {
var ond = false;
var timer = 0;
}
onClipEvent (enterFrame) {
if (this.ond) {
timer++;
if (this.timer > 100) {
this.timer = 0;
this.ond = false;
}
} else {
for (car in _root) {
if (car == "car") {
if (this.hitTest(_root.car._x, _root.car._y, 1)) {
this.ond = true;
_root.weapon3("m2l", _root.car._x, _root.car._y);
}
}
}
}
}
Instance of Symbol 810 MovieClip "cam" in Frame 291
onClipEvent (load) {
this.trackf = 6;
this.carwatch = "";
}
onClipEvent (enterFrame) {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
}
Frame 292
stop();
_root.saveTrops();
_root.onEnterFrame = null;
Frame 293
_root.saveTrops();
_root.stopAllSounds();
_root.bgm.stop();
onEnterFrame = null;
play();
Instance of Symbol 820 MovieClip in Frame 293
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Instance of Symbol 820 MovieClip in Frame 442
on (release) {
getURL ("http://www.rustygames.com", "_blank");
}
Instance of Symbol 820 MovieClip in Frame 894
on (release) {
_root.gotoAndPlay(1);
}
Frame 1792
_root.cretrop = true;
_root.saveTrops();
_root.gotoAndPlay(1);
Frame 1793
stop();
Frame 1794
stop();
Frame 1795
stop();
Instance of Symbol 924 MovieClip in Frame 1795
on (release) {
_root.pre.bitch.gotoAndStop(5);
_root.nimpo.info.text = "Avoid the missile until you complete all the laps. Good luck!";
}
Instance of Symbol 926 MovieClip in Frame 1795
on (release) {
_root.pre.bitch.gotoAndStop(3);
_root.nimpo.info.text = "Speed your way through the track within the time limit";
}
Instance of Symbol 928 MovieClip in Frame 1795
on (release) {
_root.pre.bitch.gotoAndStop(4);
_root.nimpo.info.text = "Shoot all the barrels within the time limit";
}
Instance of Symbol 930 MovieClip in Frame 1795
on (release) {
_root.pre.bitch.gotoAndStop(2);
_root.nimpo.info.text = "Grab every box within the time limit";
}
Frame 1796
stop();
Frame 1797
var bgm = new Sound();
_root.bgm.stop();
_root.bgm.attachSound("loop1");
_root.bgm.start(0, 100);
Instance of Symbol 956 MovieClip in Frame 1892
on (release) {
_root.gotoAndStop("endintro");
}
Frame 2442
_root.gotoAndPlay(1);
Symbol 20 MovieClip [Smoke] Frame 16
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 28 MovieClip [glue] Frame 6
stop();
Symbol 28 MovieClip [glue] Frame 7
stop();
Symbol 36 MovieClip [oil] Frame 6
stop();
Symbol 36 MovieClip [oil] Frame 7
stop();
Symbol 39 MovieClip [skid] Frame 60
stop();
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 59 MovieClip [mine] Frame 1
stop();
Symbol 59 MovieClip [mine] Frame 10
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 70 MovieClip Frame 12
stop();
Symbol 117 MovieClip Frame 1
stop();
Symbol 170 MovieClip Frame 1
stop();
onEnterFrame = function () {
this.loadbar._xscale = (this.getBytesLoaded() / this.getBytesTotal()) * 100;
if ((this.getBytesLoaded() / this.getBytesTotal()) == 1) {
this.nextFrame();
this.onEnterFrame = null;
}
};
Instance of Symbol 92 MovieClip in Symbol 170 MovieClip Frame 2
on (press) {
if (this._parent._currentframe == 17) {
this._parent.gotoAndStop(2);
} else {
this._parent.nextFrame();
}
}
Instance of Symbol 92 MovieClip in Symbol 170 MovieClip Frame 2
on (press) {
if (this._parent._currentframe == 2) {
this._parent.gotoAndStop(17);
} else {
this._parent.prevFrame();
}
}
Symbol 174 MovieClip Frame 1
stop();
Symbol 174 MovieClip Frame 2
stop();
Symbol 998 MovieClip [__Packages.pldmcrypt] Frame 0
class pldmcrypt
{
function pldmcrypt () {
}
static function fr(str, find, replace, limit) {
var _local2 = str;
var _local3;
var _local4;
var _local9;
if (!(typeof(find) === "string")) {
if (replace === undefined) {
replace = [""];
} else if (typeof(replace) === "string") {
replace = [replace];
}
} else {
find = [find];
replace = [replace];
}
_local9 = find.length;
var _local1 = 0;
var _local5 = 0;
while (_local1 < _local9) {
while (_local4 = _local2.indexOf(find[_local1]) , !(_local4 === -1)) {
if ((!(limit === undefined)) && (_local5 >= limit)) {
break;
}
_local3 = new Array(_local2.substring(0, _local4), _local2.substr(_local4, find[_local1].length), _local2.substr(_local4 + find[_local1].length));
_local3[1] = ((replace[_local1] === undefined) ? "" : (replace[_local1]));
_local2 = (_local3[0] + _local3[1]) + _local3[2];
_local5++;
}
_local1++;
_local5 = 0;
}
return(_local2);
}
static function encodeNum(num) {
var _local11 = getTimer();
var _local6 = ["aZ", "Zy", "Zx"];
var _local7 = ["zH", "jY", "uH"];
var _local4 = ["Ah", "Xh", "hO"];
var _local5 = ["Ub", "Bu", "Cb"];
var _local8 = ["Qc", "Pc", "Pe"];
var _local9 = ["Ei", "Ie", "Ef"];
var _local3 = ["Fk", "kG", "Kg"];
var _local13 = ["Jl", "Lm", "Mn"];
var _local12 = ["No", "Np", "Qp"];
var _local2 = ["Rs", "St", "Sw"];
var _local14 = random(3);
num = String(num);
num = fr(num, "9", _local6[random(3)], 1);
num = fr(num, "9", _local6[random(3)], 1);
num = fr(num, "9", _local6[random(3)], 1);
num = fr(num, "9", _local6[random(3)], 1);
num = fr(num, "9", _local6[random(3)], 1);
num = fr(num, "9", _local6[random(3)], 1);
num = fr(num, "8", _local7[random(3)], 1);
num = fr(num, "8", _local7[random(3)], 1);
num = fr(num, "8", _local7[random(3)], 1);
num = fr(num, "8", _local7[random(3)], 1);
num = fr(num, "8", _local7[random(3)], 1);
num = fr(num, "7", _local4[random(3)], 1);
num = fr(num, "7", _local4[random(3)], 1);
num = fr(num, "7", _local4[random(3)], 1);
num = fr(num, "7", _local4[random(3)], 1);
num = fr(num, "7", _local4[random(3)], 1);
num = fr(num, "7", _local4[random(3)], 1);
num = fr(num, "7", _local4[random(3)], 1);
num = fr(num, "7", _local4[random(3)], 1);
num = fr(num, "6", _local5[random(3)], 1);
num = fr(num, "6", _local5[random(3)], 1);
num = fr(num, "6", _local5[random(3)], 1);
num = fr(num, "6", _local5[random(3)], 1);
num = fr(num, "6", _local5[random(3)], 1);
num = fr(num, "6", _local5[random(3)], 1);
if (_local14 == 1) {
num = fr(num, "5", _local8[0]);
} else {
num = fr(num, "5", _local8[random(3)]);
}
num = fr(num, "4", _local9[random(3)]);
num = fr(num, "3", _local3[random(3)], 1);
num = fr(num, "3", _local3[random(3)], 1);
num = fr(num, "3", _local3[random(3)], 1);
num = fr(num, "3", _local3[random(3)], 1);
num = fr(num, "3", _local3[random(3)], 1);
num = fr(num, "3", _local3[random(3)], 1);
num = fr(num, "3", _local3[random(3)], 1);
num = fr(num, "3", _local3[random(3)], 1);
num = fr(num, "2", _local13[random(3)]);
num = fr(num, "1", _local12[random(3)]);
num = fr(num, "0", _local2[random(3)], 1);
num = fr(num, "0", _local2[random(3)], 1);
num = fr(num, "0", _local2[random(3)], 1);
num = fr(num, "0", _local2[random(3)], 1);
num = fr(num, "0", _local2[random(3)], 1);
num = fr(num, "0", _local2[random(3)], 1);
num = fr(num, "0", _local2[random(3)], 1);
num = fr(num, "0", _local2[random(3)], 1);
num = fr(num, "0", _local2[random(3)], 1);
var _local10 = getTimer() - _local11;
num = (num + "Dd") + _local10;
return(num);
}
static function encodeStr8bytes(str) {
var _local1 = 0;
var _local4 = str.length;
var _local3 = "%";
var _local2 = ["%", "$", "#", "@"];
while (_local1 < _local4) {
_local3 = _local3 + (str.charCodeAt(_local1) + _local2[random(_local2.length)]);
_local1++;
}
return(_local3);
}
static function decodeStr8bytes(str) {
str = ("PIE" + str) + "PIE";
str = fr(str, "%", "D");
str = fr(str, "$", "D");
str = fr(str, "#", "D");
str = fr(str, "@", "D");
str = fr(str, "PIED", "");
str = fr(str, "DPIE", "");
var _local3 = str.split("D");
var _local4 = "";
var _local1 = 0;
var _local5 = _local3.length;
while (_local1 < _local5) {
_local4 = _local4 + String(String.fromCharCode(_local3[_local1]));
_local1++;
}
return(_local4);
}
static function decodeNum(str) {
var _local2 = ["aZ", "Zy", "Zx", "zH", "jY", "uH", "Ah", "Xh", "hO", "Ub", "Bu", "Cb", "Qc", "Pc", "Pe", "Ei", "Ie", "Ef", "Fk", "kG", "Kg", "Jl", "Lm", "Mn", "No", "Np", "Qp", "Rs", "St", "Sw"];
str = String(str);
str = str.split("Dd");
str = str[0];
str = fr(str, _local2[0], "9");
str = fr(str, _local2[1], "9");
str = fr(str, _local2[2], "9");
str = fr(str, _local2[3], "8");
str = fr(str, _local2[4], "8");
str = fr(str, _local2[5], "8");
str = fr(str, _local2[6], "7");
str = fr(str, _local2[7], "7");
str = fr(str, _local2[8], "7");
str = fr(str, _local2[9], "6");
str = fr(str, _local2[10], "6");
str = fr(str, _local2[11], "6");
str = fr(str, _local2[12], "5");
str = fr(str, _local2[13], "5");
str = fr(str, _local2[14], "5");
str = fr(str, _local2[15], "4");
str = fr(str, _local2[16], "4");
str = fr(str, _local2[17], "4");
str = fr(str, _local2[18], "3");
str = fr(str, _local2[19], "3");
str = fr(str, _local2[20], "3");
str = fr(str, _local2[21], "2");
str = fr(str, _local2[22], "2");
str = fr(str, _local2[23], "2");
str = fr(str, _local2[24], "1");
str = fr(str, _local2[25], "1");
str = fr(str, _local2[26], "1");
str = fr(str, _local2[27], "0");
str = fr(str, _local2[28], "0");
str = fr(str, _local2[29], "0");
var _local3 = Number(str);
return(_local3);
}
}
Symbol 177 Button
on (press) {
_root.carno--;
if (_root.carno < 1) {
_root.carno = 7;
}
_root.changetext();
}
Symbol 178 Button
on (press) {
_root.carno++;
if (_root.carno > 7) {
_root.carno = 1;
}
_root.changetext();
}
Symbol 210 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 2
stop();
Symbol 210 MovieClip Frame 3
stop();
Symbol 223 Button
on (press) {
_root.play();
_root.characterselected = true;
}
Symbol 239 MovieClip Frame 1
stop();
Symbol 239 MovieClip Frame 2
stop();
Symbol 239 MovieClip Frame 3
stop();
Symbol 239 MovieClip Frame 4
stop();
Symbol 239 MovieClip Frame 5
stop();
Symbol 239 MovieClip Frame 6
stop();
Symbol 239 MovieClip Frame 7
stop();
Symbol 259 MovieClip Frame 1
stop();
Instance of Symbol 247 MovieClip in Symbol 259 MovieClip Frame 1
on (press) {
this._parent.startDrag();
}
onClipEvent (mouseUp) {
this._parent.stopDrag();
}
Instance of Symbol 254 MovieClip in Symbol 259 MovieClip Frame 1
on (press) {
this._parent.play();
}
Symbol 259 MovieClip Frame 2
stop();
Instance of Symbol 258 MovieClip in Symbol 259 MovieClip Frame 2
on (press) {
this._parent.play();
}
Symbol 260 MovieClip Frame 1
function camControl() {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
while (!_root.tracks.hitTest(0, this._y - (this._height / 2))) {
this._y++;
}
while (!_root.tracks.hitTest(this._x - (this._width / 2), 0)) {
this._x++;
}
while (!_root.tracks.hitTest(0, this._y + (this._height / 2))) {
this._y--;
}
while (!_root.tracks.hitTest(this._x + (this._width / 2), 0)) {
this._x--;
}
parentColor.setTransform(camColor.getTransform());
var _local5 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local5);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local5;
_parent._yscale = 100 * _local4;
if (!this.hitTest(_root._xmouse, _root._ymouse, 0)) {
_root.pauser = true;
}
this._yscale = (this._xscale = 100);
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Instance of Symbol 230 MovieClip in Symbol 260 MovieClip Frame 1
on (release) {
_root.clearAll2();
_root.play();
}
Instance of Symbol 263 MovieClip in Symbol 290 MovieClip Frame 1
on (release) {
for (all in this._parent) {
if (this._parent[all]._visible) {
this._parent[all]._visible = false;
} else {
this._parent[all]._visible = true;
}
}
this._visible = true;
}
Instance of Symbol 265 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn11._x, this._parent._y - _root.bn11._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn11._x;
_root.car._y = _root.bn11._y;
}
Instance of Symbol 267 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn1._x, this._parent._y - _root.bn1._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn1._x;
_root.car._y = _root.bn1._y;
}
Instance of Symbol 269 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn2._x, this._parent._y - _root.bn2._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn2._x;
_root.car._y = _root.bn2._y;
}
Instance of Symbol 271 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn3._x, this._parent._y - _root.bn3._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn3._x;
_root.car._y = _root.bn3._y;
}
Instance of Symbol 273 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn5._x, this._parent._y - _root.bn5._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn5._x;
_root.car._y = _root.bn5._y;
}
Instance of Symbol 275 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn6._x, this._parent._y - _root.bn6._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn6._x;
_root.car._y = _root.bn6._y;
}
Instance of Symbol 277 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn7._x, this._parent._y - _root.bn7._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn7._x;
_root.car._y = _root.bn7._y;
}
Instance of Symbol 279 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn10._x, this._parent._y - _root.bn10._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn10._x;
_root.car._y = _root.bn10._y;
}
Instance of Symbol 283 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn4._x, this._parent._y - _root.bn4._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn4._x;
_root.car._y = _root.bn4._y;
}
Instance of Symbol 285 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn8._x, this._parent._y - _root.bn8._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn8._x;
_root.car._y = _root.bn8._y;
}
Instance of Symbol 287 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn9._x, this._parent._y - _root.bn9._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn9._x;
_root.car._y = _root.bn9._y;
}
Instance of Symbol 289 MovieClip in Symbol 290 MovieClip Frame 1
onClipEvent (enterFrame) {
this.ang = Math.atan2(this._parent._x - _root.bn12._x, this._parent._y - _root.bn12._y);
this._x = Math.sin(this.ang) * -150;
this._y = Math.cos(this.ang) * -150;
}
on (press) {
_root.car._x = _root.bn12._x;
_root.car._y = _root.bn12._y;
}
Symbol 340 MovieClip Frame 1
stop();
Instance of Symbol 331 MovieClip in Symbol 340 MovieClip Frame 1
on (release) {
if (this._parent._alpha == 100) {
this._parent.play();
_root.difficulty = 0;
}
}
Instance of Symbol 333 MovieClip in Symbol 340 MovieClip Frame 1
on (release) {
if (this._parent._alpha == 100) {
this._parent.play();
_root.difficulty = 1;
}
}
Instance of Symbol 335 MovieClip in Symbol 340 MovieClip Frame 1
on (release) {
if (this._parent._alpha == 100) {
this._parent.play();
_root.difficulty = 2;
}
}
Symbol 340 MovieClip Frame 2
stop();
Instance of Symbol 338 MovieClip in Symbol 340 MovieClip Frame 2
on (release) {
_root.gotoAndStop(this._parent.modes);
}
Symbol 354 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 1
stop();
Symbol 365 MovieClip Frame 2
stop();
Symbol 365 MovieClip Frame 3
stop();
Symbol 371 MovieClip Frame 1
stop();
Symbol 375 MovieClip Frame 1
stop();
Symbol 376 MovieClip Frame 1
stop();
Symbol 388 MovieClip Frame 1
stop();
Symbol 388 MovieClip Frame 2
stop();
Symbol 388 MovieClip Frame 3
stop();
Symbol 396 MovieClip Frame 1
stop();
Symbol 403 MovieClip Frame 1
stop();
Symbol 403 MovieClip Frame 2
stop();
Symbol 403 MovieClip Frame 3
stop();
Symbol 410 MovieClip Frame 1
stop();
Symbol 410 MovieClip Frame 2
stop();
Symbol 410 MovieClip Frame 3
stop();
Symbol 419 MovieClip Frame 1
stop();
Symbol 419 MovieClip Frame 2
stop();
Symbol 419 MovieClip Frame 3
stop();
Symbol 422 MovieClip Frame 1
stop();
Symbol 423 MovieClip Frame 1
stop();
Instance of Symbol 378 MovieClip in Symbol 423 MovieClip Frame 1
onClipEvent (enterFrame) {
if (this._parent._name == "car") {
this._visible = false;
} else {
this._visible = true;
}
this._xscale = this._parent.health;
this._rotation = -this._parent._rotation;
}
Symbol 423 MovieClip Frame 2
stop();
Symbol 423 MovieClip Frame 3
stop();
Symbol 423 MovieClip Frame 4
stop();
Symbol 423 MovieClip Frame 5
stop();
Symbol 423 MovieClip Frame 6
stop();
Symbol 423 MovieClip Frame 7
stop();
Symbol 423 MovieClip Frame 8
stop();
Symbol 436 MovieClip Frame 1
stop();
Symbol 436 MovieClip Frame 2
stop();
Symbol 436 MovieClip Frame 3
stop();
Symbol 436 MovieClip Frame 4
stop();
Symbol 436 MovieClip Frame 5
stop();
Symbol 436 MovieClip Frame 6
stop();
Symbol 436 MovieClip Frame 7
stop();
Instance of Symbol 434 MovieClip in Symbol 437 MovieClip Frame 1
on (press) {
i = 1;
while (i < 4) {
if (!_root["car" + i].finishedrace) {
_root.finished.push(i);
_root["car" + i].finishedrace = true;
}
i++;
}
}
on (rollOver) {
_root.pauser = false;
}
Instance of Symbol 436 MovieClip in Symbol 437 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp1);
}
on (press) {
_root.cam.carwatch = "1";
}
on (rollOver) {
_root.pauser = false;
}
Instance of Symbol 436 MovieClip in Symbol 437 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp2);
}
on (press) {
_root.cam.carwatch = "2";
}
on (rollOver) {
_root.pauser = false;
}
Instance of Symbol 436 MovieClip in Symbol 437 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp3);
}
on (press) {
_root.cam.carwatch = "3";
}
on (rollOver) {
_root.pauser = false;
}
Symbol 473 MovieClip Frame 1
stop();
onEnterFrame = function () {
if (_root.pauser - _root.pauser2) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 1
on (release) {
_root.pauser = true;
}
on (rollOver) {
if (!_root.pauser2) {
_root.pauser = false;
}
}
Symbol 473 MovieClip Frame 2
stop();
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
_root.qual = 0;
}
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
_root.qual = 1;
}
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
_root.qual = 2;
}
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
_root.qual = 3;
}
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
_root.pauser = false;
}
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
getURL ("http://www.rustygames.com", "_blank");
}
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
getURL ("http://www.newgrounds.com", "_blank");
}
Instance of Symbol 230 MovieClip in Symbol 473 MovieClip Frame 2
on (release) {
_root.gotoAndPlay(1);
}
Instance of Symbol 478 MovieClip in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
xf = 80 / _root.tracks._width;
yf = 80 / _root.tracks._height;
this._x = _root.car._x * xf;
this._y = _root.car._y * yf;
}
Instance of Symbol 481 MovieClip in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
xf = 80 / _root.tracks._width;
yf = 80 / _root.tracks._height;
this._x = _root.car1._x * xf;
this._y = _root.car1._y * yf;
}
Instance of Symbol 481 MovieClip in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
xf = 80 / _root.tracks._width;
yf = 80 / _root.tracks._height;
this._x = _root.car2._x * xf;
this._y = _root.car2._y * yf;
}
Instance of Symbol 481 MovieClip in Symbol 489 MovieClip Frame 1
onClipEvent (enterFrame) {
xf = 80 / _root.tracks._width;
yf = 80 / _root.tracks._height;
this._x = _root.car3._x * xf;
this._y = _root.car3._y * yf;
}
Symbol 503 MovieClip Frame 88
_root.pauser = false;
_root.pauser2 = false;
Symbol 503 MovieClip Frame 109
this.swapDepths(_root.getNextHighestDepth());
this.removeMovieClip();
Symbol 517 MovieClip Frame 1
function camControl() {
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
while (!_root.tracks.hitTest(this._x, this._y - (this._height / 2))) {
this._y++;
}
while (!_root.tracks.hitTest(this._x - (this._width / 2), this._y)) {
this._x++;
}
while (!_root.tracks.hitTest(this._x, this._y + (this._height / 2))) {
this._y--;
}
while (!_root.tracks.hitTest(this._x + (this._width / 2), this._y)) {
this._x--;
}
parentColor.setTransform(camColor.getTransform());
var _local5 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local5);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local5;
_parent._yscale = 100 * _local4;
this._yscale = (this._xscale = 150);
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Instance of Symbol 425 MovieClip in Symbol 517 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (rollOut) {
_root.pauser = true;
}
Instance of Symbol 437 MovieClip in Symbol 517 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (_root.car.finishedrace) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 107 MovieClip in Symbol 517 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (_root.car.health < 20) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 461 MovieClip in Symbol 517 MovieClip Frame 1
onClipEvent (load) {
this.dis = 100;
this._visible = false;
i = 0;
while (i < 4) {
if (i == 0) {
this.health0 = _root.car.health;
} else {
this["health" + i] = _root["car" + i].health;
}
i++;
}
}
onClipEvent (enterFrame) {
this.dis++;
if (this.dis > 100) {
this._visible = false;
} else {
this._visible = true;
}
i = 0;
while (i < 4) {
if (i == 0) {
this.health0 = _root.car.health;
} else {
this["health" + i] = _root["car" + i].health;
}
i++;
}
i = 0;
while (i < 4) {
if (i == 0) {
if (((_root.car.health < 50) && (this.oldhealth0 > 50)) || ((_root.car.health < 1) && (this.oldhealth0 > 0))) {
this._visible = true;
this.quote.text = _root.quotes1[random(_root.quotes1.length)];
this.head.gotoAndStop(_root["opp" + (random(3) + 1)]);
this.dis = 0;
}
} else if (((_root["car" + i].health < 50) && (this["oldhealth" + i] > 50)) || ((_root["car" + i].health < 1) && (this["oldhealth" + i] > 0))) {
this._visible = true;
this.quote.text = _root.quotes2[random(_root.quotes1.length)];
this.head.gotoAndStop(_root["opp" + i]);
this.dis = 0;
}
i++;
}
i = 0;
while (i < 4) {
if (i == 0) {
this.oldhealth0 = _root.car.health;
} else {
this["oldhealth" + i] = _root["car" + i].health;
}
i++;
}
}
Instance of Symbol 489 MovieClip in Symbol 517 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.trackf);
}
Instance of Symbol 510 MovieClip "needle" in Symbol 517 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 3 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 510 MovieClip "needle" in Symbol 517 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 4 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 513 MovieClip "needle" in Symbol 517 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = _root.car.health;
if (this._rotation > 90) {
this._rotation = 90;
}
}
Instance of Symbol 527 MovieClip in Symbol 528 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Instance of Symbol 527 MovieClip in Symbol 528 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Instance of Symbol 527 MovieClip in Symbol 528 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Instance of Symbol 527 MovieClip in Symbol 528 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Instance of Symbol 527 MovieClip in Symbol 528 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Instance of Symbol 150 MovieClip in Symbol 538 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Instance of Symbol 150 MovieClip in Symbol 538 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Instance of Symbol 527 MovieClip in Symbol 557 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Instance of Symbol 527 MovieClip in Symbol 557 MovieClip Frame 1
onClipEvent (enterFrame) {
if (!_root.pauser) {
for (car in _root) {
if (car.slice(0, 3) == "car") {
if (this.hitTest(_root[car]._x, _root.car._y, 1)) {
_root[car].speed = _root[car].speed + 10;
}
}
}
}
}
Symbol 598 Button
on (release) {
_root.play();
}
Symbol 607 Button
on (release) {
if (_root.gameover == 1) {
_root.gotoAndStop("gameOver");
} else {
_root.gotoAndStop("ss" + _root.currentgptrack);
}
}
Symbol 694 Button
on (release) {
if (_root.strop < (_root.difficulty + 1)) {
_root.strop = _root.difficulty + 1;
}
_root.gotoAndStop("credits");
}
Instance of Symbol 706 MovieClip in Symbol 707 MovieClip Frame 1
on (press) {
if (_root.currentgptrack == 9) {
_root.GotoAndStop("gpEnd");
} else {
_root.GotoAndStop(12 + _root.currentgptrack);
}
}
Symbol 735 MovieClip Frame 20
stop();
Instance of Symbol 734 MovieClip in Symbol 735 MovieClip Frame 20
on (press) {
_root.submit();
}
Symbol 747 MovieClip Frame 1
function camControl() {
switch (_root.car.nodenum) {
case 1 :
this.tutorial.text = "Hold the 'W' or 'Up Arrow' key to accelerate. Note your speed has been decreased for practice.";
break;
case 2 :
this.tutorial.text = "To rotate in order to go around corners press 'A' or 'S'. Alternatively use the arrow keys.";
break;
case 3 :
this.tutorial.text = "Grab a box to collect a powerup. The ammo and name of the weapon are displayed in bottom right corner of the HUD.";
break;
case 4 :
this.tutorial.text = "Try another corner.";
break;
case 5 :
this.tutorial.text = "Your speed has now been increased to the games standard. Try this peice of track with the real speed.";
_root.car.max_speed = 70;
break;
case 6 :
this.tutorial.text = "Your speed has now been increased to the games standard. Try this peice of track with the real speed.";
_root.car.max_speed = 70;
break;
case 7 :
this.tutorial.text = "Use your weapon to shoot the target!";
if (!_root.targetalive) {
_root.car.max_speed = 0;
_root.car.ammo = 100;
_root.car.weapon = 2;
} else {
_root.car.max_speed = 70;
}
break;
case 8 :
this.tutorial.text = "Your health has reached 0! Tap space bar in order to replenish health!";
if (_root.car.health > 99) {
_root.car.health = 0;
}
break;
case 9 :
this.tutorial.text = "Well done. You now know how to play the game. Please enjoy!";
break;
case 10 :
this.tutorial.text = "Well done. You now know how to play the game. Please enjoy!";
break;
default :
this.tutorial.text = "Hold the 'W' or 'Up Arrow' key to accelerate. Note your speed has been decreased for practice.";
}
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
while (!_root.tracks.hitTest(this._x, this._y - (this._height / 2))) {
this._y++;
}
while (!_root.tracks.hitTest(this._x - (this._width / 2), this._y)) {
this._x++;
}
while (!_root.tracks.hitTest(this._x, this._y + (this._height / 2))) {
this._y--;
}
while (!_root.tracks.hitTest(this._x + (this._width / 2), this._y)) {
this._x--;
}
parentColor.setTransform(camColor.getTransform());
var _local5 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local5);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local5;
_parent._yscale = 100 * _local4;
this._yscale = (this._xscale = 150);
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Instance of Symbol 425 MovieClip in Symbol 747 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (rollOut) {
_root.pauser = true;
}
Instance of Symbol 489 MovieClip in Symbol 747 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.trackf);
}
Instance of Symbol 510 MovieClip "needle" in Symbol 747 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 3 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 510 MovieClip "needle" in Symbol 747 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 4 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 513 MovieClip "needle" in Symbol 747 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = _root.car.health;
if (this._rotation > 90) {
this._rotation = 90;
}
}
Instance of Symbol 437 MovieClip in Symbol 747 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (_root.car.finishedrace) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 107 MovieClip in Symbol 747 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (_root.car.health < 20) {
this._visible = true;
} else {
this._visible = false;
}
}
Instance of Symbol 570 MovieClip in Symbol 780 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp0);
}
Instance of Symbol 570 MovieClip in Symbol 780 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp1);
}
Instance of Symbol 570 MovieClip in Symbol 780 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(_root.opp2);
}
Symbol 782 Button
on (release) {
if (_root.gptrop < (_root.difficulty + 1)) {
_root.gptrop = _root.difficulty + 1;
}
_root.gotoAndStop("credits");
}
Symbol 792 MovieClip Frame 1
function camControl() {
this.cctext.htmlText = (_root.boxes + "/27 boxes collected<br>Time:") + _root.chaltime;
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
while (!_root.tracks.hitTest(this._x, this._y - (this._height / 2))) {
this._y++;
}
while (!_root.tracks.hitTest(this._x - (this._width / 2), this._y)) {
this._x++;
}
while (!_root.tracks.hitTest(this._x, this._y + (this._height / 2))) {
this._y--;
}
while (!_root.tracks.hitTest(this._x + (this._width / 2), this._y)) {
this._x--;
}
parentColor.setTransform(camColor.getTransform());
var _local5 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local5);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local5;
_parent._yscale = 100 * _local4;
this._yscale = (this._xscale = 150);
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Instance of Symbol 425 MovieClip in Symbol 792 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (rollOut) {
_root.pauser = true;
}
Instance of Symbol 489 MovieClip in Symbol 792 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.trackf);
}
Instance of Symbol 510 MovieClip "needle" in Symbol 792 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 3 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 510 MovieClip "needle" in Symbol 792 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 4 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 513 MovieClip "needle" in Symbol 792 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = _root.car.health;
if (this._rotation > 90) {
this._rotation = 90;
}
}
Instance of Symbol 107 MovieClip in Symbol 792 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (_root.car.health < 20) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 801 MovieClip Frame 1
function camControl() {
this.cctext.htmlText = (_root.boxes + "/29 barrels destroyed<br>Time:") + _root.chaltime;
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
while (!_root.tracks.hitTest(this._x, this._y - (this._height / 2))) {
this._y++;
}
while (!_root.tracks.hitTest(this._x - (this._width / 2), this._y)) {
this._x++;
}
while (!_root.tracks.hitTest(this._x, this._y + (this._height / 2))) {
this._y--;
}
while (!_root.tracks.hitTest(this._x + (this._width / 2), this._y)) {
this._x--;
}
parentColor.setTransform(camColor.getTransform());
var _local5 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local5);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local5;
_parent._yscale = 100 * _local4;
this._yscale = (this._xscale = 150);
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Instance of Symbol 425 MovieClip in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (rollOut) {
_root.pauser = true;
}
Instance of Symbol 489 MovieClip in Symbol 801 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.trackf);
}
Instance of Symbol 510 MovieClip "needle" in Symbol 801 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 3 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 510 MovieClip "needle" in Symbol 801 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 4 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 513 MovieClip "needle" in Symbol 801 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = _root.car.health;
if (this._rotation > 90) {
this._rotation = 90;
}
}
Instance of Symbol 107 MovieClip in Symbol 801 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (_root.car.health < 20) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 810 MovieClip Frame 1
function camControl() {
this.cctext.htmlText = "Time:" + _root.chaltime;
this._x = _root["car" + this.carwatch]._x;
this._y = _root["car" + this.carwatch]._y;
while (!_root.tracks.hitTest(this._x, this._y - (this._height / 2))) {
this._y++;
}
while (!_root.tracks.hitTest(this._x - (this._width / 2), this._y)) {
this._x++;
}
while (!_root.tracks.hitTest(this._x, this._y + (this._height / 2))) {
this._y--;
}
while (!_root.tracks.hitTest(this._x + (this._width / 2), this._y)) {
this._x--;
}
parentColor.setTransform(camColor.getTransform());
var _local5 = sX / this._width;
var _local4 = sY / this._height;
_parent._x = cX - (this._x * _local5);
_parent._y = cY - (this._y * _local4);
_parent._xscale = 100 * _local5;
_parent._yscale = 100 * _local4;
this._yscale = (this._xscale = 150);
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Instance of Symbol 425 MovieClip in Symbol 810 MovieClip Frame 1
onClipEvent (load) {
this.useHandCursor = false;
}
on (rollOut) {
_root.pauser = true;
}
Instance of Symbol 489 MovieClip in Symbol 810 MovieClip Frame 1
onClipEvent (enterFrame) {
this.gotoAndStop(this._parent.trackf);
}
Instance of Symbol 510 MovieClip "needle" in Symbol 810 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 3 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 510 MovieClip "needle" in Symbol 810 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = 4 * _root.car.speed;
if (_root.car.speed < 0) {
this._rotation = 0;
}
if (this._rotation > 180) {
this._rotation = 180;
}
if (this._rotation < -180) {
this._rotation = -180;
}
}
Instance of Symbol 513 MovieClip "needle" in Symbol 810 MovieClip Frame 1
onClipEvent (enterFrame) {
this._rotation = _root.car.health;
if (this._rotation > 90) {
this._rotation = 90;
}
}
Instance of Symbol 107 MovieClip in Symbol 810 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
onClipEvent (enterFrame) {
if (_root.car.health < 20) {
this._visible = true;
} else {
this._visible = false;
}
}
Symbol 817 Button
on (press) {
_root.gotoAndPlay(1);
}
Symbol 818 MovieClip Frame 25
stop();
Symbol 855 MovieClip Frame 1
stop();
Symbol 857 Button
on (release) {
_root.gotoAndPlay(1);
}
Symbol 858 Button
on (press) {
if (tracks._currentframe == 8) {
tracks.gotoAndStop(1);
} else {
tracks.nextFrame();
}
box1.cc1.text = aa1[tracks._currentframe - 1];
box1.cc2.text = aa2[tracks._currentframe - 1];
box1.cc3.text = aa3[tracks._currentframe - 1];
box1.cc4.text = aa4[tracks._currentframe - 1];
}
Symbol 859 Button
on (press) {
if (tracks._currentframe == 1) {
tracks.gotoAndStop(8);
} else {
tracks.prevFrame();
}
box1.cc1.text = aa1[tracks._currentframe - 1];
box1.cc2.text = aa2[tracks._currentframe - 1];
box1.cc3.text = aa3[tracks._currentframe - 1];
box1.cc4.text = aa4[tracks._currentframe - 1];
}
Instance of Symbol 870 MovieClip in Symbol 871 MovieClip Frame 1
on (press) {
this._parent.startDrag();
}
onClipEvent (mouseUp) {
this._parent.stopDrag();
}
Instance of Symbol 870 MovieClip in Symbol 879 MovieClip Frame 1
on (press) {
this._parent.startDrag();
}
onClipEvent (mouseUp) {
this._parent.stopDrag();
}
Instance of Symbol 875 MovieClip in Symbol 879 MovieClip Frame 1
onClipEvent (load) {
var clicking = false;
}
on (press) {
this.clicking = true;
}
onClipEvent (mouseUp) {
this.clicking = false;
}
onClipEvent (enterFrame) {
if (this.clicking) {
if (this._parent._parent.tracks._xscale < 201) {
this._parent._parent.tracks._xscale = (this._parent._parent.tracks._yscale = this._parent._parent.tracks._yscale + 10);
}
}
}
Instance of Symbol 877 MovieClip in Symbol 879 MovieClip Frame 1
onClipEvent (load) {
var clicking = false;
}
on (press) {
this.clicking = true;
}
onClipEvent (mouseUp) {
this.clicking = false;
}
onClipEvent (enterFrame) {
if (this.clicking) {
if (this._parent._parent.tracks._xscale > 101) {
this._parent._parent.tracks._xscale = (this._parent._parent.tracks._yscale = this._parent._parent.tracks._yscale - 10);
}
}
}
Symbol 880 MovieClip Frame 1
var aa1 = ["J-Zinger", "Dashing Dan", "The Real McCoy", "Krazy Kenny", "Woody", "Mad Dog Murphy", "Terrible Timmy", "Krazy Kenny"];
var aa2 = ["None", "None", "None", "Speed boosters", "Teleporters", "Missile towers", "None", "Missile towers"];
var aa3 = ["", "", "", "", "Speed boosters", "", "", "Speed boosters"];
var aa4 = ["J-zinger uses this course for practice. It is easy and should give you a good test drive", "Dan's faveroute track. This championship track can be tricky to navigate but is generaly easy", "The desert is where The Real McCoy likes to hang out. The narrow space is good for getting ahead of the other racers", "This track, constructed by Krazy Kenny, is extremely fast and furious!", "Woody and Kenny built this track together and features some 'Krazy' teleporters", "Area 51 is supposed to be off-limits however nothing is off-limits to Mad Dog Murphy!", "Terrible Timmy enjoys racing through the streets and leaving his mark", "The ultimate track with obsticles around every corner. Not for the faint hearted!"];
box1.cc1.text = aa1[tracks._currentframe - 1];
box1.cc2.text = aa2[tracks._currentframe - 1];
box1.cc3.text = aa3[tracks._currentframe - 1];
box1.cc4.text = aa4[tracks._currentframe - 1];
Instance of Symbol 855 MovieClip "tracks" in Symbol 880 MovieClip Frame 1
onClipEvent (load) {
var dragging = false;
this.useHandCursor = false;
}
on (press) {
this.dragging = true;
}
onClipEvent (mouseUp) {
this.dragging = false;
}
onClipEvent (mouseMove) {
if (this.dragging) {
this._x = this._x - (this.oldx - this._xmouse);
this._y = this._y - (this.oldy - this._ymouse);
}
this.oldx = this._xmouse;
this.oldy = this._ymouse;
}
Symbol 882 Button
on (release) {
_root.gotoAndStop("map" + _root.thingy.tracks._currentframe);
}
Symbol 884 MovieClip Frame 1
var aa1 = ["J-Zinger", "Dashing Dan", "The Real McCoy", "Krazy Kenny", "Woody", "Mad Dog Murphy", "Terrible Timmy", "Krazy Kenny"];
var aa2 = ["None", "None", "None", "Speed boosters", "Teleporters", "Missile towers", "None", "Missile towers"];
var aa3 = ["", "", "", "", "Speed boosters", "", "", "Speed boosters"];
var aa4 = ["J-zinger uses this course for practice. It is easy and should give you a good test drive", "Dan's faveroute track. This championship track can be tricky to navigate but is generaly easy", "The desert is where The Real McCoy likes to hang out. The narrow space is good for getting ahead of the other racers", "This track, constructed by Krazy Kenny, is extremely fast and furious!", "Woody and Kenny built this track together and features some 'Krazy' teleporters", "Area 51 is supposed to be off-limits however nothing is off-limits to Mad Dog Murphy!", "Terrible Timmy enjoys racing through the streets and leaving his mark", "The ultimate track with obsticles around every corner. Not for the faint hearted!"];
box1.cc1.text = aa1[tracks._currentframe - 1];
box1.cc2.text = aa2[tracks._currentframe - 1];
box1.cc3.text = aa3[tracks._currentframe - 1];
box1.cc4.text = aa4[tracks._currentframe - 1];
Instance of Symbol 855 MovieClip "tracks" in Symbol 884 MovieClip Frame 1
onClipEvent (load) {
var dragging = false;
this.useHandCursor = false;
}
on (press) {
this.dragging = true;
}
onClipEvent (mouseUp) {
this.dragging = false;
}
onClipEvent (mouseMove) {
if (this.dragging) {
this._x = this._x - (this.oldx - this._xmouse);
this._y = this._y - (this.oldy - this._ymouse);
}
this.oldx = this._xmouse;
this.oldy = this._ymouse;
}
Symbol 885 Button
on (release) {
_root.gotoAndStop("ttmap" + _root.thingy.tracks._currentframe);
}
Symbol 899 Button
on (release) {
_root.gotoAndStop("challenge" + (this._currentframe - 1));
}
Symbol 916 MovieClip Frame 1
stop();
Symbol 922 Button
on (release) {
_root.gotoAndStop(1);
}
Symbol 933 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 940 MovieClip Frame 81
_root.play();
_root.play();