Frame 1
_global.mc = {};
_global.mc.kvFoot = 820;
_global.mc.mute = 1284;
_global.mc.unmute = 1285;
_global.mc.fin1 = 1286;
_global.mc.fin2 = 1287;
_global.mc.fin3 = 1288;
_global.mc.fin4 = 1289;
_global.mc.fin5 = 1290;
_global.mc.fin6 = 1291;
_global.mc.fin7 = 1292;
_global.mc.pos1 = 1293;
_global.mc.pos2 = 1294;
_global.mc.pos3 = 1295;
_global.mc.pos4 = 1296;
_global.mc.pos5 = 1297;
_global.mc.pos6 = 1298;
_global.mc.tMobileShown = 1299;
_global.mc.tMobileFirstYes = 1300;
_global.mc.tMobileSecondYes = 1301;
_global.mc.tMobileNo = 1302;
_global.mc.team1 = 1303;
_global.mc.team2 = 1304;
_global.mc.team3 = 1305;
_global.mc.team4 = 1306;
_global.mc.team5 = 1307;
_global.mc.team6 = 1308;
_global.mc.abandonSeason = 1309;
_global.root = this;
kv_v = {c:474, a:0, da:["distralytics.com", "distralytics.co.uk"]};
kv_v.i = 0;
while (kv_v.i < kv_v.da.length) {
System.security.allowDomain(kv_v.da[kv_v.i], (kv_v.c + ".c.") + kv_v.da[kv_v.i], "*." + kv_v.da[kv_v.i]);
kv_v.i++;
}
kv_v.lc = function () {
var _local1 = ((("http://" + kv_v.c) + ".c.") + kv_v.da[kv_v.a % kv_v.da.length]) + kv_v.lurl;
System.security.allowDomain(_local1);
kv_v.l_mcl.loadClip(_local1, kv_v.t_mc);
};
kv_v.d = (_root.ori_dom ? (_root.ori_dom) : (((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]))));
kv_v.fpv = getVersion().split(" ")[1].split(",")[0];
kv_v.lurl = "/control/tracking/tracker.swf?r=" + Math.floor(Math.random() * 10000);
kv_v.t_mc = createEmptyMovieClip("kv_tracker", -16734);
kv_v.l_mcl = new MovieClipLoader();
kv_v.mcl_l = {onLoadError:function () {
kv_v.a++;
kv_v.lc();
}, onLoadStart:function (m) {
System.security.allowDomain(m._url);
}};
kv_v.l_mcl.addListener(kv_v.mcl_l);
kv_v.lc();
_global.masterDomain = "swarm.killerviral.com";
_global.assetsURL = "http://games.killerviral.com/tzero/";
_global.isMaster = _root._url.indexOf(_global.masterDomain) >= 0;
_global.domain = ((_root._url.split("/")[0].indexOf("http") == -1) ? "Local" : (_root._url.split("/")[2].split("?")[0]));
_global.playerVersion = Number(getVersion().substr(getVersion().indexOf(" ") + 1).split(",")[0]);
_global.movieVersion = (_root.getSWFVersion ? (_root.getSWFVersion()) : 8);
_global.ori_dom = (_root.ori_dom ? (_root.ori_dom) : (domain));
System.security.allowDomain(_global.masterDomain);
var game_version = 1;
if (!testMode) {
stop();
if (playerVersion < 8) {
loadMovie (_global.assetsURL + "error.swf", _root);
} else if (isMaster) {
play();
} else {
var vc_lv = new LoadVars();
vc_lv.onLoad = function (success) {
clearInterval(tOIntId);
delete tOIntId;
if (success) {
if (Number(vc_lv.v) > game_version) {
loadMovie ((_global.assetsURL + "game.swf?ori_dom=") + ori_dom, _root);
} else {
play();
}
if (vc_lv.a == 1) {
_global.tMobileBranding = true;
var _local4 = "http://ad.uk.doubleclick.net/ad/N1238.Kempt/B3239417;sz=1x1;ord=[timestamp]?";
var _local3 = new LoadVars();
_local3.load(_local4);
var _local6 = "http://ad.uk.doubleclick.net/jump/N1238.Kempt/B3239417;sz=1x1;ord=[timestamp]?";
var _local5 = new LoadVars();
_local5.load(_local6);
} else {
_global.tMobileBranding = false;
}
} else {
play();
}
delete vc_lv;
};
tOIntId = setInterval(timeout, 2000);
vc_lv.load("http://www.memecounter.com/comms/v.php?v=1&cId=474");
}
}
killerviral_btn.onMouseDown = function () {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
_root.kvClick(_global.mc.kvFoot);
}
};
Frame 3
function goToGame() {
_global.root.gotoAndPlay("game");
}
function goToPostRace() {
_global.root.gotoAndStop("menu");
game_transition.gotoAndPlay("out");
game_transition.onSlideOut = showPostRace;
}
function showPostRace() {
menu_anim.gotoAndPlay("in");
menu_anim.menu_mc.gotoAndStop("race results");
}
if (!snd_man) {
_global.snd_man = new SoundManager(this);
_global.music = snd_man.newSound("music");
music.setVolume(0);
music.start(0, 999999999);
music.fadeTo(30, 8);
}
trackNum = 0;
tracks = [];
trackLaps = 5;
trackStr = ("<track laps=\"" + trackLaps) + "\" scale=\"25\"><startPosition><start x=\"136.15\" y=\"243.7\" a=\"-1.55079899282175\" /><start x=\"60.5\" y=\"243.7\" a=\"-1.5744064194149\" /><start x=\"137.85\" y=\"290.8\" a=\"-1.49629333304434\" /><start x=\"99.15\" y=\"285.75\" a=\"-1.54050256687612\" /><start x=\"99.15\" y=\"242.05\" a=\"-1.5707963267949\" /><start x=\"60.5\" y=\"289.1\" a=\"-1.55227992472689\" /></startPosition><trackSections laps=\"3\"><ts ex=\"104\" ey=\"23\" et=\"130.670858728079\" cx=\"100.85\" cy=\"82.35\" mt=\"135.577146912822\" /><ts ex=\"197.6\" ey=\"-94\" et=\"130.951699343599\" cx=\"102.55\" cy=\"-82.35\" mt=\"182.334602444731\" /><ts ex=\"298.8\" ey=\"-96.4\" et=\"138.436112776613\" cx=\"241\" cy=\"-101.2\" mt=\"137.250784900621\" /><ts ex=\"409.1\" ey=\"9.1\" et=\"125.98687860557\" cx=\"381.85\" cy=\"-92.75\" mt=\"170.084611533956\" /><ts ex=\"316.4\" ey=\"149.1\" et=\"127.785411519642\" cx=\"425.45\" cy=\"90.9\" mt=\"172.308053793452\" /><ts ex=\"247.3\" ey=\"267.3\" et=\"117.440947151131\" cx=\"247.3\" cy=\"200\" mt=\"145.436463190125\" /><ts ex=\"254.55\" ey=\"425.45\" et=\"124.063012318799\" cx=\"243.65\" cy=\"341.85\" mt=\"116.40191140332\" /><ts ex=\"289.1\" ey=\"512.75\" et=\"136.17933021382\" cx=\"260\" cy=\"472.75\" mt=\"123.331309437773\" /><ts ex=\"350.95\" ey=\"616.4\" et=\"125.466686555924\" cx=\"358.2\" cy=\"549.1\" mt=\"133.936981493254\" /><ts ex=\"220\" ey=\"723.65\" et=\"129.452284052123\" cx=\"350.95\" cy=\"732.75\" mt=\"209.429302382358\" /><ts ex=\"107.3\" ey=\"590.95\" et=\"127.209935331557\" cx=\"105.45\" cy=\"694.55\" mt=\"164.618428962624\" /><ts ex=\"99.15\" ey=\"421.85\" et=\"129.301952558901\" cx=\"101.85\" cy=\"507.3\" mt=\"126.338528751555\" /><ts ex=\"100\" ey=\"200\" et=\"134.62698120633\" cx=\"99.15\" cy=\"309.25\" mt=\"134.491836737263\" /><ts ex=\"100.85\" ey=\"119.35\" et=\"131.301996760455\" cx=\"100.85\" cy=\"166.4\" mt=\"131.096457838235\" /></trackSections><airoutes><airoute><r cx=\"132.75\" cy=\"-210.95\" ex=\"394.55\" ey=\"-12.7\" /><r cx=\"447.3\" cy=\"78.2\" ex=\"321.85\" ey=\"152.75\" /><r cx=\"185.45\" cy=\"285.45\" ex=\"307.3\" ey=\"498.2\" /><r cx=\"409.1\" cy=\"607.3\" ex=\"354.55\" ey=\"683.65\" /><r cx=\"314.55\" cy=\"765.45\" ex=\"198.2\" ey=\"721.85\" /><r cx=\"52.75\" cy=\"670.95\" ex=\"100\" ey=\"100\" /></airoute><airoute><r cx=\"132.75\" cy=\"-210.95\" ex=\"394.55\" ey=\"-12.7\" /><r cx=\"447.3\" cy=\"78.2\" ex=\"321.85\" ey=\"152.75\" /><r cx=\"185.45\" cy=\"285.45\" ex=\"307.3\" ey=\"498.2\" /><r cx=\"409.1\" cy=\"607.3\" ex=\"354.55\" ey=\"683.65\" /><r cx=\"314.55\" cy=\"765.45\" ex=\"198.2\" ey=\"721.85\" /><r cx=\"52.75\" cy=\"670.95\" ex=\"100\" ey=\"100\" /></airoute><airoute><r cx=\"132.75\" cy=\"-210.95\" ex=\"394.55\" ey=\"-12.7\" /><r cx=\"447.3\" cy=\"78.2\" ex=\"321.85\" ey=\"152.75\" /><r cx=\"185.45\" cy=\"285.45\" ex=\"307.3\" ey=\"498.2\" /><r cx=\"409.1\" cy=\"607.3\" ex=\"354.55\" ey=\"683.65\" /><r cx=\"314.55\" cy=\"765.45\" ex=\"198.2\" ey=\"721.85\" /><r cx=\"52.75\" cy=\"670.95\" ex=\"100\" ey=\"100\" /></airoute><airoute><r cx=\"132.75\" cy=\"-210.95\" ex=\"394.55\" ey=\"-12.7\" /><r cx=\"447.3\" cy=\"78.2\" ex=\"321.85\" ey=\"152.75\" /><r cx=\"185.45\" cy=\"285.45\" ex=\"307.3\" ey=\"498.2\" /><r cx=\"409.1\" cy=\"607.3\" ex=\"354.55\" ey=\"683.65\" /><r cx=\"314.55\" cy=\"765.45\" ex=\"198.2\" ey=\"721.85\" /><r cx=\"52.75\" cy=\"670.95\" ex=\"100\" ey=\"100\" /></airoute><airoute><r cx=\"132.75\" cy=\"-210.95\" ex=\"394.55\" ey=\"-12.7\" /><r cx=\"447.3\" cy=\"78.2\" ex=\"321.85\" ey=\"152.75\" /><r cx=\"185.45\" cy=\"285.45\" ex=\"307.3\" ey=\"498.2\" /><r cx=\"409.1\" cy=\"607.3\" ex=\"354.55\" ey=\"683.65\" /><r cx=\"314.55\" cy=\"765.45\" ex=\"198.2\" ey=\"721.85\" /><r cx=\"52.75\" cy=\"670.95\" ex=\"100\" ey=\"100\" /></airoute></airoutes><scenery><si l=\"meteor_medium\" x=\"240\" y=\"40\" z=\"0\" r=\"0\" rs=\"0\" /><si l=\"bobaPink\" x=\"421.8\" y=\"291.1\" z=\"21\" r=\"0\" rs=\"0\" /><si l=\"meteor_large\" x=\"-24.6\" y=\"135.35\" z=\"0\" r=\"0\" rs=\"0\" /><si l=\"meteor_large\" x=\"-26.3\" y=\"579\" z=\"0\" r=\"0\" rs=\"0\" /></scenery><items></items></track>";
tracks.push({name:"TEE CUP", desc:"The first race of the season, and TEE MOBIL's home track! Go get 'em!", trackStr:trackStr, laps:trackLaps, team:0});
trackStr = ("<track laps=\"" + trackLaps) + "\" scale=\"25\"><startPosition><start x=\"134.65\" y=\"168.35\" a=\"-1.55079899282175\" /><start x=\"59.4\" y=\"168.35\" a=\"-1.5744064194149\" /><start x=\"134.65\" y=\"221.8\" a=\"-1.49629333304434\" /><start x=\"99\" y=\"217.85\" a=\"-1.54050256687612\" /><start x=\"99\" y=\"168.35\" a=\"-1.63226892900208\" /><start x=\"57.4\" y=\"217.85\" a=\"-1.56046374388914\" /></startPosition><trackSections laps=\"3\"><ts ex=\"114.55\" ey=\"-230.9\" et=\"130.670858728079\" cx=\"100.85\" cy=\"82.35\" mt=\"135.577146912822\" /><ts ex=\"207.3\" ey=\"-338.2\" et=\"131.875841228163\" cx=\"112.75\" cy=\"-332.7\" mt=\"182.334602444731\" /><ts ex=\"307.3\" ey=\"-216.35\" et=\"128.830304813229\" cx=\"310.95\" cy=\"-321.8\" mt=\"182.986971745067\" /><ts ex=\"389.1\" ey=\"-132.7\" et=\"124.469608575627\" cx=\"312.75\" cy=\"-140\" mt=\"154.26806351147\" /><ts ex=\"521.85\" ey=\"-18.15\" et=\"131.227616792368\" cx=\"490.95\" cy=\"-118.15\" mt=\"163.642382135358\" /><ts ex=\"567.3\" ey=\"196.4\" et=\"124.27462119811\" cx=\"547.3\" cy=\"81.85\" mt=\"127.751118995239\" /><ts ex=\"447.3\" ey=\"272.75\" et=\"126.030016358876\" cx=\"574.55\" cy=\"343.65\" mt=\"233.270297908418\" /><ts ex=\"401.85\" ey=\"183.65\" et=\"126.907713939259\" cx=\"414.55\" cy=\"238.2\" mt=\"126.468865149067\" /><ts ex=\"334.55\" ey=\"100\" et=\"127.346562729451\" cx=\"389.1\" cy=\"114.55\" mt=\"144.226238814025\" /><ts ex=\"254.55\" ey=\"198.2\" et=\"116.251161772318\" cx=\"238.2\" cy=\"100\" mt=\"185.387379629196\" /><ts ex=\"294.15\" ey=\"430.25\" et=\"127.785411519642\" cx=\"294.15\" cy=\"426.4171875\" mt=\"127.675699322094\" /><ts ex=\"194.55\" ey=\"540\" et=\"127.209935331557\" cx=\"294.15\" cy=\"536.15\" mt=\"163.087514860609\" /><ts ex=\"99.15\" ey=\"421.85\" et=\"129.301952558901\" cx=\"99.15\" cy=\"539.5\" mt=\"164.6\" /><ts ex=\"100\" ey=\"200\" et=\"132.825078723219\" cx=\"99.15\" cy=\"309.25\" mt=\"134.491836737263\" /><ts ex=\"100.85\" ey=\"119.35\" et=\"131.301996760455\" cx=\"100.85\" cy=\"166.4\" mt=\"131.096457838235\" /></trackSections><airoutes><airoute><r cx=\"115.25\" cy=\"-356.5\" ex=\"204.35\" ey=\"-350\" /><r cx=\"369.45\" cy=\"-190.45\" ex=\"397.85\" ey=\"-128.25\" /><r cx=\"554.55\" cy=\"110.925\" ex=\"565.25\" ey=\"243.5\" /><r cx=\"516.4\" cy=\"360\" ex=\"434.55\" ey=\"230.9\" /><r cx=\"363.65\" cy=\"103.65\" ex=\"305.45\" ey=\"112.75\" /><r cx=\"212.75\" cy=\"132.75\" ex=\"291.1\" ey=\"405.95\" /><r cx=\"217.8\" cy=\"617.85\" ex=\"168.3\" ey=\"560.4\" /><r cx=\"23.75\" cy=\"552.5\" ex=\"106.9\" ey=\"-136.6\" /></airoute><airoute><r cx=\"115.25\" cy=\"-356.5\" ex=\"204.35\" ey=\"-350\" /><r cx=\"369.45\" cy=\"-190.45\" ex=\"397.85\" ey=\"-128.25\" /><r cx=\"554.55\" cy=\"110.925\" ex=\"565.25\" ey=\"243.5\" /><r cx=\"516.4\" cy=\"360\" ex=\"434.55\" ey=\"230.9\" /><r cx=\"363.65\" cy=\"103.65\" ex=\"305.45\" ey=\"112.75\" /><r cx=\"212.75\" cy=\"132.75\" ex=\"291.1\" ey=\"405.95\" /><r cx=\"217.8\" cy=\"617.85\" ex=\"168.3\" ey=\"560.4\" /><r cx=\"23.75\" cy=\"552.5\" ex=\"106.9\" ey=\"-136.6\" /></airoute><airoute><r cx=\"115.25\" cy=\"-356.5\" ex=\"204.35\" ey=\"-350\" /><r cx=\"369.45\" cy=\"-190.45\" ex=\"397.85\" ey=\"-128.25\" /><r cx=\"554.55\" cy=\"110.925\" ex=\"565.25\" ey=\"243.5\" /><r cx=\"516.4\" cy=\"360\" ex=\"434.55\" ey=\"230.9\" /><r cx=\"363.65\" cy=\"103.65\" ex=\"305.45\" ey=\"112.75\" /><r cx=\"212.75\" cy=\"132.75\" ex=\"291.1\" ey=\"405.95\" /><r cx=\"217.8\" cy=\"617.85\" ex=\"168.3\" ey=\"560.4\" /><r cx=\"23.75\" cy=\"552.5\" ex=\"106.9\" ey=\"-136.6\" /></airoute><airoute><r cx=\"115.25\" cy=\"-356.5\" ex=\"204.35\" ey=\"-350\" /><r cx=\"369.45\" cy=\"-190.45\" ex=\"397.85\" ey=\"-128.25\" /><r cx=\"539.15\" cy=\"63.05\" ex=\"565.25\" ey=\"243.5\" /><r cx=\"516.4\" cy=\"360\" ex=\"434.55\" ey=\"230.9\" /><r cx=\"363.65\" cy=\"103.65\" ex=\"305.45\" ey=\"112.75\" /><r cx=\"212.75\" cy=\"132.75\" ex=\"289.15\" ey=\"360.85\" /><r cx=\"269.6\" cy=\"602.15\" ex=\"147.85\" ey=\"550\" /><r cx=\"23.75\" cy=\"552.5\" ex=\"106.9\" ey=\"-136.6\" /></airoute><airoute><r cx=\"115.25\" cy=\"-356.5\" ex=\"191.3\" ey=\"-330.45\" /><r cx=\"280.45\" cy=\"-258.7\" ex=\"421.75\" ey=\"-106.55\" /><r cx=\"528.3\" cy=\"15.2\" ex=\"547.85\" ey=\"217.4\" /><r cx=\"508.7\" cy=\"323.9\" ex=\"423.95\" ey=\"252.15\" /><r cx=\"363.65\" cy=\"103.65\" ex=\"305.45\" ey=\"112.75\" /><r cx=\"212.75\" cy=\"132.75\" ex=\"265.25\" ey=\"397.8\" /><r cx=\"297.85\" cy=\"550\" ex=\"169.55\" ey=\"530.45\" /><r cx=\"23.75\" cy=\"552.5\" ex=\"106.9\" ey=\"-136.6\" /></airoute></airoutes><scenery><si l=\"millenium\" x=\"-32.6\" y=\"-45.65\" z=\"10\" r=\"0\" rs=\"0\" /></scenery><items><si l=\"shuntboost\" x=\"547.85\" y=\"71.7\" r=\"15\" p=\"10\" /><si l=\"shuntboost\" x=\"286.95\" y=\"495.65\" r=\"15\" p=\"0\" /><si l=\"shuntboost\" x=\"113.05\" y=\"-304.35\" r=\"15\" p=\"0\" /></items></track>";
tracks.push({name:"NO 2 ARENA", desc:"Shield boosters aplenty on this circuit, so be prepared to get your fenders dirty!", trackStr:trackStr, laps:trackLaps, team:1});
trackLaps = 9;
trackStr = ("<track laps=\"" + trackLaps) + "\" scale=\"25\"><startPosition><start x=\"141.85\" y=\"241.85\" a=\"-1.55079899282175\" /><start x=\"105.45\" y=\"196.35\" a=\"-1.63592149012928\" /><start x=\"103.65\" y=\"240\" a=\"-1.5707963267949\" /><start x=\"65.45\" y=\"240\" a=\"-1.5707963267949\" /><start x=\"141.85\" y=\"196.35\" a=\"-1.5707963267949\" /><start x=\"67.3\" y=\"194.55\" a=\"-1.55227992472689\" /></startPosition><trackSections laps=\"3\"><ts ex=\"104\" ey=\"23\" et=\"130.670858728079\" cx=\"101\" cy=\"97\" mt=\"135.577146912822\" /><ts ex=\"200\" ey=\"-84\" et=\"104.735188470418\" cx=\"102.55\" cy=\"-82.35\" mt=\"182.334602444731\" /><ts ex=\"297.5\" ey=\"30.25\" et=\"128.830304813229\" cx=\"304.2\" cy=\"-82.35\" mt=\"182.986971745067\" /><ts ex=\"295.8\" ey=\"200\" et=\"131.227616792368\" cx=\"295.8\" cy=\"110.95\" mt=\"124.469608575627\" /><ts ex=\"294.15\" ey=\"430.25\" et=\"127.785411519642\" cx=\"294.15\" cy=\"307.6\" mt=\"124.27462119811\" /><ts ex=\"201.7\" ey=\"532.8\" et=\"127.209935331557\" cx=\"294.15\" cy=\"536.15\" mt=\"163.087514860609\" /><ts ex=\"99.15\" ey=\"421.85\" et=\"129.301952558901\" cx=\"99.15\" cy=\"539.5\" mt=\"164.6\" /><ts ex=\"100\" ey=\"200\" et=\"132.825078723219\" cx=\"99.15\" cy=\"309.25\" mt=\"134.491836737263\" /><ts ex=\"98\" ey=\"156\" et=\"137.82004114628\" cx=\"99\" cy=\"178\" mt=\"131.096457838235\" /></trackSections><airoutes><airoute><r cx=\"196.65\" cy=\"-282.35\" ex=\"300\" ey=\"100\" /><r cx=\"300\" cy=\"200\" ex=\"297.5\" ey=\"430.3\" /><r cx=\"200\" cy=\"684.05\" ex=\"90.75\" ey=\"418.5\" /><r cx=\"100\" cy=\"200\" ex=\"100\" ey=\"100\" /></airoute><airoute><r cx=\"196.65\" cy=\"-287.4\" ex=\"300\" ey=\"100\" /><r cx=\"300\" cy=\"200\" ex=\"299.2\" ey=\"426.9\" /><r cx=\"203.4\" cy=\"690.8\" ex=\"90.75\" ey=\"410.1\" /><r cx=\"100\" cy=\"200\" ex=\"100\" ey=\"100\" /></airoute><airoute><r cx=\"196.65\" cy=\"-285.7\" ex=\"300\" ey=\"100\" /><r cx=\"300\" cy=\"200\" ex=\"297.5\" ey=\"428.6\" /><r cx=\"178.15\" cy=\"685.75\" ex=\"94.15\" ey=\"413.45\" /><r cx=\"100\" cy=\"200\" ex=\"100\" ey=\"100\" /></airoute><airoute><r cx=\"198.35\" cy=\"-287.4\" ex=\"300\" ey=\"100\" /><r cx=\"300\" cy=\"200\" ex=\"297.5\" ey=\"428.6\" /><r cx=\"194.95\" cy=\"709.3\" ex=\"92.45\" ey=\"416.85\" /><r cx=\"100\" cy=\"200\" ex=\"100\" ey=\"100\" /></airoute><airoute><r cx=\"198.35\" cy=\"-285.7\" ex=\"300\" ey=\"100\" /><r cx=\"300\" cy=\"200\" ex=\"299.2\" ey=\"428.6\" /><r cx=\"201.7\" cy=\"672.3\" ex=\"90.75\" ey=\"426.9\" /><r cx=\"100\" cy=\"200\" ex=\"100\" ey=\"100\" /></airoute></airoutes><scenery><si l=\"urgShip\" x=\"445.8\" y=\"445.8\" z=\"0\" r=\"0\" rs=\"0\" /><si l=\"alien\" x=\"197.3\" y=\"440.55\" z=\"0\" r=\"0\" rs=\"0\" /></scenery><items></items></track>";
tracks.push({name:"URGIN BOWL", desc:"Boost often, and don't get dizzy!", trackStr:trackStr, laps:trackLaps, team:5});
trackLaps = 5;
trackStr = ("<track laps=\"" + trackLaps) + "\" scale=\"25\"><startPosition><start x=\"18\" y=\"352\" a=\"-0.0333209958782472\" /><start x=\"21\" y=\"415\" a=\"-0.0387402976634794\" /><start x=\"21\" y=\"382\" a=\"-0.1030816085227\" /><start x=\"68\" y=\"414\" a=\"0\" /><start x=\"66\" y=\"380\" a=\"-0.0281615669878924\" /><start x=\"65\" y=\"348\" a=\"0.0444152152469108\" /></startPosition><trackSections laps=\"3\"><ts ex=\"470\" ey=\"391.45\" et=\"105.724486516936\" cx=\"238.55\" cy=\"391.45\" mt=\"113.181524599418\" /><ts ex=\"638.25\" ey=\"276.45\" et=\"134.894165278933\" cx=\"615.7\" cy=\"381.45\" mt=\"180.157796149668\" /><ts ex=\"650\" ey=\"-167.65\" et=\"93.6693925460051\" cx=\"650\" cy=\"114.7\" mt=\"111.505509148678\" /><ts ex=\"535.3\" ey=\"-273.55\" et=\"91.4884241232441\" cx=\"644.1\" cy=\"-270.6\" mt=\"182.504005439758\" /><ts ex=\"415.2\" ey=\"-269.6\" et=\"95.0366308859894\" cx=\"473.525\" cy=\"-270.6\" mt=\"93.2625275046167\" /><ts ex=\"294.1\" ey=\"-264.7\" et=\"98.5848376487346\" cx=\"352.925\" cy=\"-266.175\" mt=\"96.810734267362\" /><ts ex=\"211.75\" ey=\"-147.1\" et=\"102.13304441148\" cx=\"211.75\" cy=\"-267.65\" mt=\"143.88119406769\" /><ts ex=\"111.75\" ey=\"-55.9\" et=\"134.769756957465\" cx=\"208.8\" cy=\"-44.15\" mt=\"196.905282460432\" /><ts ex=\"-85.3\" ey=\"-70.6\" et=\"131.682179172463\" cx=\"-23.55\" cy=\"-73.55\" mt=\"143.627361438643\" /><ts ex=\"-217.65\" ey=\"32.35\" et=\"117.982958924647\" cx=\"-211.75\" cy=\"-91.2\" mt=\"193.815919449773\" /><ts ex=\"-211.75\" ey=\"258.8\" et=\"122.437606594831\" cx=\"-217.65\" cy=\"126.45\" mt=\"115.622552571904\" /><ts ex=\"-117.65\" ey=\"382.35\" et=\"117.472439294074\" cx=\"-223.55\" cy=\"382.35\" mt=\"189.457329832421\" /><ts ex=\"-68.6\" ey=\"382.85\" et=\"116.507861661817\" cx=\"-93.125\" cy=\"382.6\" mt=\"105.413261793921\" /><ts ex=\"101.45\" ey=\"384.3\" et=\"111.055270895662\" cx=\"5.7\" cy=\"385.75\" mt=\"113.78156627874\" /></trackSections><airoutes><airoute><r cx=\"376.1\" cy=\"417.4\" ex=\"538.3\" ey=\"373.45\" /><r cx=\"577.15\" cy=\"328.6\" ex=\"627.7\" ey=\"266\" /><r cx=\"637.95\" cy=\"14.6\" ex=\"651.1\" ey=\"-76.6\" /><r cx=\"630\" cy=\"-240\" ex=\"577.15\" ey=\"-241.45\" /><r cx=\"249.65\" cy=\"-293.45\" ex=\"223.9\" ey=\"-200\" /><r cx=\"232.45\" cy=\"-35.15\" ex=\"67.4\" ey=\"-71.75\" /><r cx=\"-221.75\" cy=\"-37\" ex=\"-204.3\" ey=\"65.7\" /><r cx=\"-194.7\" cy=\"351.05\" ex=\"-210.65\" ey=\"275.55\" /><r cx=\"-178.55\" cy=\"375.7\" ex=\"127\" ey=\"406\" /></airoute><airoute><r cx=\"354.3\" cy=\"402.85\" ex=\"538.3\" ey=\"373.45\" /><r cx=\"612.85\" cy=\"342.85\" ex=\"627.7\" ey=\"266\" /><r cx=\"665.65\" cy=\"-2.9\" ex=\"651.1\" ey=\"-76.6\" /><r cx=\"667.15\" cy=\"-205.7\" ex=\"554.3\" ey=\"-261.45\" /><r cx=\"240.9\" cy=\"-296.35\" ex=\"228.25\" ey=\"-200\" /><r cx=\"216.25\" cy=\"-24.35\" ex=\"58.7\" ey=\"-76.1\" /><r cx=\"-204.35\" cy=\"-83.25\" ex=\"-223.9\" ey=\"63.05\" /><r cx=\"-194.7\" cy=\"351.05\" ex=\"-210.65\" ey=\"275.55\" /><r cx=\"-177.15\" cy=\"398.55\" ex=\"127\" ey=\"395\" /></airoute><airoute><r cx=\"474.3\" cy=\"430\" ex=\"581.45\" ey=\"342.85\" /><r cx=\"641.45\" cy=\"317.15\" ex=\"627.7\" ey=\"266\" /><r cx=\"652.55\" cy=\"5.85\" ex=\"651.1\" ey=\"-76.6\" /><r cx=\"642.85\" cy=\"-204.3\" ex=\"565.25\" ey=\"-247.85\" /><r cx=\"242.85\" cy=\"-274.3\" ex=\"241.3\" ey=\"-206.55\" /><r cx=\"221.65\" cy=\"-32.45\" ex=\"19.55\" ey=\"-56.55\" /><r cx=\"-202.9\" cy=\"-87.6\" ex=\"-210.85\" ey=\"32.6\" /><r cx=\"-194.7\" cy=\"351.05\" ex=\"-210.65\" ey=\"275.55\" /><r cx=\"-161.4\" cy=\"384.25\" ex=\"132\" ey=\"391\" /></airoute><airoute><r cx=\"440\" cy=\"412.85\" ex=\"512.85\" ey=\"367.15\" /><r cx=\"591.3\" cy=\"354.35\" ex=\"641.3\" ey=\"297.8\" /><r cx=\"659.85\" cy=\"-5.85\" ex=\"651.1\" ey=\"-76.6\" /><r cx=\"667.15\" cy=\"-224.3\" ex=\"560.9\" ey=\"-252.2\" /><r cx=\"267.15\" cy=\"-298.55\" ex=\"239.15\" ey=\"-213.05\" /><r cx=\"235.15\" cy=\"0\" ex=\"28.25\" ey=\"-54.35\" /><r cx=\"-224.8\" cy=\"-61.35\" ex=\"-210.85\" ey=\"65.2\" /><r cx=\"-254.35\" cy=\"197.8\" ex=\"-206.5\" ey=\"332.6\" /><r cx=\"-130\" cy=\"390\" ex=\"135\" ey=\"391\" /></airoute><airoute><r cx=\"443.5\" cy=\"406.5\" ex=\"527.15\" ey=\"348.6\" /><r cx=\"594.3\" cy=\"312.85\" ex=\"621.75\" ey=\"263.05\" /><r cx=\"646.7\" cy=\"-8.75\" ex=\"651.1\" ey=\"-76.6\" /><r cx=\"648.6\" cy=\"-240\" ex=\"563.05\" ey=\"-263.05\" /><r cx=\"280\" cy=\"-284.3\" ex=\"239.15\" ey=\"-223.95\" /><r cx=\"245.95\" cy=\"-8.15\" ex=\"58.7\" ey=\"-54.35\" /><r cx=\"-208.75\" cy=\"-62.8\" ex=\"-213.05\" ey=\"43.45\" /><r cx=\"-221.75\" cy=\"308.7\" ex=\"-165.2\" ey=\"354.35\" /><r cx=\"-142.85\" cy=\"402.85\" ex=\"139\" ey=\"384\" /></airoute></airoutes><scenery><si l=\"sputnik\" x=\"-101\" y=\"269.3\" z=\"1\" r=\"0\" rs=\"0\" /><si l=\"spaceVan\" x=\"81.1\" y=\"-202.7\" z=\"2\" r=\"0\" rs=\"0\" /><si l=\"spacecraft\" x=\"518.85\" y=\"-164.35\" z=\"15\" r=\"0\" rs=\"2\" /><si l=\"vodaShip\" x=\"302.15\" y=\"221.4\" z=\"10\" r=\"0\" rs=\"0\" /></scenery><items></items></track>";
tracks.push({name:"DARTH RACEWAY", desc:"A fast circuit that will test your maneuverability.", trackStr:trackStr, laps:trackLaps, team:3});
trackLaps = 6;
trackStr = ("<track laps=\"" + trackLaps) + "\" scale=\"25\"><startPosition><start x=\"1101.55\" y=\"-246.15\" a=\"-0.0539659953165123\" /><start x=\"1153.85\" y=\"-286.15\" a=\"0\" /><start x=\"1150.8\" y=\"-206.15\" a=\"0\" /><start x=\"1101.55\" y=\"-206.15\" a=\"-0.0623871914422006\" /><start x=\"1101.55\" y=\"-286.15\" a=\"-0.0215438227728279\" /><start x=\"1150.8\" y=\"-246.15\" a=\"-0.0824683599478238\" /></startPosition><trackSections laps=\"3\"><ts ex=\"1294.65\" ey=\"-243.25\" et=\"150.549516582415\" cx=\"1235.15\" cy=\"-243.25\" mt=\"111.922629671671\" /><ts ex=\"2110.7\" ey=\"-242.85\" et=\"157.203510310442\" cx=\"1700.05\" cy=\"-243.25\" mt=\"150.796550722298\" /><ts ex=\"2219.3\" ey=\"-238.55\" et=\"131.227616792368\" cx=\"2161.45\" cy=\"-238.55\" mt=\"127.848612683997\" /><ts ex=\"2402.45\" ey=\"-93.95\" et=\"159.475359154216\" cx=\"2390.4\" cy=\"-248.15\" mt=\"161.682485080732\" /><ts ex=\"2301.25\" ey=\"19.3\" et=\"149.491617786785\" cx=\"2397.6\" cy=\"9.65\" mt=\"204.976418591562\" /><ts ex=\"2183.15\" ey=\"-28.9\" et=\"132.747171953444\" cx=\"2233.75\" cy=\"19.3\" mt=\"157.884601776151\" /><ts ex=\"2004.4\" ey=\"-56.5\" et=\"129.452284052123\" cx=\"2126.15\" cy=\"-58.7\" mt=\"152.619374480618\" /><ts ex=\"1544.65\" ey=\"-61.5\" et=\"128.891696871981\" cx=\"1774.525\" cy=\"-59\" mt=\"129.171990462052\" /><ts ex=\"1081.25\" ey=\"-59.45\" et=\"128.33110969184\" cx=\"1312.95\" cy=\"-60.475\" mt=\"128.61140328191\" /><ts ex=\"984.2\" ey=\"-154.5\" et=\"128.177796843053\" cx=\"982.2\" cy=\"-59.45\" mt=\"179.067388264482\" /><ts ex=\"1079.25\" ey=\"-245.55\" et=\"130.670858728079\" cx=\"980.25\" cy=\"-251.5\" mt=\"196.395552530499\" /><ts ex=\"1183.65\" ey=\"-241.85\" et=\"127.50902516674\" cx=\"1116.25\" cy=\"-243.25\" mt=\"130.690889371368\" /></trackSections><airoutes><airoute><r cx=\"1086.75\" cy=\"-267.45\" ex=\"1212.05\" ey=\"-257.8\" /><r cx=\"1255.4\" cy=\"-251.1\" ex=\"1374.55\" ey=\"-285.15\" /><r cx=\"2061.55\" cy=\"-292.3\" ex=\"2292.85\" ey=\"-253.55\" /><r cx=\"2454.775\" cy=\"-199.9\" ex=\"2428.55\" ey=\"-67.85\" /><r cx=\"2385.6\" cy=\"67.5\" ex=\"2166.3\" ey=\"-16.85\" /><r cx=\"1678.55\" cy=\"-64.25\" ex=\"1318.1\" ey=\"-43.35\" /><r cx=\"1132.55\" cy=\"-40.95\" ex=\"1057.85\" ey=\"-72.3\" /><r cx=\"985.55\" cy=\"-156.6\" ex=\"1060.25\" ey=\"-233.75\" /></airoute><airoute><r cx=\"1086.75\" cy=\"-267.45\" ex=\"1212.05\" ey=\"-257.8\" /><r cx=\"1297.95\" cy=\"-208.55\" ex=\"1387.3\" ey=\"-195.75\" /><r cx=\"2027.7\" cy=\"-286.15\" ex=\"2292.85\" ey=\"-253.55\" /><r cx=\"2454.775\" cy=\"-199.9\" ex=\"2428.55\" ey=\"-67.85\" /><r cx=\"2400.05\" cy=\"45.8\" ex=\"2190.4\" ey=\"-21.7\" /><r cx=\"1678.55\" cy=\"-64.25\" ex=\"1318.1\" ey=\"-43.35\" /><r cx=\"1125.35\" cy=\"-21.7\" ex=\"1033.75\" ey=\"-84.35\" /><r cx=\"959.05\" cy=\"-168.65\" ex=\"1069.9\" ey=\"-250.6\" /></airoute><airoute><r cx=\"1086.75\" cy=\"-267.45\" ex=\"1212.05\" ey=\"-257.8\" /><r cx=\"1430.8\" cy=\"-295.4\" ex=\"1506.5\" ey=\"-289.4\" /><r cx=\"2064.65\" cy=\"-261.55\" ex=\"2241\" ey=\"-260.25\" /><r cx=\"2402.45\" cy=\"-214.45\" ex=\"2375.95\" ey=\"-84.35\" /><r cx=\"2320.55\" cy=\"28.9\" ex=\"2120.55\" ey=\"-33.75\" /><r cx=\"1678.55\" cy=\"-64.25\" ex=\"1421.35\" ey=\"-34\" /><r cx=\"1108.45\" cy=\"-19.25\" ex=\"1021.7\" ey=\"-81.9\" /><r cx=\"963.9\" cy=\"-159.05\" ex=\"1045.8\" ey=\"-226.5\" /></airoute><airoute><r cx=\"1086.75\" cy=\"-267.45\" ex=\"1178.8\" ey=\"-272.35\" /><r cx=\"1297.95\" cy=\"-208.55\" ex=\"1387.3\" ey=\"-191.5\" /><r cx=\"2120\" cy=\"-255.4\" ex=\"2336.3\" ey=\"-204.25\" /><r cx=\"2395.25\" cy=\"-175.9\" ex=\"2392.8\" ey=\"-60.25\" /><r cx=\"2361.5\" cy=\"60.25\" ex=\"2135\" ey=\"-38.55\" /><r cx=\"1678.55\" cy=\"-64.25\" ex=\"1472.45\" ey=\"-76.6\" /><r cx=\"1093.7\" cy=\"-34\" ex=\"1053.05\" ey=\"-91.55\" /><r cx=\"942.2\" cy=\"-168.65\" ex=\"1043.4\" ey=\"-245.8\" /></airoute><airoute><r cx=\"1119.2\" cy=\"-268.1\" ex=\"1270.8\" ey=\"-243.1\" /><r cx=\"1293.7\" cy=\"-204.3\" ex=\"1383.05\" ey=\"-195.75\" /><r cx=\"2202.45\" cy=\"-226.5\" ex=\"2332.6\" ey=\"-195.2\" /><r cx=\"2421.75\" cy=\"-103.6\" ex=\"2349.45\" ey=\"-31.3\" /><r cx=\"2298\" cy=\"8.55\" ex=\"2149.05\" ey=\"-63.8\" /><r cx=\"1678.55\" cy=\"-64.25\" ex=\"1245.8\" ey=\"-53\" /><r cx=\"1053.05\" cy=\"-40.95\" ex=\"1012.85\" ey=\"-119.15\" /><r cx=\"957.5\" cy=\"-157.45\" ex=\"1034.1\" ey=\"-225.5\" /></airoute></airoutes><scenery><si l=\"deathStar\" x=\"2139.55\" y=\"-398.3\" z=\"0\" r=\"0\" rs=\"0\" /></scenery><items><si l=\"barrier\" x=\"1497.95\" y=\"-242.6\" r=\"15\" p=\"20\" /><si l=\"slowdown\" x=\"1323.1\" y=\"-107.65\" r=\"15\" p=\"20\" /><si l=\"slowdown\" x=\"1323.1\" y=\"-15.35\" r=\"15\" p=\"20\" /><si l=\"pinger\" x=\"1360\" y=\"-46.15\" r=\"15\" p=\"2500\" /><si l=\"slowdown\" x=\"1323.1\" y=\"-76.9\" r=\"15\" p=\"20\" /><si l=\"pinger\" x=\"1360\" y=\"-76.9\" r=\"15\" p=\"2500\" /><si l=\"slowdown\" x=\"1323.1\" y=\"-46.15\" r=\"15\" p=\"20\" /></items></track>";
tracks.push({name:"CITRUS CIRCUIT", desc:"This track has been poorly maintained, so be careful!", trackStr:trackStr, laps:trackLaps, team:2});
trackLaps = 7;
trackStr = ("<track laps=\"" + trackLaps) + "\" scale=\"25\"><startPosition><start x=\"136.15\" y=\"243.7\" a=\"-1.55079899282175\" /><start x=\"60.5\" y=\"243.7\" a=\"-1.5744064194149\" /><start x=\"137.85\" y=\"290.8\" a=\"-1.49629333304434\" /><start x=\"99.15\" y=\"285.75\" a=\"-1.54050256687612\" /><start x=\"99.15\" y=\"242.05\" a=\"-1.5707963267949\" /><start x=\"60.5\" y=\"289.1\" a=\"-1.55227992472689\" /></startPosition><trackSections laps=\"3\"><ts ex=\"121.65\" ey=\"-718.95\" et=\"130.670858728079\" cx=\"100.85\" cy=\"82.35\" mt=\"135.577146912822\" /><ts ex=\"202.75\" ey=\"-916.25\" et=\"155.628187361696\" cx=\"127.05\" cy=\"-867.6\" mt=\"160.782897131131\" /><ts ex=\"478.4\" ey=\"-1083.8\" et=\"128.830304813229\" cx=\"332.45\" cy=\"-1010.8\" mt=\"147.431881596292\" /><ts ex=\"721.65\" ey=\"-989.2\" et=\"124.469608575627\" cx=\"654.1\" cy=\"-1186.5\" mt=\"174.693936910429\" /><ts ex=\"727.05\" ey=\"-675.7\" et=\"131.227616792368\" cx=\"781.1\" cy=\"-832.45\" mt=\"127.848612683997\" /><ts ex=\"329.75\" ey=\"418.95\" et=\"127.785411519642\" cx=\"535.15\" cy=\"-137.85\" mt=\"124.27462119811\" /><ts ex=\"201.7\" ey=\"532.8\" et=\"127.209935331557\" cx=\"294.15\" cy=\"536.15\" mt=\"163.087514860609\" /><ts ex=\"99.15\" ey=\"421.85\" et=\"129.301952558901\" cx=\"99.15\" cy=\"539.5\" mt=\"164.6\" /><ts ex=\"100\" ey=\"200\" et=\"132.825078723219\" cx=\"99.15\" cy=\"309.25\" mt=\"134.491836737263\" /><ts ex=\"100.85\" ey=\"119.35\" et=\"131.301996760455\" cx=\"100.85\" cy=\"166.4\" mt=\"131.096457838235\" /></trackSections><airoutes><airoute><r cx=\"164.3\" cy=\"-28.55\" ex=\"150\" ey=\"-210.7\" /><r cx=\"-3.6\" cy=\"-646.4\" ex=\"214.3\" ey=\"-871.45\" /><r cx=\"367.9\" cy=\"-1153.55\" ex=\"607.15\" ey=\"-1075\" /><r cx=\"989.3\" cy=\"-950\" ex=\"407.15\" ey=\"210.7\" /><r cx=\"367.85\" cy=\"525\" ex=\"153.55\" ey=\"539.3\" /><r cx=\"71.45\" cy=\"471.45\" ex=\"64.3\" ey=\"189.3\" /></airoute><airoute><r cx=\"164.3\" cy=\"-28.55\" ex=\"150\" ey=\"-210.7\" /><r cx=\"-3.6\" cy=\"-646.4\" ex=\"214.3\" ey=\"-871.45\" /><r cx=\"346.45\" cy=\"-1153.55\" ex=\"607.15\" ey=\"-1075\" /><r cx=\"1003.6\" cy=\"-935.7\" ex=\"417.9\" ey=\"217.85\" /><r cx=\"367.85\" cy=\"525\" ex=\"153.55\" ey=\"539.3\" /><r cx=\"57.15\" cy=\"467.85\" ex=\"64.3\" ey=\"189.3\" /></airoute><airoute><r cx=\"164.3\" cy=\"-28.55\" ex=\"150\" ey=\"-210.7\" /><r cx=\"-3.6\" cy=\"-646.4\" ex=\"214.3\" ey=\"-871.45\" /><r cx=\"357.15\" cy=\"-1153.55\" ex=\"614.3\" ey=\"-1075\" /><r cx=\"989.3\" cy=\"-953.55\" ex=\"392.9\" ey=\"214.3\" /><r cx=\"367.85\" cy=\"525\" ex=\"153.55\" ey=\"539.3\" /><r cx=\"57.15\" cy=\"475\" ex=\"64.3\" ey=\"189.3\" /></airoute><airoute><r cx=\"164.3\" cy=\"-28.55\" ex=\"150\" ey=\"-210.7\" /><r cx=\"-3.6\" cy=\"-646.4\" ex=\"214.3\" ey=\"-871.45\" /><r cx=\"396.45\" cy=\"-1164.3\" ex=\"610.75\" ey=\"-1071.45\" /><r cx=\"825\" cy=\"-978.55\" ex=\"739.3\" ey=\"-675\" /><r cx=\"621.45\" cy=\"-310.7\" ex=\"403.6\" ey=\"214.3\" /><r cx=\"367.85\" cy=\"525\" ex=\"153.55\" ey=\"539.3\" /><r cx=\"64.3\" cy=\"475\" ex=\"64.3\" ey=\"189.3\" /></airoute><airoute><r cx=\"164.3\" cy=\"-28.55\" ex=\"150\" ey=\"-210.7\" /><r cx=\"-3.6\" cy=\"-646.4\" ex=\"214.3\" ey=\"-871.45\" /><r cx=\"346.45\" cy=\"-1150\" ex=\"671.45\" ey=\"-1067.85\" /><r cx=\"807.15\" cy=\"-896.45\" ex=\"746.45\" ey=\"-667.85\" /><r cx=\"675\" cy=\"-385.7\" ex=\"407.15\" ey=\"225\" /><r cx=\"367.85\" cy=\"525\" ex=\"196.45\" ey=\"535.7\" /><r cx=\"60.75\" cy=\"475\" ex=\"67.9\" ey=\"189.3\" /></airoute></airoutes><scenery><si l=\"eShip\" x=\"538\" y=\"-931.1\" z=\"10\" r=\"0\" rs=\"0\" /></scenery><items><si l=\"speedboost\" x=\"139.25\" y=\"439.3\" r=\"15\" p=\"100\" /><si l=\"speedboost\" x=\"148.65\" y=\"-213.5\" r=\"15\" p=\"100\" /><si l=\"speedboost\" x=\"75.7\" y=\"-591.9\" r=\"15\" p=\"100\" /><si l=\"oil\" x=\"692.9\" y=\"-464.3\" r=\"15\" p=\"0\" /><si l=\"oil\" x=\"403.6\" y=\"117.85\" r=\"15\" p=\"0\" /></items></track>";
tracks.push({name:"TREE SPEEDWAY", desc:"A fast circuit; hit the speed boosters and keep your foot down!", trackStr:trackStr, laps:trackLaps, team:4});
trackLaps = 8;
trackStr = "<track laps=\"8\" scale=\"25\"><startPosition><start x=\"26.9\" y=\"119.3\" a=\"-1.5707963267949\" /><start x=\"-6.7\" y=\"117.65\" a=\"-1.59112951001213\" /><start x=\"26.9\" y=\"78.95\" a=\"-1.5707963267949\" /><start x=\"58.85\" y=\"80.65\" a=\"-1.7251647526887\" /><start x=\"60.5\" y=\"119.3\" a=\"-1.61993706121092\" /><start x=\"-3.35\" y=\"77.3\" a=\"-1.51961156479967\" /></startPosition><trackSections laps=\"3\"><ts ex=\"25.75\" ey=\"-207.95\" et=\"105.315104687899\" cx=\"25.75\" cy=\"-118.85\" mt=\"101.362874906887\" /><ts ex=\"191.9\" ey=\"-732.45\" et=\"119.961366311122\" cx=\"13.55\" cy=\"-724.35\" mt=\"156.180478424718\" /><ts ex=\"375.7\" ey=\"-481.1\" et=\"113.853756128534\" cx=\"367.6\" cy=\"-735.15\" mt=\"148.679915238949\" /><ts ex=\"368.45\" ey=\"-121.05\" et=\"130.120562738234\" cx=\"389.2\" cy=\"-291.9\" mt=\"125.920036666147\" /><ts ex=\"651.35\" ey=\"178.35\" et=\"119.584809624687\" cx=\"360\" cy=\"80\" mt=\"182.99241559844\" /><ts ex=\"773.7\" ey=\"284.25\" et=\"117.805612819202\" cx=\"766.15\" cy=\"181.55\" mt=\"146.062895654611\" /><ts ex=\"643.3\" ey=\"335.1\" et=\"100.324411724442\" cx=\"735.35\" cy=\"412.3\" mt=\"188.928089966575\" /><ts ex=\"497.3\" ey=\"300\" et=\"114.167834384646\" cx=\"578.6\" cy=\"285.75\" mt=\"127.298696116154\" /><ts ex=\"404.3\" ey=\"459.6\" et=\"130.641769550431\" cx=\"389.3\" cy=\"321.45\" mt=\"139.020621894546\" /><ts ex=\"221.3\" ey=\"655.35\" et=\"110.30162580712\" cx=\"378.75\" cy=\"646.85\" mt=\"172.426861857941\" /><ts ex=\"25.55\" ey=\"463.85\" et=\"123.523431162067\" cx=\"25.55\" cy=\"638.35\" mt=\"183.762379684676\" /><ts ex=\"25\" ey=\"32.15\" et=\"106.694870682291\" cx=\"25.75\" cy=\"116.8\" mt=\"99.035056546072\" /></trackSections><airoutes><airoute><r cx=\"-21.05\" cy=\"-736.85\" ex=\"204.3\" ey=\"-723.45\" /><r cx=\"406.95\" cy=\"-703.5\" ex=\"378.75\" ey=\"-480.9\" /><r cx=\"424.3\" cy=\"-200\" ex=\"412.3\" ey=\"-15.4\" /><r cx=\"523.05\" cy=\"190.75\" ex=\"767.55\" ey=\"245.95\" /><r cx=\"778.45\" cy=\"372.3\" ex=\"696.45\" ey=\"346.45\" /><r cx=\"453.6\" cy=\"214.3\" ex=\"389.3\" ey=\"489.3\" /><r cx=\"185.7\" cy=\"792.9\" ex=\"55.2\" ey=\"503.5\" /><r cx=\"20.7\" cy=\"241.4\" ex=\"20.7\" ey=\"-124.15\" /></airoute><airoute><r cx=\"-21.05\" cy=\"-736.85\" ex=\"170.25\" ey=\"-740.5\" /><r cx=\"406.95\" cy=\"-703.5\" ex=\"378.75\" ey=\"-480.9\" /><r cx=\"435.15\" cy=\"-191.9\" ex=\"390.75\" ey=\"-15.4\" /><r cx=\"523.05\" cy=\"184.6\" ex=\"745.95\" ey=\"229.7\" /><r cx=\"793.85\" cy=\"307.7\" ex=\"721.45\" ey=\"360.75\" /><r cx=\"453.6\" cy=\"214.3\" ex=\"384.65\" ey=\"461.55\" /><r cx=\"267.55\" cy=\"778.4\" ex=\"55.2\" ey=\"503.5\" /><r cx=\"64.3\" cy=\"225\" ex=\"20.7\" ey=\"-124.15\" /></airoute><airoute><r cx=\"12.8\" cy=\"-753.25\" ex=\"174.5\" ey=\"-727.75\" /><r cx=\"406.95\" cy=\"-703.5\" ex=\"378.75\" ey=\"-480.9\" /><r cx=\"437.85\" cy=\"-200\" ex=\"393.85\" ey=\"-24.65\" /><r cx=\"627.7\" cy=\"190.75\" ex=\"767.55\" ey=\"218.9\" /><r cx=\"794.6\" cy=\"318.9\" ex=\"725\" ey=\"332.15\" /><r cx=\"453.6\" cy=\"214.3\" ex=\"391.55\" ey=\"485.1\" /><r cx=\"337.85\" cy=\"635.15\" ex=\"221.6\" ey=\"667.6\" /><r cx=\"113.5\" cy=\"645.95\" ex=\"55.2\" ey=\"503.5\" /><r cx=\"-8.5\" cy=\"302.1\" ex=\"34.05\" ey=\"-123.45\" /></airoute><airoute><r cx=\"-51.05\" cy=\"-727.75\" ex=\"193.85\" ey=\"-710.8\" /><r cx=\"406.95\" cy=\"-703.5\" ex=\"378.75\" ey=\"-480.9\" /><r cx=\"415.8\" cy=\"-221.05\" ex=\"390.75\" ey=\"-12.3\" /><r cx=\"553.85\" cy=\"141.55\" ex=\"756.75\" ey=\"218.9\" /><r cx=\"818.9\" cy=\"356.75\" ex=\"673.85\" ey=\"329.25\" /><r cx=\"453.6\" cy=\"214.3\" ex=\"405.4\" ey=\"535.15\" /><r cx=\"337.85\" cy=\"656.8\" ex=\"227\" ey=\"659.5\" /><r cx=\"121.6\" cy=\"629.75\" ex=\"32.4\" ey=\"527.05\" /><r cx=\"64.3\" cy=\"260.75\" ex=\"42.85\" ey=\"-78.55\" /></airoute><airoute><r cx=\"-42.55\" cy=\"-753.25\" ex=\"178.5\" ey=\"-741.55\" /><r cx=\"382.15\" cy=\"-771.4\" ex=\"378.75\" ey=\"-480.9\" /><r cx=\"426.35\" cy=\"-194.75\" ex=\"393.85\" ey=\"-3.1\" /><r cx=\"483.05\" cy=\"147.7\" ex=\"745.95\" ey=\"218.9\" /><r cx=\"786.5\" cy=\"340.55\" ex=\"697.3\" ey=\"329.7\" /><r cx=\"432.15\" cy=\"185.75\" ex=\"395.8\" ey=\"485.1\" /><r cx=\"337.85\" cy=\"645.95\" ex=\"224.3\" ey=\"659.5\" /><r cx=\"137.85\" cy=\"670.3\" ex=\"70.25\" ey=\"543.25\" /><r cx=\"-17.85\" cy=\"317.85\" ex=\"7.15\" ey=\"-75\" /></airoute></airoutes><scenery><si l=\"meteor_medium\" x=\"123.1\" y=\"0\" z=\"10\" r=\"0\" rs=\"0\" /><si l=\"meteor_medium\" x=\"-135.4\" y=\"49.2\" z=\"0\" r=\"0\" rs=\"0\" /><si l=\"meteor_large\" x=\"-249.25\" y=\"-21.55\" z=\"0\" r=\"0\" rs=\"0\" /><si l=\"meteor_large\" x=\"-67.7\" y=\"-18.45\" z=\"10\" r=\"0\" rs=\"0\" /></scenery><items></items></track>";
tracks.push({name:"ASTEROID RING", desc:"The final race of the season! Good luck!", trackStr:trackStr, laps:trackLaps, team:-1});
racerDetails = [];
racerDetails.push(new RacerInfo("saucerImg2", "TEE MOBIL", "This team are great value at every race and known for their extremely complex race strategies. One to watch."));
racerDetails.push(new RacerInfo("saucerImg0", "NO 2", "A big, impersonal race team, they battle for places like you wouldn't believe. They won't accept anything but first place - \"NO 2\", geddit?"));
racerDetails.push(new RacerInfo("saucerImg1", "TANGERINE GT", "The most pretentious team on the grid, liable to drop out at any moment and with an inexplicable penchant for animal mascots. Racoon anyone?"));
racerDetails.push(new RacerInfo("saucerImg3", "DARTH VODA", "A scary race team from across the galaxy. They run their operation like an evil empire and will stop at nothing to be the ultimate victors."));
racerDetails.push(new RacerInfo("saucerImg4", "TREE RACING", "A team that likes to do things differently"));
racerDetails.push(new RacerInfo("saucerImg5", "URGIN GALACTIC", "Running their own versions of existing machinery"));
_global.backendURL = "http://projects.kempt.co.uk/tzero/";
sexArr = ["man", "woman"];
ageArr = ["under 21", "21-45", "over 45"];
PlayerResults.init();
Frame 4
_global.groats = Game.INIT_GROATS;
upgradesLevels = {};
upgradesLevels.speed = 0;
upgradesLevels.handling = 0;
upgradesLevels.turnSpeed = 0;
upgradesLevels.forceField = 0;
_global.upgradesLevels = upgradesLevels;
upgradeCost = {};
upgradeCost.speed = [100, 550, 850];
upgradeCost.handling = [100, 550, 850];
upgradeCost.turnSpeed = [40, 100, 300];
upgradeCost.forceField = [40, 100, 300];
_global.upgradeCost = upgradeCost;
shipUpgrades = {};
shipUpgrades.speed = [1, 1.4, 1.8, 2.2];
shipUpgrades.handlingPower = [1, 1.26, 1.57, 2.1];
shipUpgrades.handlingDrag = [0, -0.07, -0.14, -0.2];
shipUpgrades.turnSpeed = [0, 0.5, 1, 1.5];
shipUpgrades.forceField = [0, 1000, 2500, 5000];
_global.shipUpgrades = shipUpgrades;
delete selectedRacer;
trackNum = 0;
TournamentResults.init(6);
startpage.gotoAndPlay("startpage in");
Frame 5
stop();
Frame 7
game.initLevel(tracks[trackNum].trackStr, _global.root.selectedRacer, trackNum);
stop();
Symbol 3 MovieClip [tempInd] Frame 2
this.removeMovieClip();
Symbol 14 MovieClip [kvSpark] Frame 70
stop();
Symbol 28 MovieClip Frame 100
gotoAndPlay (1);
Symbol 47 MovieClip Frame 1
function onEnterFrame() {
var _local2 = _root.getBytesLoaded() / _root.getBytesTotal();
if (getTimer() >= (startTime + 4000)) {
animDone = true;
}
if ((Math.ceil(bar._width) >= width) && (animDone)) {
stopSparks = true;
delete onEnterFrame;
gotoAndPlay ("out");
} else {
setProgress(_local2);
}
}
function fadeOut() {
setProgress(progress);
this._alpha = this._alpha - 5;
if (this._alpha <= -50) {
this._visible = false;
_parent.play();
}
}
function makeSpark() {
if (!stopSparks) {
attachMovie("kvSpark", "spark" + i, this.getNextHighestDepth());
this["spark" + i]._x = bar._x + bar._width;
this["spark" + i]._y = bar._y + (Math.random() * 20);
this["spark" + i].grav = 0.1;
this["spark" + i].wind = (Math.random() * 4) - 3;
this["spark" + i].spin = Math.random() * 10;
this["spark" + i].onEnterFrame = sparkControl;
i++;
}
}
function sparkControl() {
if (!stopSparks) {
this._y = this._y + this.grav;
this._x = this._x + this.wind;
this.grav = this.grav * gravity;
this._alpha = this._alpha - this.grav;
this._rotation = this._rotation + this.spin;
if (this._alpha <= 0) {
this.removeMovieClip();
}
} else {
this.removeMovieClip();
}
}
function setProgress(p) {
bar._width = ((bar._width * 2) + (p * width)) / 3;
if (progress != 1) {
makeSpark();
}
}
width = 200;
i = 0;
gravity = 1.3;
startTime = getTimer();
if (this._name == "loader_mc") {
myName = _global.language.loadingAssets;
} else {
myName = _global.language.initLevel;
}
setProgress(0);
_parent.stop();
Symbol 47 MovieClip Frame 13
stop();
Symbol 47 MovieClip Frame 40
_parent.play();
Symbol 53 MovieClip [lineSegment3D] Frame 1
#initclip 106
Object.registerClass("lineSegment3D", cust.geom3D.LineSegment3D);
#endinitclip
Symbol 54 MovieClip [multiPoly] Frame 1
#initclip 67
Object.registerClass("multiPoly", cust.geom3D.MultiPoly);
#endinitclip
Symbol 55 MovieClip [plane] Frame 1
#initclip 68
Object.registerClass("plane", Plane);
#endinitclip
Symbol 56 MovieClip [mesh] Frame 1
#initclip 69
Object.registerClass("mesh", cust.geom3D.Mesh);
#endinitclip
Symbol 151 MovieClip Frame 8
stop();
Symbol 176 MovieClip [fire] Frame 1
#initclip 70
Object.registerClass("fire", SaucerFire);
#endinitclip
Symbol 195 MovieClip Frame 5
stop();
Symbol 201 MovieClip Frame 2
stop();
Symbol 201 MovieClip Frame 10
gotoAndStop ("off");
Symbol 201 MovieClip Frame 15
_parent.saucer.fallenOff();
Symbol 318 MovieClip [saucer3] Frame 1
#initclip 71
Object.registerClass("saucer3", SaucerMc);
#endinitclip
Symbol 319 MovieClip [saucer1] Frame 1
#initclip 72
Object.registerClass("saucer1", SaucerMc);
#endinitclip
Symbol 320 MovieClip [saucer0] Frame 1
#initclip 73
Object.registerClass("saucer0", SaucerMc);
#endinitclip
Symbol 321 MovieClip [saucer5] Frame 1
#initclip 74
Object.registerClass("saucer5", SaucerMc);
#endinitclip
Symbol 322 MovieClip [saucer4] Frame 1
#initclip 75
Object.registerClass("saucer4", SaucerMc);
#endinitclip
Symbol 323 MovieClip [saucer2] Frame 1
#initclip 76
Object.registerClass("saucer2", SaucerMc);
#endinitclip
Symbol 325 MovieClip [meteor_medium] Frame 1
#initclip 77
Object.registerClass("meteor_medium", cust.geom3D.Sprite);
#endinitclip
Symbol 327 MovieClip [meteor_large] Frame 1
#initclip 78
Object.registerClass("meteor_large", cust.geom3D.Sprite);
#endinitclip
Symbol 329 MovieClip [meteor_small] Frame 1
#initclip 79
Object.registerClass("meteor_small", cust.geom3D.Sprite);
#endinitclip
Symbol 331 MovieClip [checkPoint] Frame 1
#initclip 80
Object.registerClass("checkPoint", cust.geom3D.Sprite);
#endinitclip
Symbol 333 MovieClip [spacecraft] Frame 1
#initclip 81
Object.registerClass("spacecraft", cust.geom3D.Sprite);
#endinitclip
Symbol 335 MovieClip [armchair] Frame 1
#initclip 82
Object.registerClass("armchair", cust.geom3D.Sprite);
#endinitclip
Symbol 337 MovieClip [fridge] Frame 1
#initclip 83
Object.registerClass("fridge", cust.geom3D.Sprite);
#endinitclip
Symbol 339 MovieClip [sputnik] Frame 1
#initclip 84
Object.registerClass("sputnik", cust.geom3D.Sprite);
#endinitclip
Symbol 341 MovieClip [spaceVan] Frame 1
#initclip 85
Object.registerClass("spaceVan", cust.geom3D.Sprite);
#endinitclip
Symbol 343 MovieClip [alien] Frame 1
#initclip 86
Object.registerClass("alien", cust.geom3D.Sprite);
#endinitclip
Symbol 345 MovieClip [startline] Frame 1
#initclip 87
Object.registerClass("startline", cust.geom3D.Sprite);
#endinitclip
Symbol 347 MovieClip [sparkle] Frame 1
#initclip 88
Object.registerClass("sparkle", Particle);
#endinitclip
Symbol 351 MovieClip [carouselItem] Frame 1
#initclip 89
Object.registerClass("carouselItem", CarouselItem);
#endinitclip
Symbol 381 MovieClip [position_overview] Frame 1
#initclip 90
Object.registerClass("position_overview", PositionOverview);
#endinitclip
Symbol 388 MovieClip [standings_overview] Frame 1
#initclip 91
Object.registerClass("standings_overview", StandingsOverview);
#endinitclip
Symbol 394 MovieClip [pinger] Frame 1
#initclip 92
Object.registerClass("pinger", cust.geom3D.Sprite);
#endinitclip
stop();
Symbol 401 MovieClip [slowdown] Frame 1
#initclip 93
Object.registerClass("slowdown", cust.geom3D.Sprite);
#endinitclip
stop();
Symbol 407 MovieClip [oil] Frame 1
#initclip 94
Object.registerClass("oil", cust.geom3D.Sprite);
#endinitclip
stop();
Symbol 414 MovieClip [zerofriction] Frame 1
#initclip 95
Object.registerClass("zerofriction", cust.geom3D.Sprite);
#endinitclip
stop();
Symbol 420 MovieClip [speedboost] Frame 1
#initclip 96
Object.registerClass("speedboost", cust.geom3D.Sprite);
#endinitclip
stop();
Symbol 427 MovieClip [shuntboost] Frame 1
#initclip 97
Object.registerClass("shuntboost", cust.geom3D.Sprite);
#endinitclip
stop();
Symbol 432 MovieClip [barrier] Frame 1
#initclip 98
Object.registerClass("barrier", cust.geom3D.Sprite);
#endinitclip
stop();
Symbol 434 MovieClip [bobaPink] Frame 1
#initclip 99
Object.registerClass("bobaPink", cust.geom3D.Sprite);
#endinitclip
Symbol 436 MovieClip [dot] Frame 1
#initclip 100
Object.registerClass("dot", cust.geom3D.Sprite);
#endinitclip
Symbol 452 MovieClip [vodaShip] Frame 1
#initclip 101
Object.registerClass("vodaShip", cust.geom3D.Sprite);
#endinitclip
Symbol 454 MovieClip [millenium] Frame 1
#initclip 102
Object.registerClass("millenium", cust.geom3D.Sprite);
#endinitclip
Symbol 456 MovieClip [eShip] Frame 1
#initclip 103
Object.registerClass("eShip", cust.geom3D.Sprite);
#endinitclip
Symbol 458 MovieClip [deathStar] Frame 1
#initclip 104
Object.registerClass("deathStar", cust.geom3D.Sprite);
#endinitclip
Symbol 460 MovieClip [urgShip] Frame 1
#initclip 105
Object.registerClass("urgShip", cust.geom3D.Sprite);
#endinitclip
Symbol 478 MovieClip Frame 1
stop();
Symbol 1238 MovieClip [__Packages.RacerInfo] Frame 0
class RacerInfo
{
var linkage, title, desc;
function RacerInfo (l, t, d) {
linkage = l;
title = t;
desc = d;
}
}
Symbol 1239 MovieClip [__Packages.Snd] Frame 0
class Snd extends Sound
{
var target, manager, _volume, position, start, duration, onFadeComplete, fId, setPan, onSoundComplete;
function Snd (targ, sndman) {
super(targ);
target = (targ ? (targ) : _root);
manager = sndman;
_volume = super.getVolume();
}
function switchSound(id, loops) {
var _local3 = position;
super.stop();
super.attachSound(id);
start((_local3 % duration) / 1000, loops);
}
function fade(dVol, tVol, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), tVol, true);
}
function fadeBy(dVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
fId = setInterval(this, "changeVolTowards", FADE_RATE, dVol * (FADE_RATE / 1000), dVol * t, true);
}
}
function fadeTo(tVol, t, handler) {
onFadeComplete = handler;
if (fId) {
stopFade(fId);
}
if (t > 0) {
var _local3 = (tVol - getVolume()) / t;
fId = setInterval(this, "changeVolTowards", FADE_RATE, _local3 * (FADE_RATE / 1000), tVol, true);
} else {
setVolume(tVol);
}
}
function changeVolTowards(dVol, tVol, fading) {
var _local2 = getVolume();
if (Math.abs(dVol) < Math.abs(tVol - _local2)) {
changeVolume(dVol);
} else {
setVolume(tVol);
if (fading) {
stopFade();
}
}
}
function stopFade() {
if (fId) {
clearInterval(fId);
delete fId;
onFadeComplete();
delete onFadeComplete;
}
}
function positionSound(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
d = ((d < 1) ? 1 : (d));
var _local4 = 1 / ((d / f) * 100);
setVolume(Math.ceil(_local4 * t));
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function positionSoundLinear(a, d, f, t) {
if (d < f) {
t = (isNaN(t) ? 100 : (((t < 0) ? 0 : (t))));
setVolume(((f - d) / f) * t);
setPan((-Math.sin(a)) * 100);
} else {
setVolume(0);
}
}
function setVolume(n) {
_volume = n;
super.setVolume(n);
}
function getVolume() {
return(_volume);
}
function changeVolume(n) {
setVolume(getVolume() + n);
}
function remove() {
super.stop();
delete onSoundComplete;
stopFade();
delete manager.sounds[target.getDepth()];
target.removeMovieClip();
}
function toString() {
return(("(target=" + target) + ")");
}
function get volume() {
return(getVolume());
}
function set volume(n) {
setVolume(n);
//return(volume);
}
static var FADE_RATE = 100;
}
Symbol 1240 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager extends Snd
{
var sounds, mc_holder, getVolume;
function SoundManager (hld_mc) {
super();
sounds = new Object();
mc_holder = (hld_mc ? (hld_mc) : _root);
}
function playAndRemove(snd_id, offset, loops) {
offset = (isNaN(offset) ? 0 : (offset));
loops = (isNaN(loops) ? 0 : (loops));
var _local2 = newSound(snd_id);
_local2.start(offset, loops);
_local2.onSoundComplete = _local2.remove;
return(_local2);
}
function clearAllSounds() {
for (var _local2 in sounds) {
sounds[_local2].remove();
}
}
function newSound() {
var _local5 = mc_holder.getNextHighestDepth();
var _local6 = mc_holder.createEmptyMovieClip("sh_mc" + _local5, _local5);
var _local4 = new Snd(_local6, this);
var _local3 = 0;
while (_local3 < arguments.length) {
if (arguments[_local3] != undefined) {
_local4.attachSound(arguments[_local3]);
}
_local3++;
}
sounds[_local5] = _local4;
return(_local4);
}
function deleteSound(snd) {
snd.remove();
}
function setVolume(vol) {
if (muted) {
curVol = vol;
} else {
super.setVolume(vol);
}
}
function get mute() {
return(muted);
}
function set mute(b) {
muted = b;
if (b) {
curVol = getVolume();
super.setVolume(0);
} else {
super.setVolume(curVol);
}
//return(mute);
}
var muted = false;
var curVol = 100;
}
Symbol 1241 MovieClip [__Packages.PlayerResults] Frame 0
class PlayerResults
{
static var so;
function PlayerResults () {
}
static function init() {
so = SharedObject.getLocal(SHARED_OBJECT_NAME, "/");
if (!so.data.tracks) {
so.data.tracks = [];
}
}
static function setTrackResults(trackNum, pos, times) {
if (!so.data.tracks[trackNum]) {
so.data.tracks[trackNum] = {pos:pos, bl:times.bestLapTime(), tt:times.finishTime};
} else {
var _local1 = so.data.tracks[trackNum];
var _local2 = times.bestLapTime();
var _local5 = times.finishTime;
_local1.pos = ((pos < _local1.pos) ? (pos) : (_local1.pos));
_local1.bl = ((_local2 < _local1.bl) ? (_local2) : (_local1.bl));
_local1.tt = ((_local5 < _local1.tt) ? (_local5) : (_local1.tt));
}
so.flush();
}
static function getTrackResults(trackNum) {
var _local2 = so.data.tracks[trackNum];
if (_local2) {
var _local1 = {};
_local1.pos = _local2.pos;
_local1.bl = _local2.bl;
_local1.tt = _local2.tt;
return(_local1);
}
}
static var SHARED_OBJECT_NAME = "saucerRacerTimes";
}
Symbol 1242 MovieClip [__Packages.TrackProgress] Frame 0
class TrackProgress extends Array
{
var lapTimes, checkpointTimes, length, saucer, finishTime;
function TrackProgress (g) {
super();
var _local3 = g;
lapTimes = [0];
checkpointTimes = [];
}
function checkProgress(l) {
var _local3 = this[curCheckpoint];
if (_local3.isIntersecting(l)) {
curCheckpoint++;
curCheckpoint = curCheckpoint % length;
progress++;
checkpointTimes[checkpointTimes.length] = game.elapsedTime;
var _local4 = true;
if (curCheckpoint == 1) {
if (laps == 0) {
laps++;
} else if (laps < totalLaps) {
lapTimes[laps++] = game.elapsedTime;
saucer.lapComplete(laps - 1);
} else {
isRaceComplete = true;
finishTime = game.elapsedTime;
progress = Math.floor(progress) + (game.saucers.length - saucer.__get__position());
lapTimes[laps] = game.elapsedTime;
game.checkRaceEnded(saucer);
saucer.lapComplete(laps);
return(undefined);
}
}
}
var _local2 = flash.geom.Point.distance(l.__get__end(), this[curCheckpoint].center) / 100000;
_local2 = 1 - ((_local2 > 0) ? (((_local2 < 1) ? (_local2) : 0.9999999999)) : 1E-9);
progress = Math.floor(progress) + _local2;
if (_local4) {
game.checkpointReached(saucer, checkpointTimes.length - 1);
}
}
function getLapCompleteFract(p) {
return(progress / (length - 1));
}
function bestLapTime() {
if (lapTimes.length > 1) {
var _local4 = Number.MAX_VALUE;
var _local2 = 1;
while (_local2 < lapTimes.length) {
var _local3 = lapTimes[_local2] - lapTimes[_local2 - 1];
_local4 = ((_local3 < _local4) ? (_local3) : (_local4));
_local2++;
}
return(_local4);
}
return(-1);
}
function clone() {
var _local3 = new TrackProgress(game);
var _local2 = 0;
while (_local2 < length) {
_local3[_local2] = this[_local2];
_local2++;
}
_local3.curCheckpoint = curCheckpoint;
_local3.laps = laps;
_local3.totalLaps = totalLaps;
return(_local3);
}
function toString() {
var _local3 = "";
var _local2 = 0;
while (_local2 < length) {
_local3 = _local3 + ((((_local2 + 1) + " ") + this[_local2]) + newline);
_local2++;
}
return(_local3);
}
var curCheckpoint = 0;
var progress = 0;
var laps = 0;
var totalLaps = 1;
var isRaceComplete = false;
}
Symbol 1243 MovieClip [__Packages.cust.geom3D.Sprite] Frame 0
class cust.geom3D.Sprite extends MovieClip
{
var v, c, cto, x, y, z, s, _visible, _parent, _x, _y, swapDepths, _xscale, _yscale, removeMovieClip;
function Sprite () {
super();
v = new cust.geom3D.Vector(0, 0, 0);
c = new Color(this);
cto = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
}
function init(sx, sy, sz, s) {
x = sx;
y = sy;
z = sz;
this.s = (isNaN(s) ? 1 : (s));
}
function hide(t) {
if (t != _hide) {
if (t) {
_visible = false;
_parent.removeListener(this);
} else {
_parent.addListener(this);
}
_hide = t;
}
}
function render(vp, r, lights, a, vd) {
var _local20 = cs(vp.rx);
var _local18 = sn(vp.rx);
var _local19 = cs(vp.ry);
var _local16 = sn(vp.ry);
var _local17 = cs(vp.rz);
var _local15 = sn(vp.rz);
v.x = x;
v.y = y;
v.z = z;
v.update(vp.x, vp.y, vp.z, _local20, _local18, _local19, _local16, _local17, _local15, vp.fl);
if (v._z < 0) {
_visible = false;
return(undefined);
}
if (v._z > vd) {
_visible = false;
return(undefined);
}
_visible = true;
_x = v._x;
_y = v._y;
if (v.y < 0) {
swapDepths(((vp.viewDist - v._z) + (vp.viewDist * 2)) + 1);
} else if (v.y == 0) {
swapDepths(((vp.viewDist - v._z) + vp.viewDist) + 1);
} else {
swapDepths(vp.viewDist - v._z);
}
if (s) {
_xscale = (_yscale = (v.scale * 100) * s);
}
if (_visible) {
if ((R > 0) && (L < 1)) {
var _local2;
var _local12 = 0;
var _local9 = 0;
var _local10 = 0;
var _local7;
var _local6;
var _local5;
var _local3;
var _local8;
var _local4 = 0;
while (_local4 < lights.length) {
_local2 = lights[_local4];
if (_local2.p > 0) {
_local7 = _local2.x - v.x;
_local6 = _local2.y - v.y;
_local5 = _local2.z - v.z;
_local8 = Math.sqrt(((_local7 * _local7) + (_local6 * _local6)) + (_local5 * _local5));
_local3 = (_local2.p * cust.geom3D.Light.c) * (1 / (_local8 * _local8));
} else {
_local3 = 1;
}
_local12 = _local12 + (_local3 * _local2.r);
_local9 = _local9 + (_local3 * _local2.g);
_local10 = _local10 + (_local3 * _local2.b);
_local4++;
}
_local12 = (a + (_local12 * R)) + L;
_local9 = (a + (_local9 * R)) + L;
_local10 = (a + (_local10 * R)) + L;
_local12 = ((_local12 > 0) ? (((_local12 < 1) ? (_local12) : 1)) : 0);
_local9 = ((_local9 > 0) ? (((_local9 < 1) ? (_local9) : 1)) : 0);
_local10 = ((_local10 > 0) ? (((_local10 < 1) ? (_local10) : 1)) : 0);
cto.ra = _local12 * 100;
cto.ga = _local9 * 100;
cto.ba = _local10 * 100;
} else {
cto.ra = 100;
cto.ga = 100;
cto.ba = 100;
}
c.setTransform(cto);
}
}
function die() {
_parent.removeListener(this);
removeMovieClip();
}
var cs = Math.cos;
var sn = Math.sin;
var at = Math.atan2;
var mx = Math.max;
var mn = Math.min;
var pi2 = (Math.PI/2);
var L = 0;
var R = 1;
var _hide = false;
}
Symbol 1244 MovieClip [__Packages.cust.geom3D.Vector] Frame 0
class cust.geom3D.Vector
{
function Vector (sx, sy, sz) {
x = sx;
y = sy;
z = sz;
}
function update(vx, vy, vz, cx, sx, cy, sy, cz, sz, fl) {
vx = x - vx;
vy = y - vy;
vz = z - vz;
var _local7 = (cz * vx) - (sz * vy);
var _local6 = (cz * vy) + (sz * vx);
var _local10 = (cy * _local7) - (sy * vz);
var _local5 = (cy * vz) + (sy * _local7);
var _local9 = (cx * _local6) - (sx * _local5);
var _local8 = (cx * _local5) + (sx * _local6);
_z = _local8;
scale = fl / (fl + _local8);
_x = _local10 * scale;
_y = _local9 * scale;
}
function add(v) {
return(new cust.geom3D.Vector(x + v.x, y + v.y, z + v.z));
}
function mark(mc) {
mc.moveTo(_x + MARK_SIZE, _y + MARK_SIZE);
mc.lineTo(_x - MARK_SIZE, _y - MARK_SIZE);
mc.moveTo(_x + MARK_SIZE, _y - MARK_SIZE);
mc.lineTo(_x - MARK_SIZE, _y + MARK_SIZE);
}
function clone() {
return(new cust.geom3D.Vector(x, y, z));
}
function toString() {
return((((("x:" + x) + ", y:") + y) + ", z:") + z);
}
var x = 0;
var y = 0;
var z = 0;
var _x = 0;
var _y = 0;
var _z = 0;
var scale = 1;
static var MARK_SIZE = 5;
}
Symbol 1245 MovieClip [__Packages.cust.geom3D.Viewpoint] Frame 0
class cust.geom3D.Viewpoint extends cust.geom3D.Vector
{
var x, y, z;
function Viewpoint (sx, sy, sz, f, srx, sry, srz) {
super(sx, sy, sz);
fl = (isNaN(f) ? 200 : (f));
rx = (isNaN(srx) ? 0 : (srx));
ry = (isNaN(sry) ? 0 : (sry));
rz = (isNaN(srz) ? 0 : (srz));
}
function dolly(n) {
var _local8 = Math.cos(rx);
var _local6 = Math.sin(rx);
var _local7 = Math.cos(ry);
var _local4 = Math.sin(ry);
var _local5 = Math.cos(rz);
var _local3 = Math.sin(rz);
x = x + ((n * Math.sin(ry)) * Math.cos(rx));
y = y + (n * Math.sin(rx));
z = z + (n * Math.cos(ry));
}
function clone() {
return(new cust.geom3D.Viewpoint(x, y, z, fl, rx, ry, rz));
}
function toString() {
return(((((((((((((("{ x:" + x) + ", y:") + y) + ", z:") + z) + ", rx:") + rx) + ", ry:") + ry) + ", rz:") + rz) + ", fl:") + fl) + " }");
}
var fl = 200;
var viewDist = 10000;
var rx = 0;
var ry = 0;
var rz = 0;
}
Symbol 1246 MovieClip [__Packages.cust.geom3D.Light] Frame 0
class cust.geom3D.Light
{
function Light (sx, sy, sz, red, green, blue, pow) {
x = sx;
y = sy;
z = sz;
r = ((red > 0) ? (((red < 1) ? (red) : 1)) : 0);
g = ((green > 0) ? (((green < 1) ? (green) : 1)) : 0);
b = ((blue > 0) ? (((blue < 1) ? (blue) : 1)) : 0);
p = ((pow > 0) ? (((pow < 1) ? (pow) : 1)) : 0);
}
var x = 0;
var y = 0;
var z = 0;
var r = 1;
var g = 1;
var b = 1;
var p = 0;
static var c = 50000000;
}
Symbol 1247 MovieClip [__Packages.cust.geom3D.RotatableSprite] Frame 0
class cust.geom3D.RotatableSprite extends cust.geom3D.Sprite
{
var at, x, z, gotoAndStop, _totalframes;
function RotatableSprite () {
super();
}
function render(vp, r, lights, a, vd) {
super.render(vp, r, lights, a, vd);
var _local4 = Math.PI;
var _local6 = fixAng(vp.ry);
var _local3 = at(x - vp.x, z - vp.z);
_local3 = fixAng(_local3 - _local6);
var _local7 = fixAng(_local6 - fixAng(ry));
var _local8 = fixAng((_local7 + _local3) + Math.PI);
gotoAndStop(Math.ceil(((_local8 + _local4) / (2 * _local4)) * _totalframes));
}
static function FIX_ANG(a) {
var _local1 = Math.PI;
return(((a + (103 * _local1)) % (2 * _local1)) - Math.PI);
}
var rx = 0;
var ry = 0;
var rz = 0;
var fixAng = FIX_ANG;
}
Symbol 1248 MovieClip [__Packages.Saucer] Frame 0
class Saucer
{
var maxSpeed, game, track, checkpoints, engineOldState, engineState, movementLine, mc, ball, snd, airoute, targWaypointN, targWaypoint, curWaypointN, curWaypoint, sectorN, sector, isOnTrack, isFallenOff, isInTrack, spin, alteredDragTime, alteredAccelTime, alteredMassTime, tBoostTime, p, tBoostSnd, shuntSnd, tumbleTime, alteredAccel, alteredDrag;
function Saucer (g, startPos, n, perf, route, perfModifier) {
mass = perf.mass;
baseDrag = perf.drag;
baseAccel = perf.accel;
turnSpeed = perf.turnSpeed;
maxSpeed = accel + (accel * drag);
game = g;
track = game.track;
checkpoints = track.checkpoints.clone();
checkpoints.saucer = this;
engineOldState = (engineState = ENGINE_IDLE);
movementLine = new cust.geom2D.LineSegment(0, 0, 0, 0);
mc = game.sprites.spawnSprite(n, n, 0, 0, 0, 3.75);
mc.saucer = this;
ball = new SaucerBall(this, 0, 0, RADIUS, 0, 0, mass);
snd = game.snd_man.newSound(n + SAUCER_LOOP);
_global.setTimeout(this, "startSnd", Math.random() * 100);
snd.onSoundComplete = Delegate.create(snd, snd.onSoundComplete, 0, 100000000);
snd.setVolume(0);
airoute = route;
targWaypointN = 1;
targWaypoint = airoute[targWaypointN];
curWaypointN = 2;
curWaypoint = airoute[curWaypointN];
baseAccel = baseAccel * perfModifier.accel;
baseDrag = baseDrag + perfModifier.drag;
turnSpeed = turnSpeed + perfModifier.turnSpeed;
ball._mass = ball._mass + perfModifier.mass;
setPos(startPos);
}
function startSnd() {
snd.start(0, 100000000);
snd.setVolume(0);
}
function setPos(startPos) {
ball.x = startPos.x;
ball.y = startPos.y;
if (ball.collisionDetection(game.balls)) {
var _local4 = startPos.clone();
var _local2 = Math.PI;
var _local3 = 0;
do {
_local2 = _local2 + AVOID_COLLISION_ROT_STEP;
if (_local2 > Math.PI) {
_local2 = -3.14159265358979;
_local3 = _local3 + AVOID_COLLISION_DIST_STEP;
}
ball.x = _local4.x + (_local3 * Math.cos(_local2));
ball.y = _local4.y + (_local3 * Math.sin(_local2));
} while (ball.collisionDetection(game.balls));
startPos.x = ball.x;
startPos.y = ball.y;
}
sectorN = game.track.getSectorContainsPoint(startPos);
sector = game.track.wideSectors[sectorN];
px = (x = startPos.x);
py = (y = -50);
pz = (z = startPos.y);
ry = startPos.a;
vx = (vy = (vz = (speed = 0)));
isOnTrack = true;
isFallenOff = false;
isInTrack = true;
isTumbling = false;
gss = 0;
spin = 0;
delete alteredDragTime;
delete alteredAccelTime;
delete alteredMassTime;
delete tBoostTime;
p = new flash.geom.Point();
movementLine.x1 = x;
movementLine.y1 = z;
movementLine.x2 = x;
movementLine.y2 = z;
gss = 0;
mc._rotation = 0;
mc.teleport.gotoAndPlay("end");
isTeleportStarted = false;
}
function lapComplete(laps) {
if (tBoosts == 0) {
tBoosts = (2);
}
}
function doTBoost() {
tBoosts = ((tBoosts-1));
tBoostTime = T_BOOST_DURATION;
if (tBoostSnd) {
delete tBoostSnd.onSoundComplete;
}
tBoostSnd = game.snd_man.newSound(T_BOOST_SND);
tBoostSnd.setPosition(p.x, p.y);
tBoostSnd.start();
tBoostSnd.setInitVol(100);
tBoostSnd.onSoundComplete = Delegate.create(this, tBoostSndComplete);
}
function tBoostEnded() {
}
function tBoostSndComplete() {
tBoostSnd.remove();
delete tBoostSnd;
}
function startShunt() {
if (!shuntSnd) {
shuntSnd = game.snd_man.newSound(SHUNT_SND);
shuntSnd.setPosition(p.x, p.y);
shuntSnd.start(0, 99999999);
shuntSnd.setInitVol(100);
}
}
function stopShunt() {
shuntSnd.remove();
delete shuntSnd;
}
function update(ftime) {
if (isOnTrack) {
vx = vx * Math.pow(drag, ftime);
vz = vz * Math.pow(drag, ftime);
}
control(ftime);
vy = vy + (Game.GRAVITY * ftime);
if (isOnTrack) {
vy = 0;
y = TRACK_BASE_HEIGHT;
}
if (isTumbling) {
tumbleTime = tumbleTime - ftime;
if (tumbleTime <= 0) {
isTumbling = false;
ry = cust.geom3D.RotatableSprite.FIX_ANG(ry);
}
}
if (alteredDragTime) {
alteredDragTime = alteredDragTime - ftime;
if (alteredDragTime <= 0) {
mc.stopFrict();
delete alteredDragTime;
}
}
if (alteredAccelTime) {
alteredAccelTime = alteredAccelTime - ftime;
if (alteredAccelTime <= 0) {
mc.stopAccel();
delete alteredAccelTime;
}
}
if (alteredMassTime) {
alteredMassTime = alteredMassTime - ftime;
if (alteredMassTime <= 0) {
mc.stopShunt();
stopShunt();
delete alteredMassTime;
}
}
if (tBoostTime) {
tBoostTime = tBoostTime - ftime;
if (tBoostTime <= 0) {
tBoostEnded();
delete tBoostTime;
}
}
if (isFallenOff || (isTumbling)) {
mc._rotation = mc._rotation + (gss * ftime);
} else {
mc._rotation = 0;
}
speed = Math.sqrt((vx * vx) + (vz * vz));
px = x;
py = y;
pz = z;
x = x + (vx * ftime);
y = y + (vy * ftime);
z = z + (vz * ftime);
if (isInTrack && (y > 0)) {
isOnTrack = true;
y = TRACK_BASE_HEIGHT;
} else if (y > 0) {
isFallenOff = true;
}
ball.v.x = vx;
ball.v.y = vz;
ball.x = x;
ball.y = z;
p.x = x;
p.y = z;
if (tBoostSnd) {
tBoostSnd.setPositionPoint(p);
}
if (shuntSnd) {
shuntSnd.setPositionPoint(p);
}
snd.setPositionPoint(p);
var _local3 = accel / maxSpeed;
if (this instanceof Player) {
_local3 = _local3 / 3;
}
var _local5 = ((engineState == ENGINE_IDLE) ? (SAUCER_SND_MIN_VOL) : (SAUCER_SND_MIN_VOL + ((SAUCER_SND_MAX_VOL - SAUCER_SND_MIN_VOL) * _local3)));
var _local4 = snd.getVolume();
snd.setVolume(_local4 + ((_local5 - _local4) / SND_CHANGE_PAD));
if (!isTeleportStarted) {
if (y >= FALLEN) {
isTeleportStarted = true;
mc.teleport.gotoAndPlay("begin");
}
}
}
function control(ftime) {
engineOldState = engineState;
if (!isTumbling) {
var _local2 = false;
if (ftime) {
engineState = ENGINE_ACTIVE;
}
if (targWaypoint.isLineSegmentIntersecting(movementLine)) {
_local2 = true;
} else {
var _local7 = Math.sqrt(Math.pow(curWaypoint.x - x, 2) + Math.pow(curWaypoint.y - z, 2));
if (_local7 < MIN_WAYPOINT_TEST) {
_local2 = true;
}
}
if (_local2) {
targWaypointN = (targWaypointN + 1) % airoute.length;
targWaypoint = airoute[targWaypointN];
curWaypointN = (curWaypointN + 1) % airoute.length;
curWaypoint = airoute[curWaypointN];
}
var _local5 = Math.atan2(curWaypoint.x - x, curWaypoint.y - z);
var _local6 = fixAng(_local5 - fixAng(ry));
var _local3 = turnSpeed * ftime;
if (Math.abs(_local6) > _local3) {
if (_local6 > 0) {
ry = ry + _local3;
} else {
ry = ry - _local3;
}
} else {
ry = _local5;
}
if (isOnTrack) {
vx = vx + ((accel * ftime) * Math.sin(ry));
vz = vz + ((accel * ftime) * Math.cos(ry));
}
} else {
if (isTumbling) {
ry = ry + (spin * ftime);
}
engineState = ENGINE_IDLE;
}
}
function jump(force) {
if (isOnTrack) {
vy = force;
isOnTrack = false;
}
}
function checkPosition() {
if (!isFallenOff) {
movementLine.x1 = px;
movementLine.y1 = pz;
movementLine.x2 = x;
movementLine.y2 = z;
if (!checkpoints.isRaceComplete) {
checkpoints.checkProgress(movementLine);
}
if (isInTrack) {
if (!sector.isPointInSector(p)) {
var _local2 = sectorN;
var _local3 = game.track.wideSectors.length;
if (((sectorN = game.track.getSectorContainsPoint(p))) > -1) {
sector = game.track.wideSectors[sectorN];
isInTrack = true;
} else {
if (isOnTrack) {
if (movementLine.isIntersecting(sector.l)) {
gss = -FALLING_SPIN_SPEED;
} else if (movementLine.isIntersecting(sector.r)) {
gss = FALLING_SPIN_SPEED;
}
}
sectorN = _local2;
isOnTrack = false;
isInTrack = false;
}
}
} else if (!isFallenOff) {
var _local2 = sectorN;
if (((sectorN = game.track.getSectorContainsPoint(p))) > -1) {
sector = game.track.wideSectors[sectorN];
isInTrack = true;
} else {
sectorN = _local2;
}
}
}
}
function checkItems(items, ftime) {
var _local3;
var _local2 = 0;
while (_local2 < items.length) {
_local3 = items[_local2];
if (!_local3.containsPoint(movementLine.__get__start())) {
if (_local3.isLineIntersecting(movementLine)) {
_local3.applyEffect(this, ftime);
}
}
_local2++;
}
}
function checkObstacles(obstacles, ftime) {
var _local2 = ball.collisionDetection(obstacles);
if (_local2) {
_local2.barrierHit();
ball.collisionResponse(_local2);
mc.hit();
vx = ball.v.x;
vz = ball.v.y;
x = ball.x;
z = ball.y;
}
}
function collisionDetection(a) {
var _local2 = ball.collisionDetection(a);
if (_local2) {
return(_local2.saucer);
}
}
function collisionResponse(s) {
ball.collisionResponse(s.ball);
vx = ball.v.x;
vz = ball.v.y;
x = ball.x;
z = ball.y;
s.vx = s.ball.v.x;
s.vz = s.ball.v.y;
s.x = s.ball.x;
s.z = s.ball.y;
}
function render() {
mc.x = x;
mc.y = y + (Math.random() * HEIGHT_JIGGLE);
mc.z = z;
mc.ry = ry;
}
function fallenOff() {
var _local2 = ((sectorN + game.track.wideSectors.length) - 1) % game.track.wideSectors.length;
setPos(game.track.wideSectors[_local2].center);
}
function get position() {
var _local3 = game.saucers;
var _local4 = 1;
var _local5 = checkpoints.progress;
var _local2 = 0;
while (_local2 < _local3.length) {
if ((_local3[_local2] != this) && (_local5 < _local3[_local2].checkpoints.progress)) {
_local4++;
}
_local2++;
}
return(_local4);
}
function get accel() {
var _local2 = ((alteredAccelTime == undefined) ? (baseAccel) : (alteredAccel));
if (tBoostTime == undefined) {
return(_local2);
}
var _local3 = T_BOOST_POWER;
return(_local2 + _local3);
}
function get decel() {
return(accel * 0.5);
}
function get drag() {
return(((alteredDragTime == undefined) ? (baseDrag) : (alteredDrag)));
}
function get tBoosts() {
return(_tBoosts);
}
function set tBoosts(n) {
_tBoosts = ((n >= 0) ? (((n <= 2) ? (n) : 2)) : 0);
//return(tBoosts);
}
function die() {
snd.remove();
shuntSnd.remove();
tBoostSnd.remove();
}
function toString() {
return(((((((((((("(x=" + x) + ", y=") + y) + ", z=") + z) + ", vx=") + vx) + ", vy=") + vy) + ", vz=") + vz) + ", )");
}
var vx = 0;
var vy = 0;
var vz = 0;
var x = 0;
var y = 0;
var z = 0;
var rx = 0;
var ry = 0;
var rz = 0;
var px = 0;
var py = 0;
var pz = 0;
var gss = 0;
var mass = 100;
static var RADIUS = 225;
var baseDrag = 0.5;
var baseAccel = 7500;
var turnSpeed = 4;
var speed = 0;
var isTeleportStarted = false;
var isTumbling = false;
var fixAng = cust.geom3D.RotatableSprite.FIX_ANG;
var _tBoosts = 1;
static var MIN_WAYPOINT_TEST = 1200;
static var FALLEN = 1500;
static var AVOID_COLLISION_DIST_STEP = 150;
static var AVOID_COLLISION_ROT_STEP = (Math.PI/4);
static var FALLING_SPIN_SPEED = 200;
static var TRACK_BASE_HEIGHT = -100;
static var TRACK_HEIGHT_VARIANCE = 5;
static var ENGINE_IDLE = "idle";
static var ENGINE_ACTIVE = "active";
static var ENGINE_BOOST = "boost";
static var HEIGHT_JIGGLE = 15;
static var T_BOOST_POWER = 18000;
static var T_BOOST_DURATION = 0.6;
static var SAUCER_LOOP = "_loop";
static var SAUCER_SND_MIN_VOL = 15;
static var SAUCER_SND_MAX_VOL = 50;
static var SND_CHANGE_PAD = 3;
static var T_BOOST_SND = "tboost";
static var SHUNT_SND = "shunt";
}
Symbol 1249 MovieClip [__Packages.SaucerMc] Frame 0
class SaucerMc extends cust.geom3D.RotatableSprite
{
var frictEffect, accelEffect, shuntEffect, shieldEffect, fixAng, at, x, z, ry, gotoAndStop, _totalframes, fire, _currentframe, saucer;
function SaucerMc () {
super();
frictEffect.gotoAndStop(OFF);
accelEffect.gotoAndStop(OFF);
shuntEffect.gotoAndStop(OFF);
shieldEffect.gotoAndStop(OFF);
}
function render(vp, r, lights, a, vd) {
super.render(vp, r, lights, a, vd);
var _local4 = Math.PI;
var _local6 = fixAng(vp.ry);
var _local3 = at(x - vp.x, z - vp.z);
_local3 = fixAng(_local3 - _local6);
var _local7 = fixAng(_local6 - fixAng(ry));
var _local8 = fixAng((_local7 + _local3) + Math.PI);
gotoAndStop(Math.ceil(((_local8 + _local4) / (2 * _local4)) * _totalframes));
fire.update(_currentframe, _totalframes);
}
function hit() {
shieldEffect.gotoAndPlay(HIT);
}
function startFrict(good) {
frictEffect.gotoAndStop((good ? (ON_GOOD) : (ON_BAD)));
}
function stopFrict() {
frictEffect.gotoAndStop(OFF);
}
function startAccel() {
fire.transform.colorTransform = new flash.geom.ColorTransform(0.75, 0.75, 0.75, 1, 0, 64, 0, 0);
}
function stopAccel() {
fire.transform.colorTransform = new flash.geom.ColorTransform();
}
function startShunt() {
shuntEffect.gotoAndStop(ON);
}
function stopShunt() {
shuntEffect.gotoAndStop(OFF);
}
function onUnload() {
saucer.die();
}
var L = 1;
static var HIT = "hit";
static var ON = "on";
static var ON_GOOD = "onGood";
static var ON_BAD = "onBad";
static var OFF = "off";
}
Symbol 1250 MovieClip [__Packages.SaucerFire] Frame 0
class SaucerFire extends MovieClip
{
var saucer, _parent, gotoAndStop;
function SaucerFire () {
super();
saucer = _parent.saucer;
gotoAndStop(1);
}
function update(baseFrame, totalframes) {
var _local2;
if (saucer.engineOldState == Saucer.ENGINE_IDLE) {
if (saucer.engineState != Saucer.ENGINE_IDLE) {
gotoAndStop((IGNITE * totalframes) + baseFrame);
_local2 = "ignite";
} else {
gotoAndStop(1);
_local2 = "none";
}
} else if (saucer.engineOldState == Saucer.ENGINE_ACTIVE) {
if (saucer.engineState == Saucer.ENGINE_ACTIVE) {
gotoAndStop(((NORMAL + (f % NORMAL_RANGE)) * totalframes) + baseFrame);
_local2 = "burn";
} else if (saucer.engineState == Saucer.ENGINE_IDLE) {
gotoAndStop((OUT * totalframes) + baseFrame);
_local2 = "go out";
} else {
gotoAndStop(((BOOST + (f % BOOST_RANGE)) * totalframes) + baseFrame);
_local2 = "boost";
}
} else if (saucer.engineState == Saucer.ENGINE_ACTIVE) {
gotoAndStop(((NORMAL + (f % NORMAL_RANGE)) * totalframes) + baseFrame);
_local2 = "normal";
} else if (saucer.engineState == Saucer.ENGINE_IDLE) {
gotoAndStop((OUT * totalframes) + baseFrame);
_local2 = "go out";
} else {
gotoAndStop(((BOOST + (f % BOOST_RANGE)) * totalframes) + baseFrame);
_local2 = "boost";
}
f++;
}
var f = 0;
static var OUT = 1;
static var IGNITE = 2;
static var NORMAL = 3;
static var NORMAL_RANGE = 2;
static var BOOST = 5;
static var BOOST_RANGE = 2;
}
Symbol 1251 MovieClip [__Packages.Track] Frame 0
class Track
{
var game, trackParseCompleteHandler, sections, lp, rp, wideSections, wlp, wrp, sectors, wideSectors, startPositions, aiRoutes, obstacles, items, scale, laps, complexity, trackNode, airouteNode, sceneryNode, aiModifierNode, itemsNode, checkpoints, intId, scenery, aiModifier;
function Track () {
}
function makeTrack(g, str, madeTrackHandler) {
game = g;
trackParseCompleteHandler = madeTrackHandler;
var _local9 = new XML(str);
sections = [];
lp = [];
rp = [];
wideSections = [];
wlp = [];
wrp = [];
sectors = [];
wideSectors = [];
startPositions = [];
aiRoutes = [];
obstacles = [];
items = [];
var _local2;
var _local5 = _local9.firstChild;
scale = (_local5.attributes.scale ? (Number(_local5.attributes.scale)) : 1);
laps = (_local5.attributes.laps ? (Number(_local5.attributes.laps)) : 1);
complexity = (_local5.attributes.complexity ? (Number(_local5.attributes.complexity)) : 1);
var _local6 = getXMLNode(_local5, "startPosition");
_local2 = 0;
while (_local2 < _local6.childNodes.length) {
startPositions[_local2] = TrackStartPosition.fromXML(_local6.childNodes[_local2], scale);
_local2++;
}
trackNode = getXMLNode(_local5, "trackSections");
airouteNode = getXMLNode(_local5, "airoutes");
sceneryNode = getXMLNode(_local5, "scenery");
aiModifierNode = getXMLNode(_local5, "aiModifier");
itemsNode = getXMLNode(_local5, "items");
var _local3;
var _local7;
var _local4;
var _local8;
checkpoints = new TrackProgress(g);
checkpoints.totalLaps = laps;
_local2 = 0;
while (_local2 < trackNode.childNodes.length) {
_local3 = (sections[sections.length] = TrackSection.fromXML(this, trackNode.childNodes[_local2], scale));
_local4 = (wideSections[wideSections.length] = new TrackSection(this, _local3.end, _local3.control, _local3.endWidth + EDGE_SIZE, _local3.controlWidth + EDGE_SIZE));
if (_local2 > 0) {
_local3.init(_local7, false);
_local4.init(_local8, false);
}
_local7 = _local3;
_local8 = _local4;
_local2++;
}
sections[0].init(_local3, true);
wideSections[0].init(_local4, true);
_local2 = 0;
while (_local2 < sections.length) {
sections[_local2].setBeziers();
wideSections[_local2].setBeziers();
if ((_local2 % 5) == 0) {
checkpoints.push(new Checkpoint(wideSections[_local2].lEdge.start.x, wideSections[_local2].lEdge.start.y, wideSections[_local2].rEdge.start.x, wideSections[_local2].rEdge.start.y, sections[_local2].lEdge.start.x, sections[_local2].lEdge.start.y, sections[_local2].rEdge.start.x, sections[_local2].rEdge.start.y));
}
_local2++;
}
createBeziers();
}
function createBeziers() {
var _local5;
var _local4;
var _local6 = 0;
var _local7 = 0;
var _local3 = 0;
while (_local3 < sections.length) {
_local5 = sections[_local3].getPoints(_local6);
_local4 = wideSections[_local3].getPoints(_local7);
_local6 = _local5.offset;
_local7 = _local4.offset;
lp = lp.concat(_local5.lp);
rp = rp.concat(_local5.rp);
wlp = wlp.concat(_local4.lp);
wrp = wrp.concat(_local4.rp);
_local3++;
}
intId = _global.setTimeout(this, "doCreateBezier", parsePassWait, 0);
}
function doCreateBezier(startPoint) {
var _local3;
_local3 = startPoint;
while ((_local3 < lp.length) && (_local3 < (startPoint + beziersPerPass))) {
minX = mn(wlp[_local3].x, wrp[_local3].x, minX);
maxX = mx(wlp[_local3].x, wrp[_local3].x, maxX);
minY = mn(wlp[_local3].y, wrp[_local3].y, minY);
maxY = mx(wlp[_local3].y, wrp[_local3].y, maxY);
sectors[sectors.length] = new TrackSector(this, lp[_local3], rp[_local3], rp[(_local3 + 1) % rp.length], lp[(_local3 + 1) % lp.length]);
wideSectors[wideSectors.length] = new TrackSector(this, wlp[_local3], wrp[_local3], wrp[(_local3 + 1) % wrp.length], wlp[(_local3 + 1) % wlp.length]);
_local3++;
}
game.loadingScreen.setProgress(bezierParseProgressWeight * (_local3 / lp.length));
if (_local3 == lp.length) {
onCreateBeziersComplete();
} else {
intId = _global.setTimeout(this, "doCreateBezier", parsePassWait, _local3);
}
}
function onCreateBeziersComplete() {
var _local4;
var _local5;
var _local6 = wideSectors.length;
var _local3 = 0;
while (_local3 < wideSectors.length) {
_local4 = wideSectors[_local3];
_local5 = wideSectors[(_local3 + 1) % wideSectors.length];
wideSectors[_local3].center.a = (Math.PI/2) - Math.atan2(_local5.center.y - _local4.center.y, _local5.center.x - _local4.center.x);
_local3++;
}
area = (maxX - minX) * (maxY - minY);
intId = _global.setTimeout(this, "parseAI", parsePassWait, 0);
}
function parseAI(i) {
var _local4;
_local4 = airouteNode.childNodes[i];
aiRoutes.push(new AiRoute(this, _local4, scale));
game.loadingScreen.setProgress(bezierParseProgressWeight + (((i + 1) / airouteNode.childNodes.length) * aiParseProgressWeight));
if (i == (airouteNode.childNodes.length - 1)) {
completeParsing();
} else {
intId = _global.setTimeout(this, "parseAI", parsePassWait, i + 1);
}
}
function completeParsing() {
scenery = [];
var _local2;
_local2 = 0;
while (_local2 < sceneryNode.childNodes.length) {
scenery.push(new TrackScenery(scale, sceneryNode.childNodes[_local2]));
_local2++;
}
aiModifier = SaucerPerfModifier.fromXML(aiModifierNode);
_local2 = 0;
while (_local2 < itemsNode.childNodes.length) {
items.push(new TrackItem(scale, itemsNode.childNodes[_local2], this));
_local2++;
}
trackParseCompleteHandler();
}
function getSectorContainsPoint(p) {
var _local2 = 0;
while (_local2 < wideSectors.length) {
if (wideSectors[_local2].isPointInSector(p)) {
return(_local2);
}
_local2++;
}
return(-1);
}
function render(target, scale, fillCol, fillAlpha) {
target.beginFill(fillCol, fillAlpha);
target.moveTo(lp[lp.length - 1].y, lp[lp.length - 1].x);
var _local2 = 0;
while (_local2 < lp.length) {
target.lineTo(lp[_local2].y, lp[_local2].x);
_local2++;
}
target.moveTo(rp[rp.length - 1].y, rp[rp.length - 1].x);
_local2 = 0;
while (_local2 < rp.length) {
target.lineTo(rp[_local2].y, rp[_local2].x);
_local2++;
}
target.endFill();
}
function mn() {
var _local3 = Number.MAX_VALUE;
var _local2 = 0;
while (_local2 < arguments.length) {
_local3 = ((_local3 < arguments[_local2]) ? (_local3) : (arguments[_local2]));
_local2++;
}
return(_local3);
}
function mx() {
var _local3 = Number.MIN_VALUE;
var _local2 = 0;
while (_local2 < arguments.length) {
_local3 = ((_local3 > arguments[_local2]) ? (_local3) : (arguments[_local2]));
_local2++;
}
return(_local3);
}
static function getXMLNode(xmlNode, n) {
var _local1 = 0;
while (_local1 < xmlNode.childNodes.length) {
if (xmlNode.childNodes[_local1].nodeName == n) {
return(xmlNode.childNodes[_local1]);
}
_local1++;
}
}
var minX = Number.MAX_VALUE;
var maxX = Number.MIN_VALUE;
var minY = Number.MAX_VALUE;
var maxY = Number.MIN_VALUE;
var area = 0;
static var POINT_SEPARATION = 1800;
static var EDGE_SIZE = Saucer.RADIUS;
var beziersPerPass = 10;
var parsePassWait = 10;
var bezierParseProgressWeight = 0.25;
var aiParseProgressWeight = 1 - Track.prototype.bezierParseProgressWeight;
static var rd = 57.2957795130823;
static var hPI = (Math.PI/2);
}
Symbol 1252 MovieClip [__Packages.RGB] Frame 0
class RGB
{
function RGB (R, G, B) {
r = (isNaN(R) ? 0 : (((R > 255) ? 255 : (((R < 0) ? 0 : (R))))));
g = (isNaN(G) ? 0 : (((G > 255) ? 255 : (((G < 0) ? 0 : (G))))));
b = (isNaN(B) ? 0 : (((B > 255) ? 255 : (((B < 0) ? 0 : (B))))));
}
function toString(d) {
var _local3 = ((((r > 255) ? 255 : (r)) << 16) | (((g > 255) ? 255 : (g)) << 8)) | ((b > 255) ? 255 : (b));
d = (isNaN(d) ? 16 : (d));
return("0x" + _local3.toString(d));
}
function valueOf() {
return(((((r > 255) ? 255 : (r)) << 16) | (((g > 255) ? 255 : (g)) << 8)) | ((b > 255) ? 255 : (b)));
}
function get _rgb() {
return(((((r > 255) ? 255 : (r)) << 16) | (((g > 255) ? 255 : (g)) << 8)) | ((b > 255) ? 255 : (b)));
}
function set _rgb(c) {
r = c >> 16;
g = (c >> 8) & 255;
b = c & 255;
//return(_rgb);
}
static function makeRGB(r, g, b) {
return(((((r > 255) ? 255 : (r)) << 16) | (((g > 255) ? 255 : (g)) << 8)) | ((b > 255) ? 255 : (b)));
}
static function fromRGB(c) {
return(new RGB(c >> 16, (c >> 8) & 255, c & 255));
}
static function interpolate(c1, c2, f) {
var _local1 = 1 - f;
return(new RGB((c1.r * _local1) + (c2.r * f), (c1.g * _local1) + (c2.g * f), (c1.b * _local1) + (c2.b * f)));
}
var r = 0;
var g = 0;
var b = 0;
}
Symbol 1253 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
var AI_targetPower, AI_targetFriction, shinyTrackBmp, shinyTrackRect, menu_anim, _parent, game_transition, loadingScreen, snd_man, aiSkills, basePerf, raceNum, mapParseStartTime, playerCharN, floor, sprites, dots, bmpHolder, bmp, trackBmp, bitmapMatrix, track, cam, dotsCam, mic, light, lastTime, origin, saucers, opponents, balls, player, map, elapsedTime, hud, recommendedDetailLvl, onEnterFrame, countdown, allCheckpointMesh, allScenery, mqs, lqs, startLinePolys, checkPointPolys, _x, stars, intId, bg;
function Game () {
super();
AI_targetPower = 1.960875;
AI_targetFriction = 0.02;
ACCEL_ADJUST_PER_TRACK = AI_targetPower / AI_totalTracks;
DRAG_ADJUST_PER_TRACK = AI_targetFriction - (AI_baseFriction / AI_totalTracks);
TURN_ADJUST_PER_TRACK = AI_targetTurnSpeed - (AI_baseTurnSpeed / AI_totalTracks);
shinyTrackBmp = flash.display.BitmapData.loadBitmap(SHINY_TRACK_BMP);
shinyTrackRect = new flash.geom.Rectangle(0, 0, wWidth, bmpHeight);
menu_anim = _parent.menu_anim;
game_transition = _parent.game_transition;
loadingScreen = game_transition.loadingScreen;
snd_man = new cust.snd3D.SoundManager3D(this);
aiSkills = [];
basePerf = new SaucerPerf(375, 0.25, 6000, 2.5);
aiSkills.push(new SaucerPerf(290, AI_baseFriction * 0.9, AI_basePower * 1.1, AI_baseTurnSpeed * 1.1));
aiSkills.push(new SaucerPerf(290, AI_baseFriction * 1.4, AI_basePower * 0.4, AI_baseTurnSpeed * 0.8));
aiSkills.push(new SaucerPerf(230, AI_baseFriction, AI_basePower * 0.9, AI_baseTurnSpeed));
aiSkills.push(new SaucerPerf(350, AI_baseFriction * 0.9, AI_basePower * 1.18, AI_baseTurnSpeed * 1.2));
aiSkills.push(new SaucerPerf(260, AI_baseFriction * 1.2, AI_basePower * 0.6, AI_baseTurnSpeed));
}
function initLevel(trackStr, pcn, rn) {
raceNum = rn;
mapParseStartTime = getTimer();
playerCharN = pcn;
floor.init(wWidth / 2, wHeight / 2, wWidth, wHeight, 0, true);
sprites.init(wWidth / 2, wHeight / 2, wWidth, wHeight, 0, true);
dots.init(wWidth / 2, wHeight / 2, wWidth, wHeight, 0, true);
bmpHolder = sprites.makePlane();
bmpHolder._x = (-wWidth) / 2;
bmpHolder._y = ((-wHeight) / 2) + (wHeight - bmpHeight);
bmp = new flash.display.BitmapData(wWidth, bmpHeight, true, 0);
trackBmp = new flash.display.BitmapData(wWidth, bmpHeight, true, 0);
bmpHolder.attachBitmap(bmp, 0);
bitmapMatrix = new flash.geom.Matrix();
bitmapMatrix.translate(0, -(wHeight - bmpHeight));
track = new Track();
track.makeTrack(this, trackStr, Delegate.create(this, onMadeTrack));
}
function onMadeTrack() {
cam = new cust.geom3D.Viewpoint(track.sections[0].start.x, CAM_Y, track.sections[0].start.y, CAM_FL, 0.2, -1.5707963267949, 0);
dotsCam = new cust.geom3D.Viewpoint(track.sections[0].start.x, CAM_Y, track.sections[0].start.y, DOTS_FL, 0.2, -1.5707963267949, 0);
cam.viewDist = 25000;
dotsCam.viewDist = spriteClipDist;
mic = new cust.snd3D.Mic();
light = new cust.geom3D.Light(0, 0, 0, 1, 1, 1, 500);
sprites.lights.push(light);
dots.lights.push(light);
lastTime = new Date().valueOf();
origin = new flash.geom.Point();
floor._visible = false;
parseTrack();
var _local3;
saucers = [];
opponents = [];
balls = [];
var _local5 = new SaucerPerfModifier(raceNum * DRAG_ADJUST_PER_TRACK, 1 + (raceNum * ACCEL_ADJUST_PER_TRACK), raceNum * TURN_ADJUST_PER_TRACK, raceNum * MASS_ADJUST_PER_TRACK);
var _local4 = 0;
while ((_local4 < track.startPositions.length) && (_local4 < _global.root.racerDetails.length)) {
if (_local4 == playerCharN) {
_local3 = (player = new Player(this, track.startPositions[_local4], "saucer" + _local4, basePerf, track.aiRoutes[0], new SaucerPerfModifier(_global.shipUpgrades.handlingDrag[_global.upgradesLevels.handling], _global.shipUpgrades.speed[_global.upgradesLevels.speed] * _global.shipUpgrades.handlingPower[_global.upgradesLevels.handling], _global.shipUpgrades.turnSpeed[_global.upgradesLevels.turnSpeed])));
} else {
_local3 = new AISaucer(this, track.startPositions[_local4], "saucer" + _local4, aiSkills[opponents.length], track.aiRoutes[opponents.length], _local5);
opponents.push(_local3);
}
saucers.push(_local3);
balls.push(_local3.ball);
_local4++;
}
map.init(this);
game_transition.gotoAndPlay("out");
game_transition.onSlideOut = Delegate.create(this, startCountDown);
elapsedTime = 0;
isPaused = false;
isRunning = false;
_local4 = 0;
while (_local4 < saucers.length) {
saucers[_local4].update(0);
_local4++;
}
map.update();
hud.init(track);
var _local6 = getTimer() - mapParseStartTime;
if (!recommendedDetailLvl) {
if (_local6 < (FAST_MAP_PARSING * track.complexity)) {
recommendedDetailLvl = 3;
} else if (_local6 < (MED_MAP_PARSING * track.complexity)) {
recommendedDetailLvl = 2;
} else {
recommendedDetailLvl = 1;
}
}
setDetailLevel(curDetailLvl);
onEnterFrame = gameLoop;
}
function startCountDown() {
if (!_global.hasSeenHowToPlay) {
menu_anim.gotoAndPlay("in");
menu_anim.menu_mc.gotoAndStop("how to play start");
_global.hasSeenHowToPlay = true;
} else {
countdown.gotoAndPlay("start");
}
}
function beginLevel() {
elapsedTime = 0;
isRunning = true;
isPaused = false;
}
function parseTrack() {
var _local7;
var _local21;
var _local30;
var _local4;
var _local11;
var _local3;
var _local9;
var _local2 = 0;
while (_local2 < track.lp.length) {
if ((_local2 % 1) == 0) {
_local7 = Math.ceil(flash.geom.Point.distance(track.lp[_local2], track.rp[_local2]) / maxLineLength);
_local21 = track.rp[_local2];
_local3 = 1;
while (_local3 <= _local7) {
_local4 = flash.geom.Point.interpolate(track.lp[_local2], track.rp[_local2], (1 / _local7) * _local3);
_local21 = _local4;
_local3++;
}
}
_local7 = Math.ceil(flash.geom.Point.distance(track.lp[_local2], track.lp[(_local2 + 1) % track.lp.length]) / maxLineLength);
_local11 = track.lp[_local2];
_local3 = 1;
while (_local3 <= _local7) {
_local4 = flash.geom.Point.interpolate(track.lp[_local2], track.lp[(_local2 + 1) % track.lp.length], 1 - ((1 / _local7) * _local3));
floor.makeTrackEdge((("left" + _local2) + "_") + _local3, _local11.x, 0, _local11.y, _local4.x, 0, _local4.y, 2298478591);
_local11 = _local4;
_local3++;
}
_local7 = Math.ceil(flash.geom.Point.distance(track.rp[_local2], track.rp[(_local2 + 1) % track.rp.length]) / maxLineLength);
_local11 = track.rp[_local2];
_local3 = 1;
while (_local3 <= _local7) {
_local4 = flash.geom.Point.interpolate(track.rp[_local2], track.rp[(_local2 + 1) % track.rp.length], 1 - ((1 / _local7) * _local3));
floor.makeTrackEdge((("right" + _local2) + "_") + _local3, _local4.x, 0, _local4.y, _local11.x, 0, _local11.y, 2298478591);
_local11 = _local4;
_local3++;
}
_local2++;
}
allCheckpointMesh = [];
allScenery = [];
mqs = [];
lqs = [];
var _local10;
var _local16 = 400;
var _local20 = 188;
var _local15 = flash.geom.Point.distance(track.lp[0], track.rp[0]);
var _local17 = Math.atan2(track.lp[0].y - track.rp[0].y, track.lp[0].x - track.rp[0].x);
_local10 = sprites.spawnSprite("startLineLeft", "startline", track.lp[0].x, 0, track.lp[0].y, 5);
track.obstacles.push(new cust.geom2D.Ball(_local10.x, _local10.z, 50, 0, 0, 500, 0.1));
allScenery.push(_local10);
mqs.push(_local10);
lqs.push(_local10);
_local10 = sprites.spawnSprite("startLineRight", "startline", track.rp[0].x, 0, track.rp[0].y, 5);
track.obstacles.push(new cust.geom2D.Ball(_local10.x, _local10.z, 50, 0, 0, 500, 0.1));
allScenery.push(_local10);
mqs.push(_local10);
lqs.push(_local10);
_local7 = Math.ceil(_local15 / (maxLineLength / 2));
var _local12 = _local15 / _local7;
var _local5;
startLinePolys = new PolygonGroup();
_local2 = 0;
while (_local2 < _local7) {
_local4 = flash.geom.Point.interpolate(track.lp[0], track.rp[0], (_local12 * (_local2 + 0.5)) / _local15);
_local5 = sprites.makeRectangle("startLine" + _local2, _local4.x, -((_local16 / 2) + _local20), _local4.y, _local12, _local16);
allCheckpointMesh.push(_local5);
_local5.rotateTo(0, _local17, 0);
_local3 = 0;
while (_local3 < _local5.t.length) {
startLinePolys.push(_local5.t[_local3]);
_local5.t[_local3].L = 1;
_local3++;
}
_local2++;
}
var _local8;
var _local19 = new flash.geom.Point();
var _local18 = new flash.geom.Point();
checkPointPolys = new PolygonGroup();
_local2 = 1;
while (_local2 < track.checkpoints.length) {
_local8 = track.checkpoints[_local2];
_local15 = Math.sqrt(Math.pow(_local8.gx1 - _local8.gx2, 2) + Math.pow(_local8.gy1 - _local8.gy2, 2));
_local17 = Math.atan2(_local8.gy1 - _local8.gy2, _local8.gx1 - _local8.gx2);
_local10 = sprites.spawnSprite("checkpointLeft" + _local2, "checkPoint", _local8.gx1, 0, _local8.gy1, 5);
allScenery.push(_local10);
mqs.push(_local10);
lqs.push(_local10);
track.obstacles.push(new cust.geom2D.Ball(_local10.x, _local10.z, 50, 0, 0, 500, 0.1));
_local10 = sprites.spawnSprite("checkpointRight" + _local2, "checkPoint", _local8.gx2, 0, _local8.gy2, 5);
allScenery.push(_local10);
mqs.push(_local10);
lqs.push(_local10);
track.obstacles.push(new cust.geom2D.Ball(_local10.x, _local10.z, 50, 0, 0, 500, 0.1));
_local7 = Math.ceil(_local15 / (maxLineLength / 2));
_local12 = _local15 / _local7;
_local19.x = _local8.gx1;
_local19.y = _local8.gy1;
_local18.x = _local8.gx2;
_local18.y = _local8.gy2;
_local3 = 0;
while (_local3 < _local7) {
_local4 = flash.geom.Point.interpolate(_local19, _local18, (_local12 * (_local3 + 0.5)) / _local15);
_local5 = sprites.makeRectangle((("checkpoint" + _local2) + "_") + _local3, _local4.x, -((_local16 / 2) + _local20), _local4.y, _local12, _local16);
allCheckpointMesh.push(_local5);
_local5.rotateTo(0, _local17, 0);
_local9 = 0;
while (_local9 < _local5.t.length) {
checkPointPolys.push(_local5.t[_local9]);
_local5.t[_local9].L = 1;
_local9++;
}
_local3++;
}
_local2++;
}
var _local23 = ["meteor_small", "meteor_medium", "meteor_large"];
var _local24 = 300;
var _local25 = 1500;
var _local6;
var _local22 = Math.ceil(ASTEROID_DENSITY * track.area);
_local2 = 0;
while (_local2 < _local22) {
_local6 = sprites.spawnSprite("bgItem" + _local2, Rand.value.apply(null, _local23), Rand.random(track.minX, track.maxX), Rand.random(_local24, _local25), Rand.random(track.minY, track.maxY), 5);
_local6._rotation = Rand.random(0, 360);
_local6.rotationSpeed = Rand.random(-0.1, 0.1);
allScenery.push(_local6);
if ((_local2 % 2) == 0) {
mqs.push(_local6);
}
_local2++;
}
_local22 = _local22 * 7;
var _local26 = track.maxX - track.minX;
var _local27 = track.maxY - track.minY;
var _local28 = track.minX + (_local26 / 2);
var _local29 = track.minY + (_local27 / 2);
_local2 = 0;
while (_local2 < _local22) {
_local6 = dots.spawnSprite("dots" + _local2, "dot", Rand.random(track.minX, track.maxX), Rand.random(-500, -1800), Rand.random(track.minY, track.maxY), 0);
_local6._rotation = Rand.random(0, 360);
_local6.cacheAsBitmap = true;
allScenery.push(_local6);
if ((_local2 % 2) == 0) {
mqs.push(_local6);
}
_local2++;
}
var _local14;
_local2 = 0;
while (_local2 < track.scenery.length) {
_local14 = track.scenery[_local2];
_local6 = sprites.spawnSprite("scenery" + _local2, _local14.l, _local14.x, _local14.z, _local14.y, 3);
_local6._rotation = _local14.r;
_local6.rotationSpeed = _local14.rs;
allScenery.push(_local6);
mqs.push(_local6);
lqs.push(_local6);
_local2++;
}
var _local13;
_local2 = 0;
while (_local2 < track.items.length) {
_local13 = track.items[_local2];
_local6 = sprites.spawnSprite("item" + _local2, _local13.linkage, _local13.x, ((_local13.linkage == TrackItem.BARRIER) ? -1 : 0), _local13.y, _local13.r / 50);
_local13.sprite = _local6;
allScenery.push(_local6);
mqs.push(_local6);
lqs.push(_local6);
_local2++;
}
}
function gameLoop() {
var _local12 = new Date().valueOf();
var _local9 = _local12 - lastTime;
lastTime = _local12;
f++;
if (isRunning) {
if (!isPaused) {
var _local3;
var _local11;
var _local7 = 0;
while (_local7 < saucers.length) {
_local3 = saucers[_local7];
_local3.update(_local9 / 1000);
_local7++;
}
balls.length = 0;
_local7 = 0;
while (_local7 < saucers.length) {
_local3 = saucers[_local7];
if (_local3.isOnTrack) {
balls.push(_local3.ball);
}
_local7++;
}
_local7 = 0;
while (_local7 < saucers.length) {
_local3 = saucers[_local7];
if (_local3.isOnTrack) {
_local3.checkItems(track.items, _local9);
_local11 = _local3.collisionDetection(balls);
if (_local11) {
var _local6 = snd_man.newSound(COLLISION + Rand.random(0, 2, 0));
_local6.setInitVol(COLLION_BASE_VOL);
_local6.setPositionPoint(flash.geom.Point.interpolate(_local3.p, _local11.p, 0.5));
_local6.onSoundComplete = _local6.remove;
_local6.start();
_local11.mc.hit();
_local3.mc.hit();
_local3.collisionResponse(_local11);
}
_local3.checkObstacles(track.obstacles, _local9);
}
_local7++;
}
_local7 = 0;
while (_local7 < saucers.length) {
_local3 = saucers[_local7];
_local3.checkPosition();
_local7++;
}
if (player.tBoostTime) {
if (_x) {
_x = 0;
} else {
_x = SCREEN_SHAKE;
}
} else {
_x = 0;
}
}
}
var _local7 = 0;
while (_local7 < saucers.length) {
var _local3 = saucers[_local7];
_local3.render();
_local7++;
}
if (isRunning) {
if (!isPaused) {
if (!player.isFallenOff) {
if (!player.checkpoints.isRaceComplete) {
if (!player.isTumbling) {
cam.ry = cam.ry + ((player.ry - cam.ry) / camTurnDamp);
}
} else {
cam.ry = cam.ry + (CAM_SPIN_AROUND_SPEED * (_local9 / 1000));
}
var _local14 = camMinDist + ((camMaxDist - camMinDist) * (Math.sqrt(player.speed) / Math.sqrt(player.maxSpeed)));
curCamDist = curCamDist + ((_local14 - curCamDist) / camDistDamp);
cam.x = player.x - (curCamDist * Math.sin(cam.ry));
cam.z = player.z - (curCamDist * Math.cos(cam.ry));
mic.x = cam.x;
mic.y = cam.z;
mic.a = cam.ry;
if (curDetailLvl > 2) {
var _local13 = wWidth / 2;
stars._x = 137.5 - (((((cam.ry % Math.PI) / Math.PI) * _local13) * 4) % _local13);
shinyTrackRect.x = wWidth + ((((cam.ry % Math.PI) / Math.PI) * wWidth) % wWidth);
}
}
}
}
light.x = cam.x;
light.y = cam.y;
light.z = cam.z;
if (curDetailLvl > 1) {
startLinePolys.setColour(Rand.random(20, 60), FINISH_LINE_COL.r, FINISH_LINE_COL.g, FINISH_LINE_COL.b);
checkPointPolys.setColour(Rand.random(20, 60), CHECKPOINT_LINE_COL.r, CHECKPOINT_LINE_COL.g, CHECKPOINT_LINE_COL.b);
_local7 = 0;
while (_local7 < allScenery.length) {
allScenery[_local7]._rotation = allScenery[_local7]._rotation + (allScenery[_local7].rotationSpeed * _local9);
_local7++;
}
}
cam.viewDist = floorClipDist;
floor.render(cam);
cam.viewDist = spriteClipDist;
sprites.render(cam);
dotsCam.x = cam.x;
dotsCam.z = cam.z;
dotsCam.y = cam.y;
dotsCam.ry = cam.ry;
dots.render(dotsCam);
var _local10 = _global.allTrackEdgesGlobal;
var _local8;
var _local5;
var _local4;
trackBmp.fillRect(bmp.rectangle, 0);
trackBmp.draw(floor, bitmapMatrix);
trackBmp.threshold(trackBmp, trackBmp.rectangle, origin, ">", 0, trackFillCol, 4278190080);
_local7 = 0;
while (_local7 < _local10.length) {
if (_local10[_local7].visible) {
_local8 = _local10[_local7].ps;
_local5 = _local8._x + (wWidth / 2);
_local4 = _local8._y + ((bmpHeight - (wHeight - bmpHeight)) / 2);
if (trackBmp.rectangle.contains(_local5, _local4)) {
if (trackBmp.getPixel32(_local5, _local4) == 0) {
trackBmp.floodFill(_local5, _local4, TRACK_FILL_COL);
}
}
_local8 = _local10[_local7].pe;
_local5 = _local8._x + (wWidth / 2);
_local4 = _local8._y + ((bmpHeight - (wHeight - bmpHeight)) / 2);
if (trackBmp.rectangle.contains(_local5, _local4)) {
if (trackBmp.getPixel32(_local5, _local4) == 0) {
trackBmp.floodFill(_local5, _local4, TRACK_FILL_COL);
}
}
}
_local7++;
}
if (curDetailLvl > 1) {
bmp.copyPixels(shinyTrackBmp, shinyTrackRect, origin);
bmp.copyChannel(trackBmp, bmp.rectangle, origin, 8, 8);
} else {
bmp.copyPixels(trackBmp, bmp.rectangle, origin);
}
if (isRunning) {
if (!isPaused) {
if ((f % (4 - curDetailLvl)) == 0) {
map.update();
hud.update(elapsedTime, player);
}
elapsedTime = elapsedTime + _local9;
if (!player.checkpoints.isRaceComplete) {
if (Key.isDown(80) || (Key.isDown(19))) {
pauseGame();
}
}
} else if (Key.isDown(80) || (Key.isDown(19))) {
if (canUnpauseGame) {
unpauseGame();
}
} else {
canUnpauseGame = true;
}
}
mic.x = player.x;
mic.y = player.z;
mic.a = cam.ry;
snd_man.updateVols(mic);
}
function pauseGame() {
isPaused = true;
canUnpauseGame = false;
menu_anim.gotoAndPlay("in");
menu_anim.menu_mc.gotoAndStop("paused");
}
function unpauseGame() {
menu_anim.gotoAndPlay("out");
menu_anim.onSlideOut = Delegate.create(this, onGameUnpaused);
}
function onGameUnpaused() {
isPaused = false;
}
function checkpointReached(s, c) {
var _local8 = s.__get__position();
var _local7 = s == player;
if (_local7 && (_local8 != 1)) {
var _local2 = 0;
while (_local2 < opponents.length) {
if (opponents[_local2].position == 1) {
var _local3 = opponents[_local2].checkpoints.checkpointTimes[c];
}
_local2++;
}
} else if (((!_local7) && (player.__get__position() == 1)) && (_local8 == 2)) {
var _local10 = (player.checkpoints.laps * (player.checkpoints.length + 1)) + player.checkpoints.curCheckpoint;
}
if (_local7) {
if ((player.checkpoints.curCheckpoint != 1) || (player.checkpoints.laps == 1)) {
hud.showMessage("Checkpoint");
} else if (player.checkpoints.laps < player.checkpoints.totalLaps) {
hud.showMessage("Lap Complete");
} else {
hud.showMessage("Final Lap");
}
}
var _local4 = false;
var _local2 = 0;
while (_local2 < saucers.length) {
if (saucers[_local2].checkpoints.laps == 0) {
_local4 = true;
break;
}
_local2++;
}
if (!_local4) {
var _local5 = false;
_local2 = 0;
while (_local2 < saucers.length) {
if (saucers[_local2].checkpoints.laps == saucers[_local2].checkpoints.totalLaps) {
if (saucers[_local2].checkpoints.curCheckpoint == 0) {
_local5 = true;
break;
}
}
_local2++;
}
}
}
function checkRaceEnded(saucer) {
if (saucer == player) {
var _local4 = player.__get__position();
var _local5 = (("Race Complete: " + _local4) + Format.ordinal(_local4)) + " place!";
hud.showMessage(_local5);
var _local3 = 0;
while (_local3 < saucers.length) {
TournamentResults.racers[_local3].setRaceResult(_global.root.trackNum, saucers[_local3].position, saucers[_local3], elapsedTime);
_local3++;
}
_global.root.raceFinishPos = _local4;
hud.update(elapsedTime, player);
intId = setInterval(this, "gameEnded", END_WAIT_TIME);
player.raceEnded();
}
}
function gameEnded() {
onEnterFrame = null;
clearInterval(intId);
delete intId;
_global.root.bestLap = player.checkpoints.bestLapTime();
_global.root.submitScore = (_global.root.trackTime = player.checkpoints.finishTime);
PlayerResults.setTrackResults(_global.root.trackNum, _global.root.raceFinishPos, player.checkpoints);
sprites.onUnload();
floor.onUnload();
var _local4 = 0;
while (_local4 < saucers.length) {
saucers[_local4].die();
_local4++;
}
game_transition.gotoAndPlay("in");
loadingScreen.gotoAndStop("end");
game_transition.onSlideIn = Delegate.create(_global.root, _global.root.goToPostRace);
_global.groats = _global.groats + GROATS_REWARDS[_global.root.raceFinishPos];
_root._quality = "HIGH";
_root.kvEvent(_global.mc["fin" + (_global.root.trackNum + 1)]);
}
function setDetailLevel(d) {
var _local3;
if (d == 0) {
d = recommendedDetailLvl;
}
switch (d) {
case 3 :
_root._quality = "HIGH";
_local3 = 0;
while (_local3 < allScenery.length) {
allScenery[_local3].hide(false);
_local3++;
}
_local3 = 0;
while (_local3 < allCheckpointMesh.length) {
allCheckpointMesh[_local3].hide(false);
_local3++;
}
if (curDetailLvl < d) {
bg.play();
bg.cacheAsBitmap = false;
}
break;
case 2 :
_root._quality = "MED";
_local3 = 0;
while (_local3 < allScenery.length) {
allScenery[_local3].hide(true);
_local3++;
}
_local3 = 0;
while (_local3 < mqs.length) {
mqs[_local3].hide(false);
_local3++;
}
_local3 = 0;
while (_local3 < allCheckpointMesh.length) {
allCheckpointMesh[_local3].hide(false);
_local3++;
}
if (curDetailLvl < d) {
bg.play();
bg.cacheAsBitmap = false;
}
break;
case 1 :
_root._quality = "LOW";
_local3 = 0;
while (_local3 < allScenery.length) {
allScenery[_local3].hide(true);
_local3++;
}
_local3 = 0;
while (_local3 < lqs.length) {
lqs[_local3].hide(false);
_local3++;
}
_local3 = 0;
while (_local3 < allCheckpointMesh.length) {
allCheckpointMesh[_local3].hide(true);
_local3++;
}
bg.stop();
bg.cacheAsBitmap = true;
}
curDetailLvl = d;
menu_anim.menu_mc.onChangeDetailLvl();
}
var bmpHeight = 210;
var camMinDist = 2000;
var camMaxDist = 2300;
var camTurnDamp = 3;
var camDistDamp = 5;
var curCamDist = Game.prototype.camMinDist;
var floorClipDist = 25000;
var spriteClipDist = 14500;
var wWidth = 550;
var wHeight = 320;
var trackFillCol = 2298478591;
var maxLineLength = 2110;
var canUnpauseGame = false;
var isPaused = false;
var isRunning = false;
var curDetailLvl = 0;
var f = 0;
static var FAST_MAP_PARSING = 3000;
static var MED_MAP_PARSING = 5000;
static var TRACK_FILL_COL = 1728053247;
static var FINISH_LINE_COL = new RGB(0, 255, 0);
static var CHECKPOINT_LINE_COL = new RGB(9, 175, 247);
static var SAUCER_COLS = [16711680, 255, 16750848, 16724940, 65280, 16776960];
static var END_WAIT_TIME = 10000;
static var GRAVITY = 7500;
static var ASTEROID_DENSITY = 2E-8;
static var SHINY_TRACK_BMP = "trackTexture";
static var CAM_SPIN_AROUND_SPEED = 1;
static var CAM_Y = -1350;
static var CAM_FL = 400;
static var DOTS_FL = 700;
static var SCREEN_SHAKE = 3;
static var COLLISION = "collision";
static var COLLION_BASE_VOL = 30;
static var INIT_GROATS = 100;
static var GROATS_REWARDS = [null, 600, 400, 300, 200, 100, 50];
var ACCEL_ADJUST_PER_TRACK = 0.5;
var DRAG_ADJUST_PER_TRACK = -0.05;
var TURN_ADJUST_PER_TRACK = 0.2;
var MASS_ADJUST_PER_TRACK = 0;
var AI_totalTracks = 5;
var AI_targetTurnSpeed = 15;
var AI_baseFriction = 0.2;
var AI_basePower = 6500;
var AI_baseTurnSpeed = 10;
}
Symbol 1254 MovieClip [__Packages.cust.geom3D.World] Frame 0
class cust.geom3D.World extends MovieClip
{
var lights, blendMode, rect, scrollRect, _x, _y, _listeners, clear, broadcastMessage, tc, attachMovie, getNextHighestDepth, addListener;
function World () {
super();
lights = new Array();
blendMode = "layer";
AsBroadcaster.initialize(this);
}
function init(cx, cy, w, h, ambient, clip) {
rect = new flash.geom.Rectangle(-cx, -cy, w, h);
if (clip) {
scrollRect = rect;
} else {
_x = cx;
_y = cy;
}
a = ((ambient > 0) ? (((ambient < 1) ? (ambient) : 1)) : 0);
}
function render(vp) {
if (_listeners.length > 0) {
clear();
broadcastMessage("render", vp, rect, lights, a, vp.viewDist);
tc = true;
} else if (tc) {
clear();
tc = false;
}
}
function mapVectorToScreen(vp, vect) {
var _local7 = Math.cos(vp.rx);
var _local5 = Math.sin(vp.rx);
var _local6 = Math.cos(vp.ry);
var _local3 = Math.sin(vp.ry);
var _local4 = Math.cos(vp.rz);
var _local2 = Math.sin(vp.rz);
vect.update(vp.x, vp.y, vp.z, _local7, _local5, _local6, _local3, _local4, _local2, vp.fl);
}
function empty() {
broadcastMessage("die");
}
function testMark(vp) {
broadcastMessage("testMark", vp);
}
function numPolygons() {
var _local3 = 0;
var _local2 = 0;
while (_local2 < _listeners.length) {
if (_listeners[_local2].t.length) {
_local3 = _local3 + _listeners[_local2].t.length;
} else {
_local3++;
}
_local2++;
}
return(_local3);
}
function spawnPoly(name, sx, sy, sz, v, t, ds) {
var _local2 = attachMovie("mesh", name, getNextHighestDepth());
_local2.init(sx, sy, sz, v, t);
addListener(_local2);
_local2.ds = ds;
return(_local2);
}
function spawnSprite(name, linkage, sx, sy, sz, scale) {
var _local2 = attachMovie(linkage, name, getNextHighestDepth());
_local2.init(sx, sy, sz, scale);
addListener(_local2);
return(_local2);
}
function makeLineSegment(name, sx1, sy1, sz1, sx2, sy2, sz2, t, c) {
var _local2 = attachMovie("lineSegment3D", name, getNextHighestDepth());
_local2.init(sx1, sy1, sz1, sx2, sy2, sz2, t, c);
addListener(_local2);
return(_local2);
}
function makeSimpleLineSegment(name, sx1, sy1, sz1, sx2, sy2, sz2, c) {
var _local2 = new cust.geom3D.SimpleLineSegment3D(this, sx1, sy1, sz1, sx2, sy2, sz2, c);
addListener(_local2);
return(_local2);
}
function makeTrackEdge(name, sx1, sy1, sz1, sx2, sy2, sz2, c) {
var _local2 = new TrackEdge(this, sx1, sy1, sz1, sx2, sy2, sz2, c);
addListener(_local2);
return(_local2);
}
function makePlane() {
var _local2 = attachMovie("plane", "plane", getNextHighestDepth());
_local2.init(this);
return(_local2);
}
function makeMultiPolyFromXML(xmlnode, scale) {
var _local8 = attachMovie("multiPoly", "mp" + xmlnode.attributes.depth, Number(xmlnode.attributes.depth));
var _local7 = [];
var _local4;
var _local3 = 0;
while (_local3 < xmlnode.childNodes.length) {
_local4 = xmlnode.childNodes[_local3];
_local7[_local7.length] = new cust.geom3D.Vector(Number(_local4.attributes.x) * scale, Number(_local4.attributes.y) * scale, _global.game.map.height - (Number(_local4.attributes.z) * scale));
_local3++;
}
_local8.init(_local7, Number("0x" + xmlnode.attributes.c));
addListener(_local8);
return(_local8);
}
function makeRectangle(name, sx, sy, sz, sw, sh) {
var _local5 = sw / 2;
var _local4 = sh / 2;
var _local2 = new Array();
_local2[_local2.length] = new cust.geom3D.Vector(_local5, _local4, 0);
_local2[_local2.length] = new cust.geom3D.Vector(_local5, -_local4, 0);
_local2[_local2.length] = new cust.geom3D.Vector(-_local5, -_local4, 0);
_local2[_local2.length] = new cust.geom3D.Vector(-_local5, _local4, 0);
var _local3 = new Array();
_local3[_local3.length] = {a:0, b:1, c:2, cull:false};
_local3[_local3.length] = {a:2, b:3, c:0, cull:false};
var _local6 = attachMovie("mesh", name, getNextHighestDepth());
_local6.init(sx, sy, sz, _local2, _local3);
addListener(_local6);
return(_local6);
}
function makeCuboid(name, sx, sy, sz, sw, sh, sd) {
var _local6 = sw / 2;
var _local5 = sh / 2;
var _local4 = sd / 2;
var _local3 = new Array();
_local3[0] = new cust.geom3D.Vector(-_local6, -_local5, _local4);
_local3[1] = new cust.geom3D.Vector(_local6, -_local5, _local4);
_local3[2] = new cust.geom3D.Vector(_local6, _local5, _local4);
_local3[3] = new cust.geom3D.Vector(-_local6, _local5, _local4);
_local3[4] = new cust.geom3D.Vector(-_local6, -_local5, -_local4);
_local3[5] = new cust.geom3D.Vector(_local6, -_local5, -_local4);
_local3[6] = new cust.geom3D.Vector(_local6, _local5, -_local4);
_local3[7] = new cust.geom3D.Vector(-_local6, _local5, -_local4);
var _local2 = new Array();
_local2[0] = {a:0, b:2, c:1};
_local2[1] = {a:0, b:3, c:2};
_local2[2] = {a:0, b:1, c:5};
_local2[3] = {a:0, b:5, c:4};
_local2[4] = {a:4, b:5, c:6};
_local2[5] = {a:4, b:6, c:7};
_local2[6] = {a:3, b:6, c:2};
_local2[7] = {a:3, b:7, c:6};
_local2[8] = {a:1, b:6, c:5};
_local2[9] = {a:1, b:2, c:6};
_local2[10] = {a:4, b:3, c:0};
_local2[11] = {a:4, b:7, c:3};
var _local7 = attachMovie("mesh", name, getNextHighestDepth());
_local7.init(sx, sy, sz, _local3, _local2);
addListener(_local7);
return(_local7);
}
function makeTube(name, sx, sy, sz, sh, sd, sf) {
var _local2 = 0;
var _local9 = new Array();
var _local4 = 0;
while (_local4 < sf) {
var _local3 = ((Math.PI*2) / sf) * _local4;
var _local6 = (Math.cos(_local3) * sd) / 2;
var _local5 = (Math.sin(_local3) * sd) / 2;
_local9[_local2] = new cust.geom3D.Vector(0 + _local6, 0 + _local5, -(sh / 2));
_local9[_local2 + 1] = new cust.geom3D.Vector(0 + _local6, 0 + _local5, 0 + (sh / 2));
_local2 = _local2 + 2;
_local4++;
}
_local2 = 0;
var _local8 = new Array();
_local4 = 0;
while (_local4 < (sf - 1)) {
_local8[_local2] = {a:_local2, b:_local2 + 1, c:_local2 + 3, cull:false};
_local8[_local2 + 1] = {a:_local2, b:_local2 + 3, c:_local2 + 2, cull:false};
_local2 = _local2 + 2;
_local4++;
}
_local8[_local2] = {a:_local2, b:_local2 + 1, c:1, cull:false};
_local8[_local2 + 1] = {a:_local2, b:1, c:0, cull:false};
var _local12 = attachMovie("mesh", name, getNextHighestDepth());
_local12.ds = true;
_local12.init(sx, sy, sz, _local9, _local8);
addListener(_local12);
return(_local12);
}
function makePrism(name, sx, sy, sz, sh, sd, sf) {
var _local2 = 0;
var _local4 = new Array();
var _local6 = 0;
while (_local6 < sf) {
var _local5 = ((Math.PI*2) / sf) * _local6;
var _local8 = (Math.cos(_local5) * sd) / 2;
var _local7 = (Math.sin(_local5) * sd) / 2;
_local4[_local2] = new cust.geom3D.Vector(0 + _local8, 0 + _local7, -(sh / 2));
_local4[_local2 + 1] = new cust.geom3D.Vector(0 + _local8, 0 + _local7, 0 + (sh / 2));
_local2 = _local2 + 2;
_local6++;
}
_local4.push(new cust.geom3D.Vector(0, 0, -(sh / 2)));
_local4.push(new cust.geom3D.Vector(0, 0, 0 + (sh / 2)));
_local2 = 0;
var _local3 = new Array();
_local6 = 0;
while (_local6 < (sf - 1)) {
_local3[_local3.length] = {a:_local2, b:_local2 + 1, c:_local2 + 3};
_local3[_local3.length] = {a:_local2, b:_local2 + 3, c:_local2 + 2};
_local3[_local3.length] = {a:_local2 + 2, b:_local4.length - 2, c:_local2};
_local3[_local3.length] = {a:_local2 + 1, b:_local4.length - 1, c:_local2 + 3};
_local2 = _local2 + 2;
_local6++;
}
_local3[_local3.length] = {a:_local2, b:_local2 + 1, c:1};
_local3[_local3.length] = {a:_local2, b:1, c:0};
_local3[_local3.length] = {a:0, b:_local4.length - 2, c:_local2};
_local3[_local3.length] = {a:_local2 + 1, b:_local4.length - 1, c:1};
var _local12 = attachMovie("mesh", name, getNextHighestDepth());
_local12.init(sx, sy, sz, _local4, _local3);
addListener(_local12);
return(_local12);
}
function makeCone(name, sx, sy, sz, sh, sd, sf) {
var _local10 = new Array();
_local10[0] = new cust.geom3D.Vector(0, 0, -(sh / 2));
var _local2 = 1;
var _local4 = 0;
while (_local4 < sf) {
var _local3 = ((Math.PI*2) / sf) * _local4;
var _local7 = (Math.cos(_local3) * sd) / 2;
var _local6 = (Math.sin(_local3) * sd) / 2;
_local10[_local2] = new cust.geom3D.Vector(0 + _local7, 0 + _local6, 0 + (sh / 2));
_local2++;
_local4++;
}
_local2 = 0;
var _local9 = new Array();
_local4 = 0;
while (_local4 < (sf - 1)) {
_local9[_local2] = {a:0, b:_local2 + 1, c:_local2 + 2, cull:false};
_local2++;
_local4++;
}
_local9[_local2] = {a:0, b:_local2 + 1, c:1, cull:false};
var _local12 = attachMovie("mesh", name, getNextHighestDepth());
_local12.init(sx, sy, sz, _local10, _local9);
_local12.ds = true;
addListener(_local12);
return(_local12);
}
function makePyramid(name, sx, sy, sz, sh, sd, sf) {
var _local10 = new Array();
_local10[0] = new cust.geom3D.Vector(0, 0, -(sh / 2));
_local10[1] = new cust.geom3D.Vector(0, 0, 0 + (sh / 2));
var _local3 = 2;
var _local2 = 0;
while (_local2 < sf) {
var _local4 = ((Math.PI*2) / sf) * _local2;
var _local7 = (Math.cos(_local4) * sd) / 2;
var _local6 = (Math.sin(_local4) * sd) / 2;
_local10[_local3] = new cust.geom3D.Vector(0 + _local7, 0 + _local6, 0 + (sh / 2));
_local3++;
_local2++;
}
_local3 = 0;
var _local8 = new Array();
_local2 = 0;
while (_local2 < (sf - 1)) {
_local8[_local3] = {a:0, b:_local2 + 2, c:_local2 + 3};
_local8[_local3 + 1] = {a:1, b:_local2 + 3, c:_local2 + 2};
_local3 = _local3 + 2;
_local2++;
}
_local8[_local3] = {a:0, b:sf + 1, c:2};
_local8[_local3 + 1] = {a:1, b:2, c:sf + 1};
var _local12 = attachMovie("mesh", name, getNextHighestDepth());
_local12.init(sx, sy, sz, _local10, _local8);
addListener(_local12);
return(_local12);
}
function makeSphere(name, sx, sy, sz, sd, sl, sf) {
var _local5 = new Array();
var _local13 = sd / 2;
_local5[_local5.length] = new cust.geom3D.Vector(0, 0, -_local13);
_local5[_local5.length] = new cust.geom3D.Vector(0, 0, 0 + _local13);
var _local6 = 0;
while (_local6 < sf) {
var _local9 = ((Math.PI*2) / sf) * _local6;
var _local12 = Math.cos(_local9) * _local13;
var _local11 = Math.sin(_local9) * _local13;
_local5[_local5.length] = new cust.geom3D.Vector(0 + _local12, 0 + _local11, 0);
_local6++;
}
var _local7 = 1;
while (_local7 < sl) {
var _local10 = _local13 * Math.sin(((Math.PI/2) / sl) * _local7);
_local6 = 0;
while (_local6 < sf) {
var _local9 = ((Math.PI*2) / sf) * _local6;
var _local8 = Math.sqrt(Math.pow(_local13, 2) - Math.pow(_local10, 2));
var _local12 = Math.cos(_local9) * _local8;
var _local11 = Math.sin(_local9) * _local8;
_local5[_local5.length] = new cust.geom3D.Vector(0 + _local12, 0 + _local11, 0 + _local10);
_local5[_local5.length] = new cust.geom3D.Vector(0 + _local12, 0 + _local11, -_local10);
_local6++;
}
_local7++;
}
var _local2 = new Array();
var _local4 = sf + 2;
_local7 = 1;
while (_local7 < ((sl * 2) - 3)) {
_local6 = 0;
while (_local6 < sf) {
if ((_local6 % 2) == 0) {
_local2[_local2.length] = {a:_local4, b:_local4 + (sf * 2), c:_local4 + 2};
_local2[_local2.length] = {a:(_local4 + (sf * 2)) + 1, b:(_local4 + (sf * 2)) - 1, c:_local4 + 1};
} else {
_local2[_local2.length] = {a:_local4 + 2, b:_local4 + (sf * 2), c:_local4};
_local2[_local2.length] = {a:_local4 + 1, b:(_local4 + (sf * 2)) - 1, c:(_local4 + (sf * 2)) + 1};
}
_local4++;
_local6++;
}
_local7++;
}
_local2[_local2.length - 1] = {a:(sf * 3) + 2, b:sf + 2, c:sf * 3};
_local7 = 0;
while ((_local7 + 1) < sf) {
_local2[_local2.length] = {a:_local7 + 2, b:((_local7 + 2) + sf) + _local7, c:_local7 + 3};
_local2[_local2.length] = {a:_local7 + 3, b:((_local7 + 2) + sf) + _local7, c:(((_local7 + 2) + sf) + _local7) + 2};
_local2[_local2.length] = {a:_local7 + 3, b:(((_local7 + 2) + sf) + _local7) + 1, c:_local7 + 2};
_local2[_local2.length] = {a:_local7 + 3, b:(((_local7 + 2) + sf) + _local7) + 3, c:(((_local7 + 2) + sf) + _local7) + 1};
_local7++;
}
_local2[_local2.length] = {a:_local7 + 2, b:((_local7 + 2) + sf) + _local7, c:2};
_local2[_local2.length] = {a:2, b:((_local7 + 2) + sf) + _local7, c:2 + sf};
_local2[_local2.length] = {a:2, b:(((_local7 + 2) + sf) + _local7) + 1, c:_local7 + 2};
_local2[_local2.length] = {a:3 + sf, b:(((_local7 + 2) + sf) + _local7) + 1, c:2};
var _local14 = (((sf * (sl - 2)) * 2) + sf) + 2;
_local7 = 0;
while ((_local7 + 2) < (sf * 2)) {
if ((_local7 % 2) == 0) {
_local2[_local2.length] = {a:1, b:(_local14 + _local7) + 2, c:_local14 + _local7};
} else {
_local2[_local2.length] = {a:_local14 + _local7, b:(_local14 + _local7) + 2, c:0};
}
_local7++;
}
_local2[_local2.length] = {a:(_local14 + _local7) + 1, b:_local14 + 1, c:0};
_local2[_local2.length] = {a:1, b:_local14, c:_local14 + _local7};
var _local16 = attachMovie("mesh", name, getNextHighestDepth());
_local16.init(sx, sy, sz, _local5, _local2);
addListener(_local16);
return(_local16);
}
function onUnload() {
broadcastMessage("die");
}
var a = 0;
}
Symbol 1255 MovieClip [__Packages.cust.geom3D.Mesh] Frame 0
class cust.geom3D.Mesh extends MovieClip
{
var v, t, world, _parent, rect, cv, _visible, clear, swapDepths, removeMovieClip;
function Mesh () {
super();
v = new Array();
t = new Array();
world = _parent;
rect = new flash.geom.Rectangle(0, 0, 0, 0);
}
function init(sx, sy, sz, vectors, faces) {
cv = new cust.geom3D.Vector(sx, sy, sz);
var _local2 = 0;
while (_local2 < vectors.length) {
v[_local2] = vectors[_local2].clone();
_local2++;
}
_local2 = 0;
while (_local2 < faces.length) {
if (faces[_local2].bmp) {
t[_local2] = new cust.geom3D.BitmapPolygon(this, v[faces[_local2].a], v[faces[_local2].b], v[faces[_local2].c], faces[_local2].cull, faces[_local2].bmp, faces[_local2].s);
} else {
t[_local2] = new cust.geom3D.SolidPolygon(this, v[faces[_local2].a], v[faces[_local2].b], v[faces[_local2].c], faces[_local2].cull, faces[_local2].R, faces[_local2].G, faces[_local2].B);
}
_local2++;
}
}
function clone() {
}
function hide(t) {
if (t != _hide) {
if (t) {
_visible = false;
_parent.removeListener(this);
} else {
_parent.addListener(this);
}
_hide = t;
}
}
function render(vp, r, lights, a) {
var _local15 = cs(vp.rx);
var _local13 = sn(vp.rx);
var _local14 = cs(vp.ry);
var _local11 = sn(vp.ry);
var _local12 = cs(vp.rz);
var _local10 = sn(vp.rz);
var _local16 = vp.fl;
cv.update(vp.x, vp.y, vp.z, _local15, _local13, _local14, _local11, _local12, _local10, _local16);
if (cv._z < 0) {
_visible = false;
return(undefined);
}
if (cv._z > vp.viewDist) {
_visible = false;
return(undefined);
}
var _local19 = vp.x - cv.x;
var _local18 = vp.y - cv.y;
var _local17 = vp.z - cv.z;
_visible = true;
clear();
var _local5 = Number.POSITIVE_INFINITY;
var _local6 = Number.NEGATIVE_INFINITY;
var _local4 = Number.POSITIVE_INFINITY;
var _local8 = Number.NEGATIVE_INFINITY;
var _local7 = Number.POSITIVE_INFINITY;
var _local2;
var _local3 = 0;
while (_local3 < v.length) {
_local2 = v[_local3];
_local2.update(_local19, _local18, _local17, _local15, _local13, _local14, _local11, _local12, _local10, _local16);
_local5 = ((_local2._x < _local5) ? (_local2._x) : (_local5));
_local6 = ((_local2._x > _local6) ? (_local2._x) : (_local6));
_local4 = ((_local2._y < _local4) ? (_local2._y) : (_local4));
_local8 = ((_local2._y > _local8) ? (_local2._y) : (_local8));
_local7 = ((_local2._z < _local7) ? (_local2._z) : (_local7));
_local3++;
}
rect.x = _local5;
rect.y = _local4;
rect.width = _local6 - _local5;
rect.height = _local8 - _local4;
if (r.intersects(rect) && (_local7 > 0)) {
if (ds) {
depthSort2();
}
swapDepths(((vp.viewDist - cv._z) + vp.viewDist) + 1);
_local3 = 0;
while (_local3 < t.length) {
t[_local3].render(lights, a);
_local3++;
}
} else {
_visible = false;
}
}
function translateTo(tx, ty, tz) {
cv.x = tx;
cv.y = ty;
cv.z = tz;
}
function translateBy(dx, dy, dz) {
cv.x = cv.x + dx;
cv.y = cv.y + dy;
cv.z = cv.z + dz;
}
function rotateTo(tx, ty, tz) {
var _local18 = tx - rx;
var _local17 = ty - ry;
var _local16 = tz - rz;
rx = tx;
ry = ty;
rx = tz;
var _local6;
var _local5;
var _local4;
var _local15;
var _local14;
var _local13;
var _local2;
var _local10 = sn(_local18);
var _local8 = sn(_local17);
var _local7 = sn(_local16);
var _local12 = cs(_local18);
var _local11 = cs(_local17);
var _local9 = cs(_local16);
var _local3 = 0;
while (_local3 < v.length) {
_local2 = v[_local3];
_local6 = (_local9 * _local2.x) - (_local7 * _local2.y);
_local5 = (_local9 * _local2.y) + (_local7 * _local2.x);
_local15 = (_local11 * _local6) - (_local8 * _local2.z);
_local4 = (_local11 * _local2.z) + (_local8 * _local6);
_local14 = (_local12 * _local5) - (_local10 * _local4);
_local13 = (_local12 * _local4) + (_local10 * _local5);
_local2.x = _local15;
_local2.y = _local14;
_local2.z = _local13;
_local3++;
}
}
function rotateBy(dx, dy, dz) {
rx = rx + dx;
ry = ry + dy;
rx = rx + dz;
var _local6;
var _local5;
var _local4;
var _local15;
var _local14;
var _local13;
var _local2;
var _local10 = sn(dx);
var _local8 = sn(dy);
var _local7 = sn(dz);
var _local12 = cs(dx);
var _local11 = cs(dy);
var _local9 = cs(dz);
var _local3 = 0;
while (_local3 < v.length) {
_local2 = v[_local3];
_local6 = (_local9 * _local2.x) - (_local7 * _local2.y);
_local5 = (_local9 * _local2.y) + (_local7 * _local2.x);
_local15 = (_local11 * _local6) - (_local8 * _local2.z);
_local4 = (_local11 * _local2.z) + (_local8 * _local6);
_local14 = (_local12 * _local5) - (_local10 * _local4);
_local13 = (_local12 * _local4) + (_local10 * _local5);
_local2.x = _local15;
_local2.y = _local14;
_local2.z = _local13;
_local3++;
}
}
function die() {
world.removeListener(this);
removeMovieClip();
}
function xscale(s) {
var _local2 = 0;
while (_local2 < v.length) {
v[_local2].x = v[_local2].x * s;
_local2++;
}
}
function yscale(s) {
var _local2 = 0;
while (_local2 < v.length) {
v[_local2].y = v[_local2].y * s;
_local2++;
}
}
function zscale(s) {
var _local2 = 0;
while (_local2 < v.length) {
v[_local2].z = v[_local2].z * s;
_local2++;
}
}
function get x() {
return(cv.x);
}
function set x(nx) {
cv.x = nx;
//return(x);
}
function get y() {
return(cv.y);
}
function set y(ny) {
cv.y = ny;
//return(y);
}
function get z() {
return(cv.z);
}
function set z(nz) {
cv.z = nz;
//return(z);
}
function get _rotationx() {
return(rx * rd);
}
function set _rotationx(nx) {
var _local9 = (nx * dr) - rx;
if (_local9 != 0) {
var _local8 = _local9 * (Math.PI/180);
var _local3 = 0;
while (_local3 < v.length) {
var _local2 = v[_local3];
var _local5 = cs(_local8);
var _local4 = sn(_local8);
var _local7 = (_local5 * (_local2.y - cv.y)) - (_local4 * (_local2.z - cv.z));
var _local6 = (_local5 * (_local2.z - cv.z)) + (_local4 * (_local2.y - cv.y));
_local2.y = _local7 + cv.y;
_local2.z = _local6 + cv.z;
_local3++;
}
rx = nx % 360;
}
//return(_rotationx);
}
function get _rotationy() {
return(ry * rd);
}
function set _rotationy(ny) {
var _local9 = (ny * dr) - ry;
if (_local9 != 0) {
var _local8 = _local9 * (Math.PI/180);
var _local3 = 0;
while (_local3 < v.length) {
var _local2 = v[_local3];
var _local5 = cs(_local8);
var _local4 = sn(_local8);
var _local6 = (_local5 * (_local2.x - cv.x)) - (_local4 * (_local2.z - cv.z));
var _local7 = (_local5 * (_local2.z - cv.z)) + (_local4 * (_local2.x - cv.x));
_local2.x = _local6 + cv.x;
_local2.z = _local7 + cv.z;
_local3++;
}
rx = _local6 % 360;
}
//return(_rotationy);
}
function get _rotationz() {
return(rz * rd);
}
function set _rotationz(nz) {
var _local9 = (nz * dr) - rz;
if (_local9 != 0) {
var _local8 = _local9 * (Math.PI/180);
var _local3 = 0;
while (_local3 < v.length) {
var _local2 = v[_local3];
var _local5 = cs(_local8);
var _local4 = sn(_local8);
var _local7 = (_local5 * (_local2.x - cv.x)) - (_local4 * (_local2.y - cv.y));
var _local6 = (_local5 * (_local2.y - cv.y)) + (_local4 * (_local2.x - cv.x));
_local2.x = _local7 + cv.x;
_local2.y = _local6 + cv.y;
_local3++;
}
rz = nz % 360;
}
//return(_rotationz);
}
static function trisort(t1, t2) {
var _local2 = ((t1.a._z < t1.b._z) ? (t1.a._z) : (t1.b._z));
_local2 = ((_local2 < t1.c._z) ? (_local2) : (t1.c._z));
var _local1 = ((t2.a._z < t2.b._z) ? (t2.a._z) : (t2.b._z));
_local1 = ((_local1 < t2.c._z) ? (_local1) : (t2.c._z));
if (_local2 < _local1) {
return(1);
}
return(-1);
}
function depthSort2() {
var _local2;
var _local3 = 0;
while (_local3 < t.length) {
_local2 = t[_local3];
_local2.z = ((_local2.a._z < _local2.b._z) ? (((_local2.a._z < _local2.c._z) ? (_local2.a._z) : (_local2.c._z))) : (((_local2.b._z < _local2.c._z) ? (_local2.b._z) : (_local2.c._z))));
_local3++;
}
t.sortOn("z", Array.DESCENDING | Array.NUMERIC);
}
function depthSort3() {
var _local2;
var _local4;
var _local5 = 0;
while (_local5 < t.length) {
_local2 = t[_local5];
_local2.z = ((_local2.a._z < _local2.b._z) ? (((_local2.a._z < _local2.c._z) ? (_local2.a._z) : (_local2.c._z))) : (((_local2.b._z < _local2.c._z) ? (_local2.b._z) : (_local2.c._z))));
_local5++;
}
_local5 = t.length;
while (_local5 > 1) {
var _local3 = 1;
while (_local3 < (_local5 - 1)) {
_local2 = t[_local3];
_local4 = t[_local3 + 1];
if (_local2.z < _local4.z) {
t[_local3] = _local4;
t[_local3 + 1] = _local2;
}
_local3++;
}
_local5--;
}
}
var ds = false;
var rx = 0;
var ry = 0;
var rz = 0;
var _hide = false;
var cs = Math.cos;
var sn = Math.sin;
static var rd = 57.2957795130823;
static var dr = (Math.PI/180);
}
Symbol 1256 MovieClip [__Packages.cust.geom3D.Polygon] Frame 0
class cust.geom3D.Polygon
{
var p, a, b, c, C, L, r;
function Polygon (mesh, n1, n2, n3, cull, lum, reflect) {
p = mesh;
a = n1;
b = n2;
c = n3;
C = !(cull === false);
L = ((lum > 0) ? (((lum < 1) ? (lum) : 1)) : 0);
r = ((reflect < 1) ? (((reflect > 0) ? (reflect) : 0)) : 1);
}
function get isFacing() {
var _local5 = c._x - a._x;
var _local3 = c._y - a._y;
var _local4 = b._x - c._x;
var _local2 = b._y - c._y;
return((_local5 * _local2) < (_local3 * _local4));
}
function toString() {
return((((("a:" + a) + ", b:") + b) + ", c:") + c);
}
var z = 0;
}
Symbol 1257 MovieClip [__Packages.cust.geom3D.BitmapPolygon] Frame 0
class cust.geom3D.BitmapPolygon extends cust.geom3D.Polygon
{
var p, a, b, c, C, t, s, m1, m2, L, r;
function BitmapPolygon (mesh, n1, n2, n3, cull, texture, smooth, lum, reflect) {
super();
p = mesh;
a = n1;
b = n2;
c = n3;
C = !(cull === false);
t = texture;
s = smooth;
m1 = new flash.geom.Matrix();
m2 = new flash.geom.Matrix();
u1 = t.width - u0;
v1 = -v0;
u2 = -u0;
v2 = t.height - v0;
v3 = t.height;
v4 = t.width;
L = ((lum > 0) ? (((lum < 1) ? (lum) : 1)) : 0);
r = ((reflect < 1) ? (((reflect > 0) ? (reflect) : 0)) : 1);
}
function render(lights, w) {
if (C) {
if (((c._x - a._x) * (b._y - c._y)) >= ((c._y - a._y) * (b._x - c._x))) {
return(undefined);
}
}
var _local3 = a._x;
var _local2 = a._y;
var _local7 = b._x;
var _local5 = b._y;
var _local6 = c._x;
var _local4 = c._y;
m2.tx = u0;
m2.ty = v0;
m2.a = u1 / v3;
m2.b = v1 / v3;
m2.c = u2 / v2;
m2.d = v2 / v2;
m1.a = (_local7 - _local3) / v3;
m1.b = (_local5 - _local2) / v3;
m1.c = (_local6 - _local3) / v2;
m1.d = (_local4 - _local2) / v2;
m1.tx = _local3;
m1.ty = _local2;
m2.invert();
m2.concat(m1);
p.beginBitmapFill(t, m2, R, s);
p.moveTo(_local3, _local2);
p.lineTo(_local7, _local5);
p.lineTo(_local6, _local4);
p.lineTo(_local3, _local2);
p.endFill();
}
function updateSource() {
var _local3 = Math.sqrt(Math.pow(v4 * ssx, 2), Math.pow(sky, 2));
var _local2 = Math.atan2(sky, v4 * ssx) + sr;
u1 = _local3 * Math.cos(_local2);
v1 = _local3 * Math.sin(_local2);
_local3 = Math.sqrt(Math.pow(v3 * ssy, 2), Math.pow(skx, 2));
_local2 = Math.atan2(v3 * ssy, skx) + sr;
u2 = _local3 * Math.cos(_local2);
v2 = _local3 * Math.sin(_local2);
}
function get sourceRotation() {
return(sr);
}
function set sourceRotation(n) {
sr = ((n + Math.PI) % (Math.PI*2)) - Math.PI;
updateSource();
//return(sourceRotation);
}
function get sourceSkewX() {
return(skx);
}
function set sourceSkewX(n) {
skx = n;
updateSource();
//return(sourceSkewX);
}
function get sourceSkewY() {
return(sky);
}
function set sourceSkewY(n) {
sky = n;
updateSource();
//return(sourceSkewY);
}
function get sourceScaleX() {
return(ssx);
}
function set sourceScaleX(n) {
ssx = n;
updateSource();
//return(sourceScaleX);
}
function get sourceScaleY() {
return(ssy);
}
function set sourceScaleY(n) {
ssy = n;
updateSource();
//return(sourceScaleY);
}
function get sourceTranslateX() {
return(u0);
}
function set sourceTranslateX(n) {
u0 = n;
//return(sourceTranslateX);
}
function get sourceTranslateY() {
return(v0);
}
function set sourceTranslateY(n) {
v0 = n;
//return(sourceTranslateY);
}
function sourceTranslateTo(nx, ny) {
u0 = nx;
v0 = ny;
}
var R = true;
var u0 = 0;
var v0 = 0;
var u1 = 0;
var v1 = 0;
var u2 = 0;
var v2 = 0;
var sr = 0;
var skx = 0;
var sky = 0;
var ssx = 1;
var ssy = 1;
var v3 = 0;
var v4 = 0;
static var ori = new flash.geom.Point(0, 0);
}
Symbol 1258 MovieClip [__Packages.cust.geom3D.SolidPolygon] Frame 0
class cust.geom3D.SolidPolygon extends cust.geom3D.Polygon
{
var p, a, b, c, C, L, r;
function SolidPolygon (mesh, n1, n2, n3, cull, red, green, blue, alpha, lum, reflect) {
super();
p = mesh;
a = n1;
b = n2;
c = n3;
C = !(cull === false);
R = ((red < 255) ? (((red > 0) ? (red) : 0)) : 255);
G = ((green < 255) ? (((green > 0) ? (green) : 0)) : 255);
B = ((blue < 255) ? (((blue > 0) ? (blue) : 0)) : 255);
A = ((alpha < 100) ? (((alpha > 0) ? (alpha) : 0)) : 100);
L = ((lum > 0) ? (((lum < 1) ? (lum) : 1)) : 0);
r = ((reflect < 1) ? (((reflect > 0) ? (reflect) : 0)) : 1);
}
function render(lights, w) {
if (A > 0) {
if (C) {
if (((c._x - a._x) * (b._y - c._y)) >= ((c._y - a._y) * (b._x - c._x))) {
return(undefined);
}
}
if ((r > 0) && (L < 1)) {
var _local2;
var _local26;
var _local25;
var _local24;
var _local14;
var _local13;
var _local12;
var _local17;
var _local16;
var _local15;
var _local11;
var _local10;
var _local9;
var _local7;
var _local6;
var _local5;
var _local19;
var _local18;
var _local8;
var _local3;
var _local27;
var _local23 = 0;
var _local20 = 0;
var _local22 = 0;
_local26 = ((a.x + b.x) + c.x) / 3;
_local25 = ((a.y + b.y) + c.y) / 3;
_local24 = ((a.z + b.z) + c.z) / 3;
var _local4 = 0;
while (_local4 < lights.length) {
_local2 = lights[_local4];
_local14 = a.x - b.x;
_local13 = a.y - b.y;
_local12 = a.z - b.z;
_local17 = b.x - c.x;
_local16 = b.y - c.y;
_local15 = b.z - c.z;
_local11 = (_local13 * _local15) - (_local12 * _local16);
_local10 = -((_local14 * _local15) - (_local12 * _local17));
_local9 = (_local14 * _local16) - (_local13 * _local17);
_local7 = _local2.x - _local26;
_local6 = _local2.y - _local25;
_local5 = _local2.z - _local24;
_local19 = ((_local11 * _local7) + (_local10 * _local6)) + (_local9 * _local5);
_local8 = Math.sqrt(((_local7 * _local7) + (_local6 * _local6)) + (_local5 * _local5));
_local18 = Math.sqrt(((_local11 * _local11) + (_local10 * _local10)) + (_local9 * _local9));
_local3 = Math.acos(_local19 / (_local18 * _local8)) / Math.PI;
if (_local2.p > 0) {
_local3 = (_local2.p * cust.geom3D.Light.c) * (1 / (_local8 * _local8));
_local3 = ((_local3 > 1) ? (_local4) : (_local3));
}
_local23 = _local23 + (_local3 * _local2.r);
_local20 = _local20 + (_local3 * _local2.g);
_local22 = _local22 + (_local3 * _local2.b);
_local4++;
}
_local23 = (w + (_local23 * r)) + L;
_local20 = (w + (_local20 * r)) + L;
_local22 = (w + (_local22 * r)) + L;
_local27 = (((((R * _local23) < 255) ? (R * _local23) : 255) << 16) | ((((G * _local20) < 255) ? (G * _local20) : 255) << 8)) | (((B * _local22) < 255) ? (B * _local22) : 255);
} else {
var _local27 = (((R * L) << 16) | ((G * L) << 8)) | (B * L);
}
p.beginFill(_local27, A);
p.moveTo(a._x, a._y);
p.lineTo(b._x, b._y);
p.lineTo(c._x, c._y);
p.lineTo(a._x, a._y);
p.endFill();
}
}
function get isFacing() {
var _local5 = c._x - a._x;
var _local3 = c._y - a._y;
var _local4 = b._x - c._x;
var _local2 = b._y - c._y;
return((_local5 * _local2) < (_local3 * _local4));
}
function toString() {
return((((("a:" + a) + ", b:") + b) + ", c:") + c);
}
var R = 255;
var G = 255;
var B = 255;
var A = 100;
}
Symbol 1259 MovieClip [__Packages.cust.geom3D.LineSegment3D] Frame 0
class cust.geom3D.LineSegment3D extends MovieClip
{
var world, _parent, c1, c2, v1, v2, A, R, G, B, ct, c1_mc, c2_mc, _visible, clear, beginFill, moveTo, lineTo, endFill, removeMovieClip;
function LineSegment3D () {
super();
world = _parent;
c1 = new cust.geom2D.Circle();
c2 = new cust.geom2D.Circle();
}
function init(sx1, sy1, sz1, sx2, sy2, sz2, it, ic) {
v1 = new cust.geom3D.Vector(sx1, sy1, sz1);
v2 = new cust.geom3D.Vector(sx2, sy2, sz2);
t = it;
c = ic;
A = (c >> 24) & 255;
R = (c >> 16) & 255;
G = (c >> 8) & 255;
B = c & 255;
ct = new flash.geom.ColorTransform(0, 0, 0, 0, R, G, B, A);
c1_mc.transform.colorTransform = ct;
c2_mc.transform.colorTransform = ct;
}
function render(vp, r, lights, a, vd) {
var _local14 = cs(vp.rx);
var _local12 = sn(vp.rx);
var _local13 = cs(vp.ry);
var _local10 = sn(vp.ry);
var _local11 = cs(vp.rz);
var _local9 = sn(vp.rz);
var _local16 = vp.fl;
v1.update(vp.x, vp.y, vp.z, _local14, _local12, _local13, _local10, _local11, _local9, _local16);
if (v1._z < 0) {
_visible = false;
return(undefined);
}
v2.update(vp.x, vp.y, vp.z, _local14, _local12, _local13, _local10, _local11, _local9, _local16);
c1.r = (t * v1.scale) / 2;
c2.r = (t * v2.scale) / 2;
var _local15 = mn(v1._z, v2._z);
if (_local15 < 0) {
_visible = false;
return(undefined);
}
if (_local15 > vd) {
_visible = false;
return(undefined);
}
if (mn(v1._x - c1.r, v2._x - c2.r) > (r.x + r.width)) {
_visible = false;
return(undefined);
}
if (mx(v1._x + c1.r, v2._x + c2.r) < r.x) {
_visible = false;
return(undefined);
}
if (mn(v1._y - c1.r, v2._y - c2.r) > (r.y + r.height)) {
_visible = false;
return(undefined);
}
_visible = true;
c1_mc._x = v1._x;
c1_mc._y = v1._y;
c2_mc._x = v2._x;
c2_mc._y = v2._y;
c1_mc._width = (c1_mc._height = c1.r * 2);
c2_mc._width = (c2_mc._height = c2.r * 2);
c1.x = v1._x;
c1.y = v1._y;
c2.x = v2._x;
c2.y = v2._y;
if (c1.r != c2.r) {
if (c1.r > c2.r) {
var _local3 = c1;
var _local4 = c2;
} else {
var _local3 = c2;
var _local4 = c1;
}
var _local17 = Math.acos((_local3.r - _local4.r) / Math.sqrt(Math.pow(c1.x - c2.x, 2) + Math.pow(c1.y - c2.y, 2)));
var _local8 = at(c2.y - c1.y, c2.x - c1.x);
var _local6 = _local8 + _local17;
var _local5 = _local8 - _local17;
} else {
var _local3 = c1;
var _local4 = c2;
var _local17 = at(c2.y - c1.y, c2.x - c1.x);
var _local6 = _local17 + pi2;
var _local5 = _local17 - pi2;
}
clear();
beginFill(c & 16777215, A / 2.55);
moveTo(_local3.x + (_local3.r * cs(_local6)), _local3.y + (_local3.r * sn(_local6)));
lineTo(_local4.x + (_local4.r * cs(_local6)), _local4.y + (_local4.r * sn(_local6)));
lineTo(_local4.x + (_local4.r * cs(_local5)), _local4.y + (_local4.r * sn(_local5)));
lineTo(_local3.x + (_local3.r * cs(_local5)), _local3.y + (_local3.r * sn(_local5)));
endFill();
}
function die() {
world.removeListener(this);
removeMovieClip();
}
var t = 10;
var c = 13421772;
var cs = Math.cos;
var sn = Math.sin;
var at = Math.atan2;
var mx = Math.max;
var mn = Math.min;
var pi2 = (Math.PI/2);
}
Symbol 1260 MovieClip [__Packages.cust.geom2D.Vector] Frame 0
class cust.geom2D.Vector extends flash.geom.Point
{
var x, y;
function Vector (a, b) {
super();
x = a;
y = b;
}
function mark(mc, linestyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
mc.moveTo(x - 2, y - 2);
mc.lineTo(x + 2, y + 2);
mc.moveTo(x + 2, y - 2);
mc.lineTo(x - 2, y + 2);
}
function reflect(n) {
n.__set__length(1);
return(subtract(n.multiply(2 * dot(n))));
}
function angleBetweenVector(p) {
return(Math.acos(dot(p) / (length * p.__get__length())));
}
function angleBetweenVector2(p) {
var _local2 = Math.acos(dot(p) / (length * p.__get__length()));
var _local4 = (((p.__get__angle() - angle) + 9.42477796076938) % (Math.PI*2)) - Math.PI;
if (_local4 < 0) {
_local2 = _local2 * -1;
}
return(_local2);
}
function dot(v) {
return((x * v.x) + (y * v.y));
}
function multiply(m) {
return(new cust.geom2D.Vector(x * m, y * m));
}
function subtract(p) {
return(new cust.geom2D.Vector(x - p.x, y - p.y));
}
function toString() {
return(((("{ x:" + x) + ", y:") + y) + " }");
}
function get normal() {
var _local2 = angle;
return(new cust.geom2D.Vector(Math.cos(_local2), Math.sin(_local2)));
}
function get length() {
return(Math.sqrt((x * x) + (y * y)));
}
function set length(l) {
var _local2 = Math.atan2(y, x);
x = l * Math.cos(_local2);
y = l * Math.sin(_local2);
//return(length);
}
function get angle() {
return(Math.atan2(y, x));
}
function set angle(a) {
var _local2 = length;
x = _local2 * Math.cos(a);
y = _local2 * Math.sin(a);
//return(angle);
}
static function angleBetween(v1, v2) {
return(Math.atan2(v2.y - v1.y, v2.x - v1.x));
}
static function interpolate(p1, p2, f) {
return(new cust.geom2D.Vector(p1.x + (Math.abs(p1.x - p2.x) * f), p1.y + (Math.abs(p1.y - p2.y) * f)));
}
static function polar(l, a) {
return(new cust.geom2D.Vector(l * Math.cos(a), l * Math.sin(a)));
}
}
Symbol 1261 MovieClip [__Packages.cust.geom2D.Circle] Frame 0
class cust.geom2D.Circle extends cust.geom2D.Vector
{
var x, y, subtract;
function Circle (ix, iy, ir) {
super();
x = ix;
y = iy;
r = ir;
}
function LineIntersection(l) {
var _local3 = new Array();
var _local2 = l.__get__start();
var _local4 = l.__get__end();
var _local9 = ((_local4.x - _local2.x) * (_local4.x - _local2.x)) + ((_local4.y - _local2.y) * (_local4.y - _local2.y));
var _local7 = 2 * (((_local4.x - _local2.x) * (_local2.x - x)) + ((_local4.y - _local2.y) * (_local2.y - y)));
var _local11 = (((((x * x) + (y * y)) + (_local2.x * _local2.x)) + (_local2.y * _local2.y)) - (2 * ((x * _local2.x) + (y * _local2.y)))) - (r * r);
var _local8 = (_local7 * _local7) - ((4 * _local9) * _local11);
if (_local8 < 0) {
_local3.type = "outside";
} else if (_local8 == 0) {
_local3.type = "tangent";
} else {
var _local10 = Math.sqrt(_local8);
var _local6 = ((-_local7) + _local10) / (2 * _local9);
var _local5 = ((-_local7) - _local10) / (2 * _local9);
if (((_local6 < 0) || (_local6 > 1)) && ((_local5 < 0) || (_local5 > 1))) {
if (((_local6 < 0) && (_local5 < 0)) || ((_local6 > 1) && (_local5 > 1))) {
_local3.type = "outside";
} else {
_local3.type = "inside";
}
} else {
_local3.type = "intersection";
if ((0 <= _local6) && (_local6 <= 1)) {
_local3[_local3.length] = cust.geom2D.Vector.interpolate(_local2, _local4, _local6);
}
if ((0 <= _local5) && (_local5 <= 1)) {
_local3[_local3.length] = cust.geom2D.Vector.interpolate(_local2, _local4, _local5);
}
}
}
return(_local3);
}
function isLineIntersecting(l) {
if (l.__get__length()) {
var _local3 = l.__get__start();
var _local4 = l.vector();
var _local9 = new cust.geom2D.Vector(x - _local3.x, y - _local3.y);
var _local2 = _local9.dot(_local4) / _local4.dot(_local4);
if (_local2 < 0) {
_local2 = 0;
}
if (_local2 > 1) {
_local2 = 1;
}
var _local6 = _local4.multiply(_local2);
var _local8 = new cust.geom2D.Vector(_local3.x + _local6.x, _local3.y + _local6.y);
var _local5 = subtract(_local8);
var _local10 = _local5.dot(_local5);
return(_local10 <= (r * r));
}
return(r >= flash.geom.Point.distance(l.__get__start(), this));
}
function containsPoint(p) {
return(r >= flash.geom.Point.distance(p, this));
}
function xAtY(yp) {
yp = yp - y;
if ((yp <= r) && (yp >= (-r))) {
return(x + (r * Math.sin(Math.acos(y / r))));
}
return(false);
}
function isIntersecting(c) {
var _local2 = c.x - x;
var _local3 = c.y - y;
return((r + c.r) >= Math.sqrt((_local2 * _local2) + (_local3 * _local3)));
}
function pointsOfIntersection(c) {
var _local4 = c.x - x;
var _local5 = c.y - y;
var _local2 = Math.sqrt((_local4 * _local4) + (_local5 * _local5));
if (_local2 > (r + c.r)) {
return(false);
}
var _local3 = (((_local2 * _local2) + (r * r)) - (c.r * c.r)) / (2 * _local2);
return([new cust.geom2D.Vector((x + ((_local4 * _local3) / _local2)) + ((_local5 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))), (y + ((_local5 * _local3) / _local2)) - ((_local4 / _local2) * Math.sqrt((r * r) - (_local3 * _local3)))), new cust.geom2D.Vector((x + ((_local4 * _local3) / _local2)) - ((_local5 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))), (y + ((_local5 * _local3) / _local2)) + ((_local4 / _local2) * Math.sqrt((r * r) - (_local3 * _local3))))]);
}
function mark(mc, linestyle, fillstyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
if (fillstyle) {
mc.beginFill((fillstyle.rgb ? (fillstyle.rgb) : 0), ((fillstyle.alpha != undefined) ? (fillstyle.alpha) : 100));
}
mc.moveTo(x + r, y);
mc.curveTo(r + x, (0.414213562373095 * r) + y, (0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((0.414213562373095 * r) + x, r + y, x, r + y);
mc.curveTo((-0.414213562373095 * r) + x, r + y, (-0.707106781186547 * r) + x, (0.707106781186547 * r) + y);
mc.curveTo((-r) + x, (0.414213562373095 * r) + y, (-r) + x, y);
mc.curveTo((-r) + x, (-0.414213562373095 * r) + y, (-0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo((-0.414213562373095 * r) + x, (-r) + y, x, (-r) + y);
mc.curveTo((0.414213562373095 * r) + x, (-r) + y, (0.707106781186547 * r) + x, (-0.707106781186547 * r) + y);
mc.curveTo(r + x, (-0.414213562373095 * r) + y, r + x, y);
if (fillstyle) {
mc.endFill();
}
}
function toString() {
return(((((("(x=" + x) + ", y=") + y) + ", r=") + r) + ")");
}
var r = 0;
}
Symbol 1262 MovieClip [__Packages.cust.geom2D.LineSegment] Frame 0
class cust.geom2D.LineSegment
{
var x1, y1, x2, y2;
function LineSegment (ix1, iy1, ix2, iy2) {
x1 = ix1;
y1 = iy1;
x2 = ix2;
y2 = iy2;
}
function vector() {
return(new cust.geom2D.Vector(x2 - x1, y2 - y1));
}
function isPointOnLine(p) {
if (p.y == ((m * p.x) + c)) {
if (x1 >= x2) {
var _local6 = x1;
var _local4 = x2;
} else {
var _local6 = x2;
var _local4 = x1;
}
if (y1 >= y2) {
var _local5 = y1;
var _local3 = y2;
} else {
var _local5 = y2;
var _local3 = y1;
}
if (((p.x >= _local4) && (p.x <= _local6)) && ((p.y >= _local3) && (p.y <= _local5))) {
return(true);
}
}
return(false);
}
function isIntersectingRectangle(r) {
return(false);
}
function interpolate(f) {
f = (isNaN(f) ? 0.5 : (((f > 1) ? 1 : (((f < 0) ? 0 : (f))))));
return(new cust.geom2D.Vector(x1 + ((x2 - x1) * f), y1 + ((y2 - y1) * f)));
}
function offset(x, y) {
x1 = x1 + x;
x2 = x2 + x;
y1 = y1 + y;
y2 = y2 + y;
}
function offsetPoint(p) {
x1 = x1 + p.x;
x2 = x2 + p.x;
y1 = y1 + p.y;
y2 = y2 + p.y;
}
function isIntersecting(l) {
var _local4 = l.x1;
var _local6 = l.y1;
var _local11 = l.x2;
var _local10 = l.y2;
var _local2 = 0;
var _local3 = 0;
var _local7 = x2 - x1;
var _local5 = _local11 - _local4;
if (!_local7) {
if (!_local5) {
return(false);
}
_local2 = x1;
_local3 = _local6 + (((_local10 - _local6) * (x1 - _local4)) / _local5);
} else if (!_local5) {
_local2 = _local4;
_local3 = y1 + (((y2 - y1) * (_local4 - x1)) / _local7);
} else {
var _local9 = (y2 - y1) / _local7;
var _local8 = (_local10 - _local6) / _local5;
if (_local9 == _local8) {
return(false);
}
var _local14 = y1 - (_local9 * x1);
var _local13 = _local6 - (_local8 * _local4);
var _local12 = _local8 - _local9;
_local2 = (_local14 - _local13) / _local12;
_local3 = ((_local8 * _local14) - (_local9 * _local13)) / _local12;
}
if (_local7 > 0) {
if ((_local2 < x1) || (_local2 > x2)) {
return(false);
}
} else if (_local7 < 0) {
if ((_local2 > x1) || (_local2 < x2)) {
return(false);
}
} else if (((_local3 < y1) && (_local3 < y2)) || ((_local3 > y1) && (_local3 > y2))) {
return(false);
}
if (_local5 > 0) {
if ((_local2 < _local4) || (_local2 > _local11)) {
return(false);
}
} else if (_local5 < 0) {
if ((_local2 > _local4) || (_local2 < _local11)) {
return(false);
}
} else if (((_local3 < _local6) && (_local3 < _local10)) || ((_local3 > _local6) && (_local3 > _local10))) {
return(false);
}
return(true);
}
function isPointRightOf(p) {
var _local6 = p.x - x1;
var _local4 = p.y - y1;
var _local5 = x2 - p.x;
var _local3 = y2 - p.y;
return((_local6 * _local3) < (_local4 * _local5));
}
function clone() {
return(new cust.geom2D.LineSegment(x1, y1, x2, y2));
}
function closestPoint(p) {
var _local3 = ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2));
var _local2 = (((p.x - x1) * (x2 - x1)) + ((p.y - y1) * (y2 - y1))) / _local3;
return(new flash.geom.Point(x1 + (_local2 * (x2 - x1)), y1 + (_local2 * (y2 - y1))));
}
function extendStart(n) {
var _local2 = radians;
x1 = x1 - (n * Math.cos(_local2));
y1 = y1 - (n * Math.sin(_local2));
}
function extendEnd(l) {
var _local2 = radians;
x2 = x2 + (l * Math.cos(_local2));
y2 = y2 + (l * Math.sin(_local2));
}
function pointOfIntersection(l, full) {
var _local4 = l.x1;
var _local6 = l.y1;
var _local11 = l.x2;
var _local10 = l.y2;
var _local2 = 0;
var _local3 = 0;
var _local7 = x2 - x1;
var _local5 = _local11 - _local4;
if (!_local7) {
if (!_local5) {
return(false);
}
_local2 = x1;
_local3 = _local6 + (((_local10 - _local6) * (x1 - _local4)) / _local5);
} else if (!_local5) {
_local2 = _local4;
_local3 = y1 + (((y2 - y1) * (_local4 - x1)) / _local7);
} else {
var _local9 = (y2 - y1) / _local7;
var _local8 = (_local10 - _local6) / _local5;
if (_local9 == _local8) {
return(false);
}
var _local14 = y1 - (_local9 * x1);
var _local13 = _local6 - (_local8 * _local4);
var _local12 = _local8 - _local9;
_local2 = (_local14 - _local13) / _local12;
_local3 = ((_local8 * _local14) - (_local9 * _local13)) / _local12;
}
if (!full) {
if (_local7 > 0) {
if ((_local2 < x1) || (_local2 > x2)) {
return(false);
}
} else if (_local7 < 0) {
if ((_local2 > x1) || (_local2 < x2)) {
return(false);
}
} else if (((_local3 < y1) && (_local3 < y2)) || ((_local3 > y1) && (_local3 > y2))) {
return(false);
}
if (_local5 > 0) {
if ((_local2 < _local4) || (_local2 > _local11)) {
return(false);
}
} else if (_local5 < 0) {
if ((_local2 > _local4) || (_local2 < _local11)) {
return(false);
}
} else if (((_local3 < _local6) && (_local3 < _local10)) || ((_local3 > _local6) && (_local3 > _local10))) {
return(false);
}
}
return(new cust.geom2D.Vector(_local2, _local3));
}
function mark(mc, linestyle) {
if (linestyle) {
mc.lineStyle((linestyle.thickness ? (linestyle.thickness) : 0), (linestyle.rgb ? (linestyle.rgb) : 0), ((linestyle.alpha != undefined) ? (linestyle.alpha) : 100));
}
mc.moveTo(x1, y1);
mc.lineTo(x2, y2);
}
function toString() {
return((start.toString() + ", ") + end.toString());
}
function get c() {
return(y1 - (m * x1));
}
function get m() {
return((y2 - y1) / (x2 - x1));
}
function get length() {
return(Math.sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
}
function set length(l) {
var _local2 = radians;
x2 = x1 + (l * Math.cos(_local2));
y2 = y1 + (l * Math.sin(_local2));
//return(length);
}
function get radians() {
return(Math.atan2(y2 - y1, x2 - x1));
}
function set radians(r) {
var _local2 = length;
x2 = x1 + (_local2 * Math.cos(r));
y2 = y1 + (_local2 * Math.sin(r));
//return(radians);
}
function get degrees() {
return(Math.atan2(y2 - y1, x2 - x1) * rd);
}
function set degrees(d) {
var _local2 = length;
x2 = x1 + (_local2 * Math.cos(d * dr));
y2 = y1 + (_local2 * Math.sin(d * dr));
//return(degrees);
}
function get isVertical() {
var _local2 = m;
return((m == Number.POSITIVE_INFINITY) || (m == Number.NEGATIVE_INFINITY));
}
function get isHorizontal() {
return(m == 0);
}
function get start() {
return(new cust.geom2D.Vector(x1, y1));
}
function set start(p) {
x1 = p.x;
y1 = p.y;
//return(start);
}
function get end() {
return(new cust.geom2D.Vector(x2, y2));
}
function set end(p) {
x2 = p.x;
y2 = p.y;
//return(end);
}
static function fromPolar(m, a, p) {
if (p) {
var _local1 = p.x;
var _local2 = p.y;
} else {
var _local1 = 0;
var _local2 = 0;
}
return(new cust.geom2D.LineSegment(_local1, _local2, _local1 + (m * Math.cos(a)), _local2 + (m * Math.sin(a))));
}
static function fromPoints(p1, p2) {
if (p2) {
return(new cust.geom2D.LineSegment(p1.x, p1.y, p2.x, p2.y));
}
return(new cust.geom2D.LineSegment(0, 0, p1.x, p1.y));
}
static var rd = 57.2957795130823;
static var dr = (Math.PI/180);
}
Symbol 1263 MovieClip [__Packages.cust.geom3D.SimpleLineSegment3D] Frame 0
class cust.geom3D.SimpleLineSegment3D
{
var world, v1, v2, A, R, G, B;
function SimpleLineSegment3D (w, sx1, sy1, sz1, sx2, sy2, sz2, ic) {
world = w;
v1 = new cust.geom3D.Vector(sx1, sy1, sz1);
v2 = new cust.geom3D.Vector(sx2, sy2, sz2);
c = ic;
A = (c >> 24) & 255;
R = (c >> 16) & 255;
G = (c >> 8) & 255;
B = c & 255;
}
function render(vp, r, lights, a, vd) {
var _local9 = cs(vp.rx);
var _local7 = sn(vp.rx);
var _local8 = cs(vp.ry);
var _local5 = sn(vp.ry);
var _local6 = cs(vp.rz);
var _local4 = sn(vp.rz);
var _local11 = vp.fl;
v1.update(vp.x, vp.y, vp.z, _local9, _local7, _local8, _local5, _local6, _local4, _local11);
if (v1._z < 0) {
return(undefined);
}
v2.update(vp.x, vp.y, vp.z, _local9, _local7, _local8, _local5, _local6, _local4, _local11);
var _local10 = mn(v1._z, v2._z);
if (_local10 < 0) {
return(undefined);
}
if (_local10 > vd) {
return(undefined);
}
if (mn(v1._x, v2._x) > (r.x + r.width)) {
return(undefined);
}
if (mx(v1._x, v2._x) < r.x) {
return(undefined);
}
if (mn(v1._y, v2._y) > (r.y + r.height)) {
return(undefined);
}
world.lineStyle(2, c & 16777215, A / 2.55, true);
world.moveTo(v1._x, v1._y);
world.lineTo(v2._x, v2._y);
}
function getXAngle() {
return(Math.atan2(v2.z - v1.z, v2.y - v1.y));
}
function getYAngle() {
return(Math.atan2(v2.x - v1.x, v2.z - v1.z));
}
function getZAngle() {
return(Math.atan2(v2.y - v1.y, v2.x - v1.x));
}
function die() {
world.removeListener(this);
}
var c = 13421772;
var cs = Math.cos;
var sn = Math.sin;
var at = Math.atan2;
var mx = Math.max;
var mn = Math.min;
var pi2 = (Math.PI/2);
}
Symbol 1264 MovieClip [__Packages.TrackEdge] Frame 0
class TrackEdge extends cust.geom3D.SimpleLineSegment3D
{
var allTrackEdges, getYAngle, ps, sn, v1, cs, pe, v2, visible, mn, mx, world, c, A;
function TrackEdge (w, sx1, sy1, sz1, sx2, sy2, sz2, ic) {
super(w, sx1, sy1, sz1, sx2, sy2, sz2, ic);
if (!_global.allTrackEdgesGlobal) {
_global.allTrackEdgesGlobal = [];
}
allTrackEdges = _global.allTrackEdgesGlobal;
allTrackEdges.push(this);
var _local4 = getYAngle() + (Math.PI/2);
ps = new cust.geom3D.Vector(v1.x + (EDGE_OFFSET * sn(_local4)), v1.y, v1.z + (EDGE_OFFSET * cs(_local4)));
pe = new cust.geom3D.Vector(v2.x + (EDGE_OFFSET * sn(_local4)), v2.y, v2.z + (EDGE_OFFSET * cs(_local4)));
}
function render(vp, r, lights, a, vd) {
var _local8 = cs(vp.rx);
var _local6 = sn(vp.rx);
var _local7 = cs(vp.ry);
var _local4 = sn(vp.ry);
var _local5 = cs(vp.rz);
var _local3 = sn(vp.rz);
var _local9 = vp.fl;
v1.update(vp.x, vp.y, vp.z, _local8, _local6, _local7, _local4, _local5, _local3, _local9);
if (v1._z < 0) {
visible = false;
return(undefined);
}
v2.update(vp.x, vp.y, vp.z, _local8, _local6, _local7, _local4, _local5, _local3, _local9);
var _local11 = mn(v1._z, v2._z);
if (_local11 < 0) {
visible = false;
return(undefined);
}
if (_local11 > vd) {
visible = false;
return(undefined);
}
if (mn(v1._x, v2._x) > (r.x + r.width)) {
visible = false;
return(undefined);
}
if (mx(v1._x, v2._x) < r.x) {
visible = false;
return(undefined);
}
if (mn(v1._y, v2._y) > (r.y + r.height)) {
visible = false;
return(undefined);
}
visible = true;
ps.update(vp.x, vp.y, vp.z, _local8, _local6, _local7, _local4, _local5, _local3, _local9);
pe.update(vp.x, vp.y, vp.z, _local8, _local6, _local7, _local4, _local5, _local3, _local9);
world.lineStyle(2, c & 16777215, A / 2.55, true);
world.moveTo(v1._x, v1._y);
world.lineTo(v2._x, v2._y);
}
function die() {
var _local3 = 0;
while (_local3 < allTrackEdges.length) {
if (allTrackEdges[_local3] == this) {
break;
}
_local3++;
}
allTrackEdges.splice(_local3, 1);
super.die();
}
static var EDGE_OFFSET = 250;
}
Symbol 1265 MovieClip [__Packages.Plane] Frame 0
class Plane extends MovieClip
{
var blendMode, world, swapDepths, removeMovieClip;
function Plane () {
super();
}
function init(w) {
blendMode = "layer";
world = w;
world.addListener(this);
}
function render(vp) {
swapDepths(vp.viewDist);
}
function die() {
world.removeListener(this);
removeMovieClip();
}
}
Symbol 1266 MovieClip [__Packages.cust.geom3D.MultiPoly] Frame 0
class cust.geom3D.MultiPoly extends MovieClip
{
var world, _parent, A, R, G, B, va, _visible, clear, beginFill, moveTo, lineTo, endFill, removeMovieClip;
function MultiPoly () {
super();
world = _parent;
}
function init(points, colour) {
c = colour;
A = ((c >> 24) & 255) / 2.55;
R = (c >> 16) & 255;
G = (c >> 8) & 255;
B = c & 255;
va = points;
}
function render(vp, r, lights, a, vd) {
var _local14 = cs(vp.rx);
var _local12 = sn(vp.rx);
var _local13 = cs(vp.ry);
var _local10 = sn(vp.ry);
var _local11 = cs(vp.rz);
var _local9 = sn(vp.rz);
var _local15 = vp.fl;
var _local6 = Number.POSITIVE_INFINITY;
var _local8 = Number.NEGATIVE_INFINITY;
var _local5 = Number.POSITIVE_INFINITY;
var _local7 = Number.POSITIVE_INFINITY;
var _local3;
var _local2 = va.length - 1;
while (_local2 > -1) {
_local3 = va[_local2];
_local3.update(vp.x, vp.y, vp.z, _local14, _local12, _local13, _local10, _local11, _local9, _local15);
if (_local3._z < 0) {
_visible = false;
return(undefined);
}
_local6 = mn(_local6, _local3._z);
_local8 = mx(_local8, _local3._x);
_local5 = mn(_local5, _local3._x);
_local7 = mn(_local7, _local3._y);
_local2--;
}
if (_local6 > vd) {
_visible = false;
return(undefined);
}
if (_local8 <= r.x) {
_visible = false;
return(undefined);
}
if (_local5 >= (r.x + r.width)) {
_visible = false;
return(undefined);
}
if (_local7 >= (r.y + r.height)) {
_visible = false;
return(undefined);
}
_visible = true;
clear();
beginFill(c);
moveTo(va[va.length - 1]._x, va[va.length - 1]._y);
_local2 = va.length - 2;
while (_local2 > -1) {
lineTo(va[_local2]._x, va[_local2]._y);
_local2--;
}
endFill();
}
function get rect() {
var _local2;
var _local8 = new flash.geom.Rectangle();
var _local5 = Number.POSITIVE_INFINITY;
var _local6 = Number.NEGATIVE_INFINITY;
var _local4 = Number.POSITIVE_INFINITY;
var _local7 = Number.NEGATIVE_INFINITY;
var _local3 = va.length - 1;
while (_local3 > -1) {
_local2 = va[_local3];
_local5 = ((_local2.x < _local5) ? (_local2.x) : (_local5));
_local6 = ((_local2.x > _local6) ? (_local2.x) : (_local6));
_local4 = ((_local2.z < _local4) ? (_local2.z) : (_local4));
_local7 = ((_local2.z > _local7) ? (_local2.z) : (_local7));
_local3--;
}
_local8.x = _local5;
_local8.y = _local4;
_local8.width = _local6 - _local5;
_local8.height = _local7 - _local4;
return(_local8);
}
function die() {
world.removeListener(this);
removeMovieClip();
}
function toString() {
return(va.toString());
}
var c = 4294901760;
var cs = Math.cos;
var sn = Math.sin;
var at = Math.atan2;
var mx = Math.max;
var mn = Math.min;
var pi2 = (Math.PI/2);
}
Symbol 1267 MovieClip [__Packages.HUD] Frame 0
class HUD extends MovieClip
{
var messageQueue, boost1, boost2, lap_txt, time_txt, speed_txt, pos_mc, wrong_way_mc, startedShowingMessage, msg_txt;
function HUD () {
super();
messageQueue = [];
boost1.gotoAndStop("onend");
boost2.stop();
}
function init(t) {
lap_txt.text = "0/" + t.laps;
}
function update(elapsedTime, player) {
if (!player.checkpoints.isRaceComplete) {
time_txt.text = Format.time(elapsedTime);
lap_txt.text = (player.checkpoints.laps + "/") + player.checkpoints.totalLaps;
speed_txt.text = Format.number(player.speed * SPEED_COEFFICIENT, 0, ",", 3);
var _local8 = player.__get__position();
pos_mc.gotoAndStop(_local8);
var _local3 = player.sector.center.a;
var _local7 = fixAng(player.ry);
var _local4 = Math.atan2(player.vx, player.vz);
var _local5 = fixAng(_local7 - _local3);
if ((Math.abs(_local5) > WRONG_WAY_THRESH) && (Math.abs(fixAng(_local4 - _local3)) > WRONG_WAY_THRESH)) {
wrong_way_mc.gotoAndStop("show");
} else {
wrong_way_mc.gotoAndStop("hide");
}
}
if (startedShowingMessage == undefined) {
if (messageQueue.length > 0) {
msg_txt.text = messageQueue.shift();
startedShowingMessage = elapsedTime;
}
} else if ((startedShowingMessage + SHOW_MESSAGE_FOR) < elapsedTime) {
msg_txt.text = "";
delete startedShowingMessage;
}
}
function showMessage(msg) {
messageQueue.push(msg.toUpperCase());
}
function setLapTime(t, l) {
}
var fixAng = cust.geom3D.RotatableSprite.FIX_ANG;
static var SPEED_COEFFICIENT = 0.04;
static var SHOW_MESSAGE_FOR = 2000;
static var WRONG_WAY_THRESH = 2.07345115136926;
}
Symbol 1268 MovieClip [__Packages.Player] Frame 0
class Player extends Saucer
{
var ry, game, x, z, engineOldState, engineState, checkpoints, isTumbling, turnSpeed, isOnTrack, __get__tBoosts, tBoostTime, vx, __get__decel, vz, __get__accel, spin, baseAccel, baseDrag, _tBoosts, tBoostSnd, p, tBoostSndComplete;
function Player (g, startPos, n, perf, route, perfModifier) {
super(g, startPos, n, perf, route, perfModifier);
}
function setPos(startPos) {
super.setPos(startPos);
turnHeldDown = 0;
game.cam.ry = ry;
game.curCamDist = game.camMinDist;
game.cam.x = x - (game.curCamDist * Math.sin(ry));
game.cam.z = z - (game.curCamDist * Math.cos(ry));
}
function control(ftime) {
engineOldState = engineState;
if ((!checkpoints.isRaceComplete) && (!isTumbling)) {
engineState = Saucer.ENGINE_IDLE;
if (Key.isDown(KEY_LEFT)) {
turnHeldDown = turnHeldDown + ftime;
ry = ry - ((turnSpeed * ftime) * Math.min(1, turnHeldDown / MAX_TURN));
} else if (Key.isDown(KEY_RIGHT)) {
turnHeldDown = turnHeldDown + ftime;
ry = ry + ((turnSpeed * ftime) * Math.min(1, turnHeldDown / MAX_TURN));
} else {
turnHeldDown = 0;
}
if (isOnTrack) {
if (Key.isDown(KEY_T_BOOST) || (Key.isDown(KEY_T_BOOST_ALT))) {
if (__get__tBoosts() > 0) {
if (!tBoostTime) {
doTBoost();
}
}
}
if (Key.isDown(KEY_DECEL)) {
vx = vx - ((__get__decel() * ftime) * Math.sin(ry));
vz = vz - ((__get__decel() * ftime) * Math.cos(ry));
} else if (Key.isDown(KEY_ACCEL) || (Key.isDown(KEY_ACCEL_ALT))) {
engineState = Saucer.ENGINE_ACTIVE;
vx = vx + ((__get__accel() * ftime) * Math.sin(ry));
vz = vz + ((__get__accel() * ftime) * Math.cos(ry));
}
}
if (tBoostTime) {
engineState = Saucer.ENGINE_BOOST;
}
} else if (isTumbling) {
ry = ry + (spin * ftime);
} else {
super.control(ftime);
}
}
function raceEnded() {
baseAccel = game.opponents[0].baseAccel;
baseDrag = game.opponents[0].baseDrag;
turnSpeed = game.opponents[0].turnSpeed;
}
function lapComplete(lap) {
super.lapComplete(lap);
game.hud.setLapTime(checkpoints.lapTimes[lap] - checkpoints.lapTimes[lap - 1], lap);
}
function doTBoost() {
var _local2 = _tBoosts;
tBoosts = ((__get__tBoosts()-1));
tBoostTime = Saucer.T_BOOST_DURATION;
if (tBoostSnd) {
delete tBoostSnd.onSoundComplete;
tBoostEnded();
}
tBoostSnd = game.snd_man.newSound(Saucer.T_BOOST_SND);
tBoostSnd.setPosition(p.x, p.y);
tBoostSnd.start();
tBoostSnd.setInitVol(100);
tBoostSnd.onSoundComplete = Delegate.create(this, tBoostSndComplete);
game.hud["boost" + _local2].gotoAndPlay("active");
}
function tBoostEnded() {
var _local2 = __get__tBoosts() + 1;
game.hud["boost" + _local2].gotoAndPlay("fade");
}
function set tBoosts(n) {
var _local2 = _tBoosts;
_tBoosts = ((n >= 0) ? (((n <= 2) ? (n) : 2)) : 0);
if (_local2 == 0) {
game.hud.boost1.gotoAndPlay("on");
if (_tBoosts > 1) {
game.hud.boost2.gotoAndPlay("on");
}
}
//return(__get__tBoosts());
}
var turnHeldDown = 0;
static var MAX_TURN = 0.1;
static var KEY_ACCEL = 38;
static var KEY_ACCEL_ALT = 16;
static var KEY_DECEL = 40;
static var KEY_LEFT = 37;
static var KEY_RIGHT = 39;
static var KEY_T_BOOST = 32;
static var KEY_T_BOOST_ALT = 17;
}
Symbol 1269 MovieClip [__Packages.TrackStartPosition] Frame 0
class TrackStartPosition extends flash.geom.Point
{
var x, y, a;
function TrackStartPosition (ix, iy, ia) {
super();
x = ix;
y = iy;
a = ia;
}
function clone() {
return(new TrackStartPosition(x, y, a));
}
static function fromXML(xmlnode, scale) {
return(new TrackStartPosition(Number(xmlnode.attributes.x) * scale, Number(xmlnode.attributes.y) * scale, (-Number(xmlnode.attributes.a)) + (Math.PI/2)));
}
}
Symbol 1270 MovieClip [__Packages.SaucerPerf] Frame 0
class SaucerPerf
{
function SaucerPerf (m, d, a, t) {
mass = m;
drag = d;
accel = a;
decel = a * 1.2;
turnSpeed = t;
}
var mass = 100;
var drag = 0.5;
var accel = 7500;
var decel = SaucerPerf.prototype.accel * 1.2;
var turnSpeed = 4;
}
Symbol 1271 MovieClip [__Packages.AiRoute] Frame 0
class AiRoute extends Array
{
var track, beziers, push;
function AiRoute (t, xmlnode, scale) {
super();
track = t;
var _local8;
var _local5 = [];
var _local3 = 0;
while (_local3 < xmlnode.childNodes.length) {
_local8 = xmlnode.childNodes[_local3];
_local5.push(new flash.geom.Point(Number(_local8.attributes.cx) * scale, Number(_local8.attributes.cy) * scale));
_local5.push(new flash.geom.Point(Number(_local8.attributes.ex) * scale, Number(_local8.attributes.ey) * scale));
_local3++;
}
beziers = [];
_local3 = 0;
while (_local3 < _local5.length) {
beziers.push(new Bezier(_local5[((_local3 + _local5.length) - 1) % _local5.length], _local5[_local3], _local5[_local3 + 1]));
_local3 = _local3 + 2;
}
var _local9;
var _local7;
var _local4;
var _local11;
var _local6;
_local11 = 0;
_local3 = 0;
while (_local3 < beziers.length) {
_local6 = beziers[_local3];
_local9 = _local6.length;
if (_local9 > 0) {
_local4 = _local11;
while (_local4 <= _local9) {
_local7 = _local6.getFAtDist(_local4, 0.005);
if (_local7 >= 0) {
push(new Waypoint(_local6.getPointOnBezier(_local7), _local6.getAngleOnBezier(_local7)));
} else {
_local4 = _local4 + WAYPOINT_SPACING;
break;
}
_local4 = _local4 + WAYPOINT_SPACING;
}
_local11 = _local9 - (_local4 - WAYPOINT_SPACING);
}
_local3++;
}
}
static var WAYPOINT_SPACING = 2250;
}
Symbol 1272 MovieClip [__Packages.Bezier] Frame 0
class Bezier
{
var start, control, end;
function Bezier (s, c, e) {
start = s;
control = c;
end = e;
}
function getAngleOnBezier(t) {
t = ((t > 1) ? 1 : (((t < 0) ? 0 : (t))));
var _local5 = Math.max(0, t - 0.001);
var _local6 = Math.min(1, t + 0.001);
var _local4 = getPointOnBezier(_local5);
var _local3 = getPointOnBezier(_local6);
return(Math.atan2(_local3.y - _local4.y, _local3.x - _local4.x));
}
function getFAtDist(d, precision) {
var _local11 = -1;
precision = (isNaN(precision) ? 1 : (precision));
var _local9 = length;
if (d == 0) {
return(0);
}
if (d == _local9) {
return(1);
}
if ((d < _local9) && (d > 0)) {
var _local5 = (1 / _local9) / precision;
var _local4 = start.clone();
var _local3;
var _local6 = 0;
var _local7;
var _local2 = _local5;
while (_local2 <= 1) {
_local3 = getPointOnBezier(_local2);
_local7 = Math.sqrt(Math.pow(_local3.x - _local4.x, 2) + Math.pow(_local3.y - _local4.y, 2));
_local6 = _local6 + _local7;
if (_local6 > d) {
return(_local2);
}
_local4 = _local3;
_local2 = _local2 + _local5;
}
return(-1);
}
return(-1);
}
function getPointOnBezier(t) {
var _local3 = new flash.geom.Point();
var _local9 = start.x;
var _local8 = start.y;
var _local7 = control.x;
var _local6 = control.y;
var _local5 = end.x;
var _local4 = end.y;
_local3.x = ((((1 - t) * (1 - t)) * _local9) + ((2 * t) * ((1 - t) * _local7))) + ((t * t) * _local5);
_local3.y = ((((1 - t) * (1 - t)) * _local8) + ((2 * t) * ((1 - t) * _local6))) + ((t * t) * _local4);
return(_local3);
}
function draw(t) {
t.moveTo(start.x, start.y);
t.curveTo(control.x, control.y, end.x, end.y);
}
function get length() {
var _local2;
var _local3 = 0;
var _local6;
var _local4;
var _local5 = 0.015625;
do {
_local6 = _local3;
_local3 = 0;
_local4 = [];
_local2 = 0;
while (_local2 <= 1) {
_local4.push(getPointOnBezier(_local2));
_local2 = _local2 + _local5;
}
_local3 = getLengthOfPointsArray(_local4);
_local5 = _local5 / 2;
} while (Math.abs(_local3 - _local6) > LENGTH_PRECISION_THRESHOLD);
return(_local3);
}
static function getLengthOfPointsArray(a) {
var _local3 = 0;
var _local1 = 1;
while (_local1 < a.length) {
_local3 = _local3 + Math.sqrt(Math.pow(a[_local1].x - a[_local1 - 1].x, 2) + Math.pow(a[_local1].y - a[_local1 - 1].y, 2));
_local1++;
}
return(_local3);
}
function toString() {
var _local2 = ((((("(s:" + start) + ", c:") + control) + ", e:") + end) + ")";
return(_local2);
}
static var LENGTH_PRECISION_THRESHOLD = 5;
}
Symbol 1273 MovieClip [__Packages.cust.geom2D.Line] Frame 0
class cust.geom2D.Line
{
var m, x, y;
function Line (x, y, m) {
this.m = m;
this.x = x;
this.y = y;
}
function isPointRightOf(p) {
var _local4 = x + Math.cos(m);
var _local3 = y + Math.sin(m);
var _local8 = p.x - x;
var _local6 = p.y - y;
var _local7 = _local4 - p.x;
var _local5 = _local3 - p.y;
return((_local8 * _local5) < (_local6 * _local7));
}
function isLineSegmentIntersecting(ls) {
var _local7 = x;
var _local11 = y;
var _local19 = x + Math.cos(m);
var _local18 = y + Math.sin(m);
var _local2 = ls.x1;
var _local6 = ls.y1;
var _local12 = ls.x2;
var _local10 = ls.y2;
var _local3 = 0;
var _local4 = 0;
var _local17 = _local19 - _local7;
var _local5 = _local12 - _local2;
if (!_local17) {
if (!_local5) {
return(false);
}
_local3 = _local7;
_local4 = _local6 + (((_local10 - _local6) * (_local7 - _local2)) / _local5);
} else if (!_local5) {
_local3 = _local2;
_local4 = _local11 + (((_local18 - _local11) * (_local2 - _local7)) / _local17);
} else {
var _local9 = m;
var _local8 = (_local10 - _local6) / _local5;
if (_local9 == _local8) {
return(false);
}
var _local16 = _local11 - (_local9 * _local7);
var _local15 = _local6 - (_local8 * _local2);
var _local14 = _local8 - _local9;
_local3 = (_local16 - _local15) / _local14;
_local4 = ((_local8 * _local16) - (_local9 * _local15)) / _local14;
}
if (_local5 > 0) {
if ((_local3 < _local2) || (_local3 > _local12)) {
return(false);
}
} else if (_local5 < 0) {
if ((_local3 > _local2) || (_local3 < _local12)) {
return(false);
}
} else if (((_local4 < _local6) && (_local4 < _local10)) || ((_local4 > _local6) && (_local4 > _local10))) {
return(false);
}
return(true);
}
function pointOfIntersection(l) {
if (m == l.m) {
return(false);
}
if ((((m == Number.POSITIVE_INFINITY) || (m == Number.NEGATIVE_INFINITY)) || (l.m == Number.POSITIVE_INFINITY)) || (l.m == Number.NEGATIVE_INFINITY)) {
if ((m == Number.POSITIVE_INFINITY) || (m == Number.NEGATIVE_INFINITY)) {
var _local3 = x;
var _local4 = (l.m * (_local3 - l.x)) + l.y;
} else {
var _local3 = l.x;
var _local4 = (m * (_local3 - x)) + y;
}
} else {
var _local3 = ((((m * x) - (l.m * l.x)) + l.y) - y) / (m - l.m);
var _local4 = (m * (_local3 - x)) + y;
}
return(new cust.geom2D.Vector(_local3, _local4));
}
function get angle() {
return(Math.atan(m));
}
function toString() {
return(((((("{ x:" + x) + ", y:") + y) + ", m:") + m) + " }");
}
static function fromLineSegment(ls) {
return(new cust.geom2D.Line(ls.x1, ls.y1, (ls.y2 - ls.y1) / (ls.x2 - ls.x1)));
}
static function fromVectors(v1, v2) {
return(new cust.geom2D.Line(v1.x, v1.y, (v2.y - v1.y) / (v2.x - v1.x)));
}
static function fromPoints(x1, y1, x2, y2) {
return(new cust.geom2D.Line(x1, y1, (y2 - y1) / (x2 - x1)));
}
}
Symbol 1274 MovieClip [__Packages.Waypoint] Frame 0
class Waypoint extends cust.geom2D.Line
{
function Waypoint (p, angle) {
super(p.x, p.y, angle + (Math.PI/2));
}
}
Symbol 1275 MovieClip [__Packages.SaucerPerfModifier] Frame 0
class SaucerPerfModifier
{
function SaucerPerfModifier (d, a, t, m) {
drag = (isNaN(d) ? 0 : (d));
accel = (isNaN(a) ? 1 : (a));
turnSpeed = (isNaN(t) ? 0 : (t));
mass = (isNaN(m) ? 0 : (m));
}
static function fromXML(xmlnode) {
var _local2 = new SaucerPerfModifier(Number(xmlnode.attributes.drag), Number(xmlnode.attributes.accel), Number(xmlnode.attributes.turnSpeed), Number(xmlnode.attributes.mass));
return(_local2);
}
var drag = 0;
var accel = 0;
var turnSpeed = 0;
var mass = 0;
}
Symbol 1276 MovieClip [__Packages.Delegate] Frame 0
class Delegate
{
function Delegate () {
}
static function create(target, handler) {
var _local3 = arguments.slice(2);
var _local2 = function () {
return(arguments.callee.handler.apply(arguments.callee.target, arguments.concat(arguments.callee.extraArgs)));
};
_local2.extraArgs = _local3;
_local2.handler = handler;
_local2.target = target;
return(_local2);
}
}
Symbol 1277 MovieClip [__Packages.Format] Frame 0
class Format
{
function Format () {
}
static function zerofill(n, z) {
var _local2 = String(n);
var _local1 = _local2.length;
while (_local1 < z) {
_local2 = "0" + _local2;
_local1++;
}
return(_local2);
}
static function time(t, minp, maxp) {
var _local1 = Math.round((t % 1000) / 10);
var _local2 = Math.round(Math.floor(t / 1000) % 60);
var _local4 = Math.floor(t / 60000);
var _local5 = (((_local4 + ":") + ((_local2 < 10) ? ("0" + _local2) : (_local2))) + ":") + ((_local1 < 10) ? ("0" + _local1) : (_local1));
return(_local5);
}
static function number(n, d, c, l) {
d = (isNaN(d) ? undefined : (d));
c = ((c == undefined) ? "," : (c));
var _local1 = String(n).split(".");
if (!(d === undefined)) {
if (_local1[1]) {
var _local3 = String(Math.round(Number("." + _local1[1]) * Math.pow(10, d)) * Math.pow(10, -d));
_local3 = ((_local3.indexOf(".") < 0) ? (_local3) : (_local3.split(".")[1]));
} else {
var _local3 = "";
}
var _local2 = 0;
while (_local3.length < d) {
var _local3 = _local3 + "0";
_local2++;
}
_local1[1] = _local3;
}
var _local2 = 3;
while (_local1[0].length > _local2) {
_local1[0] = (_local1[0].substring(0, _local1[0].length - _local2) + c) + _local1[0].substring(_local1[0].length - _local2);
_local2 = _local2 + 4;
}
if (!isNaN(l)) {
_local1[0] = zerofill(_local1[0], l);
}
if ((_local1.length > 1) && (d > 0)) {
return((_local1[0] + ".") + _local1[1]);
}
return(_local1[0]);
}
static function ordinal(n) {
if (((n % 100) >= 11) && ((n % 100) <= 13)) {
return("th");
}
if ((n % 10) == 1) {
return("st");
}
if ((n % 10) == 2) {
return("nd");
}
if ((n % 10) == 3) {
return("rd");
}
return("th");
}
static function truncate(s, l, r) {
l = (isNaN(l) ? 20 : (l));
r = ((r == undefined) ? "..." : (r));
if (s.length > l) {
s = s.substr(0, l - r.length);
s = s + r;
}
return(s);
}
}
Symbol 1278 MovieClip [__Packages.Map] Frame 0
class Map extends MovieClip
{
var game, track, mapClip, playerMarker, createEmptyMovieClip, markers, attachMovie, _x, _y;
function Map () {
super();
}
function init(g) {
game = g;
track = game.track;
if (mapClip) {
mapClip.removeMovieClip();
playerMarker.removeMovieClip();
}
createEmptyMovieClip("mapClip", 0);
markers = {};
var _local3;
var _local4;
var _local9;
var _local8;
var _local2 = 0;
while (_local2 < game.saucers.length) {
_local3 = game.saucers[_local2];
_local4 = attachMovie("opponentMarker" + _local2, "opponentMarker" + _local2, _local2 + 1);
markers[_local3.mc._name] = _local4;
_local2++;
}
track.render(mapClip, track.scale, mapFillCol, mapFillAlpha);
var _local6 = mapClip.transform.pixelBounds.clone();
var _local7 = mapMaxDimensions / Math.max(_local6.width, _local6.height);
mapClip._xscale = (mapClip._yscale = _local7 * 100);
var _local5 = mapClip.getBounds(this);
mapClip._x = -_local5.xMin;
mapClip._y = -_local5.yMin;
}
function update() {
var _local2 = {};
var _local4;
var _local5;
var _local3 = 0;
while (_local3 < game.saucers.length) {
_local4 = game.saucers[_local3];
_local2.x = _local4.z;
_local2.y = _local4.x;
mapClip.localToGlobal(_local2);
_local2.x = _local2.x - _x;
_local2.y = _local2.y - _y;
_local5 = markers[_local4.mc._name];
_local5._x = _local2.x;
_local5._y = _local2.y;
_local3++;
}
}
var mapFillCol = 16777215;
var mapFillAlpha = 100;
var mapMaxDimensions = 60;
}
Symbol 1279 MovieClip [__Packages.PolygonGroup] Frame 0
class PolygonGroup extends Array
{
var length;
function PolygonGroup () {
super();
}
function setColour(a, r, g, b) {
var _local2 = 0;
while (_local2 < length) {
this[_local2].A = a;
this[_local2].R = r;
this[_local2].G = g;
this[_local2].B = b;
_local2++;
}
}
}
Symbol 1280 MovieClip [__Packages.cust.snd3D.SoundManager3D] Frame 0
class cust.snd3D.SoundManager3D extends SoundManager
{
var sounds, mc_holder;
function SoundManager3D () {
super();
}
function updateVols(mic) {
var _local2;
for (var _local3 in sounds) {
_local2 = sounds[_local3];
_local2.positionSound(mic, attenuationFactor);
}
}
function newSound() {
var _local5 = mc_holder.getNextHighestDepth();
var _local6 = mc_holder.createEmptyMovieClip("sh_mc" + _local5, _local5);
var _local4 = new cust.snd3D.Snd3D(_local6, this, 0, 0);
var _local3 = 0;
while (_local3 < arguments.length) {
if (arguments[_local3] != undefined) {
_local4.attachSound(arguments[_local3]);
}
_local3++;
}
sounds[_local5] = _local4;
_local4.setVolume(0);
return(_local4);
}
var attenuationFactor = 20000;
}
Symbol 1281 MovieClip [__Packages.cust.snd3D.Mic] Frame 0
class cust.snd3D.Mic extends flash.geom.Point
{
function Mic () {
super();
}
}
Symbol 1282 MovieClip [__Packages.cust.snd3D.Snd3D] Frame 0
class cust.snd3D.Snd3D extends Snd
{
var x, y, _vol, _distMul, setPan;
function Snd3D (targ, sndman, ix, iy) {
super(targ, sndman);
x = ix;
y = iy;
_vol = super.getVolume();
_distMul = 1;
}
function setPosition(nx, ny) {
x = nx;
y = ny;
}
function setPositionPoint(p) {
x = p.x;
y = p.y;
}
function positionSound(mic, f) {
var _local5 = x - mic.x;
var _local4 = y - mic.y;
var _local3 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local3 < f) {
var _local6 = Math.atan2(_local4, _local5);
var _local2 = 1 / ((_local3 / f) * 100);
_local2 = ((_local2 > 1) ? 1 : (_local2));
setVolume3D(_local2);
if ((_local3 / f) > MIN_SND_PAN_FRACT) {
var _local8 = -fixAng((fixAng(mic.a) + _local6) - (Math.PI/2));
setPan(_local8 * 100);
} else {
setPan(0);
}
} else {
setVolume(0);
}
}
function setInitVol(n) {
_vol = n;
}
function setVolume(n) {
_vol = n;
super.setVolume(Math.min(SND_CEIL, n * _distMul));
}
function getVolume() {
return(_vol);
}
function setVolume3D(n) {
_distMul = n;
super.setVolume(Math.min(SND_CEIL, n * _vol));
}
function getVolume3D() {
return(_distMul);
}
function fixAng(a) {
var _local1 = Math.PI;
return(((a + (103 * _local1)) % (2 * _local1)) - Math.PI);
}
static var MIN_SND_PAN_FRACT = 0.1;
static var SND_CEIL = 75;
}
Symbol 1283 MovieClip [__Packages.AISaucer] Frame 0
class AISaucer extends Saucer
{
var baseAccel, baseDrag, turnSpeed, curWaypoint, track, sectorN, airoute, curWaypointN, targWaypointN, targWaypoint, alteredDragTime, alteredDrag, game, __get__position, alteredAccelTime, alteredAccel, tBoostTime;
function AISaucer (g, startPos, n, perf, route, perfModifier) {
super(g, startPos, n, perf, route, perfModifier);
baseAccel = baseAccel * ACCEL_MOD;
baseDrag = baseDrag * DRAG_MOD;
turnSpeed = turnSpeed + TURN_MOD;
}
function fallenOff() {
var _local4 = new flash.geom.Point(curWaypoint.x, curWaypoint.y);
var _local5 = track.wideSectors[(sectorN + 1) % track.wideSectors.length];
if (!_local5.isPointInSector(_local4)) {
var _local3 = 0;
while (_local3 < airoute.length) {
_local4.x = airoute[_local3].x;
_local4.y = airoute[_local3].y;
if (_local5.isPointInSector(_local4)) {
setCurWaypoint(_local3);
break;
}
_local3++;
}
}
super.fallenOff();
}
function setCurWaypoint(n) {
curWaypointN = n;
curWaypoint = airoute[n];
targWaypointN = (curWaypointN + 1) % airoute.length;
targWaypoint = airoute[targWaypointN];
}
function get drag() {
var _local2 = ((alteredDragTime == undefined) ? (baseDrag) : (alteredDrag));
var _local3 = (__get__position() - game.player.position) - 1;
if (_local3 > 0) {
_local2 = _local2 + (BEHIND_DRAG_MOD * _local3);
}
return(Math.max(0.01, _local2));
}
function get accel() {
var _local2 = ((alteredAccelTime == undefined) ? (baseAccel) : (alteredAccel));
var _local3 = (__get__position() - game.player.position) - 1;
if (_local3 > 0) {
_local2 = _local2 * (1 + (BEHIND_ACCEL_MOD * _local3));
}
return(((tBoostTime == undefined) ? (_local2) : (_local2 * Saucer.T_BOOST_POWER)));
}
static var ACCEL_MOD = 1;
static var DRAG_MOD = 1;
static var TURN_MOD = 1;
static var BEHIND_ACCEL_MOD = 0.15;
static var BEHIND_DRAG_MOD = -0.01;
}
Symbol 1284 MovieClip [__Packages.TrackSector] Frame 0
class TrackSector
{
var track, bl, br, tl, tr, b, r, t, l, center;
function TrackSector (it, ibl, ibr, itr, itl) {
track = it;
bl = ibl;
br = ibr;
tl = itl;
tr = itr;
b = new cust.geom2D.LineSegment(bl.x, bl.y, br.x, br.y);
r = new cust.geom2D.LineSegment(br.x, br.y, tr.x, tr.y);
t = new cust.geom2D.LineSegment(tr.x, tr.y, tl.x, tl.y);
l = new cust.geom2D.LineSegment(tl.x, tl.y, bl.x, bl.y);
center = new TrackStartPosition();
center.x = (((bl.x + br.x) + tl.x) + tr.x) / 4;
center.y = (((bl.y + br.y) + tl.y) + tr.y) / 4;
center.a = (Math.PI/2) - cust.geom2D.LineSegment.fromPoints(b.interpolate(0.5), t.interpolate(0.5)).__get__radians();
}
function isPointInSector(p) {
if (b.isPointRightOf(p)) {
if (r.isPointRightOf(p)) {
if (t.isPointRightOf(p)) {
if (l.isPointRightOf(p)) {
return(true);
}
}
}
}
return(false);
}
}
Symbol 1285 MovieClip [__Packages.cust.geom2D.Ball] Frame 0
class cust.geom2D.Ball extends cust.geom2D.Circle
{
var x, y, r, v;
function Ball (ix, iy, ir, vx, vy, m, b) {
super();
x = (isNaN(ix) ? 0 : (ix));
y = (isNaN(iy) ? 0 : (iy));
r = (isNaN(ir) ? 0 : (ir));
vx = (isNaN(vx) ? 0 : (vx));
vy = (isNaN(vy) ? 0 : (vy));
mass = (isNaN(m) ? 1 : (m));
bounce = (isNaN(b) ? 1 : (b));
v = new cust.geom2D.Vector(vx, vy);
}
function move() {
x = x + v.x;
y = y + v.y;
}
function collisionDetection(objs) {
var _local6 = objs.length;
var _local2;
var _local4 = 0;
while (_local4 < _local6) {
if (this != objs[_local4]) {
_local2 = objs[_local4];
var _local3 = r + _local2.r;
if (_local2.x < (x - _local3)) {
} else if (_local2.x > (x + _local3)) {
} else if (_local2.y < (y - _local3)) {
} else if (_local2.y > (y + _local3)) {
} else if ((r + _local2.r) > Math.sqrt(((x - _local2.x) * (x - _local2.x)) + ((y - _local2.y) * (y - _local2.y)))) {
return(_local2);
}
}
_local4++;
}
}
function collisionResponse(ball) {
var _local5 = new cust.geom2D.Vector(ball.v.x - v.x, ball.v.y - v.y);
var _local4 = new cust.geom2D.Vector((ball.x - x) - _local5.x, (ball.y - y) - _local5.y);
var _local3 = (new cust.geom2D.Circle(0, 0, r + ball.r)).LineIntersection(cust.geom2D.LineSegment.fromPoints(_local4, new cust.geom2D.Vector(_local4.x + _local5.x, _local4.y + _local5.y)));
if (_local3.length == 2) {
if (flash.geom.Point.distance(_local4, _local3[1]) < flash.geom.Point.distance(_local4, _local3[0])) {
var _local7 = _local3[1];
} else {
var _local7 = _local3[0];
}
} else if (_local3.length == 1) {
var _local7 = _local3[0];
}
if (_local7) {
var _local6 = 1 - (flash.geom.Point.distance(_local7, _local4) / _local5.__get__length());
var _local9 = v.multiply(_local6);
_local9.length = _local9.length + 0.1;
x = x - _local9.x;
y = y - _local9.y;
var _local8 = ball.v.multiply(_local6);
_local8.length = _local8.length + 0.1;
ball.x = ball.x - _local8.x;
ball.y = ball.y - _local8.y;
}
bounceOffBall(ball);
if (_local7) {
var _local14 = v.multiply(_local6);
var _local12 = ball.v.multiply(_local6);
x = x + _local14.x;
y = y + _local14.y;
ball.x = ball.x + _local12.x;
ball.y = ball.y + _local12.y;
}
var _local16 = Math.sqrt(((x - ball.x) * (x - ball.x)) + ((y - ball.y) * (y - ball.y)));
if ((r + ball.r) > _local16) {
var _local18 = (r + ball.r) - _local16;
var _local15 = v.__get__length();
var _local13 = ball.v.__get__length();
var _local17 = _local18 / (_local15 + _local13);
var _local11 = new cust.geom2D.Vector(x - ball.x, y - ball.y);
var _local10 = new cust.geom2D.Vector(ball.x - x, ball.y - y);
_local11.__set__length((_local17 * _local15) + 1);
_local10.__set__length((_local17 * _local13) + 1);
x = x + _local11.x;
y = y + _local11.y;
ball.x = ball.x + _local10.x;
ball.y = ball.y + _local10.y;
}
}
function bounceOffBall(obj) {
var _local8 = obj.x - x;
var _local7 = obj.y - y;
var _local9 = Math.atan2(_local7, _local8);
var _local3 = Math.sin(_local9);
var _local2 = Math.cos(_local9);
var _local12 = new cust.geom2D.Vector(0, 0);
var _local11 = new cust.geom2D.Vector((_local8 * _local2) + (_local7 * _local3), (_local7 * _local2) - (_local8 * _local3));
var _local5 = new cust.geom2D.Vector((v.x * _local2) + (v.y * _local3), (v.y * _local2) - (v.x * _local3));
var _local6 = new cust.geom2D.Vector((obj.v.x * _local2) + (obj.v.y * _local3), (obj.v.y * _local2) - (obj.v.x * _local3));
var _local10 = _local5.x - _local6.x;
_local5.x = (((mass - obj.mass) * _local5.x) + ((2 * obj.mass) * _local6.x)) / (mass + obj.mass);
_local6.x = _local10 + _local5.x;
_local5.length = _local5.length * bounce;
_local6.length = _local6.length * obj.bounce;
v.x = (_local5.x * _local2) - (_local5.y * _local3);
v.y = (_local5.y * _local2) + (_local5.x * _local3);
obj.v.x = (_local6.x * _local2) - (_local6.y * _local3);
obj.v.y = (_local6.y * _local2) + (_local6.x * _local3);
}
function toString() {
return(((((((((("(x:" + x) + ", y:") + y) + ", r:") + r) + ", vx:") + v.x) + ", vy:") + v.y) + ")");
}
var mass = 1;
var bounce = 1;
}
Symbol 1286 MovieClip [__Packages.Checkpoint] Frame 0
class Checkpoint extends cust.geom2D.LineSegment
{
var gx1, gy1, gx2, gy2, extendStart, extendEnd, center, interpolate;
function Checkpoint (ix1, iy1, ix2, iy2, igx1, igy1, igx2, igy2) {
super(ix1, iy1, ix2, iy2);
gx1 = igx1;
gy1 = igy1;
gx2 = igx2;
gy2 = igy2;
extendStart(EXTEND);
extendEnd(EXTEND);
center = interpolate(0.5);
}
static var EXTEND = 250;
}
Symbol 1287 MovieClip [__Packages.Rand] Frame 0
class Rand
{
function Rand () {
}
static function midBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 2 : (i + 1));
var _local3 = 0;
var _local1 = 0;
while (_local1 < i) {
_local3 = _local3 + ((v() * (max - min)) + min);
_local1++;
}
_local3 = _local3 / i;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local7 = _local3 % p;
if (_local7 <= (p / 2)) {
_local3 = _local3 - _local7;
} else {
_local3 = _local3 + (p - _local7);
}
}
return(_local3);
}
static function minBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = ((1 - Math.pow(v(), 1 / (i + 1))) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function maxBias(min, max, i, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
i = (isNaN(i) ? 1 : (i));
var _local1 = (Math.pow(v(), 1 / (i + 1)) * (max - min)) + min;
if (p != undefined) {
p = 1 / Math.pow(10, p);
var _local3 = _local1 % p;
if (_local3 <= (p / 2)) {
_local1 = _local1 - _local3;
} else {
_local1 = _local1 + (p - _local3);
}
}
return(_local1);
}
static function value() {
if (arguments.length > 0) {
var _local2 = v() * arguments.length;
_local2 = _local2 - (_local2 % 1);
return(arguments[_local2]);
}
}
static function get number() {
return(v());
}
static function random(min, max, p) {
min = (isNaN(min) ? 0 : (min));
max = (isNaN(max) ? 1 : (max));
if (!isNaN(p)) {
p = 1 / Math.pow(10, p);
max = max + p;
} else {
}
var _local3 = (v() * (max - min)) + min;
if (p) {
_local3 = _local3 - (_local3 % p);
}
return(_local3);
}
static var v = Math.random;
}
Symbol 1288 MovieClip [__Packages.TrackScenery] Frame 0
class TrackScenery
{
var x, y, z, r, rs, l;
function TrackScenery (scale, xmlnode) {
x = Number(xmlnode.attributes.x) * scale;
y = Number(xmlnode.attributes.y) * scale;
z = Number(xmlnode.attributes.z) * scale;
r = Number(xmlnode.attributes.r);
rs = Number(xmlnode.attributes.rs) / 1000;
l = xmlnode.attributes.l;
}
}
Symbol 1289 MovieClip [__Packages.TrackItem] Frame 0
class TrackItem extends cust.geom2D.Ball
{
var linkage, power, applyEffect, track, x, y, sprite, r;
function TrackItem (scale, xmlnode, itrack) {
super(Number(xmlnode.attributes.x) * scale, Number(xmlnode.attributes.y) * scale, scale * Number(xmlnode.attributes.r), 0, 0, 500, 0.1);
linkage = xmlnode.attributes.l;
power = Number(xmlnode.attributes.p);
if (linkage == BARRIER) {
itrack.obstacles.push(this);
}
applyEffect = this[linkage + "Handler"];
track = itrack;
}
function pingerHandler(saucer) {
saucer.jump(-(power ? (power) : (PING_FORCE)));
var _local2 = track.game.snd_man.playAndRemove(PING_SND);
_local2.setPosition(x, y);
_local2.setInitVol(100);
sprite.gotoAndPlay(ACTIVATED);
}
function slowdownHandler(saucer) {
saucer.alteredDrag = 0.01;
saucer.alteredDragTime = 5;
saucer.mc.startFrict(false);
var _local2 = track.game.snd_man.playAndRemove(FRICT_UP_SND);
_local2.setPosition(x, y);
_local2.setInitVol(100);
sprite.gotoAndPlay(ACTIVATED);
}
function zerofrictionHandler(saucer) {
saucer.alteredDrag = 0.9;
saucer.alteredDragTime = 3;
saucer.mc.startFrict(false);
var _local2 = track.game.snd_man.playAndRemove(FRICT_DOWN_SND);
_local2.setPosition(x, y);
_local2.setInitVol(100);
sprite.gotoAndPlay(ACTIVATED);
}
function oilHandler(saucer) {
if (!saucer.isTumbling) {
saucer.isTumbling = true;
saucer.spin = Math.random() * 20;
saucer.gss = ((Math.random() > 0.5) ? 360 : -360);
saucer.tumbleTime = 1;
var _local3 = track.game.snd_man.playAndRemove(TUMBLE_SND);
_local3.setPosition(x, y);
_local3.setInitVol(100);
sprite.gotoAndPlay(ACTIVATED);
}
}
function speedboostHandler(saucer) {
saucer.alteredAccel = saucer.baseAccel * 1.5;
saucer.alteredAccelTime = 3;
saucer.mc.startAccel();
var _local2 = track.game.snd_man.playAndRemove(SPEED_BOOST_SND);
_local2.setPosition(x, y);
_local2.setInitVol(100);
sprite.gotoAndPlay(ACTIVATED);
}
function shuntboostHandler(saucer) {
saucer.alteredMass = saucer.ball._mass * 5;
saucer.alteredMassTime = 15;
saucer.mc.startShunt();
saucer.startShunt();
sprite.gotoAndPlay(ACTIVATED);
}
function gravHandler(saucer, ftime) {
var _local3 = saucer.x - x;
var _local2 = saucer.z - y;
var _local5 = Math.atan2(_local3, _local2);
var _local7 = Math.sqrt((_local3 * _local3) + (_local2 * _local2));
var _local6 = ((1 - (_local7 / r)) * power) * ftime;
saucer.vz = saucer.vz - (_local6 * Math.cos(_local5));
saucer.vx = saucer.vx - (_local6 * Math.sin(_local5));
}
function barrierHit() {
sprite.gotoAndPlay(ACTIVATED);
}
static var PING_FORCE = 1000;
static var ACTIVATED = "activated";
static var BARRIER = "barrier";
static var PING_SND = "jump";
static var TUMBLE_SND = "tumble";
static var FRICT_DOWN_SND = "frictionDown";
static var FRICT_UP_SND = "frictionUp";
static var SPEED_BOOST_SND = "speedboostSnd";
}
Symbol 1290 MovieClip [__Packages.TournamentResults] Frame 0
class TournamentResults
{
static var NUM_RACERS, racers;
function TournamentResults () {
}
static function init(numRacers) {
NUM_RACERS = numRacers;
racers = [];
var _local1 = 0;
while (_local1 < numRacers) {
racers[_local1] = new RacerTournamentStandings(_local1);
_local1++;
}
}
static function getRaceResults(raceNum) {
var _local2 = [];
var _local1 = 0;
while (_local1 < racers.length) {
_local2[racers[_local1].positions[raceNum] - 1] = racers[_local1];
_local1++;
}
return(_local2);
}
static function getStandings() {
var _local1 = [].concat(racers);
_local1.sortOn("points", Array.NUMERIC | Array.DESCENDING);
return(_local1);
}
static function pointsForPosition(p) {
var _local1 = NUM_RACERS - p;
if (p == 1) {
_local1 = _local1 + VICTORY_BONUS;
}
return(_local1);
}
static var VICTORY_BONUS = 1;
}
Symbol 1291 MovieClip [__Packages.RacerTournamentStandings] Frame 0
class RacerTournamentStandings
{
var playerNum, positions, times, bestLaps;
function RacerTournamentStandings (n) {
playerNum = n;
positions = [];
times = [];
bestLaps = [];
}
function setRaceResult(raceNum, p, saucer, elapsedTime) {
var _local4 = saucer.checkpoints;
positions[raceNum] = p;
var _local5;
if (_local4.isRaceComplete) {
_local5 = _local4.finishTime;
} else if (_local4.laps == _local4.totalLaps) {
var _local7 = saucer.track.sectors.length - saucer.sectorN;
_local5 = elapsedTime + (_local7 * TIME_PER_SECTOR);
} else {
_local5 = -1;
}
times[raceNum] = _local5;
bestLaps[raceNum] = _local4.bestLapTime();
var _local3;
points = 0;
var _local2 = 0;
while (_local2 < positions.length) {
_local3 = positions[_local2];
if (!isNaN(_local3)) {
points = points + TournamentResults.pointsForPosition(_local3);
}
_local2++;
}
}
var points = 0;
static var TIME_PER_SECTOR = 183;
}
Symbol 1292 MovieClip [__Packages.TrackSection] Frame 0
class TrackSection extends Bezier
{
var end, control, prevTrackSection, start, isStart, getAngleOnBezier, getPointOnBezier, lEdge, rEdge, __get__length, getFAtDist;
function TrackSection (t, e, c, ew, cw) {
super();
end = e;
control = c;
controlWidth = cw;
endWidth = ew;
}
function init(ps, iS) {
prevTrackSection = ps;
start = ps.end;
isStart = iS;
}
function setBeziers() {
var _local17 = prevTrackSection;
var _local6 = (Math.PI/2);
var _local18 = _local17.getAngleOnBezier(1) + _local6;
var _local15 = getAngleOnBezier(1) + _local6;
var _local3 = getAngleOnBezier(0.5) + _local6;
var _local20 = getPointOnBezier(0.5);
var _local16 = _local17.endWidth / 2;
var _local2 = controlWidth / 2;
var _local19 = endWidth / 2;
var _local8 = new flash.geom.Point();
var _local7 = new flash.geom.Point();
var _local4 = new flash.geom.Point();
var _local9 = new flash.geom.Point();
var _local5 = new flash.geom.Point();
var _local10 = new flash.geom.Point();
var _local12 = _local16 * Math.cos(_local18);
var _local11 = _local16 * Math.sin(_local18);
var _local14 = _local19 * Math.cos(_local15);
var _local13 = _local19 * Math.sin(_local15);
_local8.x = start.x + _local12;
_local8.y = start.y + _local11;
_local7.x = start.x - _local12;
_local7.y = start.y - _local11;
_local4.x = control.x + (_local2 * Math.cos(_local3));
_local4.y = control.y + (_local2 * Math.sin(_local3));
_local9.x = control.x - (_local2 * Math.cos(_local3));
_local9.y = control.y - (_local2 * Math.sin(_local3));
_local5.x = end.x + _local14;
_local5.y = end.y + _local13;
_local10.x = end.x - _local14;
_local10.y = end.y - _local13;
lEdge = new Bezier(_local8, _local4, _local5);
rEdge = new Bezier(_local7, _local9, _local10);
}
function getPoints(offset) {
var _local4 = {lp:[], rp:[]};
var _local5 = __get__length();
var _local3;
if (_local5 > 0) {
var _local2 = offset;
while (_local2 <= _local5) {
_local3 = getFAtDist(_local2, 0.01);
if (_local3 >= 0) {
_local4.lp.push(lEdge.getPointOnBezier(_local3));
_local4.rp.push(rEdge.getPointOnBezier(_local3));
} else {
_local2 = _local2 + Track.POINT_SEPARATION;
break;
}
_local2 = _local2 + Track.POINT_SEPARATION;
}
}
_local4.offset = _local5 - (_local2 - Track.POINT_SEPARATION);
return(_local4);
}
function draw(t) {
lEdge.draw(t);
rEdge.draw(t);
}
static function fromXML(track, node, scale) {
return(new TrackSection(track, new flash.geom.Point(Number(node.attributes.ex) * scale, Number(node.attributes.ey) * scale), new flash.geom.Point(Number(node.attributes.cx) * scale, Number(node.attributes.cy) * scale), Number(node.attributes.et) * scale, Number(node.attributes.mt) * scale));
}
var controlWidth = 25;
var endWidth = 25;
}
Symbol 1293 MovieClip [__Packages.SaucerBall] Frame 0
class SaucerBall extends cust.geom2D.Ball
{
var saucer, _mass;
function SaucerBall (s, ix, iy, ir, vx, vy, m, b) {
super(ix, iy, ir, vx, vy, m, b);
saucer = s;
}
function get mass() {
return((saucer.alteredMassTime ? (saucer.alteredMass) : (_mass)));
}
function set mass(n) {
_mass = n;
//return(mass);
}
}
Symbol 1294 MovieClip [__Packages.Particle] Frame 0
class Particle extends cust.geom3D.Sprite
{
var existedFor, die, cto, _rotation, vx, vy, vz, x, y, z;
function Particle () {
super();
}
function control(ftime) {
if (!existedFor) {
existedFor = ftime;
} else {
existedFor = existedFor + ftime;
if (existedFor > lifetime) {
die();
} else {
cto.ab = -255 * (existedFor / lifetime);
}
}
_rotation = _rotation + rot;
vx = vx * Math.pow(drag, ftime);
vy = vy * Math.pow(drag, ftime);
vz = vz * Math.pow(drag, ftime);
x = x + (vx * ftime);
y = y + (vy * ftime);
z = z + (vz * ftime);
}
var rot = 0;
var drag = 0.5;
var lifetime = 0.5;
}
Symbol 1295 MovieClip [__Packages.CarouselItem] Frame 0
class CarouselItem extends MovieClip
{
var reflection_ct, carousel, p, info, image, image_pos_mc, transform;
function CarouselItem () {
super();
reflection_ct = new flash.geom.ColorTransform();
}
function init(c, pos, i) {
carousel = c;
p = pos;
info = i;
image = image_pos_mc.attachMovie(i.linkage, "image", 0);
c.mcl.addListener(this);
}
function update(n) {
var _local2 = ((maxTint - minTint) * n) + minTint;
reflection_ct.redOffset = _local2 * reflectionBase.r;
reflection_ct.greenOffset = _local2 * reflectionBase.g;
reflection_ct.blueOffset = _local2 * reflectionBase.b;
reflection_ct.redMultiplier = 1 - _local2;
reflection_ct.greenMultiplier = 1 - _local2;
reflection_ct.blueMultiplier = 1 - _local2;
transform.colorTransform = reflection_ct;
}
var vAlign = "center";
var hAlign = "center";
static var MAX_ATTEMPTS = 3;
static var reflectionBase = new RGB(0);
static var maxTint = 1;
static var minTint = 0;
}
Symbol 1296 MovieClip [__Packages.Carousel] Frame 0
class Carousel extends MovieClip
{
var _visibleItems, mcl, lastTime, leftBtn, rightBtn, reflections, createEmptyMovieClip, holder, _carouselItems, broadcastMessage, nextItem, currItems, itemHolder;
function Carousel () {
super();
_visibleItems = {};
mcl = new MovieClipLoader();
mcl.checkPolicyFile = true;
lastTime = getTimer();
leftBtn.onPress = Delegate.create(this, btnPressed, -1);
rightBtn.onPress = Delegate.create(this, btnPressed, 1);
rightBtn.onDragOut = (leftBtn.onDragOut = (rightBtn.onRelease = (leftBtn.onRelease = Delegate.create(this, btnReleased))));
AsBroadcaster.initialize(this);
}
function init(itemsArr, w, h, d, s, f) {
for (s in _visibleItems) {
_visibleItems[s].carouselItem.removeMovieClip();
}
reflections.blendMode = "layer";
reflections._alpha = 25;
reflections.onPress = function () {
};
reflections.useHandCursor = false;
reflections._yscale = -100;
createEmptyMovieClip("holder", -2);
holder._visible = false;
_visibleItems = {};
_carouselItems = itemsArr;
_carouselWidth = w;
_carouselDepth = d;
_carouselHeight = h;
_itemSpacing = s;
_fov = f;
carouselPosition = (carouselLength + (-(_carouselWidth / 2)));
carouselPosition = carouselPosition + 1;
carouselPosition = carouselPosition - 1;
broadcastMessage(STOPPED, 0);
}
function btnPressed(d) {
dir = (lastDir = d);
}
function btnReleased() {
dir = 0;
}
function onEnterFrame() {
var _local5 = getTimer();
var _local3 = (_local5 - lastTime) / 1000;
if (dir) {
carouselPosition = carouselPosition + ((MOVEMENT_SPEED * _local3) * dir);
if (nextItem === undefined) {
broadcastMessage(STARTED);
}
if (dir > 0) {
nextItem = Math.floor(((carouselPosition + (_carouselWidth / 2)) / _itemSpacing) + 1) % _carouselItems.length;
} else {
nextItem = Math.floor((carouselPosition + (_carouselWidth / 2)) / _itemSpacing) % _carouselItems.length;
}
} else if (nextItem != undefined) {
var _local2 = nextItem * _itemSpacing;
var _local4;
if (_local2 >= _carouselPosition) {
_local4 = _local2 - (_carouselPosition + (_carouselWidth / 2));
} else {
_local4 = ((_carouselItems.length * _itemSpacing) - (_carouselPosition + (_carouselWidth / 2))) + _local2;
}
var _local6 = MOVEMENT_SPEED * _local3;
if ((_local4 * lastDir) > _local6) {
carouselPosition = carouselPosition + (_local6 * lastDir);
} else {
carouselPosition = (carouselLength + (_local2 - (_carouselWidth / 2)));
broadcastMessage(STOPPED, nextItem);
delete nextItem;
}
}
lastTime = _local5;
}
function rotateTo(n) {
nextItem = n;
dir = (lastDir = 1);
}
function render() {
var _local12 = Math.ceil(_carouselPosition / _itemSpacing) % _carouselItems.length;
var _local13 = Math.floor((_carouselPosition + _carouselWidth) / _itemSpacing) % _carouselItems.length;
var _local3 = {};
currItems = [];
var _local5 = _local12;
while (_local5 != ((_local13 + 1) % _carouselItems.length)) {
_local3[_local5] = _carouselItems[_local5];
currItems.push(_local5);
_local5 = (_local5 + 1) % _carouselItems.length;
}
for (var _local2 in _visibleItems) {
if (!_local3[_local2]) {
_visibleItems[_local2].carouselItem.removeMovieClip();
_visibleItems[_local2].carouselItemReflection.removeMovieClip();
delete _visibleItems[_local2];
}
}
for (var _local2 in _local3) {
if (!_visibleItems[_local2]) {
_local3[_local2].carouselItem = itemHolder.attachMovie(CAROSEL_ITEM_LINKAGE, "item" + _local2, (_carouselDepth + Number(_local2)) * 100);
_local3[_local2].carouselItemReflection = reflections.attachMovie(CAROSEL_ITEM_LINKAGE, "item" + _local2, (_carouselDepth + Number(_local2)) * 100);
_local3[_local2].carouselItem.init(this, Number(_local2), _carouselItems[_local2], _carouselItems[_local2].link);
_local3[_local2].carouselItemReflection.init(this, Number(_local2), _carouselItems[_local2]);
}
}
var _local7;
var _local4;
var _local6;
var _local10;
var _local9;
var _local11;
for (var _local2 in _local3) {
_local11 = Number(_local2) * _itemSpacing;
if (_local11 >= _carouselPosition) {
_local10 = _local11 - (_carouselPosition + (_carouselWidth / 2));
} else {
_local10 = ((_carouselItems.length * _itemSpacing) - (_carouselPosition + (_carouselWidth / 2))) + _local11;
}
_local7 = getItemDepth(_local10);
var _local8 = _local7 / _carouselDepth;
_local4 = _local3[_local2].carouselItem;
_local6 = _local3[_local2].carouselItemReflection;
_local4.swapDepths(Math.round(_local7 * 100));
_local6.swapDepths(Math.round(_local7 * 100));
_local9 = _fov / (_fov + (_carouselDepth - _local7));
_local6._x = (_local4._x = _local10 * _local9);
_local4._y = (_carouselHeight * _local8) * _local9;
_local6._y = -_local4._y;
_local6._xscale = (_local6._yscale = (_local4._xscale = (_local4._yscale = _local9 * 100)));
_local4.update(1 - _local8);
_local6.update(1 - _local8);
}
_visibleItems = _local3;
}
function getItemDepth(p) {
return(Math.cos(Math.PI * (p / _carouselWidth)) * _carouselDepth);
}
function get carouselPosition() {
return(_carouselPosition);
}
function set carouselPosition(n) {
_carouselPosition = ((_carouselItems.length * _itemSpacing) + n) % (_carouselItems.length * _itemSpacing);
render();
//return(carouselPosition);
}
function get carouselLength() {
return(_carouselItems.length * _itemSpacing);
}
function get carouselWidth() {
return(_carouselWidth);
}
function set carouselWidth(n) {
_carouselWidth = n;
render();
//return(carouselWidth);
}
function get carouselDepth() {
return(_carouselDepth);
}
function set carouselDepth(n) {
_carouselDepth = n;
render();
//return(carouselDepth);
}
function get carouselHeight() {
return(_carouselHeight);
}
function set carouselHeight(n) {
_carouselHeight = n;
render();
//return(carouselHeight);
}
function get itemSpacing() {
return(_itemSpacing);
}
function set itemSpacing(n) {
_itemSpacing = n;
render();
//return(itemSpacing);
}
function get fov() {
return(_fov);
}
function set fov(n) {
_fov = n;
render();
//return(fov);
}
var _carouselWidth = 500;
var _carouselDepth = 500;
var _carouselHeight = 50;
var _itemSpacing = 50;
var _fov = 500;
var _carouselPosition = 0;
var lastDir = 0;
var dir = 0;
var basePath = "";
static var MOVEMENT_SPEED = 300;
static var CAROSEL_ITEM_LINKAGE = "carouselItem";
static var STOPPED = "stopped";
static var STARTED = "started";
}
Symbol 1297 MovieClip [__Packages.PositionOverview] Frame 0
class PositionOverview extends MovieClip
{
var gotoAndStop, p_txt, n_txt, t_txt, bl_txt, points_txt;
function PositionOverview () {
super();
}
function init(p, n, t, bl, points, isPlayer) {
if (isPlayer) {
gotoAndStop("player");
} else {
gotoAndStop("not_player");
}
p_txt.text = p + Format.ordinal(p);
n_txt.text = n.toLowerCase();
if (t > 0) {
t_txt.text = Format.time(t);
} else {
t_txt.text = "DNF";
}
if (bl > 0) {
bl_txt.text = Format.time(bl);
} else {
bl_txt.text = "--";
}
points_txt.text = "+" + points;
}
}
Symbol 1298 MovieClip [__Packages.StandingsOverview] Frame 0
class StandingsOverview extends MovieClip
{
var gotoAndStop, p_txt, n_txt, points_txt;
function StandingsOverview () {
super();
}
function init(p, n, points, isPlayer) {
if (isPlayer) {
gotoAndStop("player");
} else {
gotoAndStop("not_player");
}
p_txt.text = p + Format.ordinal(p);
n_txt.text = n.toLowerCase();
points_txt.text = String(points);
}
}
Symbol 1299 MovieClip [__Packages.cust.GUI.RadioGroup] Frame 0
class cust.GUI.RadioGroup extends Array
{
var name, _instanceIndex, push, length, _selectedIndex;
function RadioGroup (n) {
super();
name = n;
_instanceIndex = {};
cust.events.EventBroadcaster.initialise(this);
}
function addBtn(btn) {
if (_instanceIndex[btn._name] === undefined) {
push(btn);
_instanceIndex[btn._name] = length - 1;
} else {
this[_instanceIndex[btn._name]] = btn;
}
this[btn._name] = btn;
btn.addEventListener(cust.GUI.UIBtn.RELEASE, this);
}
function release(obj) {
var _local2 = 0;
while (_local2 < length) {
if (this[_local2] == obj.target) {
break;
}
_local2++;
}
if (_local2 == length) {
selectedIndex = (-1);
} else if (_local2 != _selectedIndex) {
selectedIndex = (_local2);
}
}
function get value() {
return(this[_selectedIndex].value);
}
function get selectedIndex() {
return(_selectedIndex);
}
function set selectedIndex(n) {
if (n != _selectedIndex) {
var _local2 = {target:this, type:CHANGE, oldVal:_selectedIndex, newVal:n};
this[_selectedIndex].select(false);
_selectedIndex = n;
this[_selectedIndex].select(true);
dispatchEvent(_local2);
}
//return(selectedIndex);
}
static function GET_RADIO_GROUP(n) {
if (RADIO_GROUPS[n]) {
return(RADIO_GROUPS[n]);
}
return((RADIO_GROUPS[n] = new cust.GUI.RadioGroup(n)));
}
static var RADIO_GROUPS = {};
static var CHANGE = "change";
}
Symbol 1300 MovieClip [__Packages.cust.events.EventBroadcaster] Frame 0
class cust.events.EventBroadcaster
{
var __events;
function EventBroadcaster () {
}
static function _removeEventListener(queue, event, handler) {
if (queue != undefined) {
var _local4 = queue.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
var _local2 = queue[_local1];
if (_local2 == handler) {
queue.splice(_local1, 1);
return(undefined);
}
_local1++;
}
}
}
static function initialise(object) {
if (_fEventBroadcaster == undefined) {
_fEventBroadcaster = new cust.events.EventBroadcaster();
}
object.addEventListener = _fEventBroadcaster.addEventListener;
object.removeEventListener = _fEventBroadcaster.removeEventListener;
object.dispatchEvent = _fEventBroadcaster.dispatchEvent;
object.dispatchQueue = _fEventBroadcaster.dispatchQueue;
object.getEventListeners = _fEventBroadcaster.getEventListeners;
object.getEvents = _fEventBroadcaster.getEvents;
object.removeEventListeners = _fEventBroadcaster.removeEventListeners;
object.removeAllEventListeners = _fEventBroadcaster.removeAllEventListeners;
object.__events = new Array();
_global.ASSetPropFlags(object, "__events", 1);
}
function dispatchQueue(queueObj, eventObj) {
var _local6 = 0;
var _local8 = "__q_" + eventObj.type;
var _local5 = queueObj[_local8].concat([]);
if (_local5 != undefined) {
var _local3 = 0;
while (_local3 < _local5.length) {
var _local1 = _local5[_local3];
var _local4 = typeof(_local1);
if ((_local4 == "object") || (_local4 == "movieclip")) {
if (_local1.handleEvent != undefined) {
_local1.handleEvent(eventObj);
}
if (_local1[eventObj.type] != undefined) {
if (exceptions[eventObj.type] == undefined) {
_local1[eventObj.type](eventObj);
}
}
} else {
_local1.apply(queueObj, [eventObj]);
}
_local6++;
_local3++;
}
}
return(_local6);
}
function dispatchEvent(eventObj) {
if (eventObj.target == undefined) {
eventObj.target = this;
}
this[eventObj.type + "Handler"](eventObj);
return(eventObj.target.dispatchQueue(eventObj.target, eventObj));
}
function addEventListener(event, handler) {
var _local3 = "__q_" + event;
if (this[_local3] == undefined) {
this[_local3] = new Array();
__events.push(event);
}
_global.ASSetPropFlags(this, _local3, 1);
_removeEventListener(this[_local3], event, handler);
this[_local3].push(handler);
return(true);
}
function removeEventListener(event, handler) {
var _local2 = "__q_" + event;
_removeEventListener(this[_local2], event, handler);
}
function getEventListeners(type) {
return(this["__q_" + type]);
}
function getEvents() {
return(__events);
}
function removeEventListeners(type) {
var _local4 = "__q_" + type;
var _local2 = this[_local4];
while (_local2.length) {
_removeEventListener(_local2, type, _local2[0]);
}
}
function removeAllEventListeners() {
var _local5 = getEvents();
var _local6;
var _local2;
var _local4;
var _local3 = 0;
while (_local3 < _local5.length) {
_local4 = _local5[_local3];
_local6 = "__q_" + _local4;
_local2 = this[_local6];
while (_local2.length) {
_removeEventListener(_local2, _local4, _local2[0]);
}
_local3++;
}
}
static var _fEventBroadcaster = undefined;
static var exceptions = {move:1, draw:1, load:1};
}
Symbol 1301 MovieClip [__Packages.cust.GUI.UIBtn] Frame 0
class cust.GUI.UIBtn extends MovieClip
{
var stop, _focusrect, gotoAndStop, dispatchEvent;
function UIBtn () {
super();
cust.events.EventBroadcaster.initialise(this);
stop();
_focusrect = false;
}
function update() {
if (isDown) {
gotoAndStop(DOWN);
} else if (isOver) {
gotoAndStop(OVER);
} else {
gotoAndStop(UP);
}
}
function onSetFocus() {
Key.addListener(this);
}
function onKillFocus() {
Key.removeListener(this);
}
function onKeyDown() {
if (Key.getCode() == 13) {
onPress();
}
}
function onKeyUp() {
if (Key.getCode() == 13) {
onRelease();
}
}
function onUnload() {
onKillFocus();
}
function onRollOver() {
isOver = true;
dispatchEvent({target:this, type:ROLLOVER});
update();
}
function onRollOut() {
isOver = false;
dispatchEvent({target:this, type:ROLLOUT});
update();
}
function onPress() {
isDown = true;
dispatchEvent({target:this, type:PRESS});
update();
}
function onRelease() {
isDown = false;
dispatchEvent({target:this, type:RELEASE});
update();
}
function onDragOver() {
isOver = true;
isDown = true;
dispatchEvent({target:this, type:DRAGOVER});
update();
}
function onDragOut() {
isOver = false;
isDown = false;
dispatchEvent({target:this, type:DRAGOUT});
update();
}
var isOver = false;
var isDown = false;
static var UP = "up";
static var OVER = "over";
static var DOWN = "down";
static var ROLLOVER = "rollOver";
static var ROLLOUT = "rollOut";
static var PRESS = "press";
static var RELEASE = "release";
static var DRAGOUT = "dragOut";
static var DRAGOVER = "dragOver";
}
Symbol 1302 MovieClip [__Packages.cust.GUI.RadioBtn] Frame 0
class cust.GUI.RadioBtn extends cust.GUI.UIBtn
{
var _name, value, group, selected_mc;
function RadioBtn () {
super();
var _local3 = _name.split(DIVIDER);
value = _local3[1];
group = cust.GUI.RadioGroup.GET_RADIO_GROUP(_local3[0]);
group.addBtn(this);
selected_mc._visible = false;
}
function select(b) {
selected_mc._visible = b;
}
function get selected() {
return(selected_mc._visible);
}
function set selected(b) {
if (selected_mc._visible != b) {
if (b) {
group.release({target:this});
} else {
group.release({target:null});
}
}
selected_mc._visible = b;
//return(selected);
}
static var DIVIDER = "_";
}
Symbol 1303 MovieClip [__Packages.ClickBlocker] Frame 0
class ClickBlocker extends MovieClip
{
function ClickBlocker () {
super();
}
function onPress() {
}
var useHandCursor = false;
}
Symbol 505 MovieClip Frame 1
stop();
Symbol 505 MovieClip Frame 5
stop();
Symbol 721 Button
on (release) {
gotoAndPlay ("startpage out");
}
Symbol 722 Button
on (release) {
gotoAndPlay ("startpage out");
gotoHowToPlay = true;
}
Symbol 727 Button
on (release) {
gotoAndPlay ("startpage out");
}
Symbol 728 Button
on (release) {
gotoAndPlay ("startpage out");
gotoHowToPlay = false;
}
Symbol 729 Button
on (release) {
gotoAndPlay ("startpage out");
gotoHowToPlay = false;
}
Symbol 744 Button
on (release) {
gotoAndPlay ("tmob3");
}
Symbol 753 Button
on (release) {
gotoAndPlay ("tmob2");
_root.kvEvent(_global.mc.tMobileFirstYes);
}
Symbol 761 Button
on (release) {
_parent.play();
}
Symbol 769 Button
on (release) {
_parent.play();
_root.kvEvent(_global.mc.tMobileNo);
}
Symbol 770 Button
on (release) {
gotoAndPlay ("tmob2");
_root.kvEvent(_global.mc.tMobileSecondYes);
}
Symbol 773 MovieClip Frame 1
stop();
Symbol 773 MovieClip Frame 9
stop();
_global.groats = _global.groats + 100;
Symbol 773 MovieClip Frame 17
stop();
Instance of Symbol 505 MovieClip "mute" in Symbol 774 MovieClip Frame 1
onClipEvent (load) {
if (_global.snd_man.mute) {
gotoAndStop ("off");
}
this.onRelease = function () {
if (_global.snd_man.mute) {
gotoAndStop ("on");
if (_global.mc.unmute) {
_root.kvEvent(_global.mc.unmute);
}
_global.snd_man.mute = false;
} else {
gotoAndStop ("off");
if (_global.mc.mute) {
_root.kvEvent(_global.mc.mute);
}
_global.snd_man.mute = true;
}
};
}
Symbol 774 MovieClip Frame 2
stop();
Symbol 774 MovieClip Frame 81
stop();
Symbol 774 MovieClip Frame 82
play();
Symbol 774 MovieClip Frame 119
if ((!gotoHowToPlay) && (_global.tMobileBranding)) {
_root.kvEvent(_global.mc.tMobileShown);
} else {
tMobileAd._visible = false;
}
Symbol 774 MovieClip Frame 126
if ((!gotoHowToPlay) && (_global.tMobileBranding)) {
stop();
} else {
tMobileAd._visible = false;
}
Symbol 774 MovieClip Frame 127
stop();
_parent.menu_anim.gotoAndPlay("in");
if (gotoHowToPlay) {
_parent.menu_anim.menu_mc.gotoAndStop("how to play");
} else {
_parent.menu_anim.menu_mc.gotoAndStop("select racer");
}
Symbol 780 MovieClip Frame 1
function setProgress(n) {
loading_bar.bar._xscale = n * 100;
}
setProgress(0);
Symbol 781 MovieClip Frame 1
function transitionTo(f) {
loadingScreen.gotoAndStop("end");
frame = f;
gotoAndPlay ("in");
}
function doTransition() {
if (frame) {
_parent.gotoAndStop(frame);
delete frame;
prevPage = frame;
}
}
stop();
Symbol 781 MovieClip Frame 23
if (frame) {
doTransition();
} else {
stop();
onSlideIn();
delete onSlideIn;
}
Symbol 781 MovieClip Frame 46
onSlideOut();
delete onSlideOut;
Symbol 784 MovieClip Frame 1
function transitionTo(f) {
frame = f;
gotoAndPlay ("begin");
}
function doTransition() {
prevPage = _parent._currentframe;
_parent.gotoAndStop(frame);
curPage = _parent._currentframe;
}
stop();
Symbol 784 MovieClip Frame 2
play();
Symbol 784 MovieClip Frame 9
doTransition();
Symbol 792 Button
on (release) {
choose("forceField");
}
on (rollOver) {
rolled("forceField");
}
Symbol 793 Button
on (release) {
choose("turnSpeed");
}
on (rollOver) {
rolled("turnSpeed");
}
Symbol 794 Button
on (release) {
choose("handling");
}
on (rollOver) {
rolled("handling");
}
Symbol 795 Button
on (release) {
choose("speed");
}
on (rollOver) {
rolled("speed");
}
Symbol 800 MovieClip Frame 1
stop();
Symbol 804 Button
on (release) {
choose("handling");
}
on (rollOver) {
rolled("handling");
}
Symbol 805 Button
on (release) {
choose("turnSpeed");
}
on (rollOver) {
rolled("turnSpeed");
}
Symbol 806 Button
on (release) {
choose("forceField");
}
on (rollOver) {
rolled("forceField");
}
Symbol 807 MovieClip Frame 1
function choose(f) {
_parent.choose(f);
}
function rolled(f) {
}
stop();
Symbol 817 MovieClip Frame 1
if (!(_global.root.selectedRacer === undefined)) {
gotoAndStop ("off");
} else {
stop();
}
function setShip(n) {
var _local2 = _parent.ship._currentframe;
_parent.gotoAndStop(n);
_parent.ship.gotoAndPlay(_local2);
_parent.ship.fire._visible = false;
}
nextBtn.onRelease = function () {
if (_parent._currentframe == _parent._totalframes) {
setShip(1);
} else {
setShip(_parent._currentframe + 1);
}
};
prevBtn.onRelease = function () {
if (_parent._currentframe == 1) {
setShip(_parent._totalframes);
} else {
setShip(_parent._currentframe - 1);
}
};
Symbol 828 MovieClip Frame 1
ship.fire._visible = false;
stop();
Symbol 840 Button
on (release) {
_parent._parent.sell();
}
Symbol 841 MovieClip Frame 1
stop();
Symbol 841 MovieClip Frame 2
stop();
Symbol 846 Button
on (release) {
_parent._parent.buy();
}
Symbol 848 MovieClip Frame 1
stop();
Symbol 862 MovieClip Frame 1
setText();
stop();
Symbol 862 MovieClip Frame 8
setText = function () {
};
Symbol 862 MovieClip Frame 13
setText();
stop();
Symbol 862 MovieClip Frame 29
setText();
stop();
Symbol 862 MovieClip Frame 37
setText();
stop();
Symbol 862 MovieClip Frame 46
setText();
stop();
Symbol 862 MovieClip Frame 55
setText();
stop();
Symbol 862 MovieClip Frame 64
setText();
stop();
Symbol 862 MovieClip Frame 71
setText();
stop();
Symbol 862 MovieClip Frame 79
setText();
stop();
Symbol 862 MovieClip Frame 88
setText();
stop();
Symbol 862 MovieClip Frame 97
setText();
stop();
Symbol 862 MovieClip Frame 107
setText();
stop();
Symbol 862 MovieClip Frame 115
setText();
stop();
Symbol 862 MovieClip Frame 124
setText();
stop();
Symbol 862 MovieClip Frame 135
setText();
stop();
Symbol 862 MovieClip Frame 146
setText();
stop();
Symbol 864 MovieClip Frame 1
function setDetail() {
detail.gotoAndStop(nextDetail + (upgradesLevels[nextDetail] + 1));
detail.currentGroats.text = _global.groats;
detail.header.htmlText = (upgradeNames[nextDetail] + " ") + (_global.upgradesLevels[nextDetail] + 1);
detail.verb.htmlText = _global.language[("newICE_" + nextDetail) + "Verb"];
detail.description.htmlText = _global.language[(("newICE_" + nextDetail) + "UpgradeDesc") + (_global.upgradesLevels[nextDetail] + 1)];
detail.currentGroatsTitle.htmlText = _global.language.newICE_currentGroats;
detail.thisUpgrade.htmlText = _global.language.newICE_thisUpgrade;
detail.upgradePrice.htmlText = _global.upgradeCost[nextDetail][_global.upgradesLevels[nextDetail]];
if (nextDetail == "speed") {
detail.category.htmlText = "Speed";
} else if (nextDetail == "acceleration") {
detail.category.htmlText = "Acceleration";
} else if (nextDetail == "handling") {
detail.category.htmlText = "Grip";
} else if (nextDetail == "turnSpeed") {
detail.category.htmlText = "Turn Speed";
} else if (nextDetail == "forceField") {
detail.category.htmlText = "Force Field";
}
if (_global.upgradesLevels[nextDetail]) {
detail.sellIt.gotoAndStop("on");
detail.sellIt.sellFor.text = "Sell for " + Math.floor(_global.upgradeCost[nextDetail][_global.upgradesLevels[nextDetail] - 1] * 0.75);
} else {
detail.sellIt.gotoAndStop("off");
detail.sellFor.text = "";
}
if (_global.groats < _global.upgradeCost[nextDetail][_global.upgradesLevels[nextDetail]]) {
detail.buyIt.gotoAndStop("off");
} else {
detail.buyIt.gotoAndStop("on");
}
}
function buy() {
_global.groats = _global.groats - _global.upgradeCost[nextDetail][_global.upgradesLevels[nextDetail]];
upgradesLevels[nextDetail]++;
setDetail();
setBars();
setEstimates();
}
function sell() {
_global.groats = _global.groats + Math.floor(_global.upgradeCost[nextDetail][_global.upgradesLevels[nextDetail] - 1] * 0.75);
upgradesLevels[nextDetail]--;
setDetail();
setBars();
setEstimates();
}
function choose(f) {
mainCat.gotoAndStop(f);
carPlan.gotoAndStop(f);
nextDetail = f;
play();
}
function setBars() {
mainCat.speedBar.gotoAndStop(Math.ceil(mainCat.speedBar._totalframes * (upgradesLevels.speed / 3)) + 1);
mainCat.accelerationBar.gotoAndStop(Math.ceil(mainCat.accelerationBar._totalframes * (upgradesLevels.acceleration / 3)) + 1);
mainCat.handlingBar.gotoAndStop(Math.ceil(mainCat.handlingBar._totalframes * (upgradesLevels.handling / 3)) + 1);
mainCat.turnSpeedBar.gotoAndStop(Math.ceil(mainCat.turnSpeedBar._totalframes * (upgradesLevels.turnSpeed / 3)) + 1);
mainCat.forceFieldBar.gotoAndStop(Math.ceil(mainCat.forceFieldBar._totalframes * (upgradesLevels.forceField / 3)) + 1);
}
function setEstimates() {
mainCat.speedEstimate.text = upgradesLevels.speed;
mainCat.accelerationEstimate.text = upgradesLevels.acceleration;
mainCat.handlingEstimate.text = upgradesLevels.handling;
mainCat.ICEPowerEstimate.text = upgradesLevels.ICEPower;
mainCat.v.text = upgradesLevels.ICEEfficiency;
}
function init() {
updateCurrentSystem();
setBars();
setEstimates();
choose("start");
}
racerSelector.gotoAndStop(_global.root.selectedRacer + 1);
upgradeNames = {};
upgradeNames.speed = "Speed";
upgradeNames.handling = "Grip";
upgradeNames.turnSpeed = "Turn speed";
upgradeNames.forceField = "Force Field";
init();
Symbol 864 MovieClip Frame 2
gotoAndPlay ("detail");
Symbol 864 MovieClip Frame 6
delete lastRolledOver;
setDetail();
Symbol 864 MovieClip Frame 15
stop();
Symbol 864 MovieClip Frame 25
gotoAndPlay ("detail");
Symbol 962 MovieClip Frame 1
function canAffordUpgrade() {
for (var _local2 in _global.upgradesLevels) {
if ((_global.upgradesLevels[_local2] + 1) < _global.upgradeCost[_local2].length) {
if (_global.groats >= _global.upgradeCost[_local2][_global.upgradesLevels[_local2] + 1]) {
return(true);
}
}
}
return(false);
}
if (canAffordUpgrade()) {
gotoAndStop ("flash");
} else {
stop();
}
Symbol 980 MovieClip Frame 1
stop();
Symbol 980 MovieClip Frame 2
stop();
Symbol 980 MovieClip Frame 3
stop();
Symbol 980 MovieClip Frame 4
stop();
Symbol 980 MovieClip Frame 5
stop();
Symbol 980 MovieClip Frame 6
stop();
Symbol 980 MovieClip Frame 7
stop();
Symbol 1014 MovieClip Frame 1
function scoreSubmitted(success) {
if (success) {
if (this.result == "success") {
if (!_global.root.pId) {
_global.root.pId = Number(this.pId);
}
gotoAndStop ("submitted");
} else {
gotoAndStop ("error");
}
} else {
gotoAndStop ("error");
}
}
if (!_global.root.pId) {
stop();
submit_highscores_btn.onRelease = _parent.gotoSubmitScore;
} else {
var lv = new LoadVars();
lv.lId = _global.root.trackNum + 1;
lv.pId = _global.root.pId;
lv.score = _global.root.submitScore;
lv.lap = _global.root.bestLap;
lv.r = Math.random();
lv.onLoad = scoreSubmitted;
lv.sendAndLoad(_global.backendURL + "comms/submitscore.comms.php", lv, "GET");
gotoAndStop ("submitting");
}
Symbol 1033 Button
on (release) {
getURL ("http://ad.uk.doubleclick.net/clk;209092362;31418361;z?http://www.t-mobile.co.uk/pay-as-you-go/top-up/ ", "_blank");
_root.kvClick(832);
}
Symbol 1081 MovieClip [maleBtn] Frame 1
#initclip 112
Object.registerClass("maleBtn", cust.GUI.RadioBtn);
#endinitclip
Symbol 1084 MovieClip [femaleBtn] Frame 1
#initclip 107
Object.registerClass("femaleBtn", cust.GUI.RadioBtn);
#endinitclip
Symbol 1088 MovieClip [ageChildBtn] Frame 1
#initclip 108
Object.registerClass("ageChildBtn", cust.GUI.RadioBtn);
#endinitclip
Symbol 1089 MovieClip [ageAdultBtn] Frame 1
#initclip 109
Object.registerClass("ageAdultBtn", cust.GUI.RadioBtn);
#endinitclip
Symbol 1094 MovieClip [ageOAPBtn] Frame 1
#initclip 110
Object.registerClass("ageOAPBtn", cust.GUI.RadioBtn);
#endinitclip
Symbol 1113 MovieClip [click blocker] Frame 1
#initclip 111
Object.registerClass("click blocker", ClickBlocker);
#endinitclip
Symbol 1116 MovieClip Frame 1
function createUser() {
var _local2 = new LoadVars();
_local2.lId = _global.root.trackNum + 1;
_local2.name = (_global.root.name = (((name_txt.text == "Enter your name") || (name_txt.text == "")) ? "anonymous" : (name_txt.text)));
_local2.age = (_global.root.age = age.selectedIndex);
_local2.sex = (_global.root.sex = sex.selectedIndex);
_local2.fanOf = _global.root.selectedRacer;
_local2.score = _global.root.submitScore;
_local2.lap = _global.root.bestLap;
_local2.r = Math.random();
_global.root.autosave = autosave.checked;
submitAndShowThrobber(_local2);
}
function updateScore() {
var _local2 = new LoadVars();
_local2.lId = _global.root.trackNum + 1;
_local2.pId = _global.root.pId;
_local2.score = _global.root.submitScore;
_local2.lap = _global.root.bestLap;
_local2.r = Math.random();
submitAndShowThrobber(_local2);
}
function submitAndShowThrobber(lv) {
lv.onLoad = scoreSubmitted;
lv.sendAndLoad(_global.backendURL + "comms/submitscore.comms.php", lv, "GET");
gotoAndStop ("saving");
}
function scoreSubmitted(success) {
if (success) {
if (this.result == "success") {
if (!_global.root.pId) {
_global.root.pId = Number(this.pId);
}
_parent.transition.transitionTo("highscores");
} else {
gotoAndStop ("error");
}
} else {
gotoAndStop ("error");
}
}
Symbol 1116 MovieClip Frame 2
stop();
if (_global.root.pId) {
updateScore();
} else {
name_txt.restrict = "a-zA-Z0-9";
name_txt.onSetFocus = function () {
if (this.text == "Enter your name") {
this.text = "";
}
Key.addListener(this);
};
name_txt.onKillFocus = function () {
if (this.text == "") {
this.text = "Enter your name";
}
Key.removeListener(this);
};
name_txt.onKeyDown = function () {
if (Key.getCode() == 13) {
Key.removeListener(this);
createUser();
}
};
var age = cust.GUI.RadioGroup.GET_RADIO_GROUP("age");
var sex = cust.GUI.RadioGroup.GET_RADIO_GROUP("sex");
age.__set__selectedIndex(0);
sex.__set__selectedIndex(0);
save_btn.onRelease = createUser;
}
Symbol 1132 Button
on (release) {
populateScores(me);
}
Symbol 1137 Button
on (release) {
getScores("country");
}
Symbol 1139 Button
on (release) {
getScores("sex");
}
Symbol 1141 Button
on (release) {
getScores("age");
}
Symbol 1144 Button
on (release) {
getScores("fanOf");
}
Symbol 1151 Button
on (release) {
_parent.selectLevel(2);
}
Symbol 1154 Button
on (release) {
_parent.selectLevel(3);
}
Symbol 1157 Button
on (release) {
_parent.selectLevel(4);
}
Symbol 1160 Button
on (release) {
_parent.selectLevel(5);
}
Symbol 1163 Button
on (release) {
_parent.selectLevel(1);
}
Symbol 1166 Button
on (release) {
play();
}
Symbol 1169 Button
on (release) {
_parent.selectLevel(6);
}
Symbol 1172 Button
on (release) {
_parent.selectLevel(7);
}
Symbol 1174 Button
on (release) {
play();
}
Symbol 1177 MovieClip Frame 1
stop();
Symbol 1177 MovieClip Frame 8
stop();
Symbol 1182 Button
on (release) {
populateScores(top10);
}
Symbol 1190 MovieClip [highscoresItem] Frame 1
stop();
Symbol 1196 MovieClip Frame 1
stop();
Symbol 1197 MovieClip Frame 1
function getScores(mode) {
throbber.gotoAndStop("throb");
xml = new XML();
xml.ignoreWhite = true;
var _local2;
switch (mode) {
case "level" :
case "cheats" :
_local2 = (((_global.backendURL + "comms/getscores.comms.php?lId=") + lId) + "&mode=") + mode;
break;
case "sex" :
case "age" :
case "fanOf" :
case "country" :
_local2 = ((_global.backendURL + "cache/leagues/") + mode.toLowerCase()) + ".xml?";
}
if (_global.root.pId) {
_local2 = _local2 + ("&pId=" + _global.root.pId);
}
_local2 = _local2 + ("&r=" + Math.random());
xml.onLoad = gotScores;
xml.load(_local2);
}
function gotScores(success) {
if (success) {
var _local5 = this.firstChild;
var _local3;
best_txt.text = "";
top10 = [];
me = [];
var _local4 = 0;
while (_local4 < _local5.childNodes.length) {
_local3 = _local5.childNodes[_local4];
switch (_local3.nodeName) {
case "top10" :
top10 = nodeToArray(_local3);
break;
case "me" :
me = nodeToArray(_local3);
break;
case "best" :
best_txt.text = (((("You are the " + _local3.attributes.rank) + " highest scoring ") + _global.root.sexArr[_global.root.sex]) + " who is ") + _global.root.ageArr[_global.root.age];
}
_local4++;
}
if (_global.root.pId && (me.length)) {
populateScores(me);
findYou_btn._visible = true;
} else {
populateScores(top10);
findYou_btn._visible = false;
}
switch (_local5.attributes.mode) {
case "level" :
var _local6 = _global.root.tracks[lId - 1].name;
scoresFor_txt.htmlText = "Scores: " + _local6;
break;
case "country" :
scoresFor_txt.htmlText = "Scores: Country";
break;
case "sex" :
scoresFor_txt.htmlText = "Scores: Gender";
break;
case "age" :
scoresFor_txt.htmlText = "Scores: Age Group";
break;
case "band" :
scoresFor_txt.htmlText = "Scores: Fave Band";
break;
case "cheats" :
scoresFor_txt.htmlText = "Scores: Cheats";
}
}
throbber.gotoAndPlay("throbOut");
}
function nodeToArray(node) {
arr = [];
i = 0;
while (i < node.childNodes.length) {
arr.push(node.childNodes[i].attributes);
i++;
}
if (node.attributes.mypos) {
arr.mypos = Number(node.attributes.mypos);
}
return(arr);
}
function populateScores(arr) {
var _local5 = 14;
var _local4 = 0;
for (var _local6 in highscores_mc) {
if (highscores_mc[_local6] instanceof MovieClip) {
highscores_mc[_local6].removeMovieClip();
}
}
var _local3;
var _local1 = 0;
while ((_local1 < arr.length) && (_local1 < 10)) {
_local3 = highscores_mc.attachMovie("highscoresItem", "hsi" + _local1, _local1);
_local3._y = _local4;
_local3.pos_txt.text = arr[_local1].pos;
_local3.name_txt.text = (checkSwear(arr[_local1].name) ? (checkSwear(arr[_local1].name)) : "anonymous");
_local3.score_txt.text = Format.time(arr[_local1].score);
_local3.lap_txt.text = Format.time(arr[_local1].lap);
_local4 = _local4 + _local5;
if ((!(arr.mypos === undefined)) && ((arr.mypos + 1) == arr[_local1].pos)) {
_local3.gotoAndStop("you");
}
_local1++;
}
}
function selectLevel(n) {
lId = n;
getScores("level");
selectLevel_mc.gotoAndPlay("hideLevels");
}
swearArray = new Array("fuck", "shit", "cunt", "fuk", "kunt", "phuk", "phuck");
checkSwear = function (mytext, peek) {
findMe = swearArray;
peek = 1;
myTotal = 0;
myWords = 0;
while (myWords <= (findMe.length - 1)) {
look = 0;
while (look < mytext.length) {
j = 0;
fill = "";
mySmall = mytext.substr(look, findMe[myWords].length).toLowerCase();
wordSmall = findMe[myWords].toLowerCase();
if (mySmall == wordSmall) {
while (j < (findMe[myWords].length - (2 * peek))) {
fill = fill + "*";
j++;
}
mytext = (mytext.substr(0, look + peek) + fill) + mytext.substr((look - peek) + findMe[myWords].length);
myTotal++;
}
look++;
}
myWords++;
}
return(mytext);
};
lId = _global.root.trackNum + 1;
getScores("level");
if (!_global.root.pId) {
findYou_btn._visible = false;
}
Symbol 1198 MovieClip Frame 1
function gotoRace() {
_parent.gotoAndPlay("out");
_parent.onSlideOut = function () {
_global.root.game_transition.gotoAndPlay("in");
_global.root.game_transition.loadingScreen.gotoAndStop("start");
_global.root.game_transition.onSlideIn = _global.root.goToGame;
};
}
function abandonRace() {
_parent.gotoAndPlay("out");
_global.root.trackNum = 0;
delete _global.root.selectedRacer;
_root.kvEvent(_global.mc.abandonSeason);
_parent.onSlideOut = function () {
_global.root.gotoAndPlay("startpage");
};
}
function closePauseMenu() {
_global.root.game.unpauseGame();
}
function endRace() {
_parent.gotoAndPlay("out");
_global.root.trackNum = 0;
delete _global.root.selectedRacer;
_parent.onSlideOut = function () {
_global.root.gotoAndPlay("startpage");
};
}
function gotoStandings() {
transition.transitionTo("tournament standings");
}
function gotoGarage() {
prevPage = _currentframe;
transition.transitionTo("garage");
}
function garageNextBtn() {
if (_global.root.selectedRacer === undefined) {
prevPage = "start race";
_global.root.selectedRacer = ice_mc.racerSelector._currentframe - 1;
_root.kvEvent(_global.mc["team" + (_global.root.selectedRacer + 1)]);
}
transition.transitionTo(prevPage);
}
function gotoStartRace() {
if ((_global.root.trackNum + 1) < _global.root.tracks.length) {
_global.root.trackNum++;
transition.transitionTo("start race");
} else {
transition.transitionTo("game over");
}
}
function gotoSubmitScore() {
prevPage = _currentframe;
transition.transitionTo("submit");
}
function gotoHighscores() {
prevPage = _currentframe;
transition.transitionTo("highscores");
}
function backFromHighscores() {
transition.transitionTo(prevPage);
}
function gotoHowToPlay() {
prevPage = _currentframe;
transition.transitionTo("how to play");
}
function howToPlayBack() {
if (prevPage) {
transition.transitionTo(prevPage);
} else {
_parent.gotoAndPlay("out");
_parent.onSlideOut = function () {
_global.root.startpage.gotoAndPlay("startpage in");
};
}
}
function startGame() {
_parent.gotoAndPlay("out");
_parent.onSlideOut = function () {
_global.root.game.startCountDown();
};
}
stop();
Symbol 1198 MovieClip Frame 2
next_btn.onRelease = garageNextBtn;
Symbol 1198 MovieClip Frame 12
_parent.ok_btn.setLabel("BACK");
_parent.ok_btn.onRelease = function () {
transition.transitionTo(transition.prevPage);
};
back_btn.onRelease = howToPlayBack;
_global.hasSeenHowToPlay = true;
Symbol 1198 MovieClip Frame 22
start_btn.onRelease = startGame;
Symbol 1198 MovieClip Frame 37
function onChangeDetailLvl() {
var _local3 = _global.root.game.curDetailLvl;
var _local2 = _global.root.game.recommendedDetailLvl;
curDetail_txt.text = ((_local3 == 1) ? "Low" : (((_local3 == 2) ? "Medium" : "High")));
recDetail_txt.text = ((_local2 == 1) ? "Low" : (((_local2 == 2) ? "Medium" : "High")));
}
_parent.ok_btn.setLabel("BACK");
_parent.ok_btn.onRelease = Delegate.create(_global.root.game, _global.root.game.unpauseGame);
high_qual_btn._label = "High";
med_qual_btn._label = "Medium";
low_qual_btn._label = "Low";
how_to_play_btn._label = "How to Play";
quit_btn._label = "Quit";
high_qual_btn.onRelease = Delegate.create(_global.root.game, _global.root.game.setDetailLevel, 3);
med_qual_btn.onRelease = Delegate.create(_global.root.game, _global.root.game.setDetailLevel, 2);
low_qual_btn.onRelease = Delegate.create(_global.root.game, _global.root.game.setDetailLevel, 1);
how_to_play_btn.onRelease = Delegate.create(transition, transition.transitionTo, "how to play");
quit_btn.onRelease = Delegate.create(_global.root.game_transition, _global.root.game_transition.transitionTo, "startpage");
onChangeDetailLvl();
close_btn.onRelease = closePauseMenu;
how_to_play_btn.onRelease = gotoHowToPlay;
abandon_btn.onRelease = abandonRace;
Symbol 1198 MovieClip Frame 44
trackInfo = _global.root.tracks[_global.root.trackNum];
title_txt.text = (("ROUND " + (_global.root.trackNum + 1)) + ": ") + trackInfo.name;
desc_txt.text = trackInfo.desc;
maps.gotoAndStop(_global.root.trackNum + 1);
if (trackInfo.team == -1) {
team_txt.text = "n/a";
} else {
team_txt.text = _global.root.racerDetails[trackInfo.team].title;
}
lapNumber_txt.text = trackInfo.laps + " laps";
var tr = PlayerResults.getTrackResults(_global.root.trackNum);
if (tr) {
time_txt.text = Format.time(tr.tt);
lap_txt.text = Format.time(tr.bl);
pos_txt.text = tr.pos + Format.ordinal(tr.pos);
}
abandon_btn.onRelease = abandonRace;
how_to_play_btn.onRelease = gotoHowToPlay;
garage_mc.onRelease = gotoGarage;
next_btn.onRelease = Delegate.create(transition, gotoRace);
Symbol 1198 MovieClip Frame 52
var raceNum = _global.root.trackNum;
var standings = TournamentResults.getRaceResults(raceNum);
winning_txt.text = Game.GROATS_REWARDS[_global.root.raceFinishPos];
resSpacing = 15;
var res;
var i = 0;
while (i < standings.length) {
res = results_holder.attachMovie("position_overview", "res" + i, i);
res._y = i * resSpacing;
res.init(standings[i].positions[raceNum], _global.root.racerDetails[standings[i].playerNum].title, standings[i].times[raceNum], standings[i].bestLaps[raceNum], TournamentResults.pointsForPosition(standings[i].positions[raceNum]), _global.root.selectedRacer == standings[i].playerNum);
i++;
}
if ((_global.root.trackNum + 1) == _global.root.tracks.length) {
garage_mc._visible = false;
}
abandon_btn.onRelease = abandonRace;
how_to_play_btn.onRelease = gotoHowToPlay;
view_highscores_btn.onRelease = gotoHighscores;
garage_mc.onRelease = gotoGarage;
next_btn.onRelease = gotoStandings;
if (_global.tMobileBranding) {
gotoAndStop ("race result banner");
}
Symbol 1198 MovieClip Frame 61
var raceNum = _global.root.trackNum;
var standings = TournamentResults.getRaceResults(raceNum);
winning_txt.text = Game.GROATS_REWARDS[_global.root.raceFinishPos];
resSpacing = 15;
var res;
var i = 0;
while (i < standings.length) {
res = results_holder.attachMovie("position_overview", "res" + i, i);
res._y = i * resSpacing;
res.init(standings[i].positions[raceNum], _global.root.racerDetails[standings[i].playerNum].title, standings[i].times[raceNum], standings[i].bestLaps[raceNum], TournamentResults.pointsForPosition(standings[i].positions[raceNum]), _global.root.selectedRacer == standings[i].playerNum);
i++;
}
if ((_global.root.trackNum + 1) == _global.root.tracks.length) {
garage_mc._visible = false;
}
abandon_btn.onRelease = abandonRace;
how_to_play_btn.onRelease = gotoHowToPlay;
view_highscores_btn.onRelease = gotoHighscores;
garage_mc.onRelease = gotoGarage;
next_btn.onRelease = gotoStandings;
Symbol 1198 MovieClip Frame 75
var raceNum = _global.root.trackNum;
var standings = TournamentResults.getStandings();
resSpacing = 15;
var res;
var i = 0;
while (i < standings.length) {
res = standings_holder.attachMovie("standings_overview", "res" + i, i);
res._y = i * resSpacing;
res.init(i + 1, _global.root.racerDetails[standings[i].playerNum].title, standings[i].points, _global.root.selectedRacer == standings[i].playerNum);
i++;
}
if ((_global.root.trackNum + 1) == _global.root.tracks.length) {
garage_mc._visible = false;
}
abandon_btn.onRelease = abandonRace;
how_to_play_btn.onRelease = gotoHowToPlay;
view_highscores_btn.onRelease = gotoHighscores;
garage_mc.onRelease = gotoGarage;
next_btn.onRelease = gotoStartRace;
round_txt.text = ((_global.root.trackNum + 1) + " of ") + _global.root.tracks.length;
if (_global.tMobileBranding) {
gotoAndStop ("tournament standings banner");
}
Symbol 1198 MovieClip Frame 92
var raceNum = _global.root.trackNum;
var standings = TournamentResults.getStandings();
resSpacing = 15;
var res;
var i = 0;
while (i < standings.length) {
res = standings_holder.attachMovie("standings_overview", "res" + i, i);
res._y = i * resSpacing;
res.init(i + 1, _global.root.racerDetails[standings[i].playerNum].title, standings[i].points, _global.root.selectedRacer == standings[i].playerNum);
i++;
}
if ((_global.root.trackNum + 1) == _global.root.tracks.length) {
garage_mc._visible = false;
}
abandon_btn.onRelease = abandonRace;
how_to_play_btn.onRelease = gotoHowToPlay;
view_highscores_btn.onRelease = gotoHighscores;
garage_mc.onRelease = gotoGarage;
next_btn.onRelease = gotoStartRace;
round_txt.text = ((_global.root.trackNum + 1) + " of ") + _global.root.tracks.length;
Symbol 1198 MovieClip Frame 115
_parent.ok_btn.setLabel("QUIT");
_parent.ok_btn.onRelease = function () {
_parent.gotoAndPlay("out");
_parent.onSlideOut = function () {
_global.root.gotoAndPlay("startpage");
};
};
var standings = TournamentResults.getStandings();
var i = 0;
while (i < standings.length) {
if (_global.root.selectedRacer == standings[i].playerNum) {
break;
}
i++;
}
results_mc.gotoAndStop(i + 1);
_root.kvEvent(_global.mc["pos" + (i + 1)]);
ok_btn.onRelease = endRace;
Symbol 1198 MovieClip Frame 129
view_highscores_btn.onRelease = Delegate.create(transition, transition.transitionTo, "highscores");
back_btn.onRelease = backFromHighscores;
Symbol 1198 MovieClip Frame 136
back_btn.onRelease = backFromHighscores;
Symbol 1201 MovieClip Frame 1
stop();
menu_mc.gotoAndStop(1);
Symbol 1201 MovieClip Frame 2
lay();
Symbol 1201 MovieClip Frame 14
stop();
Symbol 1201 MovieClip Frame 15
play();
Symbol 1201 MovieClip Frame 28
onSlideOut();
delete onSlideOut;
Symbol 1202 MovieClip [world] Frame 1
#initclip 116
Object.registerClass("world", cust.geom3D.World);
#endinitclip
Symbol 1221 MovieClip Frame 1
stop();
Symbol 1221 MovieClip Frame 2
stop();
Symbol 1221 MovieClip Frame 3
stop();
Symbol 1221 MovieClip Frame 4
stop();
Symbol 1221 MovieClip Frame 5
stop();
Symbol 1221 MovieClip Frame 6
stop();
Symbol 1226 MovieClip Frame 13
stop();
Symbol 1226 MovieClip Frame 20
gotoAndPlay ("active");
Symbol 1226 MovieClip Frame 35
stop();
Symbol 1228 MovieClip Frame 1
stop();
Symbol 1230 MovieClip [Gui] Frame 1
#initclip 113
Object.registerClass("Gui", HUD);
#endinitclip
Symbol 1231 MovieClip [map] Frame 1
#initclip 114
Object.registerClass("map", Map);
#endinitclip
Symbol 1236 MovieClip Frame 1
stop();
Symbol 1236 MovieClip Frame 2
play();
Symbol 1236 MovieClip Frame 81
_global.root.game.beginLevel();
Symbol 1236 MovieClip Frame 106
stop();
Symbol 1237 MovieClip [game] Frame 1
#initclip 115
Object.registerClass("game", Game);
#endinitclip