Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Action script...
- // [onClipEvent of sprite 2461 in frame 1]
- onClipEvent (load)
- {
- BG1.loadScrollContent(appdir add "\\IMG\\race.jpg");
- BG2.loadScrollContent(appdir add "\\IMG\\race.jpg");
- }
- // [onClipEvent of sprite 2543 in frame 88]
- onClipEvent (initialize)
- {
- label = "\"\"";
- initialValue = true;
- labelPlacement = "right";
- changeHandler = "\"\"";
- }
- // [onClipEvent of sprite 2543 in frame 88]
- onClipEvent (initialize)
- {
- label = "";
- initialValue = true;
- labelPlacement = "right";
- changeHandler = "";
- }
- // [onClipEvent of sprite 2543 in frame 88]
- onClipEvent (initialize)
- {
- label = "\"\"";
- initialValue = true;
- labelPlacement = "right";
- changeHandler = "\"\"";
- }
- // [onClipEvent of sprite 2543 in frame 88]
- onClipEvent (initialize)
- {
- label = "";
- initialValue = true;
- labelPlacement = "right";
- changeHandler = "";
- }
- // [Action in Frame 1]
- function timeFormat(ms)
- {
- if (ms % 60 < 10)
- {
- return (Math.floor(ms / 60) add ":0" add ms % 60);
- }
- else
- {
- return (Math.floor(ms / 60) add ":" add ms % 60);
- } // end else if
- } // End of the function
- function StartNOS(_racer, n)
- {
- _racer.rdata.n = 20;
- } // End of the function
- function NOS(_racer)
- {
- if (_racer.stats.NOS <= 5 && _racer.stats.NRES > 0)
- {
- _racer.stats.NOS = 100;
- --_racer.stats.NRES;
- } // end if
- if (_racer.stats.NOS - 2 > 0)
- {
- _racer.stats.NOS = _racer.stats.NOS - 2;
- getAccel(_racer);
- if (_racer.rdata.g >= 4 && _racer.rdata.v / _racer.rdata.TopSpeed[_racer.rdata.g] > 0.400000)
- {
- if (_racer.stats.UPGRADE[27])
- {
- _racer.rdata.a = _racer.rdata.a * 4;
- }
- else
- {
- _racer.rdata.a = _racer.rdata.a * 2;
- } // end else if
- }
- else
- {
- _racer.rdata.a = _racer.rdata.a * 0.900000;
- } // end if
- } // end else if
- } // End of the function
- function getAcceler(g, _stats)
- {
- if (_stats["GEAR" add g] == 2 || _stats["GEAR" add g] == 0)
- {
- _stats["GEAR" add g] = 1;
- } // end if
- f = (_stats.TQ + tqbonus - _stats.FR - frbonus) / Math.pow(1.500000, g * 2) * (2 - _stats["GEAR" add g]);
- return (f * 0.900000 / (_stats.WT * wtbonus));
- } // End of the function
- function getAccel(racer)
- {
- racer.rdata.a = racer.rdata.Accel[racer.rdata.g];
- if (racer.rdata.v / racer.rdata.TopSpeed[racer.rdata.g] < 0.700000)
- {
- racer.rdata.a = racer.rdata.a / (racer.stats.CAMADJUST + 1);
- }
- else if (racer.rdata.v / racer.rdata.TopSpeed[racer.rdata.g] > 0.900000)
- {
- racer.rdata.a = racer.rdata.a / 2;
- }
- else
- {
- racer.rdata.a = racer.rdata.a * racer.stats.CAMADJUST;
- } // end else if
- racer.rdata.a = racer.rdata.a * 2;
- } // End of the function
- function race(racer)
- {
- if (burnout && racer.typ == 1)
- {
- if (Key.isDown(32))
- {
- P1.CAR.lwheel.gotoAndStop(_root.CIVIC.MAX_WHEEL + 2);
- ReColor(P1, Player[0]);
- ReColor(P2, Player[1]);
- burnout = true;
- getAccel(racer);
- racer.rdata.v = racer.rdata.v + racer.rdata.a * 100 / 60 * 1.700000;
- if (racer.rdata.v >= racer.rdata.TopSpeed[racer.rdata.g])
- {
- racer.rdata.v = racer.rdata.TopSpeed[racer.rdata.g] * 0.900000;
- } // end if
- --bn;
- if (bn <= 0)
- {
- ReColor(P1, Player[0]);
- burnout = false;
- } // end if
- racer.rdata.d = racer.rdata.d + racer.rdata.v * 0.030000;
- }
- else
- {
- P1.CAR.lwheel.gotoAndStop(Player[0].stats._wheel);
- ReColor(P1, Player[0]);
- ReColor(P2, Player[1]);
- burnout = false;
- race(racer);
- } // end else if
- }
- else if (racer.typ != 5)
- {
- if (Key.isDown(32) && racer.typ == 1 || racer.typ == 2)
- {
- if (racer.rdata.n <= 0)
- {
- getAccel(racer);
- }
- else
- {
- NOS(racer);
- --racer.rdata.n;
- } // end else if
- }
- else
- {
- racer.rdata.a = -0.006000 + racer.stats.CL / 1000;
- } // end else if
- if (racer.typ == 2 && racer.rdata.n <= 0)
- {
- if (Player[1].rdata.d > Player[0].rdata.d)
- {
- Player[1].rdata.a = Player[1].rdata.a * 0.500000;
- }
- else
- {
- Player[1].rdata.a = Player[1].rdata.a * 1.500000;
- } // end if
- } // end else if
- racer.rdata.v = racer.rdata.v + racer.rdata.a * 1000 / 60 * 1.700000;
- if (racer.rdata.v < 0)
- {
- racer.rdata.v = 0;
- } // end if
- if (racer.rdata.v >= racer.rdata.TopSpeed[racer.rdata.g])
- {
- racer.rdata.v = racer.rdata.TopSpeed[racer.rdata.g] * 0.900000;
- } // end if
- if (racer.typ == 2 && racer.rdata.v / racer.rdata.TopSpeed[racer.rdata.g] >= 0.800000 + df)
- {
- GearUp(racer);
- } // end if
- if (racer.typ == 2 && racer.rdata.g > 2 && racer.rdata.n <= 0 && typ1 != "a" && df > 0.030000)
- {
- StartNOS(racer);
- } // end if
- racer.rdata.tops = Math.max(racer.rdata.tops, racer.rdata.v);
- racer.rdata.d = racer.rdata.d + racer.rdata.v * 0.030000;
- } // end else if
- } // End of the function
- function GearUp(racer)
- {
- if (!_root.Options.clutch || Key.isDown(17) || racer.typ != 1)
- {
- if (!_root.Options.nogas || !Key.isDown(32) || racer.typ != 1)
- {
- if (racer.rdata.g++ >= 6)
- {
- racer.rdata.g = 6;
- } // end if
- } // end if
- } // end if
- } // End of the function
- function GearDown(racer)
- {
- if (!_root.Options.clutch || Key.isDown(17) || racer.typ != 1)
- {
- if (!_root.Options.nogas || !Key.isDown(32) || racer.typ != 1)
- {
- if (racer.rdata.g-- <= 1)
- {
- racer.rdata.g = 1;
- } // end if
- } // end if
- } // end if
- } // End of the function
- function initrace(racer, stats)
- {
- if (racer.typ != 5)
- {
- racer.stats = stats;
- racer.rdata = new Object();
- racer.rdata.tops = 0;
- frbonus = Math.round(racer.stats.AIRINTAKE * 2.500000);
- hpbonus = Math.round(racer.stats.BOOST * 10) - 10;
- tqbonus = Math.round(racer.stats.BOOST * 10) - 25;
- if (stats.WT > 2000)
- {
- wtbonus = 1.150000;
- }
- else if (stats.WT > 1700)
- {
- wtbonus = 1.100000;
- }
- else
- {
- wtbonus = 1;
- } // end else if
- racer.rdata.v = 0;
- racer.rdata.a = 0;
- racer.rdata.d = 0;
- racer.rdata.g = 1;
- racer.rdata.n = 0;
- racer.rdata.Accel = new Array();
- for (var _loc3 = 1; _loc3 <= 6; ++_loc3)
- {
- racer.rdata.Accel[_loc3] = getAcceler(_loc3, racer.stats);
- } // end of for
- racer.rdata.TopSpeed = new Array();
- racer.rdata.TopSpeed[0] = 0;
- racer.rdata.TopSpeed[1] = 15 * stats.GEAR1;
- racer.rdata.TopSpeed[2] = Math.round(25 + Math.sqrt(stats.HP + hpbonus) * 6 / 25 * 4) * stats.GEAR2 * 0.900000;
- racer.rdata.TopSpeed[3] = Math.round(25 + Math.sqrt(stats.HP + hpbonus) * 6 / 25 * 9) * stats.GEAR3 * 0.800000;
- racer.rdata.TopSpeed[4] = Math.round(25 + Math.sqrt(stats.HP + hpbonus) * 6 / 25 * 16) * stats.GEAR4 * 0.900000;
- racer.rdata.TopSpeed[5] = Math.round(25 + Math.sqrt(stats.HP + hpbonus) * 6 / 25 * 25) * stats.GEAR5 * 0.900000;
- racer.rdata.TopSpeed[6] = Math.round(25 + Math.sqrt(stats.HP + hpbonus) * 6 / 25 * 36) * stats.GEAR6 * 0.800000;
- racer.rdata.temp = Math.round((2 - racer.stats.AIRINTAKE) * 10 + racer.stats.BOOST * 40);
- racer.rdata.ctemp = racer.rdata.temp;
- if (racer.typ == 2)
- {
- if (racer.stats.HP > 2000)
- {
- df = 0.100000;
- }
- else if (racer.stats.HP > 1000)
- {
- df = 0.070000;
- }
- else if (racer.stats.HP > 600)
- {
- df = 0.060000;
- }
- else if (racer.stats.HP > 300)
- {
- df = 0.040000;
- }
- else
- {
- df = 0;
- } // end else if
- } // end else if
- }
- else
- {
- _root.RaceDataUpdate = true;
- _root.RaceTempDistance = 0;
- Player[1].rdata = new Object();
- Player[1].rdata.d = _root.RaceTempDistance;
- } // end else if
- } // End of the function
- frames = 0;
- startTime = getTimer();
- mseconds = 0;
- seconds = 0;
- if (obj1 == undefined)
- {
- _root.prompt("", "Race Error!\nYour Car Was Absent!");
- this.removeMovieClip();
- } // end if
- numplayers = 2;
- raceresult = undefined;
- burnout = true;
- blur = false;
- temp_gear = 1;
- gear = 1;
- initx = joystick._x;
- inity = joystick._y;
- tension = 0.500000;
- decay = 0.500000;
- if (typ1 == "a")
- {
- gotoAndStop("analyze");
- } // end if
- // [Action in Frame 2]
- function ReColor(CARMCPL, PLYDAT)
- {
- COLOUR = new Color(CARMCPL.CAR.lwheel.COL);
- COLOUR.setTransform(PLYDAT.stats.rimcols);
- COLOUR = new Color(CARMCPL.CAR.rwheel.COL);
- COLOUR.setTransform(PLYDAT.stats.rimcols);
- } // End of the function
- function UpdateHUD()
- {
- HUD.v = Math.round(Player[0].rdata.v) add "mph";
- HUD.ts = Player[0].rdata.TopSpeed[Player[0].rdata.g];
- HUD.a = Player[0].rdata.a;
- HUD.d = Player[0].rdata.d;
- joystick.knob.gear = Player[0].rdata.g;
- HUD.t = timeFormat(seconds * 60 + mseconds);
- HUD.FPS = Math.round(Player[0].rdata.ctemp);
- HUD.nospin._rotation = Player[0].stats.NOS / 100 * 270 - 135;
- HUD.temppin._rotation = Player[0].rdata.ctemp / 100 * 270 - 125;
- HUD.NRES = Player[0].stats.NRES;
- BG.BG0._x = BG.BG0._x - Player[0].rdata.v * 2;
- BG.BG1._x = BG.BG1._x - Player[0].rdata.v * 2;
- BG.BG2._x = BG.BG2._x - Player[0].rdata.v * 2;
- if (BG.BG2._x <= BG.BG1._width / 2)
- {
- BG.BG1._x = BG.BG1._width / 2;
- BG.BG2._x = BG.BG1._width * 1.500000;
- } // end if
- BG2._x = BG2._x - Player[0].rdata.v * 1.500000;
- if (BG2._x <= -400)
- {
- BG2._x = BG2._width * 0.500000 - 400;
- } // end if
- HUD.DM.M1._x = Player[0].rdata.d / maxdistance * 772;
- HUD.DM.M2._x = Player[1].rdata.d / maxdistance * 772;
- if (burnout && Player[0].rdata.v > 0)
- {
- P1.CAR.lwheel._rotation = 0;
- P1.CAR.lwheel.gotoAndStop(_root.CIVIC.MAX_WHEEL + 2);
- P1.CAR.rwheel.gotoAndStop(Player[0].stats._wheel);
- ReColor(P1, Player[0]);
- }
- else if (Player[0].rdata.v * 4 > 180)
- {
- P1.CAR.lwheel.gotoAndStop(_root.CIVIC.MAX_WHEEL + 1);
- P1.CAR.rwheel.gotoAndStop(_root.CIVIC.MAX_WHEEL + 1);
- ReColor(P1, Player[0]);
- }
- else
- {
- P1.CAR.lwheel.gotoAndStop(Player[0].stats._wheel);
- P1.CAR.rwheel.gotoAndStop(Player[0].stats._wheel);
- ReColor(P1, Player[0]);
- } // end else if
- if (!burnout)
- {
- P1.CAR.lwheel._rotation = P1.CAR.lwheel._rotation + Player[0].rdata.v * 4;
- P1.CAR.rwheel._rotation = P1.CAR.rwheel._rotation + Player[0].rdata.v * 4;
- } // end if
- P2.CAR.lwheel._rotation = P2.CAR.lwheel._rotation + Player[1].rdata.v * 4;
- P2.CAR.rwheel._rotation = P2.CAR.rwheel._rotation + Player[1].rdata.v * 4;
- P2._x = (Player[1].rdata.d - Player[0].rdata.d) * 50 + P1._x;
- if (P1._x < 0)
- {
- P1._x = P1._x + Player[0].rdata.v * 0.500000;
- }
- else if (P1._x > 0)
- {
- P1._x = 0;
- } // end else if
- tach = Player[0].rdata.v / Player[0].rdata.TopSpeed[Player[0].rdata.g];
- if (Player[0].rdata.v < 120)
- {
- setAngle(P1, Math.round((1 + tach * -5) * 10) / 15);
- }
- else if (Math.random() < 0.500000)
- {
- setAngle(P1, Math.round((1 + tach * -5) * 10) / 15 + 0.200000);
- }
- else
- {
- setAngle(P1, Math.round((1 + tach * -5) * 10) / 15 - 0.200000);
- } // end else if
- HUD.rpmpin._rotation = Player[0].rdata.v / Player[0].rdata.TopSpeed[Player[0].rdata.g] * REDLINE_ANG - 135;
- HUD.velopin._rotation = Player[0].rdata.v - 135;
- if (HUD.REDLINE._currentframe == 1 && Player[0].rdata.v / Player[0].rdata.TopSpeed[Player[0].rdata.g] > 0.900000)
- {
- HUD.REDLINE.gotoAndPlay("red");
- Player[0].rdata.ctemp = Player[0].rdata.ctemp + 3;
- }
- else if (HUD.REDLINE._currentframe == 1 && Player[0].rdata.v / Player[0].rdata.TopSpeed[Player[0].rdata.g] > 0.800000)
- {
- HUD.REDLINE.gotoAndPlay("red2");
- Player[0].rdata.ctemp = Player[0].rdata.ctemp + 0.500000;
- }
- else if (HUD.REDLINE._currentframe == 1 && Player[0].rdata.v / Player[0].rdata.TopSpeed[Player[0].rdata.g] > 0.700000)
- {
- Player[0].rdata.ctemp = Player[0].rdata.ctemp + 0.100000;
- }
- else
- {
- HUD.REDLINE.gotoAndStop(1);
- Player[0].rdata.ctemp = Player[0].rdata.ctemp - 0.100000;
- Player[0].rdata.ctemp = Math.max(Player[0].rdata.ctemp, Player[0].rdata.temp);
- } // end else if
- P1.CAR.exhaust.NOS._visible = Player[0].rdata.n > 0 && Player[0].stats.NOS > 1;
- P2.CAR.exhaust.NOS._visible = Player[1].rdata.n > 0 && Player[1].stats.NOS > 1;
- if (Player[0].rdata.n > 0 && Player[0].stats.NOS > 1)
- {
- nosSound = new Sound(this);
- nosSound.attachSound("NOS.wav");
- nosSound.start();
- this._x = this._x + (Math.random() - 0.500000) * 5;
- this._y = this._y + (Math.random() - 0.500000) * 5;
- }
- else
- {
- nosSound.stop();
- this._x = 400;
- this._y = 0;
- } // end else if
- } // End of the function
- function setAngle(PMC, a)
- {
- if (burnout && Player[0].stats.TQ > 800)
- {
- a = (a - 2) * 5;
- max = 6;
- }
- else
- {
- max = 2;
- } // end else if
- if (PMC.CAR._rotation > Player[0].stats.frameangle + a)
- {
- PMC.CAR._rotation = PMC.CAR._rotation - Math.min(max, PMC.CAR._rotation - (Player[0].stats.frameangle + a));
- }
- else if (PMC.CAR._rotation < Player[0].stats.frameangle + a)
- {
- PMC.CAR._rotation = PMC.CAR._rotation + Math.min(max, Player[0].stats.frameangle + a - PMC.CAR._rotation);
- } // end else if
- with (PMC)
- {
- LCALC = Math.tan(CAR._rotation * 3.141593 / 180) * ldiff;
- RCALC = Math.tan(CAR._rotation * 3.141593 / 180) * rdiff;
- if (!burnout)
- {
- CAR.rcaliper._y = RWY + RCALC * 1.500000;
- CAR.rwheel._y = RWY + RCALC * 1.500000;
- S;
- CAR.lwheel._y = LWY + LCALC;
- CAR.lcaliper._y = LWY + LCALC;
- CAR._y = CY + LCALC / 2;
- }
- else
- {
- CAR.rcaliper._y = RWY;
- CAR.rwheel._y = RWY;
- CAR.lwheel._y = LWY;
- CAR.lcaliper._y = LWY;
- CAR._y = CY + LCALC;
- } // end else if
- } // End of with
- } // End of the function
- _parent.gotoAndStop("racestop");
- Player = new Array();
- if (obj1 != undefined)
- {
- Player[0] = new Object();
- Player[0].typ = typ1;
- initrace(Player[0], obj1);
- } // end if
- if (obj2 != undefined)
- {
- Player[1] = new Object();
- Player[1].typ = typ2;
- initrace(Player[1], obj2);
- }
- else
- {
- P2._visible = false;
- } // end else if
- bn = 5 + Math.floor(Player[0].TQ / 2);
- COL = new Color(HUD.DM.M1);
- COL.setTransform(Player[0].stats.framecols);
- COL = new Color(HUD.DM.M2);
- COL.setTransform(Player[1].stats.framecols);
- HUD.DM.M1._x = 0;
- HUD.DM.M2._x = 0;
- _root.BuildCar(obj1, this._name, "P1");
- _root.BuildCar(obj2, this._name, "P2");
- P1._yscale = 60;
- P2._yscale = 55;
- P1._xscale = 60;
- P2._xscale = 55;
- HUD.nospin.gotoAndStop(Player[0].stats.UPGRADE[66] + 1);
- HUD.temppin.gotoAndStop(Player[0].stats.UPGRADE[66] + 1);
- HUD.rpmpin.gotoAndStop(Player[0].stats.UPGRADE[66] + 1);
- HUD.velopin.gotoAndStop(Player[0].stats.UPGRADE[66] + 1);
- HUD.nospin._rotation = Player[0].stats.NOS / 100 * 270 - 125;
- HUD.temppin._rotation = HUD.FPS / 30 * 270 - 125;
- if (Player[0].stats.HP < 200)
- {
- HUD.REDZONE.gotoAndStop(1);
- REDLINE_ANG = 115;
- }
- else if (Player[0].stats.HP < 300)
- {
- HUD.REDZONE.gotoAndStop(2);
- REDLINE_ANG = 150;
- }
- else if (Player[0].stats.HP < 400)
- {
- HUD.REDZONE.gotoAndStop(3);
- REDLINE_ANG = 210;
- }
- else
- {
- HUD.REDZONE.gotoAndStop(4);
- REDLINE_ANG = 260;
- } // end else if
- BG1.loadScrollContent(appdir add "\\IMG\\dash.jpg");
- temp_gear = 1;
- gear = 1;
- initx = joystick._x;
- inity = joystick._y;
- tension = 0.500000;
- decay = 0.500000;
- joystick.onPress = function ()
- {
- _root.dragging = true;
- };
- joystick.onRelease = function ()
- {
- _root.dragging = false;
- };
- joystick.onReleaseOutside = function ()
- {
- _root.dragging = false;
- };
- with (joystick)
- {
- shaft._xscale = Math.sqrt((knob._x - shaft._x) * (knob._x - shaft._x) + (knob._y - shaft._y) * (knob._y - shaft._y));
- shaft._rotation = Math.atan2(knob._y - shaft._y, knob._x - shaft._x) * 180 / 3.141593;
- if (shaft._xscale > 90)
- {
- shaft._xscale = 90;
- knob._x = shaft._x + Math.cos(shaft._rotation * 3.141593 / 180) * shaft._xscale;
- knob._y = shaft._y + Math.sin(shaft._rotation * 3.141593 / 180) * shaft._xscale;
- targetx = knob._x;
- targety = knob._y;
- } // end if
- } // End of with
- joystick.knob.gotoAndStop(Player[0].stats.UPGRADE[64] + 1);
- LWY = P1.CAR.lwheel._y;
- RWY = P1.CAR.rwheel._y;
- CY = P1.CAR._y;
- ldiff = P1.CAR.frame._x - P1.CAR.lwheel._x;
- rdiff = P1.CAR.frame._x - P1.CAR.rwheel._x;
- // [Action in Frame 80]
- P1.CAR.lwheel.gotoAndStop(_root.CIVIC.MAX_WHEEL + 2);
- ReColor(P1, Player[0]);
- if (typ2 != 5)
- {
- P2.CAR.lwheel.gotoAndStop(_root.CIVIC.MAX_WHEEL + 2);
- ReColor(P2, Player[1]);
- } // end if
- // [Action in Frame 85]
- P2.CAR.lwheel.gotoAndStop(Player[1].stats._wheel);
- ReColor(P2, Player[1]);
- rctTime = 0;
- rctCheck = false;
- // [Action in Frame 86]
- mseconds = mseconds + 4;
- if (mseconds >= 60)
- {
- mseconds = 0;
- ++seconds;
- } // end if
- var i = 0;
- while (i < numplayers)
- {
- race(Player[i]);
- ++i;
- } // end while
- if (!rctCheck)
- {
- if (!Key.isDown(32))
- {
- rctTime = rctTime + 4;
- }
- else if (Key.isDown(32))
- {
- rctCheck = true;
- } // end if
- } // end else if
- UpdateHUD();
- if (Player[0].rdata.d > maxdistance || Player[0].rdata.ctemp >= 100 || raceresult == false)
- {
- sound.gotoAndPlay("stop");
- sound.engine.stop("eng90");
- Player[0].stats.OIL = Player[0].stats.OIL + 3;
- if (Player[0].stats.OIL >= 100)
- {
- _root.prompt("", "Your Oil Needs to be Changed!");
- } // end if
- if (Player[0].rdata.ctemp >= 100)
- {
- _root.prompt("", "Your Engine Broke Down!");
- raceresult = false;
- } // end if
- if (Player[0].stats.HP < 40)
- {
- Player[0].stats.HP = 40;
- } // end if
- if (Player[0].stats.TQ < 40)
- {
- Player[0].stats.TQ = 40;
- } // end if
- if (_root.RaceDataUpdate)
- {
- ftime = seconds * 60 + mseconds;
- _root.es.sendMove([_root.OnlineChallenger.name.value], {action: ftime});
- gotoAndPlay(ONLINE);
- }
- else if (raceresult != false)
- {
- raceresult = true;
- gotoAndPlay(WIN);
- }
- else
- {
- gotoAndPlay(LOSE);
- } // end else if
- }
- else
- {
- raceresult = undefined;
- var i = 1;
- while (i < numplayers)
- {
- if (Player[i].rdata.d > maxdistance && typ2 != 5)
- {
- raceresult = false;
- } // end if
- ++i;
- } // end while
- } // end else if
- with (joystick)
- {
- if (!_root.Options.nogas || !Key.isDown(32))
- {
- if (_root.dragging && _root.Options.gearsh)
- {
- targetx = _xmouse;
- targety = _ymouse;
- }
- else
- {
- targetx = joystick["G" add temp_gear]._x + joystick["G" add temp_gear]._width / 2;
- targety = joystick["G" add temp_gear]._y + joystick["G" add temp_gear]._width / 2;
- } // end if
- } // end else if
- } // End of with
- with (joystick)
- {
- boolx = new Number(0);
- booly = new Number(0);
- var p = 0;
- while (p <= 5)
- {
- angle = Math.atan2(targety - knob._y, targetx - knob._x);
- oldx = knob._x;
- oldy = knob._y;
- knob._x = knob._x + Math.cos(angle) * 7;
- boolx = 0;
- var i = 1;
- while (i <= 4)
- {
- if (!_parent["GEARCHECK" add i].hitTest(knob.col))
- {
- ++boolx;
- } // end if
- ++i;
- } // end while
- knob._x = oldx;
- knob._y = knob._y + Math.sin(angle) * 7;
- booly = 0;
- var i = 1;
- while (i <= 4)
- {
- if (!_parent["GEARCHECK" add i].hitTest(knob.col))
- {
- ++booly;
- } // end if
- ++i;
- } // end while
- if (boolx != 4)
- {
- knob._x = knob._x + Math.cos(angle) * 7;
- } // end if
- if (booly == 4)
- {
- knob._y = oldy;
- } // end if
- ++p;
- } // end while
- } // End of with
- with (joystick)
- {
- shaft._xscale = Math.sqrt((knob._x - shaft._x) * (knob._x - shaft._x) + (knob._y - shaft._y) * (knob._y - shaft._y));
- shaft._rotation = Math.atan2(knob._y - shaft._y, knob._x - shaft._x) * 180 / 3.141593;
- if (shaft._xscale > 90)
- {
- shaft._xscale = 90;
- knob._x = shaft._x + Math.cos(shaft._rotation * 3.141593 / 180) * shaft._xscale;
- knob._y = shaft._y + Math.sin(shaft._rotation * 3.141593 / 180) * shaft._xscale;
- targetx = knob._x;
- targety = knob._y;
- } // end if
- } // End of with
- if (Math.abs(joystick.knob._x - targetx) < 15 && Math.abs(joystick.knob._y - targety) < 15)
- {
- var i = 0;
- while (i <= 6)
- {
- if (joystick.knob.col.hitTest(joystick["G" add i]))
- {
- temp_gear = i;
- Player[0].rdata.g = i;
- } // end if
- ++i;
- } // end while
- } // end if
- // [Action in Frame 87]
- gotoAndPlay(RaceLoop);
- // [Action in Frame 88]
- stop ();
- if (_root.player.typ != "Arcade")
- {
- _root.SaveGame(_root.player, _root.car);
- }
- else
- {
- submit._visible = false;
- } // end else if
- ftime = seconds * 60 + mseconds;
- rctTime = timeFormat(rctTime);
- final = ftime add "ms (" add timeFormat(ftime) add ")";
- topspeed = Math.round(Player[0].rdata.tops) add "mph";
- wonby = Math.round(Player[0].rdata.d - Player[1].rdata.d) add "m";
- if (wonby < 0)
- {
- gotoAndStop("LOSE");
- } // end if
- if (Player[1] != undefined)
- {
- ++_root.player.wins;
- } // end if
- maxd = maxdistance add "m Race";
- tmpNOS = obj1.NOS;
- tmpNRES = obj1.NRES;
- perfect = new Object();
- perfect.typ = 2;
- initrace(perfect, obj1);
- while (perfect.rdata.d < maxdistance)
- {
- race(perfect);
- ptime = ptime + 4;
- } // end while
- obj1.NOS = tmpNOS;
- obj1.NRES = tmpNRES;
- perfecttime = ptime add "ms (" add timeFormat(ptime) add ")";
- effic = Math.round(ptime / ftime * 100) add "%";
- credits = rew.cr;
- carwon = rew.ca.FULLNAME;
- // [Action in Frame 89]
- stop ();
- rctTime = timeFormat(rctTime);
- if (_root.player.typ != "Arcade")
- {
- _root.SaveGame(_root.player, _root.car);
- }
- else
- {
- submit._visible = false;
- } // end else if
- ftime = seconds * 60 + mseconds;
- final = ftime add "ms (" add timeFormat(ftime) add ")";
- topspeed = Math.round(Player[0].rdata.tops) add "mph";
- wonby = Math.round(Player[1].rdata.d - Player[0].rdata.d) add "m";
- maxd = maxdistance add "m Race";
- ++_root.player.loss;
- perfecttime = "Unavailable";
- effic = "Unavailable";
- credits = los.cr;
- if (los.ca)
- {
- carwon = "This Car!";
- }
- else
- {
- carwon = "";
- } // end else if
- if (los.cr != undefined)
- {
- _root.Buy(rew.cr);
- } // end if
- if (los.ca)
- {
- player.cash = player.cash - _root.car[_root.player.car].CW;
- _root.SellCar(_root.player.car);
- } // end if
- // [Action in Frame 90]
- play ();
- rctTime = timeFormat(rctTime);
- ftime = seconds * 60 + mseconds;
- p1final = ftime add "ms (" add timeFormat(ftime) add ")";
- p1name = _root.Account.alias;
- p2name = _root.OnlineChallenger.name.value;
- if (_root.RaceTempTime != "")
- {
- _root.RaceDataUpdate = false;
- p2final = _root.RaceTempTime add "ms (" add timeFormat(_root.RaceTempTime) add ")";
- result._visible = true;
- if (_root.RaceTempTime > ftime)
- {
- result.gotoAndStop(1);
- }
- else if (_root.RaceTempTime < ftime)
- {
- result.gotoAndStop(2);
- }
- else if (_root.RaceTempTime == ftime)
- {
- result.gotoAndStop(3);
- } // end else if
- }
- else
- {
- p2final = "Waiting...";
- result._visible = false;
- } // end else if
- // [Action in Frame 91]
- prevFrame ();
- // [Action in Frame 92]
- gtime = new Array();
- var i = 1;
- while (i <= 6)
- {
- gtime[i] = 0;
- ++i;
- } // end while
- perfect = new Object();
- perfect.typ = 2;
- tmpNOS = obj1.NOS;
- tmpNRES = obj1.NRES;
- initrace(perfect, obj1);
- ptime = 0;
- while (perfect.rdata.d < 400)
- {
- race(perfect);
- ptime = ptime + 4;
- gtime[perfect.rdata.g] = gtime[perfect.rdata.g] + 4;
- } // end while
- t400 = timeFormat(ptime);
- ts400 = Math.round(perfect.rdata.tops) add " mph";
- perfect = new Object();
- perfect.typ = 2;
- initrace(perfect, obj1);
- for (ptime = 0; perfect.rdata.d < 1000; ptime = ptime + 4)
- {
- race(perfect);
- } // end of for
- t1000 = timeFormat(ptime);
- ts1000 = Math.round(perfect.rdata.tops) add " mph";
- tspeed = Math.round(perfect.rdata.TopSpeed[6]) add " mph";
- accel = 0;
- var i = 1;
- while (i <= 6)
- {
- this["g" + i + "ts"] = Math.round(perfect.rdata.TopSpeed[i]);
- this["g" + i + "a"] = Math.round(perfect.rdata.Accel[i] * 1000);
- this["g" + i + "t"] = timeFormat(gtime[i]);
- accel = accel + perfect.rdata.Accel[i];
- ++i;
- } // end while
- accel = accel / 6;
- accel = accel * 1000;
- accel = Math.round(accel);
- obj1.NOS = tmpNOS;
- obj1.NRES = tmpNRES;
- // [Action in Frame 93]
- stop ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement