Section 1
//BetweenLevelsOverlayInfo_96 (HeatRush_fla.BetweenLevelsOverlayInfo_96)
package HeatRush_fla {
import flash.display.*;
import flash.text.*;
public dynamic class BetweenLevelsOverlayInfo_96 extends MovieClip {
public var road0:MovieClip;
public var road2:MovieClip;
public var road7:MovieClip;
public var road3:MovieClip;
public var road4:MovieClip;
public var road5:MovieClip;
public var road6:MovieClip;
public var buttonUpgrades:SimpleButton;
public var level0:MovieClip;
public var level1:MovieClip;
public var level2:MovieClip;
public var level4:MovieClip;
public var level5:MovieClip;
public var level6:MovieClip;
public var road1:MovieClip;
public var level3:MovieClip;
public var level8:MovieClip;
public var level9:MovieClip;
public var road8:MovieClip;
public var level7:MovieClip;
public var road9:MovieClip;
public var buttonGameNinja:MovieClip;
public var buttonQuit:SimpleButton;
public var textFinalScore:TextField;
public var buttonContinue:SimpleButton;
}
}//package HeatRush_fla
Section 2
//EndGameOverlayInfo_105 (HeatRush_fla.EndGameOverlayInfo_105)
package HeatRush_fla {
import flash.display.*;
import flash.text.*;
public dynamic class EndGameOverlayInfo_105 extends MovieClip {
public var road0:MovieClip;
public var road2:MovieClip;
public var road7:MovieClip;
public var road3:MovieClip;
public var road4:MovieClip;
public var road5:MovieClip;
public var buttonUpgrades:SimpleButton;
public var level0:MovieClip;
public var level1:MovieClip;
public var level2:MovieClip;
public var level4:MovieClip;
public var level5:MovieClip;
public var level6:MovieClip;
public var road1:MovieClip;
public var level3:MovieClip;
public var level8:MovieClip;
public var level9:MovieClip;
public var road6:MovieClip;
public var road8:MovieClip;
public var level7:MovieClip;
public var textRaceTime:TextField;
public var road9:MovieClip;
public var buttonGameNinja:MovieClip;
public var textFinalScore:TextField;
public var buttonSubmitScore:MovieClip;
public var buttonContinue:SimpleButton;
}
}//package HeatRush_fla
Section 3
//GameninjaIntro_4 (HeatRush_fla.GameninjaIntro_4)
package HeatRush_fla {
import flash.events.*;
import flash.display.*;
public dynamic class GameninjaIntro_4 extends MovieClip {
public var goToGameNinjaBtn:SimpleButton;
public function GameninjaIntro_4(){
addFrameScript(0, frame1, 278, frame279);
}
function frame279(){
stop();
MovieClip(parent).play();
}
function frame1(){
addEventListener(MouseEvent.CLICK, TitleScreenState.GameNinjaTitleButtonPressed);
}
}
}//package HeatRush_fla
Section 4
//MainTimeline (HeatRush_fla.MainTimeline)
package HeatRush_fla {
import flash.display.*;
public dynamic class MainTimeline extends MovieClip {
public var preloader:MovieClip;
public var r:Number;
public var loaderBack:MovieClip;
public var gameninjaintro:MovieClip;
public function MainTimeline(){
addFrameScript(0, frame1, 2, frame3, 4, frame5);
}
function frame3(){
stop();
}
function frame1(){
Licensors.InitOnce();
if (Licensors.GetLicensor() == Licensors.LICENSOR_GAMENINJA_VIRAL){
r = Math.random();
if (r < 0.5){
MochiAd.showPreGameAd({clip:root, id:"bd28e4b9c8ba973e", res:"640x480"});
} else {
MochiAd.showPreGameAd({clip:root, id:"80268986e7958f7a", res:"640x480"});
};
};
preloader.gotoAndPlay(1);
}
function frame5(){
removeChild(preloader);
preloader = null;
if (gameninjaintro != null){
removeChild(gameninjaintro);
gameninjaintro = null;
};
stop();
}
}
}//package HeatRush_fla
Section 5
//OpeningTitle_74 (HeatRush_fla.OpeningTitle_74)
package HeatRush_fla {
import flash.display.*;
public dynamic class OpeningTitle_74 extends MovieClip {
public function OpeningTitle_74(){
addFrameScript(69, frame70);
}
function frame70(){
stop();
}
}
}//package HeatRush_fla
Section 6
//PreGameOverlayInfo_107 (HeatRush_fla.PreGameOverlayInfo_107)
package HeatRush_fla {
import flash.display.*;
import flash.text.*;
public dynamic class PreGameOverlayInfo_107 extends MovieClip {
public var road0:MovieClip;
public var road2:MovieClip;
public var road7:MovieClip;
public var road3:MovieClip;
public var road4:MovieClip;
public var road5:MovieClip;
public var buttonUpgrades:SimpleButton;
public var level0:MovieClip;
public var level1:MovieClip;
public var level2:MovieClip;
public var level4:MovieClip;
public var level5:MovieClip;
public var level6:MovieClip;
public var road1:MovieClip;
public var level3:MovieClip;
public var level8:MovieClip;
public var level9:MovieClip;
public var road6:MovieClip;
public var road8:MovieClip;
public var level7:MovieClip;
public var textRaceTime:TextField;
public var road9:MovieClip;
public var buttonGameNinja:MovieClip;
public var textFinalScore:TextField;
public var buttonContinue:SimpleButton;
}
}//package HeatRush_fla
Section 7
//SubmitScoreClip_82 (HeatRush_fla.SubmitScoreClip_82)
package HeatRush_fla {
import flash.display.*;
import flash.text.*;
public dynamic class SubmitScoreClip_82 extends MovieClip {
public var textName:TextField;
public var buttonSubmitScore:SimpleButton;
}
}//package HeatRush_fla
Section 8
//sun_1 (HeatRush_fla.sun_1)
package HeatRush_fla {
import flash.display.*;
public dynamic class sun_1 extends MovieClip {
public function sun_1(){
addFrameScript(34, frame35, 65, frame66);
}
function frame35(){
stop();
}
function frame66(){
stop();
MovieClip(parent).play();
}
}
}//package HeatRush_fla
Section 9
//Test_Button_101 (HeatRush_fla.Test_Button_101)
package HeatRush_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Test_Button_101 extends MovieClip {
public var textStageName:TextField;
public var textStageTime:TextField;
public var bg:MovieClip;
public var diorama:MovieClip;
}
}//package HeatRush_fla
Section 10
//Test_RoadBits_98 (HeatRush_fla.Test_RoadBits_98)
package HeatRush_fla {
import flash.display.*;
public dynamic class Test_RoadBits_98 extends MovieClip {
public var rightRoad:MovieClip;
public var leftRoad:MovieClip;
}
}//package HeatRush_fla
Section 11
//Achievement (Achievement)
package {
class Achievement {
var items:Array;
var conditionText:String;
var name:String;
var unlockName:String;
var complete:Boolean;
function Achievement(){
items = new Array();
name = "";
unlockName = "";
conditionText = "";
complete = false;
}
}
}//package
Section 12
//Achievements (Achievements)
package {
public class Achievements {
static var newAchievementList:Array;
static var list:Array;
public static function RemoveNewAchievements(){
newAchievementList = new Array();
}
public static function InitOnce(){
var _local1:XML;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:XML;
var _local6:Achievement;
var _local7:int;
var _local8:XML;
var _local9:AchievementItem;
list = new Array();
_local1 = ExternalData.xml;
_local2 = _local1.achievement.length();
_local3 = 0;
_local4 = 0;
trace(("num achievements: " + _local2));
_local3 = 0;
while (_local3 < _local2) {
_local5 = _local1.achievement[_local3];
_local6 = new Achievement();
_local6.name = _local5.@name;
_local6.unlockName = _local5.@unlock;
_local6.conditionText = _local5.@condition;
list.push(_local6);
_local7 = _local5.item.length();
_local4 = 0;
while (_local4 < _local7) {
_local8 = _local5.item[_local4];
_local9 = new AchievementItem();
_local9.id = int(_local8.@id);
_local9.levelName = _local8.@level;
_local9.variableName = _local8.@variable;
_local9.condition = _local8.@condition;
_local9.value = _local8.@value;
_local6.items.push(_local9);
_local4++;
};
_local3++;
};
}
public static function TestAtLevelComplete(_arg1:int){
var _local2:Achievement;
var _local3:Boolean;
var _local4:AchievementItem;
var _local5:Boolean;
newAchievementList = new Array();
for each (_local2 in list) {
if (_local2.complete == false){
_local3 = true;
for each (_local4 in _local2.items) {
_local5 = _local4.Test(_arg1);
if (_local5 == false){
_local3 = false;
};
};
if (_local3){
_local2.complete = true;
trace((("ACHIEVEMENT: " + _local2.name) + " COMPLETED"));
Upgrades.Unlock(_local2.unlockName);
newAchievementList.push(_local2);
} else {
trace((("ACHIEVEMENT: " + _local2.name) + " FAILED"));
};
};
};
}
}
}//package
class AchievementItem {
private var variableName:String;
private var id:int;
private var levelName:String;
private var value:String;
private var condition:String;
public static const CONDITION_EQUALS:String = "equals";
public static const CONDITION_GREATERTHANEQUAL:String = "greaterthanequal";
public static const CONDITION_LESSTHANEQUAL:String = "lessthanequal";
public static const CONDITION_GREATERTHAN:String = "greaterthan";
public static const CONDITION_LESSTHAN:String = "lessthan";
private function AchievementItem(){
}
public function Test(_arg1:int):Boolean{
var _local2:int;
var _local3:Number;
var _local4:Number;
_local2 = int(levelName);
if (_local2 != _arg1){
return (false);
};
_local3 = Stats.GetLevelStat(_local2, variableName);
_local4 = Number(value);
if (condition == CONDITION_EQUALS){
if (_local3 == _local4){
return (true);
};
} else {
if (condition == CONDITION_LESSTHAN){
if (_local3 < _local4){
return (true);
};
} else {
if (condition == CONDITION_LESSTHANEQUAL){
if (_local3 <= _local4){
return (true);
};
} else {
if (condition == CONDITION_GREATERTHAN){
if (_local3 > _local4){
return (true);
};
} else {
if (condition == CONDITION_GREATERTHANEQUAL){
if (_local3 >= _local4){
return (true);
};
};
};
};
};
};
return (false);
}
}
Section 13
//AICarInfo (AICarInfo)
package {
public class AICarInfo {
var accel:Number;
var maxRangeMax:Number;
var maxRangeMin:Number;
var type:String;
public function AICarInfo(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number){
type = _arg1;
accel = _arg2;
maxRangeMin = _arg3;
maxRangeMax = _arg4;
}
}
}//package
Section 14
//Background (Background)
package {
import flash.display.*;
public dynamic class Background extends MovieClip {
}
}//package
Section 15
//BetweenLevelsOverlay (BetweenLevelsOverlay)
package {
import flash.display.*;
public dynamic class BetweenLevelsOverlay extends MovieClip {
public var info:MovieClip;
public function BetweenLevelsOverlay(){
addFrameScript(0, frame1, 28, frame29, 59, frame60);
}
function frame1(){
}
function frame29(){
stop();
Game.BetweenLevelsOverlay_Done(0);
}
function frame60(){
stop();
Game.BetweenLevelsOverlay_Done(1);
}
}
}//package
Section 16
//Billboard (Billboard)
package {
public class Billboard {
var collisions:Array;
var name:String;
var yoffset:Number;
var frame:int;
public function Billboard(){
collisions = new Array();
name = "";
frame = 0;
yoffset = 0;
}
}
}//package
Section 17
//BillboardCollision (BillboardCollision)
package {
public class BillboardCollision {
var xoffset:Number;
var yoffset:Number;
var radius:Number;
var type:int;
public function BillboardCollision(){
xoffset = 0;
yoffset = 0;
radius = 0;
type = 0;
}
}
}//package
Section 18
//Billboards (Billboards)
package {
import flash.display.*;
public dynamic class Billboards extends MovieClip {
}
}//package
Section 19
//Camera (Camera)
package {
public class Camera {
public var mat:Matrix3;
public var farZ:Number;
public var fov:Number;
public var nearZ:Number;
public var pos:V3;
public var yrot:Number;
public function Camera(){
nearZ = 1;
farZ = 8000;
pos = new V3();
pos.FromXYZ(0, 0, 0);
mat = new Matrix3();
fov = 180;
yrot = 0;
}
}
}//package
Section 20
//Car01 (Car01)
package {
import flash.display.*;
public dynamic class Car01 extends MovieClip {
}
}//package
Section 21
//Car02 (Car02)
package {
import flash.display.*;
public dynamic class Car02 extends MovieClip {
}
}//package
Section 22
//Car03 (Car03)
package {
import flash.display.*;
public dynamic class Car03 extends MovieClip {
}
}//package
Section 23
//Car04 (Car04)
package {
import flash.display.*;
public dynamic class Car04 extends MovieClip {
}
}//package
Section 24
//Car05 (Car05)
package {
import flash.display.*;
public dynamic class Car05 extends MovieClip {
}
}//package
Section 25
//Car06 (Car06)
package {
import flash.display.*;
public dynamic class Car06 extends MovieClip {
}
}//package
Section 26
//Collision (Collision)
package {
public class Collision {
public static var stats_numIntersections:int;
public static var stats_numPolyCollisionTests:int;
static var collideSoundTimer:int = 0;
public static var main:Main;
public static var stats_numBBTests:int;
public static function Update(_arg1:Main){
main = _arg1;
stats_numIntersections = 0;
stats_numBBTests = 0;
stats_numPolyCollisionTests = 0;
CarCarCollision();
PlayerOvertakeCollision();
}
public static function CarCarCollision(){
var _local1:Array;
var _local2:GameObj;
var _local3:Number;
var _local4:Number;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:GameObj;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
if (collideSoundTimer > 0){
collideSoundTimer--;
};
_local1 = new Array();
for each (_local2 in GameObjects.objs) {
if (((((_local2.active) && (_local2.is3DObj))) && (((_local2.isPlayer) || (_local2.isAiVehicle))))){
_local1.push(_local2);
};
};
_local3 = 0.1;
_local4 = 10;
_local5 = 0;
while (_local5 < (_local1.length - 1)) {
_local2 = _local1[_local5];
_local7 = _local2.zpos;
_local8 = _local2.xpos;
_local8 = (_local8 * _local3);
_local6 = (_local5 + 1);
while (_local6 < _local1.length) {
_local9 = _local1[_local6];
_local10 = _local9.zpos;
_local11 = _local9.xpos;
_local11 = (_local11 * _local3);
_local12 = Utils.DistBetweenPoints(_local8, _local7, _local11, _local10);
if (_local12 < 10){
_local13 = Math.atan2((_local10 - _local7), (_local11 - _local8));
_local14 = ((10 - _local12) * 1);
_local2.xpos = (_local2.xpos - ((Math.cos(_local13) * _local14) * _local4));
_local2.ypos = (_local2.ypos - (Math.sin(_local13) * _local14));
_local9.xpos = (_local9.xpos + ((Math.cos(_local13) * _local14) * _local4));
_local9.ypos = (_local9.ypos + (Math.sin(_local13) * _local14));
_local2.xvel = (_local2.xvel * -1);
_local9.xvel = (_local9.xvel * -1);
if (_local2.isPlayer){
_local2.zvel = (_local2.zvel * 0.75);
};
if (_local9.isPlayer){
_local9.zvel = (_local9.zvel * 0.75);
};
if (((_local2.isPlayer) || (_local9.isPlayer))){
if (collideSoundTimer == 0){
SoundPlayer.Play(SoundPlayer.SOUND_HITCAR);
collideSoundTimer = 10;
};
Stats.AddLevelStat(Game.currentLevel, "hitcars", 1);
};
};
_local6++;
};
_local5++;
};
}
public static function PlayerOvertakeCollision(){
var _local1:Array;
var _local2:GameObj;
var _local3:Number;
var _local4:int;
var _local5:int;
var _local6:Number;
_local1 = new Array();
for each (_local2 in GameObjects.objs) {
if (((((_local2.active) && (_local2.is3DObj))) && (_local2.isAiVehicle))){
_local1.push(_local2);
};
};
_local3 = Game.goPlayer.zpos;
_local4 = 0;
while (_local4 < _local1.length) {
_local2 = _local1[_local4];
_local6 = _local2.zpos;
if (_local3 > _local6){
if (_local2.beenOvertaken == false){
_local2.beenOvertaken = true;
Stats.AddLevelStat(Game.currentLevel, "overtake", 1);
};
};
_local4++;
};
}
}
}//package
Section 27
//CourseCompleteScreen (CourseCompleteScreen)
package {
import flash.display.*;
public dynamic class CourseCompleteScreen extends MovieClip {
public var buttonContinue:SimpleButton;
public function CourseCompleteScreen(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 28
//Debug (Debug)
package {
public class Debug {
public static var debugMode:int = 0;
public static function RenderCollision(){
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:uint;
var _local5:Line;
var _local6:Line;
var _local7:int;
var _local8:Poly;
if ((debugMode & 1) == 0){
return;
};
_local1 = Game.scrollX;
_local2 = Game.scrollY;
_local7 = 0;
for each (_local8 in Game.polygonList) {
_local3 = 0;
while (_local3 < (_local8.GetNumLines() - 1)) {
_local4 = 4294967295;
_local5 = _local8.GetLine(_local3);
Utils.RenderDotLine(Game.main.screenBD, (_local5.x0 - _local1), (_local5.y0 - _local2), (_local5.x1 - _local1), (_local5.y1 - _local2), 100, _local4);
_local3++;
};
if (_local8.closed){
};
_local8.DrawCatmullRom(Game.main.screenBD, 4294901760, 100, 100);
_local7++;
};
}
public static function RenderPlayerInfo(){
var _local1:String;
var _local2:GameObj;
if ((debugMode & 2) == 0){
return;
};
_local2 = Game.goPlayer;
}
}
}//package
Section 29
//Defs (Defs)
package {
import flash.geom.*;
public class Defs {
public static const zpos_PICKUP = 1100;
public static const zpos_ENEMY = 1000;
public static const displayarea_w = 640;
public static const zpos_OVERLAY = 500;
public static const displayarea_w2 = 320;
public static const zpos_FAR = 10000;
public static const roadarea_h2 = 192;
public static const roadarea_h = 384;
public static const zpos_PLAYER = 1000;
public static const fps:Number = 34;
public static const platformW2 = 15;
public static const zpos_BACKGROUND = 10000;
public static const displayarea_h = 480;
public static const panelarea_h = 96;
public static var pointZero:Point = new Point(0, 0);
public static var screenRect:Rectangle = new Rectangle(0, 0, displayarea_w, displayarea_h);
}
}//package
Section 30
//DisplayObj (DisplayObj)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
public class DisplayObj {
var frames:Array;
public var frame:int;
public function DisplayObj(_arg1:MovieClip, _arg2:Number, _arg3:int, _arg4:ColorTransform=null):void{
frame = 0;
if (_arg1 != null){
CreateBitmapsFromMovieClip(_arg1, _arg3, _arg4);
};
}
public function GetHeight():Number{
return (frames[frame].bitmap.height);
}
public function GetBitmap():Bitmap{
return (frames[frame].bitmap);
}
function CreateAsciiStringTable():Array{
var _local1:Array;
_local1 = new Array();
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push("");
_local1.push(" ");
_local1.push("!");
_local1.push("'");
_local1.push("#");
_local1.push("$");
_local1.push("%");
_local1.push("&");
_local1.push("'");
_local1.push("(");
_local1.push(")");
_local1.push("*");
_local1.push("+");
_local1.push(",");
_local1.push("-");
_local1.push(".");
_local1.push("/");
_local1.push("0");
_local1.push("1");
_local1.push("2");
_local1.push("3");
_local1.push("4");
_local1.push("5");
_local1.push("6");
_local1.push("7");
_local1.push("8");
_local1.push("9");
_local1.push(":");
_local1.push(";");
_local1.push("<");
_local1.push("=");
_local1.push(">");
_local1.push("?");
_local1.push("@");
_local1.push("A");
_local1.push("B");
_local1.push("C");
_local1.push("D");
_local1.push("E");
_local1.push("F");
_local1.push("G");
_local1.push("H");
_local1.push("I");
_local1.push("J");
_local1.push("K");
_local1.push("L");
_local1.push("M");
_local1.push("N");
_local1.push("O");
_local1.push("P");
_local1.push("Q");
_local1.push("R");
_local1.push("S");
_local1.push("T");
_local1.push("U");
_local1.push("V");
_local1.push("W");
_local1.push("X");
_local1.push("Y");
_local1.push("Z");
_local1.push("[");
_local1.push("\\");
_local1.push("]");
_local1.push("^");
_local1.push("_");
_local1.push("'");
_local1.push("a");
_local1.push("b");
_local1.push("c");
_local1.push("d");
_local1.push("e");
_local1.push("f");
_local1.push("g");
_local1.push("h");
_local1.push("i");
_local1.push("j");
_local1.push("k");
_local1.push("l");
_local1.push("m");
_local1.push("n");
_local1.push("o");
_local1.push("p");
_local1.push("q");
_local1.push("r");
_local1.push("s");
_local1.push("t");
_local1.push("u");
_local1.push("v");
_local1.push("w");
_local1.push("x");
_local1.push("y");
_local1.push("z");
_local1.push("{");
_local1.push("|");
_local1.push("}");
_local1.push("~");
return (_local1);
}
public function RenderAt(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
frames[frame].RenderAt(_arg1, _arg2, _arg3, _arg4);
}
public function SetFrame(_arg1:int){
frame = _arg1;
if (frame < 0){
frame = 0;
};
if (frame >= frames.length){
frame = (frames.length - 1);
};
}
public function CreateBitmapsFromMovieClip(_arg1:MovieClip, _arg2:int, _arg3:ColorTransform=null):void{
var _local4:Boolean;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Matrix;
var _local10:Rectangle;
var _local11:Bitmap;
var _local12:BitmapData;
var _local13:Bitmap;
var _local14:BitmapData;
var _local15:int;
var _local16:*;
_local4 = false;
if (_arg2 == 2){
_local4 = true;
_arg2 = 0;
};
if (_arg2 == 3){
};
frames = new Array();
_arg1.gotoAndStop(0);
_local15 = 32;
_local5 = 0;
while (_local5 < _arg1.totalFrames) {
_local16 = new DisplayObjFrame();
_local16.bitmaps = new Array();
_local16.burnedbitmaps = new Array();
_local16.xoffsets = new Array();
_local16.yoffsets = new Array();
_local16.mat = new Matrix();
_local16.colTrans = new ColorTransform();
_local10 = _arg1.getBounds(null);
_local10.x = Math.floor(_local10.x);
_local10.y = Math.floor(_local10.y);
_local10.width = Math.floor((_local10.width + 1));
_local10.height = Math.floor((_local10.height + 1));
_local8 = Math.floor(_local8);
_local9 = new Matrix();
_local7 = _local10.left;
_local8 = _local10.top;
_local9.translate(-(_local7), -(_local8));
_local16.xoffsets.push(Number(_local7));
_local16.yoffsets.push(Number(_local8));
if (((!((_arg1.width == 0))) && (!((_arg1.height == 0))))){
_local11 = new Bitmap();
_local12 = new BitmapData(_local10.width, _local10.height, true, 0);
_local12.draw(_arg1, _local9, _arg3);
_local11.bitmapData = _local12;
_local16.bitmaps.push(_local11);
} else {
_local16.bitmaps.push(null);
};
if (_local4){
_local10 = _arg1.getBounds(null);
_local10.x = Math.floor(_local10.x);
_local10.y = Math.floor(_local10.y);
_local10.width = Math.floor((_local10.width + 1));
_local10.height = Math.floor((_local10.height + 1));
_local9 = new Matrix();
_local7 = _local10.left;
_local8 = _local10.top;
_local9.translate(-(_local7), -(_local8));
_local9.scale(-1, 1);
_local9.translate(_local10.width, 0);
_local16.xoffsets.push(Number(-(_local10.right)));
_local16.yoffsets.push(Number(_local8));
if (((!((_arg1.width == 0))) && (!((_arg1.height == 0))))){
_local11 = new Bitmap();
_local12 = new BitmapData(_local10.width, _local10.height, true, 0);
_local12.draw(_arg1, _local9, _arg3);
_local11.bitmapData = _local12;
_local16.bitmaps.push(_local11);
} else {
_local16.bitmaps.push(null);
};
};
frames.push(_local16);
_arg1.nextFrame();
_local5++;
};
}
public function GetWidth():Number{
return (frames[frame].bitmap.width);
}
public function RenderAtColTrans(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:ColorTransform, _arg5:Boolean=false):void{
frames[frame].RenderAtColTrans(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function CreateFont(_arg1:TextFormat):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Matrix;
var _local7:Rectangle;
var _local8:Bitmap;
var _local9:BitmapData;
var _local10:Array;
var _local11:TextField;
var _local12:*;
frames = new Array();
_local10 = CreateAsciiStringTable();
_local2 = 0;
while (_local2 < _local10.length) {
_local11 = new TextField();
_local11.textColor = 4294967295;
_local11.selectable = false;
_local11.embedFonts = true;
_local11.autoSize = TextFieldAutoSize.LEFT;
_local11.x = 0;
_local11.y = 0;
_local11.text = _local10[_local2];
_local11.setTextFormat(_arg1);
_local12 = new DisplayObjFrame();
_local12.bitmaps = new Array();
_local12.xoffsets = new Array();
_local12.yoffsets = new Array();
_local12.mat = new Matrix();
_local12.colTrans = new ColorTransform();
_local7 = _local11.getBounds(null);
_local6 = new Matrix();
_local12.xoffsets.push(0);
_local12.yoffsets.push(0);
_local8 = new Bitmap();
_local9 = new BitmapData(_local7.width, _local7.height, true, 0);
_local9.draw(_local11, _local6);
_local8.bitmapData = _local9;
_local12.bitmaps.push(_local8);
frames.push(_local12);
_local2++;
};
}
public function GetMaxFrames():int{
return (frames.length);
}
public function GetXOffset():Number{
return (frames[frame].xoffset);
}
public function GetYOffset():Number{
return (frames[frame].yoffset);
}
public function GetFrame():int{
return (frame);
}
public function RenderAtRot(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):void{
if (_arg5){
frames[frame].RenderAtRotBurned(_arg1, _arg2, _arg3, _arg4);
} else {
frames[frame].RenderAtRot(_arg1, _arg2, _arg3, _arg4);
};
}
public function GetFrameWidth(_arg1:int):Number{
return (frames[_arg1].bitmap.width);
}
public function GetScaledBitmap():Bitmap{
return (frames[frame].scaledBitmap);
}
}
}//package
import flash.display.*;
import flash.geom.*;
class DisplayObjFrame {
public var mat:Matrix;
public var bitmaps:Array;
public var xoffsets:Array;
public var burnedbitmaps:Array;
public var colTrans:ColorTransform;
public var yoffsets:Array;
private function DisplayObjFrame(){
}
public function RenderAtScaled(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1):void{
var _local6:Bitmap;
var _local7:Number;
var _local8:Number;
_local6 = bitmaps[0];
_local7 = xoffsets[0];
_local8 = yoffsets[0];
if (_arg4){
_local6 = bitmaps[1];
_local7 = xoffsets[1];
_local8 = yoffsets[1];
};
mat.identity();
mat.scale(_arg5, _arg5);
mat.translate((_arg2 + (_local7 * _arg5)), (_arg3 + (_local8 * _arg5)));
if (_local6 != null){
if (_local6.bitmapData != null){
_arg1.draw(_local6.bitmapData, mat);
};
};
}
public function RenderAt(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
if (_arg4){
_local5 = bitmaps[1];
_local6 = xoffsets[1];
_local7 = yoffsets[1];
};
_arg1.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point((_arg2 + _local6), (_arg3 + _local7)), null, null, true);
}
public function RenderAtRotScaled(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Number=1, _arg6:Number=0):void{
var _local7:Bitmap;
var _local8:Number;
var _local9:Number;
_local7 = bitmaps[0];
_local8 = xoffsets[0];
_local9 = yoffsets[0];
if (_arg4){
_local7 = bitmaps[1];
_local8 = xoffsets[1];
_local9 = yoffsets[1];
};
mat.identity();
mat.translate(_local8, _local9);
mat.rotate(_arg6);
mat.translate(-(_local8), -(_local9));
mat.scale(_arg5, _arg5);
mat.translate((_arg2 + (_local8 * _arg5)), (_arg3 + (_local9 * _arg5)));
if (_local7 != null){
if (_local7.bitmapData != null){
_arg1.draw(_local7.bitmapData, mat);
};
};
}
public function RenderAtSplit(_arg1:BitmapData, _arg2:Number, _arg3:Number):void{
var _local4:int;
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local4 = 0;
while (_local4 < bitmaps.length) {
_local5 = bitmaps[_local4];
_local6 = xoffsets[_local4];
_local7 = yoffsets[_local4];
_arg1.copyPixels(_local5.bitmapData, new Rectangle(0, 0, _local5.width, _local5.height), new Point((_arg2 + _local6), (_arg3 + _local7)), null, null, true);
_local4++;
};
}
public function RenderAtColTrans(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:ColorTransform, _arg5:Boolean=false):void{
var _local6:Bitmap;
var _local7:Number;
var _local8:Number;
_local6 = bitmaps[0];
_local7 = xoffsets[0];
_local8 = yoffsets[0];
if (_arg5){
_local6 = bitmaps[1];
_local7 = xoffsets[1];
_local8 = yoffsets[1];
};
mat.identity();
mat.translate((_arg2 + _local7), (_arg3 + _local8));
if (_local6 != null){
if (_local6.bitmapData != null){
_arg1.draw(_local6.bitmapData, mat, _arg4);
};
};
}
public function RenderAtAdditive(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
mat.identity();
mat.translate((_arg2 + _local6), (_arg3 + _local7));
colTrans.alphaMultiplier = _arg4;
if (_local5 != null){
if (_local5.bitmapData != null){
_arg1.draw(_local5.bitmapData, mat, colTrans, "add");
};
};
}
public function RenderAtAlpha(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Bitmap;
var _local6:Number;
var _local7:Number;
_local5 = bitmaps[0];
_local6 = xoffsets[0];
_local7 = yoffsets[0];
mat.identity();
mat.translate((_arg2 + _local6), (_arg3 + _local7));
colTrans.alphaMultiplier = _arg4;
if (_local5 != null){
if (_local5.bitmapData != null){
_arg1.draw(_local5.bitmapData, mat, colTrans);
};
};
}
public function RenderAtRot(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:int;
var _local6:int;
var _local7:Bitmap;
var _local8:Number;
var _local9:Number;
_arg4 = (_arg4 - 0.01);
_local5 = bitmaps.length;
_arg4 = ((Number(_local5) / (Math.PI * 2)) * _arg4);
_local6 = _arg4;
while (_local6 < 0) {
_local6 = (_local6 + _local5);
};
while (_local6 > (_local5 - 1)) {
_local6 = (_local6 - _local5);
};
_local6 = ((_local5 - 1) - _local6);
_local7 = bitmaps[_local6];
_local8 = xoffsets[_local6];
_local9 = yoffsets[_local6];
_arg1.copyPixels(_local7.bitmapData, new Rectangle(0, 0, _local7.width, _local7.height), new Point((_arg2 + _local8), (_arg3 + _local9)));
}
}
Section 31
//EndGameOverlay (EndGameOverlay)
package {
import flash.display.*;
public dynamic class EndGameOverlay extends MovieClip {
public var info:MovieClip;
public function EndGameOverlay(){
addFrameScript(0, frame1, 28, frame29, 60, frame61);
}
function frame1(){
}
function frame29(){
stop();
Game.BetweenLevelsOverlay_Done(0);
}
function frame61(){
stop();
Game.BetweenLevelsOverlay_Done(1);
}
}
}//package
Section 32
//EndMovie1 (EndMovie1)
package {
import flash.display.*;
public dynamic class EndMovie1 extends MovieClip {
public function EndMovie1(){
addFrameScript(199, frame200);
}
function frame200(){
stop();
}
}
}//package
Section 33
//EndMovie2 (EndMovie2)
package {
import flash.display.*;
public dynamic class EndMovie2 extends MovieClip {
public function EndMovie2(){
addFrameScript(199, frame200);
}
function frame200(){
stop();
}
}
}//package
Section 34
//EndMovie3 (EndMovie3)
package {
import flash.display.*;
public dynamic class EndMovie3 extends MovieClip {
public function EndMovie3(){
addFrameScript(199, frame200);
}
function frame200(){
stop();
}
}
}//package
Section 35
//EndMovie4 (EndMovie4)
package {
import flash.display.*;
public dynamic class EndMovie4 extends MovieClip {
public function EndMovie4(){
addFrameScript(199, frame200);
}
function frame200(){
stop();
}
}
}//package
Section 36
//EngineLoop (EngineLoop)
package {
import flash.media.*;
public dynamic class EngineLoop extends Sound {
}
}//package
Section 37
//EngineStart (EngineStart)
package {
import flash.media.*;
public dynamic class EngineStart extends Sound {
}
}//package
Section 38
//ExternalData (ExternalData)
package {
import flash.events.*;
import flash.net.*;
public class ExternalData {
static var f:Function;
static var xml:XML;
static var xxx:XML = <data>
<!-- Collision types:
1 = spinoff
2 = crash
.. anything else needed?
-->
<billboard name="BarrierRed" frame="0" yoffset="0">
<collision type="1" radius="1" xoff="0"/>
</billboard>
<billboard name="BarrierWhite" frame="1" yoffset="0">
<collision type="1" radius="1" xoff="0"/>
</billboard>
<billboard name="Boulders" frame="2" yoffset="0">
<collision type="2" radius="2" xoff="0"/>
</billboard>
<billboard name="CherryBush" frame="3" yoffset="0">
<collision type="1" radius="2" xoff="0"/>
</billboard>
<billboard name="LargeBush" frame="4" yoffset="0">
<collision type="1" radius="1" xoff="0"/>
</billboard>
<billboard name="Wave" frame="5" yoffset="0">
</billboard>
<billboard name="YuccaBush" frame="6" yoffset="0">
<collision type="1" radius="1" xoff="0"/>
</billboard>
<billboard name="Lamppost" frame="7" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="Mound" frame="8" yoffset="0">
<collision type="2" radius="3" xoff="0"/>
</billboard>
<billboard name="Palm" frame="9" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="Plant" frame="10" yoffset="0">
<collision type="1" radius="1" xoff="0"/>
</billboard>
<billboard name="Rock" frame="11" yoffset="0">
<collision type="2" radius="2" xoff="0"/>
</billboard>
<billboard name="Rockwall" frame="12" yoffset="0">
<collision type="2" radius="2" xoff="0"/>
</billboard>
<billboard name="Scrub" frame="13" yoffset="0">
</billboard>
<billboard name="Shrubs" frame="14" yoffset="0">
<collision type="1" radius="1" xoff="0"/>
</billboard>
<billboard name="SignLeft" frame="15" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="SignLeftChicane" frame="16" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="SignRight" frame="17" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="SignRightChicane" frame="18" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="BareTree" frame="19" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="OakTree" frame="20" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="SpaceTree" frame="21" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="SpruceTree" frame="22" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="Wall" frame="23" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="BrokenWall" frame="24" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="Windmill" frame="25" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="Cloud" frame="26" yoffset="0">
</billboard>
<billboard name="Puddle" frame="27" yoffset="0">
<collision type="0" radius="1" xoff="0"/>
</billboard>
<billboard name="Gantry_Split" frame="28" yoffset="0">
<collision type="2" radius="2" xoff="500"/>
<collision type="2" radius="2" xoff="-500"/>
</billboard>
<billboard name="Gantry" frame="29" yoffset="0">
<collision type="2" radius="2" xoff="500"/>
<collision type="2" radius="2" xoff="-500"/>
</billboard>
<billboard name="Gantry_Start" frame="30" yoffset="0">
<collision type="2" radius="2" xoff="500"/>
<collision type="2" radius="2" xoff="-500"/>
</billboard>
<billboard name="Gantry_Goal" frame="31" yoffset="0">
<collision type="2" radius="2" xoff="500"/>
<collision type="2" radius="2" xoff="-5000"/>
</billboard>
<billboard name="BeachHut" frame="32" yoffset="0">
<collision type="2" radius="2" xoff="0"/>
</billboard>
<billboard name="GreekHut1" frame="33" yoffset="0">
<collision type="2" radius="3" xoff="0"/>
</billboard>
<billboard name="GreekHut2" frame="34" yoffset="0">
<collision type="2" radius="3" xoff="0"/>
</billboard>
<billboard name="Advert1" frame="35" yoffset="0">
<collision type="2" radius="2" xoff="0"/>
</billboard>
<billboard name="Advert2" frame="36" yoffset="0">
<collision type="1" radius="3" xoff="0"/>
</billboard>
<billboard name="Barn" frame="37" yoffset="0">
<collision type="2" radius="3" xoff="0"/>
</billboard>
<billboard name="Flowers" frame="38" yoffset="0">
</billboard>
<billboard name="GrassTall" frame="39" yoffset="0">
</billboard>
<billboard name="Wheat" frame="40" yoffset="0">
</billboard>
<billboard name="Hay" frame="41" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="Lamppost_Ornate" frame="42" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="RockBridge" frame="43" yoffset="0">
<collision type="2" radius="1" xoff="500"/>
<collision type="2" radius="1" xoff="-500"/>
</billboard>
<billboard name="RockBridge_Open" frame="44" yoffset="0">
<collision type="2" radius="1" xoff="500"/>
<collision type="2" radius="1" xoff="-500"/>
</billboard>
<billboard name="WindTurbine" frame="45" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="SpeedBump" frame="46" yoffset="0">
</billboard>
<billboard name="MoundSide" frame="47" yoffset="0">
<collision type="2" radius="3" xoff="0"/>
</billboard>
<billboard name="ElmTree" frame="48" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="Lamppost_Mid" frame="49" yoffset="0">
<collision type="2" radius="1" xoff="0"/>
</billboard>
<billboard name="Yacht" frame="50" yoffset="0">
</billboard>
<billboard name="Balloon" frame="51" yoffset="0">
</billboard>
<surfacetype name="tarmac"/>
<surfacetype name="bumpy"/>
<surfacetype name="wet"/>
<!--
info.length = max length of road. If you try to add segments beyond this it'll probably break.
info.drawdist = the number of segments to draw
info.objdist = the distance when objects stop drawing
info.camheight = camera height above road
info.fov = field of view (although it's not fov as you know it!)
info.zstep = the physical z distance relating to each road segment.
info.zoffset = the distance from the player car to the camera
base - mainly default values
base.width = default road width
base.surface = default surface
base.curvemul = global multiplier for bends - can instatly make the whole road more or less bendy with this.
base.hillmul = global multiplier for hills
surface - this defines the surface ID for areas of road.
- the 'surface' parameter is an index in to the 'roadsegment' block below
roadsegment - think of this as a 256 high texture map. The data in here must add up to 256 scans.
roadsegment.pattern - a simple way of defining the texture.
roadsegment.pattern.repeat = the number of scans
roadsegment.pattern.value = This is the actual scan line which is being displayed. Each pattern.value represents a different 1-pixel high texture
-->
<setup>
<player accel="0.2" decel="0.1" max="9" roadpush="30" roadpushvelexp="1" smokeminxvel="12" lrmax="20" lracc="2" speedtomph="13"/>
<ai maxcars="10" cutoffbehindplayer="50" gendist="500"/>
<aicar type="Prelude" accel="0.01" maxA="6" maxB="6.5"/>
<aicar type="Capri" accel="0.02" maxA="6.5" maxB="7"/>
<aicar type="Porsche" accel="0.03" maxA="7" maxB="7.5"/>
<aicar type="Jeep" accel="0.04" maxA="6" maxB="6.5"/>
<aicar type="Mini" accel="0.04" maxA="6.5" maxB="7"/>
<aicar type="Truck" accel="0.04" maxA="5" maxB="6"/>
<turbo mintriggerspeed="7" accel="0.1" decel="0.1" maxspeed="3" time="5" rechargetime="6"/>
<upgrade accel="0.01" decel="0.01" max="0.2" roadpush="-0.3" lracc="0.1" turbomax="0.3" turborecharge="-1" turbotime="1"/>
</setup>
<!-- 10000 = approx 30secs -->
<!-- STAGE 1 (COPY) -->
<!-- COCOA CITY -->
<!-- A seaside stage, nice gentle introduction -->
<road>
<!-- data -->
<info name="Cocoa City" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="500"/>
<time normal="55"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="189" colg="211" colb="236" frame="6"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="3000" text="FIRSTBEND"/>
<label z="8000" text="BIGHILL"/>
<label z="10800" text="CHICANE"/>
<!-- ai -->
<aizone z="0" dist="20000" density="0.2" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="0.2" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="0.2" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="20000" density="0.2" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="20000" density="0.2" cartype="4"/> <!-- Mini -->
<aizone z="0" dist="20000" density="0.2" cartype="5"/> <!-- Truck -->
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="233" colg="220" colb="140" splash="1"/> <!-- sand2 -->
<edge z="0" dist="16000" side="1" colr="233" colg="220" colb="140" splash="1"/>
<edge z="5000" dist="3000" side="-1" colr="21" colg="60" colb="106" splash="3"/> <!-- sea --> <!-- left -->
<edge z="5000" dist="3000" side="1" colr="227" colg="211" colb="195" splash="1"/> <!-- sand --> <!-- right -->
<edge z="12000" dist="1500" side="-1" colr="21" colg="60" colb="106" splash="3"/> <!-- sea --> <!-- left -->
<edge z="12000" dist="1500" side="1" colr="227" colg="211" colb="195" splash="1"/> <!-- sand --> <!-- right -->
<surface z="0" dist="100" surface="0" splash="0"/>
<surface z="100" dist="125" surface="3" splash="0"/>
<surface z="125" dist="1475" surface="0" splash="0"/>
<surface z="2600" dist="9400" surface="2" splash="0"/>
<surface z="12000" dist="100" surface="0" splash="0"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<!-- road -->
<width z="0" dist="1600" width="400" crossdist="100"/>
<width z="2600" dist="9400" width="700" crossdist="100"/>
<width z="12000" dist="300" width="400" crossdist="300"/>
<!-- bends -->
<bend z="3000" dist="1000" curve="4"/> <!-- right -->
<bend z="5000" dist="1000" curve="-4"/> <!-- left -->
<bend z="7000" dist="400" curve="-8"/>
<bend z="8000" dist="800" curve="8"/>
<bend z="9400" dist="600" curve="-12"/>
<bend z="10200" dist="600" curve="10"/>
<bend z="12600" dist="600" curve="4"/>
<bend z="13200" dist="600" curve="-4"/>
<!-- hills -->
<hill z="1000" dist="400" curve="4"/> <!-- down -->
<hill z="1400" dist="200" curve="-2"/>
<hill z="1600" dist="200" curve="-2"/>
<hill z="1800" dist="200" curve="2"/>
<hill z="2000" dist="200" curve="-2"/>
<hill z="4400" dist="400" curve="4"/>
<hill z="4800" dist="200" curve="-2"/>
<hill z="8000" dist="1200" curve="-6"/>
<hill z="9200" dist="200" curve="2"/>
<hill z="10800" dist="1000" curve="6"/>
<hill z="11800" dist="200" curve="-2"/>
<!-- scenery -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="200" dist="300" side="-1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="200" dist="300" side="1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="800" dist="4000" side="1" frequency="100" x0="500" x1="2000" type="LargeBush"/> <!-- distance object -->
<billboard z="800" dist="4000" side="-1" frequency="100" x0="500" x1="2000" type="LargeBush"/> <!-- distance object -->
<billboard z="700" dist="200" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="710" dist="200" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="1000" dist="200" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="1000" dist="200" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="1200" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="1200" dist="200" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="1450" dist="100" side="-1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="1450" dist="100" side="1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="1600" dist="600" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="1610" dist="600" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="2300" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="2300" dist="200" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="2600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="2600" dist="600" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<!-- FIRST BEND 3000 -->
<billboard z="3200" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="3400" dist="200" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="3600" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="3800" dist="200" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="4000" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="4300" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="4300" dist="200" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="4600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="5100" dist="400" side="1" frequency="50" x0="80" x1="80" type="BeachHut"/>
<billboard z="5110" dist="400" side="1" frequency="50" x0="400" x1="800" type="Palm"/>
<billboard z="5500" dist="2000" side="-1" frequency="200" x0="400" x1="2000" type="Yacht"/> <!-- distance object -->
<billboard z="5000" dist="3000" side="-1" frequency="20" x0="100" x1="2000" type="Wave"/> <!-- distance object -->
<billboard z="5600" dist="200" side="1" frequency="40" x0="20" x1="20" type="Palm"/>
<billboard z="5710" dist="200" side="1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="6100" dist="400" side="1" frequency="50" x0="80" x1="80" type="BeachHut"/>
<billboard z="6110" dist="400" side="1" frequency="50" x0="400" x1="800" type="Palm"/>
<billboard z="6600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="7100" dist="200" side="1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="7300" dist="200" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="7500" dist="400" side="1" frequency="50" x0="80" x1="80" type="BeachHut"/>
<billboard z="7510" dist="400" side="1" frequency="50" x0="400" x1="800" type="Palm"/>
<!-- BIG HILL 8000 -->
<billboard z="8000" dist="200" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="8400" dist="600" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="8410" dist="600" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="8600" dist="3200" side="1" frequency="100" x0="500" x1="2000" type="LargeBush"/> <!-- distance object -->
<billboard z="8600" dist="3200" side="-1" frequency="100" x0="500" x1="2000" type="LargeBush"/> <!-- distance object -->
<billboard z="8510" dist="400" side="-1" frequency="20" x0="20" x1="20" type="Palm"/>
<billboard z="9000" dist="2000" side="0" frequency="200" x0="-5000" x1="5000" y0="600" y1="1600" type="Balloon"/>
<billboard z="9000" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="9400" dist="400" side="-1" frequency="20" x0="20" x1="20" type="Palm"/>
<billboard z="9600" dist="400" side="1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="9800" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="10200" dist="400" side="1" frequency="20" x0="20" x1="20" type="Palm"/>
<billboard z="10400" dist="400" side="-1" frequency="30" x0="150" x1="150" type="Advert2"/>
<!-- CHICANE 10800 -->
<billboard z="11200" dist="700" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="11210" dist="700" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="11505" dist="300" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="11515" dist="300" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="12000" dist="1500" side="-1" frequency="20" x0="100" x1="2000" type="Wave"/> <!-- distance object -->
<billboard z="12200" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane right then left -->
<billboard z="12610" dist="800" side="1" frequency="50" x0="400" x1="800" type="Plant"/>
<billboard z="12800" dist="400" side="1" frequency="50" x0="80" x1="80" type="BeachHut"/>
<billboard z="13600" dist="300" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="13610" dist="300" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="14000" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="0" repeat="128"/>
<pattern value="2" repeat="128"/>
</roadsegment>
<roadsegment> <!-- blank -->
<pattern value="0" repeat="256"/>
</roadsegment>
<roadsegment> <!-- 5 lane striped -->
<pattern value="0" repeat="128"/>
<pattern value="4" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="5" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 2 -->
<!-- WIND VALLEY -->
<!-- A windy stage set on hilly open plains, with clouds, wind turbines -->
<road>
<!-- data -->
<info name="Wind Valley" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="1000"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="097" colg="219" colb="249" frame="5"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="5400" text="SNAKE"/>
<label z="9000" text="LONGCURVE"/>
<!-- ai -->
<aizone z="0" dist="20000" density="0.4" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="0.4" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="0.4" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="20000" density="0.4" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="20000" density="0.4" cartype="4"/> <!-- Mini -->
<aizone z="0" dist="20000" density="0.4" cartype="5"/> <!-- Truck -->
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="61" colg="100" colb="14" splash="2"/>
<edge z="0" dist="16000" side="1" colr="61" colg="100" colb="14" splash="2"/>
<surface z="0" dist="100" surface="0" splash="0"/>
<surface z="100" dist="125" surface="3" splash="0"/>
<surface z="125" dist="15874" surface="0" splash="0"/>
<surface z="8200" dist="4800" surface="2" splash="0"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<!-- road -->
<width z="8200" dist="5000" width="700" crossdist="200"/>
<width z="13000" dist="200" width="400" crossdist="200"/>
<!-- bends -->
<bend z="800" dist="200" curve="6"/> <!-- right -->
<bend z="1000" dist="400" curve="-6"/> <!-- left -->
<bend z="2500" dist="500" curve="-8"/> <!-- left -->
<bend z="3000" dist="800" curve="12"/> <!-- right -->
<bend z="4000" dist="1000" curve="6"/> <!-- right -->
<bend z="5400" dist="1200" curve="-8"/> <!-- left -->
<bend z="7000" dist="1200" curve="10"/> <!-- right -->
<bend z="9000" dist="2000" curve="2"/> <!-- right -->
<bend z="10400" dist="600" curve="16"/> <!-- right -->
<bend z="11000" dist="600" curve="-12"/> <!-- left -->
<bend z="12000" dist="1200" curve="-2"/> <!-- left -->
<!-- hills -->
<hill z="200" dist="300" curve="4"/> <!-- up -->
<hill z="500" dist="300" curve="-4"/>
<hill z="2000" dist="2000" curve="-2"/>
<hill z="4000" dist="1000" curve="4"/>
<hill z="5400" dist="600" curve="-2"/>
<hill z="6000" dist="600" curve="2"/>
<hill z="7000" dist="600" curve="-2"/>
<hill z="7600" dist="600" curve="2"/>
<hill z="8200" dist="800" curve="-2"/>
<hill z="9000" dist="100" curve="-2"/>
<hill z="9100" dist="100" curve="2"/>
<hill z="9200" dist="100" curve="-2"/>
<hill z="9300" dist="100" curve="2"/>
<hill z="9400" dist="100" curve="-2"/>
<hill z="9600" dist="100" curve="-2"/>
<hill z="9700" dist="100" curve="2"/>
<hill z="9800" dist="100" curve="-2"/>
<hill z="9900" dist="100" curve="2"/>
<hill z="10000" dist="100" curve="-2"/>
<hill z="10400" dist="300" curve="-4"/>
<hill z="10700" dist="300" curve="4"/>
<hill z="11000" dist="200" curve="-2"/>
<hill z="13000" dist="600" curve="8"/>
<hill z="13600" dist="800" curve="-6"/>
<!-- scenery -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="400" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane right then left -->
<billboard z="400" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane right then left -->
<billboard z="800" dist="600" side="-1" frequency="30" x0="50" x1="100" type="CherryBush"/>
<billboard z="800" dist="600" side="1" frequency="30" x0="50" x1="100" type="CherryBush"/>
<billboard z="1400" dist="1200" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="1400" dist="1200" side="-1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="2100" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="2500" dist="500" side="1" frequency="30" x0="50" x1="100" type="CherryBush"/>
<billboard z="2600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="3100" dist="600" side="-1" frequency="30" x0="50" x1="100" type="CherryBush"/>
<billboard z="3000" dist="800" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="3600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="4600" dist="400" side="1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="4602" dist="400" side="1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="4600" dist="400" side="-1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="4602" dist="400" side="-1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="5000" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="5000" dist="1000" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="5000" dist="1000" side="-1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="5000" dist="2000" side="0" frequency="200" x0="-5000" x1="5000" y0="600" y1="1600" type="Balloon"/>
<billboard z="6000" dist="400" side="1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="6002" dist="400" side="1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="6000" dist="400" side="-1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="6002" dist="400" side="-1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="6600" dist="800" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="6600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="7000" dist="500" side="-1" frequency="30" x0="50" x1="100" type="CherryBush"/>
<billboard z="7600" dist="400" side="1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="7602" dist="400" side="1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="7600" dist="400" side="-1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="7602" dist="400" side="-1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="9000" dist="3600" side="0" frequency="10" x0="-4000" x1="4000" y0="1200" y1="1200" type="Cloud"/>
<billboard z="8000" dist="800" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="8000" dist="800" side="-1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="9000" dist="800" side="1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="9002" dist="800" side="1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="9000" dist="800" side="-1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="9002" dist="800" side="-1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="9800" dist="600" side="1" frequency="30" x0="50" x1="100" type="CherryBush"/>
<billboard z="10000" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="10400" dist="800" side="-1" frequency="30" x0="50" x1="100" type="CherryBush"/>
<billboard z="10600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="10800" dist="600" side="1" frequency="30" x0="50" x1="100" type="CherryBush"/>
<billboard z="11000" dist="2000" side="1" frequency="30" x0="100" x1="500" type="GrassTall"/>
<billboard z="11000" dist="2000" side="-1" frequency="30" x0="100" x1="500" type="GrassTall"/>
<billboard z="13000" dist="1000" side="1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="13002" dist="1000" side="1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="13000" dist="1000" side="-1" frequency="80" x0="40" x1="40" type="WindTurbine"/>
<billboard z="13002" dist="1000" side="-1" frequency="80" x0="600" x1="600" type="WindTurbine"/>
<billboard z="14400" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="8" repeat="128"/>
</roadsegment>
<roadsegment> <!-- blank -->
<pattern value="6" repeat="256"/>
</roadsegment>
<roadsegment> <!-- 5 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="10" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="11" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 3 -->
<!-- BLACK MOUNTAIN -->
<!-- A rocky mountain stage, with sharp bends and winding hills -->
<road>
<!-- data -->
<info name="Black Mountain" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="1000"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="155" colg="208" colb="255" frame="0"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="8400" text="TOPOFTHEHILL"/>
<label z="10800" text="CHICANE"/>
<!-- ai -->
<aizone z="0" dist="20000" density="0.4" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="0.4" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="0.4" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="20000" density="0.4" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="20000" density="0.4" cartype="4"/> <!-- Mini -->
<aizone z="0" dist="20000" density="0.4" cartype="5"/> <!-- Truck -->
<!-- edges and surfaces -->
<!--<edge z="0" dist="16000" side="-1" colr="177" colg="132" colb="108"/> brown -->
<edge z="0" dist="16000" side="-1" colr="128" colg="82" colb="58" splash="1"/>
<edge z="0" dist="16000" side="1" colr="128" colg="82" colb="58" splash="1"/>
<surface z="0" dist="100" surface="0" splash="0"/>
<surface z="100" dist="125" surface="3" splash="0"/>
<surface z="125" dist="15874" surface="0" splash="0"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<!-- road -->
<width z="9000" dist="4000" width="500" crossdist="200"/>
<width z="13000" dist="200" width="400" crossdist="200"/>
<!-- bends -->
<bend z="800" dist="1200" curve="6"/> <!-- right -->
<bend z="3000" dist="800" curve="-12"/> <!-- left -->
<bend z="4800" dist="800" curve="12"/> <!-- right -->
<bend z="5600" dist="200" curve="-2"/>
<bend z="6400" dist="200" curve="2"/>
<bend z="6600" dist="800" curve="-12"/> <!-- left -->
<bend z="8400" dist="800" curve="12"/> <!-- right -->
<bend z="9200" dist="200" curve="-2"/>
<bend z="12000" dist="800" curve="6"/>
<bend z="12800" dist="600" curve="-6"/>
<!-- hills -->
<hill z="200" dist="300" curve="1"/> <!-- up -->
<hill z="500" dist="300" curve="-1"/>
<hill z="2000" dist="1000" curve="-4"/> <!-- hill climb -->
<hill z="3000" dist="400" curve="2"/>
<hill z="3800" dist="1000" curve="-4"/>
<hill z="4800" dist="400" curve="2"/>
<hill z="5800" dist="600" curve="-4"/>
<hill z="6400" dist="400" curve="2"/>
<hill z="7400" dist="1000" curve="-4"/>
<hill z="8400" dist="400" curve="2"/>
<hill z="9400" dist="1600" curve="14"/> <!-- drop -->
<hill z="11400" dist="1800" curve="-4"/>
<hill z="13000" dist="300" curve="1"/> <!-- up -->
<hill z="13300" dist="300" curve="-3"/>
<hill z="13600" dist="600" curve="3"/>
<!-- scenery -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="305" dist="2000" side="1" frequency="30" x0="500" x1="2000" type="Scrub"/> <!-- distance object -->
<billboard z="305" dist="1600" side="-1" frequency="30" x0="500" x1="2000" type="Scrub"/> <!-- distance object -->
<billboard z="400" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="700" dist="800" side="-1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="1600" dist="400" side="-1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="1800" dist="1200" side="1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="3000" dist="600" side="1" frequency="30" x0="20" x1="100" type="Scrub"/>
<billboard z="2000" dist="1400" side="-1" frequency="15" x0="40" x1="80" type="Rockwall"/>
<billboard z="3000" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="3400" dist="200" side="-1" frequency="30" x0="40" x1="260" type="Boulders"/>
<billboard z="3600" dist="200" side="1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="3600" dist="1200" side="-1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="4400" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="4800" dist="800" side="-1" frequency="30" x0="20" x1="100" type="Scrub"/>
<billboard z="3800" dist="1400" side="1" frequency="15" x0="40" x1="80" type="Rockwall"/>
<billboard z="5200" dist="200" side="1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="5600" dist="200" side="-1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="5600" dist="1200" side="1" frequency="15" x0="20" x1="260" type="SpruceTree"/>
<billboard z="6200" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="6800" dist="800" side="1" frequency="30" x0="20" x1="100" type="Scrub"/>
<billboard z="5800" dist="1200" side="-1" frequency="15" x0="40" x1="80" type="Rockwall"/>
<billboard z="7000" dist="200" side="-1" frequency="30" x0="40" x1="260" type="Boulders"/>
<billboard z="7200" dist="700" side="-1" frequency="15" x0="20" x1="260" type="SpruceTree"/>
<billboard z="7900" dist="700" side="-1" frequency="30" x0="20" x1="100" type="Scrub"/>
<billboard z="7400" dist="1400" side="1" frequency="15" x0="40" x1="80" type="Rockwall"/>
<billboard z="8000" dist="1200" side="1" frequency="30" x0="20" x1="100" type="Scrub"/>
<billboard z="8000" dist="1200" side="-1" frequency="30" x0="20" x1="100" type="Scrub"/>
<billboard z="8000" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<!-- 8400 TOP OF HILL -->
<billboard z="9400" dist="2600" side="1" frequency="20" x0="40" x1="80" type="Rockwall"/>
<billboard z="9000" dist="2400" side="-1" frequency="30" x0="40" x1="260" type="Boulders"/>
<billboard z="11400" dist="2400" side="-1" frequency="30" x0="500" x1="2000" type="Scrub"/> <!-- distance -->
<billboard z="11600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="12000" dist="400" side="1" frequency="30" x0="40" x1="260" type="Boulders"/>
<billboard z="12000" dist="800" side="-1" frequency="15" x0="20" x1="260" type="SpruceTree"/>
<billboard z="12410" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="12410" dist="1400" side="1" frequency="30" x0="500" x1="2000" type="Scrub"/> <!-- distance -->
<billboard z="12815" dist="800" side="-1" frequency="15" x0="20" x1="260" type="OakTree"/>
<billboard z="12610" dist="800" side="1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="14000" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="8" repeat="128"/>
</roadsegment>
<roadsegment> <!-- blank -->
<pattern value="6" repeat="256"/>
</roadsegment>
<roadsegment> <!-- 5 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="10" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="11" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 4 -->
<!-- SERPENTS PASS -->
<!-- A winding jungle, almost rally like -->
<road>
<!-- data -->
<info name="Serpents Pass" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="1000"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="179" colg="232" colb="245" frame="8"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="5000" text="1ST RIVER"/>
<label z="11000" text="2ND RIVER"/>
<!-- ai -->
<aizone z="0" dist="20000" density="0.6" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="0.6" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="0.6" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="20000" density="1" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="20000" density="0.6" cartype="4"/> <!-- Mini -->
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="92" colg="151" colb="63" splash="2"/> <!-- green for tropical bg08-->
<edge z="0" dist="16000" side="1" colr="92" colg="151" colb="63" splash="2"/> <!-- green for tropical bg08-->
<edge z="5200" dist="800" side="1" colr="28" colg="61" colb="141" splash="3"/> <!-- water -->
<edge z="5200" dist="800" side="-1" colr="28" colg="61" colb="141" splash="3"/> <!-- water -->
<edge z="11600" dist="1000" side="1" colr="28" colg="61" colb="141" splash="3"/> <!-- water -->
<edge z="11600" dist="1000" side="-1" colr="28" colg="61" colb="141" splash="3"/> <!-- water -->
<surface z="0" dist="100" surface="0" splash="1"/>
<surface z="100" dist="125" surface="3" splash="1"/>
<surface z="125" dist="875" surface="0" splash="1"/>
<surface z="1000" dist="800" surface="1" splash="1"/>
<surface z="1800" dist="1200" surface="0" splash="1"/>
<surface z="3000" dist="1500" surface="1" splash="1"/>
<surface z="4500" dist="700" surface="0" splash="1"/>
<surface z="5200" dist="800" surface="2" splash="3"/>
<surface z="6000" dist="2000" surface="0" splash="1"/>
<surface z="8000" dist="1000" surface="1" splash="1"/>
<surface z="9000" dist="2600" surface="0" splash="1"/>
<surface z="11600" dist="1000" surface="2" splash="3"/>
<surface z="12600" dist="100" surface="0" splash="1"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<surfacetype z="1000" dist="800" type="bumpy"/>
<surfacetype z="3000" dist="1500" type="bumpy"/>
<surfacetype z="5200" dist="800" type="wet"/>
<surfacetype z="8000" dist="1000" type="bumpy"/>
<surfacetype z="11600" dist="1000" type="wet"/>
<!-- road -->
<width z="0" dist="100" width="400" crossdist="400"/>
<!-- bends -->
<bend z="500" dist="250" curve="-6"/> <!-- l -->
<bend z="750" dist="250" curve="6"/> <!-- r -->
<bend z="1400" dist="600" curve="10"/> <!-- r -->
<bend z="2500" dist="250" curve="-8"/> <!-- l -->
<bend z="2750" dist="250" curve="8"/> <!-- r -->
<bend z="3000" dist="750" curve="-10"/> <!-- l -->
<bend z="3750" dist="500" curve="8"/> <!-- r -->
<bend z="4250" dist="250" curve="-8"/> <!-- l -->
<bend z="4500" dist="700" curve="-10"/> <!-- l -->
<bend z="5200" dist="800" curve="10"/> <!-- r -->
<bend z="6000" dist="600" curve="-10"/> <!-- l -->
<bend z="7000" dist="1000" curve="-10"/> <!-- l -->
<bend z="8000" dist="300" curve="-10"/> <!-- l -->
<bend z="8300" dist="600" curve="12"/> <!-- r -->
<bend z="9000" dist="400" curve="-12"/> <!-- l -->
<bend z="9400" dist="200" curve="-16"/> <!-- l -->
<bend z="9600" dist="400" curve="-12"/> <!-- l -->
<bend z="10000" dist="800" curve="12"/> <!-- r -->
<bend z="10800" dist="200" curve="-10"/> <!-- l -->
<bend z="11000" dist="400" curve="-10"/> <!-- l -->
<bend z="11400" dist="1200" curve="10"/> <!-- r -->
<bend z="13000" dist="300" curve="10"/> <!-- r -->
<bend z="13300" dist="800" curve="-12"/> <!-- l -->
<!-- hills -->
<hill z="600" dist="400" curve="-2"/> <!-- u -->
<hill z="1000" dist="800" curve="2"/> <!-- d -->
<hill z="1800" dist="400" curve="-2"/> <!-- u -->
<hill z="3750" dist="500" curve="-2"/> <!-- u -->
<hill z="4250" dist="250" curve="2"/> <!-- d -->
<hill z="4500" dist="200" curve="-2"/> <!-- u -->
<hill z="4900" dist="100" curve="-4"/> <!-- u -->
<hill z="5000" dist="100" curve="4"/> <!-- d -->
<hill z="5100" dist="100" curve="-4"/> <!-- u -->
<hill z="6600" dist="200" curve="-4"/> <!-- u -->
<hill z="6800" dist="200" curve="4"/> <!-- d -->
<hill z="7000" dist="200" curve="-4"/> <!-- u -->
<hill z="8000" dist="100" curve="-4"/> <!-- u -->
<hill z="8100" dist="100" curve="4"/> <!-- d -->
<hill z="8200" dist="100" curve="-4"/> <!-- u -->
<hill z="8400" dist="100" curve="-8"/> <!-- u -->
<hill z="8500" dist="100" curve="8"/> <!-- d -->
<hill z="8600" dist="100" curve="-8"/> <!-- u -->
<hill z="9200" dist="600" curve="-4"/> <!-- u -->
<hill z="9800" dist="400" curve="4"/> <!-- d -->
<hill z="10200" dist="600" curve="-4"/> <!-- u -->
<hill z="10800" dist="400" curve="-4"/> <!-- u -->
<hill z="11200" dist="200" curve="4"/> <!-- d -->
<hill z="11400" dist="200" curve="-4"/> <!-- u -->
<hill z="12800" dist="100" curve="-4"/> <!-- u -->
<hill z="12900" dist="100" curve="4"/> <!-- d -->
<hill z="13000" dist="100" curve="-4"/> <!-- u -->
<hill z="13200" dist="200" curve="-4"/> <!-- u -->
<hill z="13400" dist="200" curve="4"/> <!-- d -->
<hill z="13600" dist="200" curve="-4"/> <!-- u -->
<hill z="13800" dist="100" curve="-4"/> <!-- u -->
<hill z="13900" dist="100" curve="4"/> <!-- d -->
<hill z="14000" dist="100" curve="-4"/> <!-- u -->
<!-- scenery -->
<!-- 0 - 3300 : Green 1 -->
<billboard z="200" dist="4900" side="1" frequency="100" x0="500" x1="2000" type="Palm"/> <!-- distance object -->
<billboard z="200" dist="4900" side="-1" frequency="100" x0="500" x1="2000" type="Palm"/> <!-- distance object -->
<billboard z="250" dist="4900" side="1" frequency="80" x0="500" x1="2000" type="YuccaBush"/> <!-- distance object -->
<billboard z="250" dist="4900" side="-1" frequency="80" x0="500" x1="2000" type="YuccaBush"/> <!-- distance object -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="100" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane left then right -->
<billboard z="100" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane left then right -->
<billboard z="500" dist="500" side="1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="500" dist="500" side="-1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="1000" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="1000" dist="800" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="1400" dist="400" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="1000" dist="800" side="0" frequency="40" x0="0" x1="0" type="SpeedBump"/>
<billboard z="1800" dist="300" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="1800" dist="300" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="2100" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane left then right -->
<billboard z="2100" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane left then right -->
<billboard z="2500" dist="500" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="2500" dist="500" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="3000" dist="1500" side="0" frequency="40" x0="0" x1="0" type="SpeedBump"/>
<billboard z="3000" dist="350" side="1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="3000" dist="350" side="-1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="3350" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane right then left -->
<billboard z="3350" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane right then left -->
<billboard z="3800" dist="700" side="1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="3800" dist="700" side="-1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="4500" dist="300" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="4500" dist="300" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="4800" dist="400" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="4800" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<!-- 5200 - 6000 WATER -->
<billboard z="5200" dist="600" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="5200" dist="600" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="6000" dist="200" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="6000" dist="1000" side="-1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="6200" dist="800" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="6200" dist="5200" side="1" frequency="100" x0="500" x1="2000" type="Palm"/> <!-- distance object -->
<billboard z="6200" dist="5200" side="-1" frequency="100" x0="500" x1="2000" type="Palm"/> <!-- distance object -->
<billboard z="6250" dist="5200" side="1" frequency="80" x0="500" x1="2000" type="Plant"/> <!-- distance object -->
<billboard z="6250" dist="5200" side="-1" frequency="80" x0="500" x1="2000" type="Plant"/> <!-- distance object -->
<billboard z="6600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="7000" dist="400" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="7000" dist="400" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="7600" dist="400" side="1" frequency="30" x0="20" x1="20" type="YuccaBush"/>
<billboard z="7600" dist="400" side="-1" frequency="30" x0="20" x1="20" type="YuccaBush"/>
<billboard z="8000" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane left then right -->
<billboard z="8000" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane left then right -->
<billboard z="8000" dist="1000" side="0" frequency="40" x0="0" x1="0" type="SpeedBump"/>
<billboard z="8400" dist="200" side="1" frequency="20" x0="20" x1="20" type="YuccaBush"/>
<billboard z="8400" dist="1200" side="-1" frequency="20" x0="150" x1="150" type="MoundSide"/>
<billboard z="8600" dist="200" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="8800" dist="600" side="1" frequency="20" x0="150" x1="150" type="MoundSide"/>
<billboard z="9400" dist="600" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="9600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="10000" dist="1000" side="-1" frequency="40" x0="20" x1="20" type="Plant"/>
<billboard z="10020" dist="1000" side="-1" frequency="40" x0="20" x1="20" type="YuccaBush"/>
<billboard z="10000" dist="400" side="1" frequency="20" x0="150" x1="150" type="MoundSide"/>
<billboard z="10400" dist="200" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="10600" dist="400" side="1" frequency="20" x0="150" x1="150" type="MoundSide"/>
<!-- 11600 - 12600 WATER -->
<billboard z="11000" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="11000" dist="600" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="11000" dist="2000" side="-1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="11600" dist="1400" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="12600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane right then left -->
<billboard z="12600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane right then left -->
<billboard z="12800" dist="1800" side="1" frequency="100" x0="500" x1="2000" type="Palm"/> <!-- distance object -->
<billboard z="12800" dist="1800" side="-1" frequency="100" x0="500" x1="2000" type="Palm"/> <!-- distance object -->
<billboard z="12850" dist="1800" side="1" frequency="80" x0="500" x1="2000" type="YuccaBush"/> <!-- distance object -->
<billboard z="12850" dist="1800" side="-1" frequency="80" x0="500" x1="2000" type="YuccaBush"/> <!-- distance object -->
<billboard z="13000" dist="600" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="13000" dist="600" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="13600" dist="400" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="13600" dist="400" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="14000" dist="700" side="-1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="14000" dist="700" side="1" frequency="20" x0="100" x1="500" type="GrassTall"/>
<billboard z="14700" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="14" repeat="128"/>
<pattern value="15" repeat="128"/>
</roadsegment>
<roadsegment> <!-- blank -->
<pattern value="14" repeat="256"/>
</roadsegment>
<roadsegment> <!-- wet -->
<pattern value="18" repeat="128"/>
<pattern value="19" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="5" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 5 -->
<!-- TWILIGHT PASS -->
<!-- A forest at night, long, hard corners and hills with split sections -->
<road>
<!-- data -->
<info name="Twilight Pass" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="1000"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="5" colg="25" colb="161" frame="11"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="5000" text="1ST SPLIT END"/>
<label z="9000" text="2ND SPLIT"/>
<!-- ai -->
<aizone z="0" dist="20000" density="0.6" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="0.6" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="0.6" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="20000" density="0.6" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="20000" density="0.6" cartype="4"/> <!-- Mini -->
<aizone z="0" dist="20000" density="0.6" cartype="5"/> <!-- Truck -->
<noairange z="2500" dist="2000" min="-0.3" max="0.3"/>
<noairange z="10000" dist="2000" min="-0.3" max="0.3"/>
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="0" colg="2" colb="11" splash="1"/> <!-- green for tropical bg08-->
<edge z="0" dist="16000" side="1" colr="0" colg="2" colb="11" splash="1"/> <!-- green for tropical bg08-->
<surface z="0" dist="100" surface="0" splash="0"/>
<surface z="100" dist="125" surface="3" splash="0"/>
<surface z="125" dist="1875" surface="0" splash="0"/>
<surface z="2000" dist="500" surface="2" splash="0"/>
<surface z="2500" dist="2000" surface="1" splash="0"/>
<surface z="4500" dist="500" surface="2" splash="0"/>
<surface z="9000" dist="1000" surface="2" splash="0"/>
<surface z="10000" dist="2000" surface="1" splash="0"/>
<surface z="12000" dist="500" surface="2" splash="0"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<!-- road -->
<width z="2000" dist="3000" width="700" crossdist="200"/>
<width z="9000" dist="3500" width="700" crossdist="200"/>
<!-- bends -->
<bend z="2000" dist="3000" curve="8"/> <!-- r -->
<bend z="5000" dist="750" curve="-6"/> <!-- l -->
<bend z="5750" dist="500" curve="-12"/> <!-- l -->
<bend z="6250" dist="1750" curve="-10"/> <!-- l -->
<bend z="8000" dist="2000" curve="12"/> <!-- r -->
<bend z="10000" dist="2000" curve="-8"/> <!-- l -->
<bend z="12000" dist="1500" curve="-10"/> <!-- l -->
<bend z="13500" dist="1000" curve="-12"/> <!-- l -->
<!-- hills -->
<hill z="600" dist="1400" curve="-2"/> <!-- u -->
<hill z="1800" dist="2200" curve="2"/> <!-- d -->
<hill z="4000" dist="1000" curve="-2"/> <!-- u -->
<hill z="7000" dist="1500" curve="-4"/> <!-- u -->
<hill z="8500" dist="500" curve="2"/> <!-- d -->
<hill z="10000" dist="1500" curve="4"/> <!-- d -->
<hill z="11500" dist="500" curve="-4"/> <!-- u -->
<hill z="13000" dist="1000" curve="-4"/> <!-- u -->
<hill z="14000" dist="800" curve="4"/> <!-- d -->
<!-- scenery -->
<!-- 0 - 3300 : Green 1 -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="200" dist="4900" side="1" frequency="100" x0="500" x1="2000" type="SpruceTree"/> <!-- distance object -->
<billboard z="200" dist="4900" side="-1" frequency="100" x0="500" x1="2000" type="SpruceTree"/> <!-- distance object -->
<billboard z="250" dist="4900" side="1" frequency="80" x0="500" x1="2000" type="Shrubs"/> <!-- distance object -->
<billboard z="250" dist="4900" side="-1" frequency="80" x0="500" x1="2000" type="Shrubs"/> <!-- distance object -->
<billboard z="600" dist="800" side="1" frequency="15" x0="20" x1="260" type="SpruceTree"/>
<billboard z="600" dist="800" side="-1" frequency="15" x0="20" x1="260" type="SpruceTree"/>
<billboard z="1600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="2000" dist="600" side="-1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="2000" dist="600" side="1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="2500" dist="2000" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="2500" dist="2000" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="2510" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierRed"/>
<billboard z="2500" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierWhite"/>
<billboard z="2600" dist="700" side="0" frequency="30" x0="0" x1="0" type="SpruceTree"/>
<billboard z="3700" dist="800" side="0" frequency="30" x0="0" x1="0" type="SpruceTree"/>
<billboard z="4500" dist="500" side="-1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="4600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="5100" dist="5000" side="1" frequency="100" x0="500" x1="2000" type="BareTree"/> <!-- distance object -->
<billboard z="5100" dist="5000" side="-1" frequency="100" x0="500" x1="2000" type="BareTree"/> <!-- distance object -->
<billboard z="5150" dist="5000" side="1" frequency="80" x0="500" x1="2000" type="Scrub"/> <!-- distance object -->
<billboard z="5150" dist="5000" side="-1" frequency="80" x0="500" x1="2000" type="Scrub"/> <!-- distance object -->
<billboard z="5200" dist="600" side="-1" frequency="30" x0="20" x1="260" type="BareTree"/>
<billboard z="5200" dist="600" side="1" frequency="30" x0="20" x1="260" type="BareTree"/>
<billboard z="6000" dist="600" side="-1" frequency="30" x0="20" x1="260" type="BareTree"/>
<billboard z="6000" dist="600" side="1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="6800" dist="600" side="-1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="6800" dist="600" side="1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="7600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="7600" dist="600" side="1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="8200" dist="800" side="1" frequency="30" x0="20" x1="260" type="SpruceTree"/>
<billboard z="8100" dist="800" side="-1" frequency="30" x0="20" x1="260" type="SpruceTree"/>
<billboard z="9200" dist="400" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="9200" dist="400" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="9220" dist="400" side="-1" frequency="50" x0="20" x1="260" type="OakTree"/>
<billboard z="9220" dist="400" side="1" frequency="50" x0="20" x1="260" type="OakTree"/>
<billboard z="9600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="9600" dist="400" side="-1" frequency="30" x0="20" x1="260" type="SpruceTree"/>
<billboard z="10100" dist="4500" side="1" frequency="100" x0="500" x1="2000" type="SpruceTree"/> <!-- distance object -->
<billboard z="10100" dist="4500" side="-1" frequency="100" x0="500" x1="2000" type="SpruceTree"/> <!-- distance object -->
<billboard z="10150" dist="4500" side="1" frequency="80" x0="500" x1="2000" type="Shrubs"/> <!-- distance object -->
<billboard z="10150" dist="4500" side="-1" frequency="80" x0="500" x1="2000" type="Shrubs"/> <!-- distance object -->
<billboard z="10100" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierRed"/>
<billboard z="10110" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierWhite"/>
<billboard z="10200" dist="800" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="10200" dist="800" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="10200" dist="800" side="0" frequency="50" x0="0" x1="0" type="Lamppost_Mid"/>
<billboard z="11000" dist="400" side="-1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="11000" dist="400" side="1" frequency="30" x0="20" x1="260" type="OakTree"/>
<billboard z="11400" dist="800" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="11400" dist="800" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="11400" dist="500" side="0" frequency="30" x0="0" x1="0" type="Lamppost_Mid"/>
<billboard z="11420" dist="800" side="-1" frequency="50" x0="20" x1="260" type="OakTree"/>
<billboard z="11420" dist="800" side="1" frequency="50" x0="20" x1="260" type="OakTree"/>
<billboard z="12410" dist="800" side="-1" frequency="25" x0="20" x1="260" type="OakTree"/>
<billboard z="12410" dist="600" side="1" frequency="25" x0="20" x1="260" type="OakTree"/>
<billboard z="13100" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="13500" dist="500" side="1" frequency="30" x0="20" x1="260" type="SpruceTree"/>
<billboard z="13500" dist="500" side="-1" frequency="30" x0="20" x1="260" type="SpruceTree"/>
<billboard z="14000" dist="600" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="14000" dist="600" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="14700" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="8" repeat="128"/>
</roadsegment>
<roadsegment> <!-- split -->
<pattern value="16" repeat="128"/>
<pattern value="17" repeat="128"/>
</roadsegment>
<roadsegment> <!-- 5 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="10" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="11" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 6 -->
<!-- RIDGEWAY -->
<!-- Rocky and twisty canyon -->
<road>
<!-- data -->
<info name="Ridgeway" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="500"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="255" colg="246" colb="236" frame="16"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="3000" text="FIRSTBEND"/>
<label z="8000" text="BIGHILL"/>
<label z="10800" text="CHICANE"/>
<!-- ai -->
<aizone z="0" dist="20000" density="0.3" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="0.3" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="0.3" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="20000" density="0.8" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="20000" density="0.8" cartype="4"/> <!-- Mini -->
<aizone z="0" dist="20000" density="0.2" cartype="5"/> <!-- Truck -->
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="178" colg="151" colb="119" splash="1"/> <!-- sand2 -->
<edge z="0" dist="16000" side="1" colr="178" colg="151" colb="119" splash="1"/>
<surface z="0" dist="100" surface="0" splash="0"/>
<surface z="100" dist="125" surface="3" splash="0"/>
<surface z="125" dist="2425" surface="2" splash="0"/>
<surface z="3000" dist="12999" surface="0" splash="0"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<!-- road -->
<width z="0" dist="300" width="400" crossdist="100"/>
<width z="125" dist="2425" width="700" crossdist="200"/>
<width z="2600" dist="400" width="400" crossdist="200"/>
<!-- hills -->
<hill z="800" dist="700" curve="-6"/> <!-- up -->
<hill z="1600" dist="1000" curve="4"/>
<hill z="2600" dist="400" curve="-6"/> <!-- up -->
<hill z="3000" dist="1500" curve="3"/>
<hill z="4500" dist="1500" curve="-3"/>
<hill z="6600" dist="800" curve="-6"/>
<hill z="7400" dist="800" curve="5"/>
<hill z="8200" dist="600" curve="-4"/>
<hill z="9200" dist="200" curve="-6"/>
<hill z="9400" dist="200" curve="6"/>
<hill z="9600" dist="200" curve="-6"/>
<hill z="10000" dist="500" curve="5"/>
<hill z="10500" dist="500" curve="-5"/>
<hill z="12400" dist="200" curve="6"/>
<hill z="12600" dist="200" curve="-6"/>
<hill z="12800" dist="200" curve="6"/>
<hill z="13400" dist="800" curve="-5"/>
<hill z="14200" dist="600" curve="4"/>
<!-- bends -->
<bend z="800" dist="300" curve="12"/> <!-- right -->
<bend z="1100" dist="300" curve="-8"/> <!-- left -->
<bend z="1500" dist="300" curve="-8"/> <!-- left -->
<bend z="1900" dist="700" curve="-14"/> <!-- left -->
<bend z="2600" dist="400" curve="12"/> <!-- right -->
<bend z="3000" dist="1400" curve="8"/> <!-- right -->
<bend z="4600" dist="1400" curve="-8"/> <!-- left -->
<bend z="6000" dist="250" curve="12"/> <!-- right -->
<bend z="6250" dist="250" curve="-12"/> <!-- left -->
<bend z="6500" dist="500" curve="-8"/> <!-- left -->
<bend z="7000" dist="600" curve="14"/> <!-- right -->
<bend z="7600" dist="1400" curve="-8"/> <!-- left -->
<bend z="9700" dist="300" curve="-8"/> <!-- left -->
<bend z="10000" dist="1000" curve="12"/> <!-- right -->
<bend z="11300" dist="700" curve="12"/> <!-- right -->
<bend z="13400" dist="250" curve="6"/> <!-- right -->
<bend z="13650" dist="400" curve="-6"/> <!-- left -->
<bend z="14050" dist="750" curve="12"/> <!-- right -->
<!-- scenery -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="200" dist="3000" side="1" frequency="30" x0="200" x1="1000" type="Scrub"/> <!-- distance object -->
<billboard z="200" dist="3000" side="-1" frequency="30" x0="200" x1="1000" type="Scrub"/> <!-- distance object -->
<billboard z="400" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane right then left -->
<billboard z="400" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane right then left -->
<billboard z="800" dist="600" side="1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="800" dist="600" side="-1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="1500" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="1500" dist="200" side="-1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="1800" dist="200" side="-1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="1900" dist="300" side="1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="2400" dist="200" side="1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="2100" dist="1100" side="-1" frequency="15" x0="100" x1="140" type="Rockwall"/>
<billboard z="2200" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="2600" dist="200" side="1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="2800" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="3000" dist="200" side="1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="3200" dist="1600" side="0" frequency="30" x0="40" x1="80" type="RockBridge"/>
<billboard z="4800" dist="400" side="0" frequency="20" x0="40" x1="80" type="RockBridge_Open"/>
<billboard z="5200" dist="1200" side="0" frequency="30" x0="40" x1="80" type="RockBridge"/>
<billboard z="6400" dist="1200" side="-1" frequency="15" x0="100" x1="140" type="Rockwall"/>
<billboard z="6500" dist="300" side="1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="6800" dist="200" side="1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="7000" dist="200" side="1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="6600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="7200" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="7600" dist="200" side="0" frequency="20" x0="40" x1="80" type="RockBridge_Open"/>
<billboard z="7800" dist="400" side="0" frequency="30" x0="40" x1="80" type="RockBridge"/>
<billboard z="8200" dist="200" side="0" frequency="20" x0="40" x1="80" type="RockBridge_Open"/>
<billboard z="8400" dist="600" side="0" frequency="30" x0="40" x1="80" type="RockBridge"/>
<billboard z="9000" dist="200" side="-1" frequency="15" x0="100" x1="140" type="Rockwall"/>
<billboard z="9000" dist="200" side="1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="9200" dist="500" side="1" frequency="20" x0="50" x1="50" type="BarrierRed"/>
<billboard z="9210" dist="500" side="1" frequency="20" x0="50" x1="50" type="BarrierWhite"/>
<billboard z="9200" dist="500" side="-1" frequency="20" x0="50" x1="50" type="BarrierRed"/>
<billboard z="9210" dist="500" side="-1" frequency="20" x0="50" x1="50" type="BarrierWhite"/>
<billboard z="9800" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="9700" dist="400" side="-1" frequency="15" x0="100" x1="140" type="Rockwall"/>
<billboard z="9700" dist="200" side="1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="10000" dist="100" side="1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="10200" dist="1000" side="0" frequency="30" x0="40" x1="80" type="RockBridge"/>
<billboard z="11200" dist="800" side="0" frequency="20" x0="40" x1="80" type="RockBridge_Open"/>
<billboard z="12000" dist="600" side="1" frequency="30" x0="200" x1="1000" type="Scrub"/> <!-- distance object -->
<billboard z="12000" dist="600" side="-1" frequency="30" x0="200" x1="1000" type="Scrub"/> <!-- distance object -->
<billboard z="12005" dist="590" side="-1" frequency="20" x0="20" x1="250" type="Shrubs"/>
<billboard z="12005" dist="590" side="1" frequency="20" x0="20" x1="250" type="Shrubs"/>
<billboard z="12600" dist="200" side="0" frequency="20" x0="40" x1="80" type="RockBridge"/>
<billboard z="13200" dist="800" side="1" frequency="15" x0="100" x1="140" type="Rockwall"/>
<billboard z="13200" dist="800" side="-1" frequency="15" x0="100" x1="140" type="Rockwall"/>
<billboard z="12800" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane right then left -->
<billboard z="12800" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane right then left -->
<billboard z="14000" dist="400" side="-1" frequency="20" x0="40" x1="260" type="Boulders"/>
<billboard z="14005" dist="490" side="1" frequency="20" x0="20" x1="250" type="Shrubs"/>
<billboard z="14600" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="8" repeat="128"/>
</roadsegment>
<roadsegment> <!-- split -->
<pattern value="16" repeat="128"/>
<pattern value="17" repeat="128"/>
</roadsegment>
<roadsegment> <!-- 5 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="10" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="11" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 7 -->
<!-- OCEAN BOULEVARD -->
<!-- Stage 9 is a seaside stage, like Stage 1 but reverse and harder -->
<road>
<!-- data -->
<info name="Ocean Boulevard" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="1000"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="222" colg="251" colb="255" frame="1"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="2000" text="ENDOFSEA1"/>
<label z="6000" text="SEA2"/>
<label z="12000" text="GOAL"/>
<!-- ai -->
<aizone z="0" dist="7200" density="0.8" cartype="0"/> <!-- Prelude -->
<aizone z="7200" dist="2000" density="0.4" cartype="0"/>
<aizone z="9200" dist="10000" density="0.8" cartype="0"/>
<aizone z="0" dist="7200" density="0.8" cartype="1"/> <!-- Capri -->
<aizone z="7200" dist="2000" density="0.4" cartype="1"/>
<aizone z="9200" dist="10000" density="0.8" cartype="1"/>
<aizone z="0" dist="7200" density="0.8" cartype="2"/> <!-- Porsche -->
<aizone z="7200" dist="2000" density="0.4" cartype="2"/>
<aizone z="9200" dist="10000" density="0.8" cartype="2"/>
<aizone z="0" dist="7200" density="0.8" cartype="3"/> <!-- Jeep -->
<aizone z="7200" dist="2000" density="0.4" cartype="3"/>
<aizone z="9200" dist="10000" density="0.8" cartype="3"/>
<aizone z="0" dist="7200" density="0.8" cartype="4"/> <!-- Mini -->
<aizone z="7200" dist="2000" density="0.4" cartype="4"/>
<aizone z="9200" dist="10000" density="0.8" cartype="4"/>
<aizone z="0" dist="7200" density="0.8" cartype="5"/> <!-- Truck -->
<aizone z="7200" dist="2000" density="0.4" cartype="5"/>
<aizone z="9200" dist="10000" density="0.8" cartype="5"/>
<noairange z="7200" dist="2000" min="-0.3" max="-0.3"/>
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="161" colg="206" colb="53" splash="2"/> <!-- green -->
<edge z="0" dist="16000" side="1" colr="161" colg="206" colb="53" splash="2"/>
<edge z="500" dist="1500" side="-1" colr="146" colg="156" colb="227" splash="3"/> <!-- sea --> <!-- left -->
<edge z="500" dist="1500" side="1" colr="227" colg="211" colb="195" splash="1"/> <!-- sand --> <!-- right -->
<edge z="6000" dist="3000" side="-1" colr="146" colg="156" colb="227" splash="3"/> <!-- sea --> <!-- left -->
<edge z="6000" dist="3000" side="1" colr="227" colg="211" colb="195" splash="1"/> <!-- sand --> <!-- right -->
<edge z="14400" dist="2500" side="-1" colr="146" colg="156" colb="227" splash="3"/> <!-- sea --> <!-- left -->
<edge z="14400" dist="2500" side="1" colr="227" colg="211" colb="195" splash="1"/> <!-- sand --> <!-- right -->
<surface z="0" dist="100" surface="0" splash="0"/>
<surface z="100" dist="25" surface="3" splash="0"/>
<surface z="125" dist="1475" surface="0" splash="0"/>
<surface z="2000" dist="9400" surface="2" splash="0"/>
<surface z="7200" dist="2000" surface="1" splash="0"/>
<surface z="11400" dist="100" surface="0" splash="0"/>
<surface z="14000" dist="25" surface="3" splash="0"/>
<surface z="14025" dist="100" surface="0" splash="0"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<surfacetype z="14000" dist="25" type="bumpy"/>
<!-- road -->
<width z="0" dist="4000" width="400" crossdist="100"/>
<width z="2000" dist="9400" width="700" crossdist="300"/>
<width z="11400" dist="100" width="400" crossdist="100"/>
<!-- bends -->
<bend z="200" dist="600" curve="-8"/>
<bend z="800" dist="600" curve="8"/>
<bend z="3200" dist="600" curve="14"/>
<bend z="4000" dist="600" curve="-16"/>
<bend z="5200" dist="800" curve="14"/>
<bend z="6600" dist="400" curve="-14"/>
<bend z="8000" dist="1000" curve="-14"/> <!-- left -->
<bend z="10000" dist="1000" curve="10"/> <!-- right -->
<!-- hills -->
<hill z="2000" dist="200" curve="-4"/>
<hill z="2200" dist="1000" curve="8"/>
<hill z="4600" dist="200" curve="4"/>
<hill z="4800" dist="1200" curve="-12"/>
<hill z="9000" dist="200" curve="-4"/>
<hill z="9200" dist="400" curve="8"/>
<hill z="11800" dist="200" curve="-4"/>
<hill z="12000" dist="200" curve="4"/>
<hill z="12200" dist="200" curve="-4"/>
<hill z="12400" dist="200" curve="-4"/>
<hill z="12600" dist="800" curve="8"/> <!-- down -->
<hill z="13400" dist="600" curve="-4"/>
<!-- scenery -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="150" dist="100" side="1" frequency="20" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane left then right -->
<billboard z="150" dist="100" side="-1" frequency="20" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane left then right -->
<billboard z="255" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="260" dist="200" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="500" dist="1500" side="-1" frequency="20" x0="100" x1="2000" type="Wave"/> <!-- distance object -->
<billboard z="610" dist="1200" side="1" frequency="50" x0="400" x1="800" type="Plant"/>
<billboard z="800" dist="800" side="1" frequency="50" x0="80" x1="80" type="BeachHut"/>
<billboard z="2100" dist="700" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="2110" dist="700" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="2200" dist="3200" side="1" frequency="100" x0="500" x1="2000" type="LargeBush"/> <!-- distance object -->
<billboard z="2200" dist="3200" side="-1" frequency="100" x0="500" x1="2000" type="LargeBush"/> <!-- distance object -->
<billboard z="2205" dist="300" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="2215" dist="300" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="2800" dist="400" side="1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="3000" dist="2000" side="0" frequency="20" x0="-5000" x1="5000" y0="600" y1="1600" type="Cloud"/>
<billboard z="2800" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="3400" dist="400" side="-1" frequency="20" x0="20" x1="20" type="Palm"/>
<billboard z="3600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="4000" dist="400" side="1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="4200" dist="400" side="-1" frequency="20" x0="20" x1="20" type="Palm"/>
<billboard z="4400" dist="400" side="1" frequency="20" x0="20" x1="20" type="Palm"/>
<billboard z="4800" dist="200" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="5000" dist="600" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="5010" dist="600" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="5110" dist="400" side="-1" frequency="20" x0="20" x1="20" type="Palm"/>
<billboard z="5700" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="6200" dist="2600" side="-1" frequency="200" x0="400" x1="2000" type="Yacht"/> <!-- distance object -->
<billboard z="6000" dist="3000" side="-1" frequency="20" x0="100" x1="2000" type="Wave"/> <!-- distance object -->
<billboard z="6100" dist="200" side="1" frequency="50" x0="80" x1="80" type="BeachHut"/>
<billboard z="6110" dist="200" side="1" frequency="50" x0="400" x1="800" type="Palm"/>
<billboard z="6300" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="6700" dist="300" side="1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="7000" dist="400" side="1" frequency="50" x0="80" x1="80" type="BeachHut"/>
<billboard z="7010" dist="400" side="1" frequency="50" x0="400" x1="800" type="Palm"/>
<billboard z="7310" dist="500" side="0" frequency="25" x0="0" x1="0" type="Plant"/>
<billboard z="7400" dist="300" side="0" frequency="50" x0="0" x1="0" type="Lamppost_Ornate"/>
<billboard z="8010" dist="400" side="0" frequency="25" x0="0" x1="0" type="Plant"/>
<billboard z="8100" dist="200" side="0" frequency="50" x0="0" x1="0" type="Lamppost_Ornate"/>
<billboard z="8610" dist="500" side="0" frequency="25" x0="0" x1="0" type="Plant"/>
<billboard z="8700" dist="400" side="0" frequency="50" x0="0" x1="0" type="Lamppost_Ornate"/>
<billboard z="7600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="8110" dist="200" side="1" frequency="20" x0="150" x1="150" type="Mound"/>
<billboard z="8200" dist="200" side="1" frequency="40" x0="20" x1="20" type="Palm"/>
<billboard z="8500" dist="400" side="1" frequency="50" x0="80" x1="80" type="BeachHut"/>
<billboard z="8510" dist="400" side="1" frequency="50" x0="400" x1="800" type="Palm"/>
<billboard z="9200" dist="4000" side="1" frequency="100" x0="500" x1="2000" type="LargeBush"/> <!-- distance object -->
<billboard z="9200" dist="4000" side="-1" frequency="100" x0="500" x1="2000" type="LargeBush"/> <!-- distance object -->
<billboard z="9500" dist="100" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="9500" dist="200" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="9600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="10000" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="10000" dist="200" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="10200" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="10400" dist="200" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="10600" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="10800" dist="600" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="11500" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="11500" dist="200" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="11800" dist="600" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="11810" dist="600" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="12450" dist="100" side="-1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="12450" dist="100" side="1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="12600" dist="200" side="-1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="12600" dist="200" side="1" frequency="30" x0="20" x1="20" type="Palm"/>
<billboard z="12800" dist="200" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="12800" dist="200" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="13100" dist="200" side="-1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="13110" dist="200" side="1" frequency="20" x0="20" x1="20" type="Plant"/>
<billboard z="13500" dist="800" side="-1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="13500" dist="800" side="1" frequency="30" x0="150" x1="150" type="Advert2"/>
<billboard z="14000" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Goal"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="0" repeat="128"/>
<pattern value="2" repeat="128"/>
</roadsegment>
<roadsegment> <!-- midsection -->
<pattern value="12" repeat="128"/>
<pattern value="13" repeat="128"/>
</roadsegment>
<roadsegment> <!-- 5 lane striped -->
<pattern value="0" repeat="128"/>
<pattern value="4" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="5" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 8 -->
<!-- ROUTE 88 -->
<!-- Stage 4 is a sunset freeway stage, with split roads and fast speed - should be about dodging traffic -->
<road>
<!-- data -->
<info name="Route 88" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="1000"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="097" colg="219" colb="249" frame="7"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="4000" text="SPLIT"/>
<label z="9800" text="GANTRIES"/>
<!-- ai -->
<aizone z="0" dist="20000" density="1" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="1" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="1" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="9800" density="0.5" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="9800" density="0.5" cartype="4"/> <!-- Mini -->
<aizone z="0" dist="9800" density="2" cartype="5"/> <!-- Truck -->
<noairange z="4600" dist="3600" min="-0.3" max="0.3"/>
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="98" colg="64" colb="28" splash="1"/>
<edge z="0" dist="16000" side="1" colr="98" colg="64" colb="28" splash="1"/>
<surface z="0" dist="100" surface="0" splash="0"/>
<surface z="100" dist="125" surface="3" splash="0"/>
<surface z="125" dist="1675" surface="0" splash="0"/>
<surface z="1800" dist="2800" surface="2" splash="0"/>
<surface z="4600" dist="3600" surface="1" splash="0"/>
<surface z="8200" dist="2800" surface="2" splash="0"/>
<surface z="11000" dist="400" surface="0" splash="0"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<!-- road -->
<width z="1400" dist="9600" width="700" crossdist="400"/>
<width z="11000" dist="200" width="400" crossdist="400"/>
<!-- bends -->
<bend z="200" dist="1000" curve="4"/> <!-- right -->
<bend z="1200" dist="1400" curve="-4"/> <!-- left -->
<bend z="2800" dist="800" curve="2"/> <!-- right -->
<bend z="3600" dist="1000" curve="-10"/> <!-- left -->
<bend z="4600" dist="1000" curve="2"/> <!-- right -->
<bend z="5600" dist="800" curve="-2"/> <!-- left -->
<bend z="7000" dist="1000" curve="12"/> <!-- right -->
<bend z="8400" dist="1800" curve="-6"/> <!-- left -->
<bend z="10400" dist="600" curve="-2"/> <!-- left -->
<bend z="11600" dist="600" curve="8"/> <!-- right -->
<bend z="12200" dist="600" curve="-8"/> <!-- left -->
<bend z="13000" dist="400" curve="14"/> <!-- right -->
<bend z="13800" dist="400" curve="14"/> <!-- right -->
<!-- hills -->
<hill z="600" dist="800" curve="2"/> <!-- down -->
<hill z="1400" dist="600" curve="-1"/>
<hill z="2000" dist="800" curve="1"/> <!-- down -->
<hill z="2800" dist="200" curve="-1"/>
<hill z="3600" dist="1000" curve="-1"/>
<hill z="4600" dist="400" curve="1"/>
<hill z="6400" dist="600" curve="2"/>
<hill z="7000" dist="1000" curve="-2"/>
<hill z="9000" dist="1400" curve="-1"/>
<hill z="10400" dist="600" curve="1"/>
<hill z="11000" dist="600" curve="1"/>
<hill z="11600" dist="100" curve="1"/>
<hill z="12600" dist="400" curve="-2"/>
<hill z="13000" dist="100" curve="1"/>
<hill z="13400" dist="400" curve="-3"/>
<hill z="13800" dist="100" curve="2"/>
<hill z="14200" dist="400" curve="-3"/>
<hill z="14600" dist="100" curve="2"/>
<!-- scenery -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="200" dist="1200" side="1" frequency="40" x0="40" x1="50" type="BarrierRed"/>
<billboard z="200" dist="1200" side="-1" frequency="40" x0="40" x1="50" type="BarrierWhite"/>
<billboard z="220" dist="1200" side="1" frequency="40" x0="40" x1="50" type="BarrierWhite"/>
<billboard z="220" dist="1200" side="-1" frequency="40" x0="40" x1="50" type="BarrierRed"/>
<billboard z="800" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="1400" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry"/>
<billboard z="1500" dist="800" side="-1" frequency="50" x0="150" x1="150" type="Advert2"/>
<billboard z="1500" dist="800" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="2800" dist="400" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="2800" dist="400" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="3200" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="3600" dist="600" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="3600" dist="600" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="4650" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierRed"/>
<billboard z="4660" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierWhite"/>
<billboard z="4800" dist="600" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="4800" dist="600" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="4800" dist="600" side="0" frequency="50" x0="0" x1="0" type="Lamppost_Mid"/>
<billboard z="5550" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierRed"/>
<billboard z="5560" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierWhite"/>
<billboard z="5800" dist="600" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="5800" dist="600" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="5800" dist="600" side="0" frequency="50" x0="0" x1="0" type="Lamppost_Mid"/>
<billboard z="6550" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierRed"/>
<billboard z="6560" dist="100" side="0" frequency="20" x0="0" x1="0" type="BarrierWhite"/>
<billboard z="6600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="7000" dist="400" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="6800" dist="600" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="6800" dist="600" side="0" frequency="50" x0="0" x1="0" type="Lamppost_Mid"/>
<billboard z="7600" dist="400" side="-1" frequency="50" x0="70" x1="70" type="Advert1"/>
<billboard z="7550" dist="400" side="0" frequency="20" x0="0" x1="0" type="BarrierRed"/>
<billboard z="7560" dist="400" side="0" frequency="20" x0="0" x1="0" type="BarrierWhite"/>
<billboard z="8000" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="8600" dist="1000" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="8600" dist="1000" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="9800" dist="800" side="-1" frequency="50" x0="70" x1="70" type="Advert1"/>
<billboard z="9800" dist="800" side="1" frequency="50" x0="70" x1="70" type="Advert1"/>
<billboard z="10600" dist="400" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="10600" dist="350" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="11025" dist="100" side="0" frequency="25" x0="0" x1="0" type="Gantry"/>
<billboard z="11200" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="11625" dist="100" side="0" frequency="25" x0="0" x1="0" type="Gantry"/>
<billboard z="11800" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="11800" dist="400" side="-1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="12225" dist="300" side="0" frequency="25" x0="0" x1="0" type="Gantry"/>
<billboard z="12600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="12600" dist="400" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="13025" dist="300" side="0" frequency="25" x0="0" x1="0" type="Gantry"/>
<billboard z="13400" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="13400" dist="400" side="1" frequency="50" x0="50" x1="50" type="Lamppost"/>
<billboard z="13825" dist="600" side="0" frequency="25" x0="0" x1="0" type="Gantry"/>
<billboard z="14700" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="0" repeat="128"/>
<pattern value="2" repeat="128"/>
</roadsegment>
<roadsegment> <!-- midsection -->
<pattern value="12" repeat="128"/>
<pattern value="13" repeat="128"/>
</roadsegment>
<roadsegment> <!-- 5 lane striped -->
<pattern value="0" repeat="128"/>
<pattern value="4" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="5" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 9 -->
<!-- HARVEST LANE -->
<!-- Stage 5 is a country stage, split between greenery and wheatfields, with bumps between sections -->
<road>
<!-- data -->
<info name="Harvest Lane" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="1000"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="221" colg="238" colb="255" frame="9"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="3000" text="WHEAT1"/>
<label z="6500" text="GREENHILL"/>
<label z="9000" text="WHEAT2"/>
<label z="12000" text="GREEN"/>
<!-- ai -->
<aizone z="0" dist="20000" density="0.8" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="0.8" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="0.8" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="20000" density="1" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="20000" density="0.8" cartype="4"/> <!-- Mini -->
<aizone z="0" dist="20000" density="0.5" cartype="5"/> <!-- Truck -->
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="37" colg="119" colb="93" splash="2"/> <!-- green light -->
<edge z="0" dist="16000" side="1" colr="37" colg="119" colb="93" splash="2"/> <!-- green light -->
<edge z="3300" dist="4700" side="-1" colr="174" colg="153" colb="8" splash="1"/> <!-- wheat -->
<edge z="3300" dist="4700" side="1" colr="174" colg="153" colb="8" splash="1"/> <!-- wheat -->
<edge z="7000" dist="2500" side="-1" colr="14" colg="77" colb="86" splash="2"/> <!-- green dark -->
<edge z="7000" dist="2500" side="1" colr="14" colg="77" colb="86" splash="2"/> <!-- green dark -->
<edge z="9500" dist="3000" side="-1" colr="174" colg="153" colb="8" splash="1"/> <!-- wheat -->
<edge z="9500" dist="3000" side="1" colr="174" colg="153" colb="8" splash="1"/> <!-- wheat -->
<surface z="0" dist="100" surface="0" splash="0"/>
<surface z="100" dist="125" surface="3" splash="0"/>
<surface z="125" dist="2875" surface="0" splash="0"/>
<surface z="3000" dist="600" surface="1" splash="0"/>
<surface z="3600" dist="3100" surface="0" splash="0"/>
<surface z="6700" dist="600" surface="1" splash="0"/>
<surface z="7300" dist="1700" surface="0" splash="0"/>
<surface z="9000" dist="1000" surface="1" splash="0"/>
<surface z="10000" dist="3000" surface="0" splash="0"/>
<surface z="12000" dist="1000" surface="1" splash="0"/>
<surface z="14000" dist="100" surface="0" splash="0"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<surfacetype z="3100" dist="400" type="bumpy"/>
<surfacetype z="6800" dist="400" type="bumpy"/>
<surfacetype z="9100" dist="800" type="bumpy"/>
<surfacetype z="12100" dist="800" type="bumpy"/>
<!-- road -->
<width z="0" dist="100" width="400" crossdist="400"/>
<!-- bends -->
<bend z="1000" dist="1000" curve="-8"/> <!-- left -->
<bend z="2000" dist="1000" curve="8"/> <!-- right -->
<bend z="4000" dist="2000" curve="12"/> <!-- right -->
<bend z="8000" dist="1000" curve="12"/> <!-- right -->
<bend z="9000" dist="1000" curve="4"/> <!-- right -->
<bend z="11600" dist="400" curve="-6"/> <!-- left -->
<bend z="12000" dist="2000" curve="12"/> <!-- right -->
<!-- hills -->
<hill z="1000" dist="1000" curve="-4"/>
<hill z="2000" dist="1000" curve="4"/> <!-- down -->
<hill z="3000" dist="1000" curve="-2"/>
<hill z="4000" dist="500" curve="-2"/>
<hill z="4500" dist="1000" curve="2"/>
<hill z="5500" dist="500" curve="-2"/>
<hill z="6000" dist="500" curve="-6"/>
<hill z="6500" dist="1000" curve="2"/>
<hill z="7500" dist="500" curve="-2"/>
<hill z="8000" dist="1000" curve="4"/>
<hill z="9000" dist="1000" curve="-2"/>
<hill z="11000" dist="200" curve="-2"/>
<hill z="11200" dist="400" curve="1"/>
<hill z="11600" dist="200" curve="-2"/>
<hill z="12000" dist="1000" curve="-4"/>
<hill z="13000" dist="1000" curve="2"/>
<hill z="14000" dist="500" curve="-2"/>
<!-- scenery -->
<!-- 0 - 3300 : Green 1 -->
<billboard z="800" dist="2200" side="1" frequency="100" x0="600" x1="2000" type="CherryBush"/> <!-- distance object -->
<billboard z="800" dist="2200" side="-1" frequency="100" x0="600" x1="2000" type="CherryBush"/> <!-- distance object -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="1000" dist="1000" side="1" frequency="20" x0="20" x1="50" type="CherryBush"/>
<billboard z="1010" dist="1000" side="1" frequency="80" x0="20" x1="200" type="ElmTree"/>
<billboard z="1000" dist="1000" side="-1" frequency="20" x0="20" x1="50" type="CherryBush"/>
<billboard z="2400" dist="800" side="1" frequency="40" x0="20" x1="200" type="ElmTree"/>
<billboard z="2400" dist="800" side="-1" frequency="40" x0="20" x1="200" type="ElmTree"/>
<billboard z="1600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="3100" dist="400" side="0" frequency="40" x0="0" x1="0" type="SpeedBump"/>
<!-- 3300 - 7000 : Wheat -->
<billboard z="3300" dist="3200" side="1" frequency="100" x0="600" x1="2000" type="Hay"/> <!-- distance object -->
<billboard z="3300" dist="3200" side="-1" frequency="100" x0="600" x1="2000" type="Hay"/> <!-- distance object -->
<billboard z="3300" dist="1200" side="1" frequency="20" x0="100" x1="500" type="Wheat"/>
<billboard z="3300" dist="1200" side="-1" frequency="20" x0="100" x1="500" type="Wheat"/>
<billboard z="3600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="4600" dist="800" side="-1" frequency="80" x0="100" x1="100" type="Barn"/>
<billboard z="4600" dist="800" side="1" frequency="20" x0="100" x1="500" type="Wheat"/>
<billboard z="5500" dist="1400" side="1" frequency="20" x0="100" x1="500" type="Wheat"/>
<billboard z="5500" dist="1400" side="-1" frequency="40" x0="40" x1="200" type="Hay"/>
<billboard z="6800" dist="400" side="0" frequency="40" x0="0" x1="0" type="SpeedBump"/>
<!-- 7000 - 9500 : Green 2 -->
<billboard z="7000" dist="2200" side="1" frequency="100" x0="600" x1="2000" type="CherryBush"/> <!-- distance object -->
<billboard z="7000" dist="2200" side="-1" frequency="100" x0="600" x1="2000" type="CherryBush"/> <!-- distance object -->
<billboard z="7000" dist="1000" side="1" frequency="20" x0="100" x1="200" type="Flowers"/>
<billboard z="7000" dist="1000" side="-1" frequency="20" x0="100" x1="200" type="Flowers"/>
<billboard z="7600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="8000" dist="600" side="1" frequency="20" x0="100" x1="200" type="CherryBush"/>
<billboard z="8000" dist="600" side="-1" frequency="40" x0="20" x1="200" type="ElmTree"/>
<billboard z="8600" dist="800" side="1" frequency="40" x0="20" x1="200" type="ElmTree"/>
<billboard z="8600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="9000" dist="400" side="-1" frequency="40" x0="20" x1="200" type="ElmTree"/>
<billboard z="9100" dist="800" side="0" frequency="40" x0="0" x1="0" type="SpeedBump"/>
<!-- 9500 - 12500 : Wheat -->
<billboard z="9600" dist="2800" side="1" frequency="100" x0="600" x1="2000" type="Hay"/> <!-- distance object -->
<billboard z="9600" dist="2800" side="-1" frequency="100" x0="600" x1="2000" type="Hay"/> <!-- distance object -->
<billboard z="9500" dist="900" side="1" frequency="20" x0="100" x1="500" type="Wheat"/>
<billboard z="9500" dist="900" side="-1" frequency="20" x0="100" x1="500" type="Wheat"/>
<billboard z="10410" dist="600" side="1" frequency="40" x0="40" x1="200" type="Hay"/>
<billboard z="10420" dist="600" side="-1" frequency="40" x0="40" x1="200" type="Hay"/>
<billboard z="11020" dist="500" side="-1" frequency="20" x0="100" x1="500" type="Wheat"/>
<billboard z="11200" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="11620" dist="800" side="1" frequency="80" x0="100" x1="100" type="Barn"/>
<billboard z="11600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="12000" dist="500" side="-1" frequency="20" x0="100" x1="500" type="Wheat"/>
<billboard z="12100" dist="800" side="0" frequency="40" x0="0" x1="0" type="SpeedBump"/>
<!-- 12500 - End : Green 1 -->
<billboard z="12500" dist="2200" side="1" frequency="100" x0="600" x1="2000" type="CherryBush"/> <!-- distance object -->
<billboard z="12500" dist="2200" side="-1" frequency="100" x0="600" x1="2000" type="CherryBush"/> <!-- distance object -->
<billboard z="12500" dist="1000" side="1" frequency="20" x0="100" x1="200" type="Flowers"/>
<billboard z="12500" dist="500" side="-1" frequency="20" x0="100" x1="200" type="Flowers"/>
<billboard z="13000" dist="500" side="-1" frequency="20" x0="20" x1="50" type="CherryBush"/>
<billboard z="13500" dist="1200" side="-1" frequency="40" x0="20" x1="200" type="ElmTree"/>
<billboard z="13500" dist="1200" side="1" frequency="40" x0="20" x1="200" type="ElmTree"/>
<billboard z="14700" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="8" repeat="128"/>
</roadsegment>
<roadsegment>
<pattern value="6" repeat="256"/>
</roadsegment>
<roadsegment> <!-- 5 lane striped -->
<pattern value="6" repeat="128"/>
<pattern value="10" repeat="128"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="11" repeat="256"/>
</roadsegment>
</road>
<!-- STAGE 10 -->
<!-- MARINA DRIVE -->
<!-- A greek island/village type stage with beaches and rocky tunnels -->
<road>
<!-- data -->
<info name="Marina Drive" length="16000" drawdist="800" objdist="600" camheight="220" fov="180" zstep="10" zoffset="25" aigenstep="1000"/>
<time normal="45"/>
<base width="400" surface="0" curvemul="0.01" hillmul="0.01" surfacetype="tarmac" edgecolr="0" edgecolg="200" edgecolb="20"/>
<background colr="96" colg="156" colb="220" frame="17"/>
<!-- labels -->
<label z="0000" text="START"/>
<label z="2600" text="SEA"/>
<label z="8000" text="CLIFFS"/>
<label z="13000" text="SEA2"/>
<!-- ai -->
<aizone z="0" dist="20000" density="0.6" cartype="0"/> <!-- Prelude -->
<aizone z="0" dist="20000" density="0.6" cartype="1"/> <!-- Capri -->
<aizone z="0" dist="20000" density="0.6" cartype="2"/> <!-- Porsche -->
<aizone z="0" dist="20000" density="1" cartype="3"/> <!-- Jeep -->
<aizone z="0" dist="20000" density="1" cartype="4"/> <!-- Mini -->
<!-- edges and surfaces -->
<edge z="0" dist="16000" side="-1" colr="207" colg="191" colb="191" splash="1"/> <!-- sandy -->
<edge z="0" dist="16000" side="1" colr="207" colg="191" colb="191" splash="1"/> <!-- sandy -->
<edge z="2800" dist="5200" side="-1" colr="28" colg="61" colb="141" splash="3"/> <!-- sea -->
<edge z="9000" dist="4000" side="-1" colr="178" colg="159" colb="126" splash="1"/> <!-- cliffs -->
<edge z="9000" dist="4000" side="1" colr="178" colg="159" colb="126" splash="1"/> <!-- cliffs -->
<edge z="13600" dist="1000" side="-1" colr="35" colg="75" colb="161" splash="3"/> <!-- sea -->
<surface z="0" dist="100" surface="0" splash="1"/>
<surface z="100" dist="125" surface="2" splash="1"/>
<surface z="125" dist="2875" surface="0" splash="1"/>
<surfacetype z="100" dist="25" type="bumpy"/>
<!-- road -->
<width z="0" dist="100" width="400" crossdist="400"/>
<!-- bends -->
<bend z="1000" dist="400" curve="6"/> <!-- r -->
<bend z="1400" dist="600" curve="-8"/> <!-- l -->
<bend z="2200" dist="200" curve="-14"/> <!-- l -->
<bend z="2400" dist="200" curve="14"/> <!-- r -->
<bend z="3000" dist="1000" curve="-10"/> <!-- l -->
<bend z="4000" dist="600" curve="-6"/> <!-- l -->
<bend z="4600" dist="1800" curve="10"/> <!-- r -->
<bend z="6400" dist="600" curve="-10"/> <!-- l -->
<bend z="7400" dist="600" curve="-10"/> <!-- l -->
<bend z="9000" dist="1000" curve="14"/> <!-- r -->
<bend z="11000" dist="1000" curve="-12"/> <!-- l -->
<bend z="12000" dist="1000" curve="10"/> <!-- r -->
<bend z="13000" dist="600" curve="-4"/> <!-- l -->
<bend z="13600" dist="400" curve="-2"/> <!-- l -->
<bend z="14000" dist="600" curve="2"/> <!-- r -->
<!-- hills -->
<hill z="1000" dist="400" curve="5"/> <!-- d -->
<hill z="1400" dist="600" curve="-2"/> <!-- u -->
<hill z="2200" dist="100" curve="-2"/> <!-- u -->
<hill z="2300" dist="200" curve="2"/> <!-- d -->
<hill z="2500" dist="100" curve="-2"/> <!-- u -->
<hill z="8000" dist="1000" curve="-4"/> <!-- u -->
<hill z="9000" dist="1000" curve="2"/> <!-- d -->
<hill z="10000" dist="300" curve="2"/> <!-- d -->
<hill z="10300" dist="400" curve="-4"/> <!-- u -->
<hill z="10700" dist="300" curve="2"/> <!-- d -->
<hill z="12000" dist="1000" curve="4"/> <!-- d -->
<hill z="13000" dist="600" curve="-2"/> <!-- u -->
<!-- scenery -->
<!-- 0 - 3300 : Green 1 -->
<billboard z="100" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Start"/>
<billboard z="200" dist="400" side="-1" frequency="20" x0="50" x1="100" type="YuccaBush"/>
<billboard z="200" dist="1000" side="1" frequency="20" x0="50" x1="100" type="YuccaBush"/>
<billboard z="600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="800" dist="2000" side="1" frequency="100" x0="400" x1="1000" type="YuccaBush"/> <!-- distance object -->
<billboard z="800" dist="2000" side="-1" frequency="100" x0="400" x1="1000" type="YuccaBush"/> <!-- distance object -->
<billboard z="1000" dist="200" side="-1" frequency="40" x0="150" x1="150" type="Rock"/>
<billboard z="1200" dist="600" side="-1" frequency="20" x0="20" x1="100" type="YuccaBush"/>
<billboard z="1200" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="1400" dist="400" side="1" frequency="40" x0="150" x1="150" type="Rock"/>
<billboard z="1800" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignLeftChicane"/> <!-- chicane left then right -->
<billboard z="1800" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRightChicane"/> <!-- chicane left then right -->
<billboard z="2200" dist="400" side="1" frequency="40" x0="150" x1="150" type="Rock"/>
<billboard z="2200" dist="400" side="-1" frequency="40" x0="150" x1="150" type="Rock"/>
<billboard z="2600" dist="6400" side="1" frequency="50" x0="400" x1="1000" type="YuccaBush"/> <!-- distance object -->
<billboard z="3000" dist="4800" side="-1" frequency="200" x0="400" x1="2000" type="Yacht"/> <!-- distance object -->
<billboard z="2800" dist="5200" side="-1" frequency="20" x0="100" x1="2000" type="Wave"/> <!-- distance object -->
<billboard z="2600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="3000" dist="400" side="1" frequency="20" x0="20" x1="200" type="YuccaBush"/>
<billboard z="3600" dist="400" side="1" frequency="20" x0="20" x1="200" type="Plant"/>
<billboard z="3620" dist="600" side="1" frequency="40" x0="20" x1="20" type="Palm"/>
<billboard z="4200" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignLeft"/> <!-- really right -->
<billboard z="4620" dist="600" side="1" frequency="80" x0="20" x1="20" type="Palm"/>
<billboard z="5220" dist="600" side="1" frequency="80" x0="20" x1="20" type="Lamppost_Ornate"/>
<billboard z="4820" dist="400" side="1" frequency="80" x0="400" x1="400" type="GreekHut1"/>
<billboard z="5420" dist="400" side="1" frequency="80" x0="400" x1="400" type="GreekHut2"/>
<billboard z="6000" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="6400" dist="600" side="1" frequency="20" x0="20" x1="200" type="Plant"/>
<billboard z="7020" dist="800" side="1" frequency="80" x0="20" x1="20" type="Lamppost_Ornate"/>
<billboard z="7120" dist="400" side="1" frequency="80" x0="400" x1="400" type="GreekHut1"/>
<billboard z="7620" dist="400" side="1" frequency="80" x0="400" x1="400" type="GreekHut2"/>
<billboard z="7820" dist="800" side="1" frequency="80" x0="20" x1="20" type="Palm"/>
<billboard z="8200" dist="400" side="-1" frequency="20" x0="20" x1="200" type="YuccaBush"/>
<billboard z="8600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="9000" dist="800" side="-1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="9000" dist="1000" side="1" frequency="15" x0="40" x1="80" type="Rockwall"/>
<billboard z="9800" dist="400" side="-1" frequency="15" x0="20" x1="150" type="Scrub"/>
<billboard z="9805" dist="400" side="-1" frequency="15" x0="150" x1="250" type="Shrubs"/>
<billboard z="10000" dist="200" side="1" frequency="15" x0="20" x1="150" type="Scrub"/>
<billboard z="10005" dist="200" side="1" frequency="15" x0="150" x1="250" type="Shrubs"/>
<billboard z="10200" dist="400" side="0" frequency="20" x0="40" x1="80" type="RockBridge"/>
<billboard z="10400" dist="800" side="-1" frequency="30" x0="150" x1="150" type="Rock"/>
<billboard z="10600" dist="400" side="1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- really left -->
<billboard z="11000" dist="200" side="0" frequency="20" x0="40" x1="80" type="RockBridge"/>
<billboard z="11200" dist="200" side="0" frequency="20" x0="40" x1="80" type="RockBridge_Open"/>
<billboard z="11400" dist="200" side="0" frequency="20" x0="40" x1="80" type="RockBridge"/>
<billboard z="11600" dist="400" side="1" frequency="15" x0="40" x1="80" type="Rockwall"/>
<billboard z="11600" dist="400" side="-1" frequency="40" x0="20" x1="20" type="SignRight"/> <!-- right -->
<billboard z="12000" dist="400" side="0" frequency="20" x0="40" x1="80" type="RockBridge"/>
<billboard z="12400" dist="100" side="0" frequency="20" x0="40" x1="80" type="RockBridge_Open"/>
<billboard z="12500" dist="700" side="0" frequency="30" x0="40" x1="80" type="RockBridge"/>
<billboard z="13200" dist="400" side="0" frequency="30" x0="40" x1="80" type="RockBridge_Open"/>
<billboard z="13600" dist="1000" side="1" frequency="50" x0="400" x1="1000" type="YuccaBush"/> <!-- distance object -->
<billboard z="13600" dist="1000" side="-1" frequency="20" x0="100" x1="2000" type="Wave"/> <!-- distance object -->
<billboard z="13600" dist="200" side="1" frequency="15" x0="20" x1="150" type="Scrub"/>
<billboard z="13605" dist="200" side="1" frequency="15" x0="150" x1="250" type="Shrubs"/>
<billboard z="13810" dist="600" side="1" frequency="20" x0="20" x1="200" type="Plant"/>
<billboard z="14700" dist="25" side="0" frequency="25" x0="0" x1="0" type="Gantry_Split"/>
<!-- surface definitions -->
<roadsegment> <!-- 3 lane striped -->
<pattern value="14" repeat="128"/>
<pattern value="15" repeat="128"/>
</roadsegment>
<roadsegment>
<pattern value="14" repeat="256"/>
</roadsegment>
<roadsegment> <!-- check -->
<pattern value="5" repeat="256"/>
</roadsegment>
</road>
<!-- ACHIEVEMENTS -->
<achievementcondition name="equals"/>
<achievementcondition name="lessthan"/>
<achievementcondition name="lessthanequal"/>
<achievementcondition name="greaterthan"/>
<achievementcondition name="greaterthanequal"/>
<achievementvariable name="finishtime" initialvalue="100000"/>
<achievementvariable name="hitcars" initialvalue="0"/>
<achievementvariable name="crashes" initialvalue="0"/>
<achievementvariable name="overtake" initialvalue="0"/>
<achievementvariable name="timeatfullspeed" initialvalue="0"/>
<achievementvariable name="braketime" initialvalue="0"/>
<achievementvariable name="turbostart" initialvalue="0"/>
<achievement name="Forged Pistons" unlock="Forged Pistons" condition="Cocoa City: Finish in under 40 secs">
<item id="0" level="0" variable="finishtime" condition="lessthan" value="42"/>
</achievement>
<achievement name="Lowered Springs" unlock="Lowered Springs" condition="Cocoa City: Hit no traffic">
<item id="0" level="0" variable="hitcars" condition="lessthan" value="1"/>
</achievement>
<achievement name="Uprated Cams" unlock="Uprated Cams" condition="Wind Valley: Maintain full speed for 20 secs">
<item id="0" level="1" variable="timeatfullspeed" condition="greaterthanequal" value="20"/>
</achievement>
<achievement name="6 Pot Calipers" unlock="6 Pot Calipers" condition="Wind Valley: Don't brake">
<item id="0" level="1" variable="braketime" condition="lessthan" value="1"/>
</achievement>
<achievement name="Ceramic Turbo" unlock="Ceramic Turbo" condition="Black Mountain: Perform a Turbo Start">
<item id="0" level="2" variable="turbostart" condition="greaterthanequal" value="1"/>
</achievement>
<achievement name="Short Steering Rack" unlock="Short Steering Rack" condition="Black Mountain: Overtake 30 cars">
<item id="0" level="2" variable="overtake" condition="greaterthanequal" value="30"/>
</achievement>
<achievement name="Large Bore Exhaust" unlock="Large Bore Exhaust" condition="Serpents Pass: Maintain full speed for 20 secs">
<item id="0" level="3" variable="timeatfullspeed" condition="greaterthanequal" value="20"/>
</achievement>
<achievement name="Performance Dampers" unlock="Performance Dampers" condition="Serpents Pass: Don't crash">
<item id="0" level="3" variable="crashes" condition="lessthan" value="1"/>
</achievement>
<achievement name="Induction Kit" unlock="Induction Kit" condition="Twilight Pass: Finish in under 47 secs">
<item id="0" level="4" variable="finishtime" condition="lessthan" value="47"/>
</achievement>
<achievement name="Vented Discs" unlock="Vented Discs" condition="Twilight Pass: Don't brake">
<item id="0" level="4" variable="braketime" condition="lessthan" value="1"/>
</achievement>
<achievement name="High Flow Fuel Pump" unlock="High Flow Fuel Pump" condition="Ridgeway: Finish in under 48 secs">
<item id="0" level="5" variable="finishtime" condition="lessthan" value="48"/>
</achievement>
<achievement name="Braided Hoses" unlock="Braided Hoses" condition="Ridgeway: Don't brake">
<item id="0" level="5" variable="braketime" condition="lessthan" value="1"/>
</achievement>
<achievement name="Charge Cooler" unlock="Charge Cooler" condition="Ocean Boulevard: Perform a Turbo Start">
<item id="0" level="6" variable="turbostart" condition="greaterthanequal" value="1"/>
</achievement>
<achievement name="Recirculating Dump Valve" unlock="Recirculating Dump Valve" condition="Route 88: Perform a Turbo Start">
<item id="0" level="7" variable="turbostart" condition="greaterthanequal" value="1"/>
</achievement>
<achievement name="Racing Tyres" unlock="Racing Tyres" condition="Harvest Lane: Hit no traffic">
<item id="0" level="8" variable="hitcars" condition="lessthan" value="1"/>
</achievement>
<achievement name="Racing Wheel" unlock="Racing Wheel" condition="Marina Drive: Overtake 30 cars">
<item id="0" level="9" variable="overtake" condition="greaterthanequal" value="30"/>
</achievement>
</data>
;
static var xmlLoader:URLLoader;
public static function InitOnce(_arg1:Function){
f = _arg1;
XmlLoadedInternal();
}
public static function xmlLoaded(_arg1:Event){
XML.ignoreWhitespace = true;
xml = new XML(_arg1.target.data);
f();
}
public static function XmlLoadedInternal(){
XML.ignoreWhitespace = true;
xml = new XML(xxx);
f();
}
}
}//package
Section 39
//Font20 (Font20)
package {
import flash.text.*;
public dynamic class Font20 extends Font {
}
}//package
Section 40
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.geom.*;
import flash.utils.*;
import mochi.as3.*;
public class Game {
static const levelState_TimeRunOut = 3;
static const levelFinishedState_WON = 1;
static const levelFinishedState_NOT = 0;
static const levelFinishedState_LOST = 2;
static const levelState_Play = 1;
static const levelState_Null = 2;
static const levelState_LevelStart = 0;
static var doRender:Boolean;
static var panelRect:Rectangle = new Rectangle(0, 0, 10, 10);
static var dibsSpeechTimer:int;
static var levelFinishedState:int;
static var levelTimer:int;
static var levelTimes:Array;
static var levelNames:Array;
static var nextCarGenPos:int;
static var playerupgrade_turbomax:Number;
static var levelTimer1:int;
static var player_turboMaxRechargeTime:int;
public static var startLevel:int;
public static var gravity;
static var AICarSpeedMax:Number = 6;
public static var firstTime_Powerup1:Boolean;
public static var firstTime_Powerup3:Boolean;
public static var skidSound0:SoundChannel = null;
public static var firstTime_Powerup4:Boolean;
static var route:Array;
static var numUpdates:int;
static var player_zacc:Number;
static var invincibleTimer:int;
public static var currentStartPointIndex:int;
public static var firstTime_Powerup2:Boolean;
static var player_turboMinSpeed:Number;
static var ai_cutoffbehindplayer:int;
static var player_xmax:Number;
static var numLevels:int;
public static var maxFallSpeed;
static var currentScore:int;
static var totalRaceTime:int;
static var speedToMph:Number;
static var dodebug:Boolean = false;
static var playerupgrade_xacc:Number;
public static var playerExtraJumpYvel = -4;
public static var LevelUpdateCallback:Object;
static var newAchievementIndex:int;
static var playerupgrade_turbotime:Number;
static var ai_carInfoList:Array;
static var showingOverlay:Boolean;
static var player_turboDecel:Number;
static var player_turboMaxTime:int;
static var sitelock:Boolean = false;
static var player_turboMaxVel:Number;
static var currentLabel:int;
public static var polygonList:Array;
static var panelButtonsPosX:Array = new Array(378, 421, 461, 502, 545, 586);
static var panelButtonsPosY:int = 60;
static var playerupgrade_decel:Number;
static var numCreds:int;
static var playerupgrade_maxspeed:Number;
static var overlaySelected:Boolean;
static var ingameMusicChoice:int = 0;
static var numWeenies:int;
public static var scrollH:Number;
static var invincibleTimerMax:int;
public static var road:Road;
static var numLives:int;
static var selectedDirection:int;
static var showingOverlayID:int;
static var speedupTimerMax:int;
static var testingScale:Boolean = false;
public static var scrollW:Number;
public static var scrollX:Number;
public static var scrollY:Number;
static var soundon:Boolean = true;
public static var camera:Camera;
static var AICarSpeedMin:Number = 5;
static var ai_cutoffinfrontofplayer:int;
public static var playerRot:Number = 0;
static var player_roadpushvelexp:int;
static var speedupTimer:int;
static var player_zmax:Number;
static var levelStateTimer1:int;
static var levelStateTimer2:int;
static var ai_maxcars:int;
static var levelState:int;
static var levelsUnlocked:Array;
static var newAchievementsMC:MovieClip = null;
public static var numKilledInWaveList:Array;
public static var currentLevel:int;
static var player_turboAccel:Number;
static var playerupgrade_turborecharge:Number;
static var dibsSpeechFlag:Boolean;
static var player_xacc:Number;
static var upgradesMC:MovieClip;
static var mouseOverButton:int = -1;
static var main:Main;
static var multiplier:int;
static var carGenTimer:int;
static var playerupgrade_accel:Number;
public static var startPointObjs:Array;
static var levelStateTimer:int;
static var overlay_racefinished:Boolean = false;
public static var playerJumpYvel = -6;
static var player_smokeminvel:Number;
static var playerupgrade_roadpush:Number;
static var ai_gendist:int;
static var scrollMaxX;
static var scrollMaxY;
public static var engineSound0:SoundChannel = null;
public static var startPoints:Array;
static var player_zdec:Number;
static var stageNumber:int;
static var overlayMC:MovieClip;
static var goPlayer:GameObj;
static var pause:Boolean;
static var player_roadpush:Number;
static function InitLevelCompleteOverlay():void{
var _local1:MovieClip;
var _local2:int;
StopLoops();
pause = true;
selectedDirection = 0;
StopLoops();
overlaySelected = false;
overlayMC = new CourseCompleteScreen();
_local2 = (currentLevel - 6);
trace(("ending " + _local2));
if (_local2 == 0){
_local1 = new EndMovie1();
};
if (_local2 == 1){
_local1 = new EndMovie2();
};
if (_local2 == 2){
_local1 = new EndMovie3();
};
if (_local2 == 3){
_local1 = new EndMovie4();
};
overlayMC.addChild(_local1);
_local1.gotoAndPlay(1);
main.addChild(overlayMC);
overlayMC.buttonContinue.addEventListener(MouseEvent.CLICK, LevelCompleteOverlay_buttonContinuePressed);
}
public static function ExitDibsSpeech(){
}
static function BetweenLevelsOverlay_KeyPressed(_arg1:int){
var _local2:int;
var _local3:int;
var _local4:int;
_local3 = 0;
_local4 = _arg1;
selectedDirection = _arg1;
UpdateBetweenLevelOverlay();
}
public static function buttonEndGameContinuePressed(_arg1:MouseEvent){
main.removeChild(overlayMC);
overlayMC = null;
main.SetGameState(Main.gameState_TITLE);
}
public static function UpdateGameplay():void{
var _local1:RoadLabel;
var _local2:int;
if (road == null){
return;
};
if (levelState == levelState_Null){
if (pause){
return;
};
return;
};
if (pause){
return;
};
UpdatePanelButtons();
if (levelState == levelState_LevelStart){
levelStateTimer2++;
levelStateTimer1++;
if (levelStateTimer1 >= Defs.fps){
levelStateTimer1 = 0;
levelStateTimer++;
InitPreRaceOverlay((levelStateTimer - 1));
if (levelStateTimer == 3){
InitLevelState(levelState_Play);
};
};
};
if (LevelUpdateCallback != null){
LevelUpdateCallback();
};
numUpdates = 1;
if (KeyReader.Pressed(KeyReader.KEY_1)){
StartIngameMusicStream(0);
};
if (KeyReader.Pressed(KeyReader.KEY_2)){
StartIngameMusicStream(1);
};
if (KeyReader.Pressed(KeyReader.KEY_3)){
StartIngameMusicStream(2);
};
if (dodebug){
if (KeyReader.Down(KeyReader.KEY_5)){
numUpdates = 5;
};
if (KeyReader.Down(KeyReader.KEY_6)){
numUpdates = 20;
};
if (KeyReader.Pressed(KeyReader.KEY_8)){
InitLevel();
};
if (KeyReader.Pressed(KeyReader.KEY_9)){
NextLevel();
};
};
if (levelFinishedState == levelFinishedState_WON){
};
if (levelFinishedState == levelFinishedState_LOST){
};
if (levelState == levelState_LevelStart){
};
numUpdates = 1;
if (main.extraframe){
numUpdates++;
};
_local2 = 0;
while (_local2 < numUpdates) {
if (levelState == levelState_Play){
totalRaceTime++;
levelTimer1++;
levelTimer--;
if (levelTimer <= 0){
InitLevelState(levelState_TimeRunOut);
};
};
if (levelState == levelState_TimeRunOut){
if (goPlayer.zvel <= 0){
InitLevelState(levelState_Null);
TitleScreenState.InitGameOverFailed();
levelTimer = 0;
};
};
UpdatePlayer();
UpdateAIVehicles();
GameObjects.Update();
Collision.Update(main);
if (overlayMC == null){
if (goPlayer.zpos > road.goalZPos){
AddScore((1000 * (levelTimer / Defs.fps)));
Stats.SetLevelStat(currentLevel, "finishtime", (levelTimer1 / Defs.fps));
Stats.EndLevel(currentLevel);
Achievements.TestAtLevelComplete(currentLevel);
SaveData.Save();
levelTimes.push(levelTimer1);
trace(("stageNumber " + stageNumber));
stageNumber++;
if (stageNumber == 4){
InitLevelState(levelState_Null);
InitLevelCompleteOverlay();
} else {
InitLevelState(levelState_Null);
InitBetweenLevelOverlay();
};
};
};
_local2++;
};
}
static function NextLevel(){
var _local1:*;
currentLevel++;
_local1 = int(ExternalData.xml.road.length());
currentLevel = (currentLevel % _local1);
trace(("Starting level " + currentLevel));
InitLevel();
}
public static function buttonSubmitScorePressed(_arg1:MouseEvent){
var _local2:String;
_local2 = overlayMC.info.buttonSubmitScore.textName.text;
overlayMC.info.buttonSubmitScore.visible = false;
TitleScreenState.SubmitScore(_local2);
}
public static function InitLevel(){
main.screenBD.fillRect(Defs.screenRect, 4278190080);
main.trackBD.fillRect(Defs.screenRect, 4278190080);
doRender = false;
ExternalData.InitOnce(InitLevel1);
}
static function InitAIVehicles():void{
var _local1:int;
var _local2:GameObj;
_local1 = 0;
while (_local1 < 5) {
_local2 = GameObjects.AddObj(0, 0, 1000);
_local2.InitAIVehicle((_local1 % 4), true);
_local2.zpos = (0 + (_local1 * 20));
_local1++;
};
carGenTimer = 20;
}
public static function buttonQuitPressed(_arg1:MouseEvent){
main.removeChild(overlayMC);
overlayMC = null;
Game.main.SetGameState(Main.gameState_TITLE);
}
public static function buttonLevelPressed(_arg1:MouseEvent){
var _local2:int;
var _local3:Array;
_local2 = _arg1.currentTarget.levelIndex;
trace(("levle " + _local2));
_local3 = GetNextLevelChoice(currentLevel);
if (_local2 == _local3[0]){
selectedDirection = 0;
UpdateBetweenLevelOverlay();
} else {
if (_local2 == _local3[1]){
selectedDirection = 1;
UpdateBetweenLevelOverlay();
};
};
}
public static function buttonUpgradesExitPressed(_arg1:MouseEvent){
main.removeChild(upgradesMC);
upgradesMC = null;
}
static function UpdatePanelButtons(){
var _local1:int;
var _local2:Rectangle;
var _local3:int;
var _local4:int;
mouseOverButton = -1;
_local1 = Defs.roadarea_h;
_local2 = new Rectangle(0, (_local1 + panelButtonsPosY), 32, 32);
_local4 = -1;
_local3 = 0;
while (_local3 < 6) {
_local2.x = panelButtonsPosX[_local3];
if (_local2.contains(MouseControl.mousePosX, MouseControl.mousePosY)){
_local4 = _local3;
mouseOverButton = _local3;
};
_local3++;
};
if (MouseControl.buttonPressed){
MouseControl.buttonPressed = false;
if (_local4 != -1){
if (_local4 == 0){
SoundPlayer.ToggleSound();
};
if (_local4 == 1){
MusicPlayer.ToggleSound();
};
if (_local4 == 2){
StartIngameMusicStream(0);
};
if (_local4 == 3){
StartIngameMusicStream(1);
};
if (_local4 == 4){
StartIngameMusicStream(2);
};
if (levelState == levelState_Play){
if (_local4 == 5){
if (pause == false){
PauseMenu.Pause();
};
};
};
};
};
}
public static function buttonNewAchievementsExitPressed(_arg1:MouseEvent){
if (newAchievementIndex >= Achievements.newAchievementList.length){
main.removeChild(newAchievementsMC);
newAchievementsMC = null;
KeyReader.InitOnce(main.stage);
} else {
NewAchievement_PopulateScreen();
};
}
public static function ShowSign(_arg1:int){
if (showingOverlay){
return;
};
showingOverlay = true;
showingOverlayID = _arg1;
}
public static function InitLevel1(){
var _local1:GameObj;
var _local2:XML;
Debug.debugMode = 0;
KeyReader.InitOnce(main.stage);
InitPlayerVars();
InitAICarVars();
ObjectDefs.Init();
GameObjects.ClearAll();
levelFinishedState = levelFinishedState_NOT;
goPlayer = GameObjects.AddObj(400, 400, 1000);
goPlayer.InitPlayer();
scrollX = 0;
scrollY = 0;
LevelUpdateCallback = null;
scrollMaxX = (scrollW - Defs.displayarea_w);
scrollMaxY = (scrollH - Defs.displayarea_h);
gravity = 0.2;
maxFallSpeed = 6;
goPlayer.xpos = 0;
goPlayer.ypos = 0;
goPlayer.zpos = 50;
showingOverlay = false;
showingOverlayID = 0;
invincibleTimer = 0;
invincibleTimerMax = (Defs.fps * 10);
speedupTimer = 0;
speedupTimerMax = (Defs.fps * 10);
numWeenies = 0;
numCreds = 0;
dibsSpeechFlag = false;
dibsSpeechTimer = 0;
firstTime_Powerup1 = false;
firstTime_Powerup2 = false;
firstTime_Powerup3 = false;
firstTime_Powerup4 = false;
road = new Road();
road.InitRoad();
InitUpdateAIVehicles();
currentLabel = 0;
InitLevelState(levelState_LevelStart);
_local2 = road.GetRoadXml();
levelTimer = (levelTimer + (Number(_local2.time.@normal) * Defs.fps));
levelTimer1 = 0;
if (((!((startLevel == 0))) && ((startLevel == currentLevel)))){
levelTimer = (levelTimer + (10 * Defs.fps));
};
speedToMph = Number(ExternalData.xml.setup.player.@speedtomph);
pause = false;
Stats.StartLevel(currentLevel);
doRender = true;
StartIngameMusicStream(ingameMusicChoice);
}
static function CarSceneryCollision(_arg1:GameObj):BillboardCollision{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:RoadObj;
var _local7:Billboard;
var _local8:BillboardCollision;
var _local9:Number;
if (_arg1.zvel < 3){
return (null);
};
_local2 = (_arg1.zpos - 10);
_local3 = (_arg1.zpos + 10);
_local4 = _local2;
while (_local4 < _local3) {
_local5 = Game.road.GetRoadObjects(_local4);
for each (_local6 in _local5) {
_local7 = road.billboards[_local6.type];
for each (_local8 in _local7.collisions) {
_local9 = (_local6.xpos + _local8.xoffset);
if (Math.abs((_local6.zpos - _arg1.zpos)) < 50){
if (Math.abs((_local9 - _arg1.xpos)) < (50 * _local8.radius)){
return (_local8);
};
};
};
};
_local4++;
};
return (null);
}
public static function AddScore(_arg1:int):void{
currentScore = (currentScore + (_arg1 * multiplier));
}
static function InitPreGameOverlay():void{
var _local1:MovieClip;
var _local2:int;
StopLoops();
selectedDirection = 0;
StopLoops();
overlaySelected = false;
overlayMC = new PreGameOverlay();
main.addChild(overlayMC);
overlayMC.info.buttonUpgrades.addEventListener(MouseEvent.CLICK, buttonUpgradesPressed);
overlayMC.info.buttonContinue.addEventListener(MouseEvent.CLICK, buttonPreGameContinuePressed);
TitleScreenState.GameNinjaButton(overlayMC.info.buttonGameNinja, "heatrushlevel");
_local2 = 0;
while (_local2 < 10) {
_local1 = overlayMC.info[("level" + _local2)];
_local1.levelIndex = _local2;
_local1.addEventListener(MouseEvent.CLICK, PreGameOverlay_buttonLevelPressed);
_local2++;
};
UpdatePreGameOverlay();
overlayMC.gotoAndStop("faded1");
trace("init pre game overlay");
}
public static function UpdatePreGameOverlay(){
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:int;
var _local4:int;
_local3 = 0;
while (_local3 < 10) {
_local2 = overlayMC.info[("road" + _local3)];
_local2.leftRoad.visible = false;
_local2.rightRoad.visible = false;
_local2.leftRoad.gotoAndStop(2);
_local2.rightRoad.gotoAndStop(2);
_local3++;
};
_local3 = 0;
while (_local3 < 10) {
_local1 = overlayMC.info[("level" + _local3)];
_local1.diorama.gotoAndStop((_local3 + 1));
_local4 = 4;
if (levelsUnlocked[_local3] == true){
_local4 = 2;
};
if (_local3 == currentLevel){
_local4 = 3;
};
_local1.bg.gotoAndStop(_local4);
if (_local4 == 4){
_local1.bg.visible = false;
} else {
_local1.bg.visible = true;
};
_local1.textStageTime.visible = false;
_local1.textStageName.text = levelNames[_local3];
_local3++;
};
}
static function UpdateAIVehicles():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:GameObj;
if (road == null){
return;
};
_local1 = CountAiCars();
if (_local1 > ai_maxcars){
return;
};
if (road.aiCarSpawnPoints == null){
return;
};
if (road.aiCarSpawnPoints.length == 0){
return;
};
_local2 = road.aiCarSpawnPoints[nextCarGenPos].x;
_local3 = road.aiCarSpawnPoints[nextCarGenPos].y;
_local4 = goPlayer.zpos;
if (_local4 > _local2){
nextCarGenPos++;
if (nextCarGenPos >= road.aiCarSpawnPoints.length){
nextCarGenPos = (road.aiCarSpawnPoints.length - 1);
};
_local5 = GameObjects.AddObj(0, 0, 1000);
_local5.InitAIVehicle(_local3);
};
}
public static function UpdateBetweenLevelOverlay(){
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:int;
_local3 = 0;
while (_local3 < 10) {
_local2 = overlayMC.info[("road" + _local3)];
_local2.leftRoad.visible = false;
_local2.rightRoad.visible = false;
_local2.leftRoad.gotoAndStop(2);
_local2.rightRoad.gotoAndStop(2);
_local3++;
};
_local3 = 0;
while (_local3 < 10) {
_local1 = overlayMC.info[("level" + _local3)];
_local1.diorama.gotoAndStop((_local3 + 1));
_local1.bg.gotoAndStop(1);
_local1.bg.visible = false;
_local1.textStageTime.visible = false;
_local1.textStageName.text = levelNames[_local3];
_local3++;
};
_local4 = 0;
_local3 = 0;
_local1 = overlayMC.info[("level" + _local4)];
_local1.bg.visible = true;
_local1.bg.gotoAndStop(4);
_local1.textStageTime.visible = true;
_local1.textStageTime.text = Utils.CounterToSecondsString(levelTimes[_local3]);
for each (_local5 in route) {
_local3++;
_local2 = overlayMC.info[("road" + _local4)];
if (_local5 == 0){
_local2.leftRoad.visible = true;
_local2.leftRoad.gotoAndStop(4);
} else {
_local2.rightRoad.visible = true;
_local2.rightRoad.gotoAndStop(4);
};
_local6 = GetNextLevelChoice(_local4);
_local4 = _local6[_local5];
_local1 = overlayMC.info[("level" + _local4)];
_local1.bg.visible = true;
_local1.bg.gotoAndStop(4);
_local1.textStageTime.visible = true;
_local1.textStageTime.text = Utils.CounterToSecondsString(levelTimes[_local3]);
};
if (overlay_racefinished == false){
_local6 = GetNextLevelChoice(currentLevel);
_local7 = 0;
for each (_local3 in _local6) {
_local1 = overlayMC.info[("level" + _local3)];
_local1.bg.gotoAndStop(2);
if (selectedDirection == _local7){
_local1.bg.visible = true;
_local1.bg.gotoAndStop(3);
};
_local7++;
};
_local1 = overlayMC.info[("level" + currentLevel)];
_local1.bg.gotoAndStop(4);
_local2 = overlayMC.info[("road" + currentLevel)];
_local2.leftRoad.visible = true;
_local2.rightRoad.visible = true;
_local2.leftRoad.gotoAndStop(2);
_local2.rightRoad.gotoAndStop(2);
if (selectedDirection == 0){
_local2.leftRoad.gotoAndStop(3);
};
if (selectedDirection == 1){
_local2.rightRoad.gotoAndStop(3);
};
};
}
public static function InitLevelState(_arg1:int){
levelState = _arg1;
levelStateTimer = 0;
if (levelState == levelState_LevelStart){
levelStateTimer = 0;
levelStateTimer1 = 0;
levelStateTimer2 = 0;
road.camHeight = (road.camHeight + 200);
};
if (levelState == levelState_Play){
};
}
public static function buttonUpgradesPressed(_arg1:MouseEvent){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Upgrade;
var _local6:Achievement;
var _local7:MovieClip;
if (overlaySelected){
return;
};
upgradesMC = new UpgradesScreen();
main.addChild(upgradesMC);
upgradesMC.buttonExit.addEventListener(MouseEvent.CLICK, buttonUpgradesExitPressed);
_local2 = 20;
_local3 = 40;
_local4 = 0;
for each (_local5 in Upgrades.list) {
_local6 = Achievements.list[_local4];
_local7 = new SingleUpgrade();
upgradesMC.addChild(_local7);
_local7.x = _local2;
_local7.y = _local3;
_local7.textName.text = _local6.unlockName;
_local7.textHowTo.text = _local6.conditionText;
if (_local5.gotit){
_local7.gotoAndStop(2);
} else {
_local7.gotoAndStop(1);
};
_local3 = (_local3 + 24);
_local4++;
};
}
static function TestScaleStuff1(_arg1:int, _arg2:int):Number{
var _local3:Number;
var _local4:int;
var _local5:Rectangle;
var _local6:BitmapData;
var _local7:Number;
var _local8:Number;
var _local9:Matrix;
var _local10:BitmapData;
var _local11:int;
var _local12:Number;
_local3 = getTimer();
_local4 = GraphicObjects.gfx_scaletest;
_local5 = new Rectangle(0, 0, 1, 1);
if (_arg2 == 0){
_local5.width = (_local5.height = 700);
};
if (_arg2 == 1){
_local5.width = (_local5.height = 300);
};
if (_arg2 == 2){
_local5.width = (_local5.height = 50);
};
_local6 = GraphicObjects.GetBitmap(_local4, _arg1).bitmapData;
_local7 = (Number(_local5.width) / Number(_local6.width));
_local8 = (Number(_local5.height) / Number(_local6.height));
_local9 = new Matrix();
_local9.scale(_local7, _local8);
_local10 = Game.main.screenBD;
_local11 = 0;
while (_local11 < 1000) {
_local10.draw(_local6, _local9);
_local11++;
};
_local12 = getTimer();
return ((_local12 - _local3));
}
public static function NewAchievement_PopulateScreen(){
var _local1:Array;
var _local2:Achievement;
_local1 = Achievements.newAchievementList;
_local2 = _local1[newAchievementIndex];
newAchievementsMC.textAchievement.text = (_local2.unlockName + " awarded!");
newAchievementsMC.textDescription.text = _local2.conditionText;
newAchievementIndex++;
}
static function StartIngameMusicStream(_arg1:int){
ingameMusicChoice = _arg1;
if (!MusicPlayer.IsCurrentStream(ingameMusicChoice)){
MusicPlayer.StopMusic();
MusicPlayer.StartStream(ingameMusicChoice);
};
}
static function InitPreRaceOverlay(_arg1:int, _arg2:int=0){
var _local3:GameObj;
_local3 = GameObjects.AddObj(320, 50, 100);
_local3.InitOverlay(_arg1, _arg2);
}
public static function buttonOverlayClosedPressed(_arg1:MouseEvent){
Overlay_Remove();
InitLevelState(levelState_Play);
}
static function InitBetweenLevelOverlay():void{
var _local1:MovieClip;
var _local2:int;
overlay_racefinished = false;
selectedDirection = 0;
StopLoops();
overlaySelected = false;
overlayMC = new BetweenLevelsOverlay();
main.addChild(overlayMC);
overlayMC.info.buttonUpgrades.addEventListener(MouseEvent.CLICK, buttonUpgradesPressed);
overlayMC.info.buttonContinue.addEventListener(MouseEvent.CLICK, buttonContinuePressed);
overlayMC.info.buttonQuit.addEventListener(MouseEvent.CLICK, buttonQuitPressed);
TitleScreenState.GameNinjaButton(overlayMC.info.buttonGameNinja, "heatrushlevel");
_local2 = 0;
while (_local2 < 10) {
_local1 = overlayMC.info[("level" + _local2)];
_local1.levelIndex = _local2;
_local1.addEventListener(MouseEvent.CLICK, buttonLevelPressed);
_local2++;
};
UpdateBetweenLevelOverlay();
overlayMC.gotoAndPlay("in");
}
static function TestScaleStuff(){
var _local1:Array;
var _local2:Number;
_local1 = new Array();
testingScale = true;
_local1.push(TestScaleStuff1(0, 0));
_local1.push(TestScaleStuff1(0, 1));
_local1.push(TestScaleStuff1(0, 2));
_local1.push(TestScaleStuff1(1, 0));
_local1.push(TestScaleStuff1(1, 1));
_local1.push(TestScaleStuff1(1, 2));
_local1.push(TestScaleStuff1(2, 0));
_local1.push(TestScaleStuff1(2, 1));
_local1.push(TestScaleStuff1(2, 2));
for each (_local2 in _local1) {
trace(_local2);
};
}
public static function InitGame1(){
var _local1:int;
var _local2:XML;
var _local3:int;
Debug.debugMode = 0;
numLives = 3;
polygonList = new Array();
startPoints = new Array();
startPointObjs = new Array();
currentStartPointIndex = 0;
camera = new Camera();
overlayMC = null;
if (skidSound0 == null){
skidSound0 = SoundPlayer.StartLoop(SoundPlayer.SOUND_SKID);
};
SoundPlayer.SetVolume(skidSound0, 0);
if (engineSound0 == null){
engineSound0 = SoundPlayer.StartLoop(SoundPlayer.SOUND_ENGINELOOP);
};
SoundPlayer.SetVolume(engineSound0, 0);
levelsUnlocked = new Array();
_local1 = 0;
while (_local1 < 10) {
levelsUnlocked.push(Boolean(false));
_local1++;
};
levelsUnlocked[0] = true;
levelTimer = 0;
Stats.InitOnce();
Achievements.InitOnce();
Upgrades.InitOnce();
SaveData.Load();
currentLevel = (startLevel = 0);
totalRaceTime = 0;
stageNumber = 0;
currentScore = 0;
route = new Array();
levelTimes = new Array();
levelNames = new Array();
_local2 = ExternalData.xxx;
_local3 = _local2.road.length();
_local1 = 0;
while (_local1 < _local3) {
levelNames.push(_local2.road[_local1].info.@name);
_local1++;
};
InitPreGameOverlay();
}
public static function Init(_arg1:Main){
main = _arg1;
currentScore = 0;
multiplier = 1;
numLevels = 8;
currentLevel = 0;
}
static function CountAiCars():int{
var _local1:int;
var _local2:GameObj;
_local1 = 0;
for each (_local2 in GameObjects.objs) {
if (((_local2.active) && (_local2.isAiVehicle))){
_local1++;
};
};
return (_local1);
}
static function GetNextLevelChoice(_arg1:int):Array{
var _local2:Array;
_local2 = new Array();
if (_arg1 == 0){
_local2.push(1, 2);
};
if (_arg1 == 1){
_local2.push(3, 4);
};
if (_arg1 == 2){
_local2.push(4, 5);
};
if (_arg1 == 3){
_local2.push(6, 7);
};
if (_arg1 == 4){
_local2.push(7, 8);
};
if (_arg1 == 5){
_local2.push(8, 9);
};
if (_arg1 == 6){
_local2.push(0);
};
if (_arg1 == 7){
_local2.push(0);
};
if (_arg1 == 8){
_local2.push(0);
};
if (_arg1 == 9){
_local2.push(0);
};
return (_local2);
}
public static function InitGame(){
pause = true;
doRender = false;
ExternalData.InitOnce(InitGame1);
}
public static function UpdatePlayer():void{
var _local1:GameObj;
if (road == null){
return;
};
_local1 = goPlayer;
_local1.UpdatePlayer();
}
public static function StopLoops(){
SoundPlayer.SetVolume(skidSound0, 0);
SoundPlayer.SetVolume(engineSound0, 0);
}
static function BetweenLevelsOverlay_Done(_arg1:int){
if (_arg1 == 0){
pause = true;
InitNewAchievements();
} else {
main.removeChild(overlayMC);
overlayMC = null;
pause = false;
KeyReader.InitOnce(main.stage);
};
}
static function buttonPreGameContinuePressed(_arg1:MouseEvent){
main.removeChild(overlayMC);
overlayMC = null;
main.SetGameState(Main.gameState_LEVEL_PLAY);
}
public static function InitDibsSpeech(_arg1:int){
}
static function InitEndGameOverlay(_arg1:Boolean=false):void{
var _local2:MovieClip;
overlay_racefinished = true;
StopLoops();
selectedDirection = 0;
StopLoops();
overlaySelected = false;
overlayMC = new EndGameOverlay();
main.addChild(overlayMC);
Kong.SubmitStat(currentScore, "Score");
overlayMC.info.buttonSubmitScore.textName.text = TitleScreenState.scoreName;
overlayMC.info.buttonSubmitScore.buttonSubmitScore.addEventListener(MouseEvent.CLICK, buttonSubmitScorePressed);
overlayMC.info.buttonUpgrades.addEventListener(MouseEvent.CLICK, buttonUpgradesPressed);
overlayMC.info.buttonContinue.addEventListener(MouseEvent.CLICK, buttonEndGameContinuePressed);
TitleScreenState.GameNinjaButton(overlayMC.info.buttonGameNinja, "heatrushend");
if (Game.startLevel == 0){
overlayMC.info.buttonSubmitScore.visible = true;
} else {
overlayMC.info.buttonSubmitScore.visible = false;
};
overlayMC.info.textFinalScore.text = ("Final Score " + currentScore.toString());
overlayMC.info.textRaceTime.text = ("Race Time " + Utils.CounterToSecondsString(totalRaceTime, true));
UpdateBetweenLevelOverlay();
overlayMC.gotoAndPlay("faded");
}
static function LevelCompleteOverlay_buttonContinuePressed(_arg1:MouseEvent){
main.removeChild(overlayMC);
overlayMC = null;
InitEndGameOverlay();
}
public static function Overlay_Remove(){
if (overlayMC != null){
main.removeChild(overlayMC);
overlayMC = null;
KeyReader.InitOnce(main.stage);
};
}
static function PreGameOverlay_buttonLevelPressed(_arg1:MouseEvent){
var _local2:int;
_local2 = _arg1.currentTarget.levelIndex;
if (levelsUnlocked[_local2] == false){
return;
};
levelTimes = new Array();
route = new Array();
stageNumber = 0;
totalRaceTime = 0;
currentLevel = (startLevel = _local2);
trace(("startLevel: " + startLevel));
if (currentLevel > 0){
levelTimes.push((99 * Defs.fps));
totalRaceTime = (totalRaceTime + (99 * Defs.fps));
stageNumber++;
};
if (currentLevel > 2){
levelTimes.push((99 * Defs.fps));
totalRaceTime = (totalRaceTime + (99 * Defs.fps));
stageNumber++;
};
if (currentLevel > 5){
levelTimes.push((99 * Defs.fps));
totalRaceTime = (totalRaceTime + (99 * Defs.fps));
stageNumber++;
};
if (currentLevel == 1){
route.push(0);
};
if (currentLevel == 2){
route.push(1);
};
if (currentLevel == 3){
route.push(0, 0);
};
if (currentLevel == 4){
route.push(0, 1);
};
if (currentLevel == 5){
route.push(1, 1);
};
if (currentLevel == 6){
route.push(0, 0, 0);
};
if (currentLevel == 7){
route.push(0, 0, 1);
};
if (currentLevel == 8){
route.push(1, 0, 1);
};
if (currentLevel == 9){
route.push(1, 1, 1);
};
UpdatePreGameOverlay();
}
static function InitNewAchievements(){
var _local1:Array;
_local1 = Achievements.newAchievementList;
if (_local1.length == 0){
return;
};
newAchievementsMC = new UpgradeAwardedScreen();
main.addChild(newAchievementsMC);
newAchievementsMC.buttonExit.addEventListener(MouseEvent.CLICK, buttonNewAchievementsExitPressed);
newAchievementIndex = 0;
NewAchievement_PopulateScreen();
}
static function InitAICarVars(){
var _local1:XML;
var _local2:int;
var _local3:XML;
var _local4:AICarInfo;
_local1 = ExternalData.xml.setup[0];
ai_maxcars = int(_local1.ai.@maxcars);
ai_cutoffbehindplayer = int(_local1.ai.@cutoffbehindplayer);
ai_gendist = int(_local1.ai.@gendist);
ai_cutoffinfrontofplayer = (ai_gendist + 100);
ai_carInfoList = new Array();
_local2 = 0;
while (_local2 < _local1.aicar.length()) {
_local3 = _local1.aicar[_local2];
_local4 = new AICarInfo(_local3.@type, Number(_local3.@accel), Number(_local3.@maxA), Number(_local3.@maxB));
ai_carInfoList.push(_local4);
_local2++;
};
}
static function Render(){
var _local1:Matrix;
var _local2:ColorTransform;
var _local3:Number;
if (doRender == false){
return;
};
if (road == null){
return;
};
road.Render();
_local1 = new Matrix();
_local2 = new ColorTransform(1, 1, 1, 1);
if (goPlayer.turboMode == 1){
_local2.alphaMultiplier = Utils.ScaleTo(1, 0.35, 0, player_turboMaxVel, goPlayer.turboVel);
};
_local3 = (goPlayer.xvel * 0.002);
_local1.translate(-(Defs.displayarea_w2), -(Defs.roadarea_h2));
_local1.rotate(-(_local3));
_local1.translate(Defs.displayarea_w2, Defs.roadarea_h2);
_local1 = null;
main.screenBD.draw(main.trackBD, _local1, _local2);
GameObjects.Render();
Particles.Render(main);
RenderPanel();
Debug.RenderCollision();
Debug.RenderPlayerInfo();
}
public static function Overlay_Show(_arg1:int){
}
static function InitUpdateAIVehicles():void{
nextCarGenPos = 0;
}
static function RenderPanel(){
var _local1:*;
var _local2:*;
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:RoadLabel;
var _local10:int;
var _local11:Number;
var _local12:Number;
var _local13:int;
_local1 = 10;
_local2 = 10;
_local4 = 0;
_local5 = Defs.roadarea_h;
GraphicObjects.RenderAt(GraphicObjects.gfx_panel_back, 0, main.screenBD, 0, _local5);
_local8 = GraphicObjects.gfx_panel_speedo;
_local6 = GraphicObjects.GetNumFrames(_local8);
_local7 = Utils.ScaleTo(0, (_local6 - 1), 0, (player_zmax + player_turboMaxVel), (goPlayer.zvel + goPlayer.turboVel));
GraphicObjects.RenderAt(_local8, int(_local7), main.screenBD, 25, (_local5 + 22));
_local8 = GraphicObjects.gfx_panel_turbo;
_local6 = GraphicObjects.GetNumFrames(_local8);
if (goPlayer.turboMode == 0){
_local7 = (_local6 - 2);
if ((((goPlayer.zvel >= player_turboMinSpeed)) && ((levelTimer & 2)))){
_local7 = (_local6 - 1);
};
} else {
if (goPlayer.turboMode == 1){
_local7 = 0;
} else {
if (goPlayer.turboMode == 2){
_local7 = Utils.ScaleTo((_local6 - 1), 0, 0, player_turboMaxRechargeTime, goPlayer.turboTimer);
};
};
};
GraphicObjects.RenderAt(_local8, int(_local7), main.screenBD, 108, (_local5 + 71));
_local9 = road.GetRoadLabel(currentLabel);
if ((Debug.debugMode & 1)){
_local3 = ((((("fps: " + Utils.DP2(main.fps)) + " ftime: ") + main.fcount) + " updates: ") + numUpdates);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, 10, 0, _local3, 0);
_local3 = ((((((("9 = reset " + Utils.NumberToString2DP((goPlayer.xpos * 0.1))) + " ") + Utils.NumberToString2DP(goPlayer.zpos)) + " ") + Utils.NumberToString2DP(road.renderZPos)) + " ") + road.goalZPos);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, 10, 20, _local3, 0);
_local3 = ((((("level: " + road.name) + " Label ") + _local9.name) + " ") + _local9.zpos);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, 10, 40, _local3, 0);
_local12 = player_zmax;
_local3 = ((("speed: " + Utils.DP3(goPlayer.zvel)) + " / ") + Utils.DP3(_local12));
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, 10, 60, _local3, 0);
_local3 = ((("Turbo: " + goPlayer.turboMode) + " ") + Utils.DP3(goPlayer.turboVel));
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, 10, 80, _local3, 0);
};
_local10 = 0;
while (_local10 < 6) {
_local13 = 0;
if (_local10 == 0){
_local13 = 1;
if (SoundPlayer.doSFX){
_local13 = 0;
};
};
if (_local10 == 1){
_local13 = 1;
if (MusicPlayer.doMusic){
_local13 = 0;
};
};
if ((((((_local10 == 2)) || ((_local10 == 3)))) || ((_local10 == 4)))){
_local13 = 0;
if (ingameMusicChoice == (_local10 - 2)){
_local13 = 1;
};
};
if (_local10 == 5){
if (pause){
_local13 = 1;
};
};
if (_local10 == mouseOverButton){
_local13 = 2;
};
_local13 = (_local13 + (_local10 * 3));
_local1 = panelButtonsPosX[_local10];
_local2 = (panelButtonsPosY + _local5);
GraphicObjects.RenderAt(GraphicObjects.gfx_panel_buttons, _local13, main.screenBD, _local1, _local2);
_local10++;
};
_local1 = 320;
_local2 = (_local5 + 52);
_local3 = Utils.CounterToSecondsString(levelTimer);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font2, (_local1 - 40), (_local2 - 10), _local3, -2);
_local1 = 212;
_local2 = (_local5 + 50);
_local11 = Math.floor(((goPlayer.zvel + goPlayer.turboVel) * speedToMph));
_local3 = _local11.toString();
_local4 = GraphicObjects.GetStringWidth(main.screenBD, GraphicObjects.gfx_font2, _local3, -2);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font2, (_local1 - _local4), (_local2 - 10), _local3, -2);
_local1 = 482;
_local2 = (_local5 + 22);
_local3 = ((("STAGE " + int((currentLevel + 1)).toString()) + " ") + road.name);
_local4 = GraphicObjects.GetStringWidth(main.screenBD, GraphicObjects.gfx_font1, _local3, -2);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, (_local1 - (_local4 / 2)), (_local2 - 10), _local3, -2);
_local1 = 440;
_local2 = (_local5 + 37);
_local3 = "SCORE: ";
_local1 = (_local1 + GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, _local1, (_local2 - 10), _local3, -2));
_local3 = currentScore.toString();
_local4 = GraphicObjects.GetStringWidth(main.screenBD, GraphicObjects.gfx_font1, _local3, -2);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, _local1, (_local2 - 10), _local3, -2);
_local1 = 412;
_local2 = (_local5 + 52);
_local3 = "RACE TIME: ";
_local1 = (_local1 + GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, _local1, (_local2 - 10), _local3, -2));
_local3 = Utils.CounterToSecondsString(totalRaceTime, true);
_local4 = GraphicObjects.GetStringWidth(main.screenBD, GraphicObjects.gfx_font1, _local3, 10, true);
GraphicObjects.RenderStringAt(main.screenBD, GraphicObjects.gfx_font1, _local1, (_local2 - 10), _local3, 10, true);
}
public static function buttonContinuePressed(_arg1:MouseEvent){
var _local2:Array;
var _local3:int;
if (overlaySelected){
return;
};
_local2 = GetNextLevelChoice(currentLevel);
_local3 = _local2[selectedDirection];
route.push(selectedDirection);
overlaySelected = true;
currentLevel = _local3;
levelsUnlocked[currentLevel] = true;
SaveData.Save();
InitLevel();
overlayMC.gotoAndPlay("out");
}
static function InitPlayerVars(){
var _local1:XML;
_local1 = ExternalData.xml.setup[0];
player_xacc = Number(_local1.player.@lracc);
player_xmax = Number(_local1.player.@lrmax);
player_turboMinSpeed = Number(_local1.turbo.@mintriggerspeed);
player_turboMaxTime = (int(_local1.turbo.@time) * Defs.fps);
player_turboMaxRechargeTime = (int(_local1.turbo.@rechargetime) * Defs.fps);
player_turboAccel = Number(_local1.turbo.@accel);
player_turboDecel = Number(_local1.turbo.@decel);
player_turboMaxVel = Number(_local1.turbo.@maxspeed);
player_zacc = Number(_local1.player.@accel);
player_zdec = Number(_local1.player.@decel);
player_zmax = Number(_local1.player.@max);
player_roadpushvelexp = (int(_local1.player.@roadpushvelexp) - 1);
player_roadpush = Number(_local1.player.@roadpush);
player_smokeminvel = Number(_local1.player.@smokeminxvel);
playerupgrade_accel = Number(_local1.upgrade.@accel);
playerupgrade_decel = Number(_local1.upgrade.@decel);
playerupgrade_maxspeed = Number(_local1.upgrade.@max);
playerupgrade_roadpush = Number(_local1.upgrade.@roadpush);
playerupgrade_xacc = Number(_local1.upgrade.@lracc);
playerupgrade_turbomax = Number(_local1.upgrade.@turbomax);
playerupgrade_turborecharge = Number(_local1.upgrade.@turborecharge);
playerupgrade_turbotime = (Number(_local1.upgrade.@turbotime) * Defs.fps);
Upgrades.AddToStats();
}
}
}//package
Section 41
//GameObj (GameObj)
package {
import flash.events.*;
import flash.geom.*;
public class GameObj {
var turboTimer:int;
var revValue:Number;
var graphicID:int;
public var xacc:Number;
var xoffset:Number;
public var active:Boolean;
var angle_x:int;
var angle_y:int;
public var count:int;
var is3DObj:Boolean;
public var xvel:Number;
var braking:Boolean;
var path:Poly;
public var todir:Number;
var flashTimer:int;
public var type:int;
public var ypos:Number;
var minFrame:int;
var maxSpeed:Number;
var timer:Number;
var rotVel:Number;
public var speed:Number;
var yoffset:Number;
var objectDef:ObjectDef;
var startx:Number;
public var ypos2:Number;
var startz:Number;
var scale:Number;
var health:Number;
var starty:Number;
var frame1:Number;
public var movementVec:Vec;
public var yacc:Number;
var maxFrame:int;
var frame:Number;
var crashResetPos:Number;
var turboStartFlag:int;
public var hitTimer:Number;
public var controlIndex:int;
public var subtype:int;
var flashFlag:Boolean;
public var oldxpos:Number;
public var yvel:Number;
var skidVolume:Number;// = 0
public var name:String;
var timer1:Number;
public var dir:Number;
public var renderFunction:Function;
public var radius:Number;
public var visible:Boolean;
public var zpos:Number;
var graphicID1:int;
public var toPosX:Number;
public var controlMode:int;
public var origspeed:Number;
public var toPosY:Number;
public var driveVec:Vec;
var isPlayer:Boolean;
public var xvel2:Number;
var turboVel:Number;
var main:Main;
public var updateFunction:Function;
public var zacc:Number;
var beenOvertaken:Boolean;
var zveloff:Number;
var dist:Number;
public var xpos2:Number;
var inFrontZone:Poly;
var turboSide:Boolean;
public var xpos:Number;
var timerMax:Number;
public var oldypos:Number;
public var zvel:Number;
var xflip:Boolean;
var turboMode:int;
var parentObj:GameObj;
var flashTimerMax:int;
public var frameVel:Number;
var isAiVehicle:Boolean;
var currentMaxSpeed:Number;
static var turboOffsetsX:Array = new Array(81, 62, 51, 39, 27, 15, -11, 85, 64, 52, 41, 29, 16, -11, 86, 66, 55, 42, 30, 16, -11, 87, 67, 55, 43, 29, 16, -10, 89, 67, 56, 44, 30, 17, -11);
static var turboOffsetsY:Array = new Array(29, 23, 19, 17, 19, 23, 29, 28, 23, 21, 20, 21, 23, 28, 32, 28, 27, 26, 27, 28, 32, 37, 36, 34, 34, 34, 36, 37, 46, 45, 44, 44, 44, 45, 46);
public function GameObj(_arg1, _arg2, _arg3){
skidVolume = 0;
super();
xpos = _arg2;
ypos = _arg3;
zpos = 1;
starty = _arg2;
startx = _arg2;
active = false;
main = _arg1;
zpos = 0;
graphicID = 0;
frame = 0;
frameVel = 0;
controlIndex = 0;
timer = 0;
timer1 = 0;
radius = 14;
minFrame = 0;
maxFrame = 0;
movementVec = new Vec();
}
public function UpdateCarSurface(){
var _local1:int;
_local1 = Game.road.GetRoadSurfaceType(zpos);
if (_local1 == 1){
if (ypos == 0){
yvel = Utils.RandBetweenFloat(3, 5);
};
};
yvel = (yvel - 1);
ypos = (ypos + yvel);
if (ypos <= 0){
ypos = 0;
};
}
function IsInWorld(_arg1:Number):Boolean{
if (xpos < (0 - _arg1)){
return (false);
};
if (ypos < (0 - _arg1)){
return (false);
};
if (xpos > (Defs.displayarea_w + _arg1)){
return (false);
};
if (ypos > (Defs.displayarea_h + _arg1)){
return (false);
};
return (true);
}
function UpdateOverlay(){
if (controlMode == 1){
timer1--;
if (timer1 <= 0){
controlMode = 0;
visible = true;
};
return;
};
scale = (scale + ((1 - scale) * 0.1));
timer--;
if (timer <= 0){
active = false;
};
}
public function GetVelFromDir(_arg1:Number){
xvel = (Math.cos(dir) * _arg1);
yvel = (Math.sin(dir) * _arg1);
}
public function UpdateAIVehicle(){
var _local1:RoadSeg;
var _local2:Number;
var _local3:Number;
if (Game.levelState == Game.levelState_LevelStart){
return;
};
zvel = (zvel + zacc);
if (zvel > speed){
zvel = speed;
};
zpos = (zpos + zvel);
if (zpos < (Game.goPlayer.zpos - Game.ai_cutoffbehindplayer)){
active = false;
};
if (zpos > (Game.goPlayer.zpos + Game.ai_cutoffinfrontofplayer)){
active = false;
};
_local1 = Game.road.GetRoadSeg(zpos);
_local2 = (-0.9 * _local1.width);
_local3 = (0.9 * _local1.width);
if (_local1.rangeMin <= 1){
if (xpos < 0){
_local2 = (-0.9 * _local1.width);
_local3 = (_local1.rangeMin * _local1.width);
} else {
_local2 = (_local1.rangeMax * _local1.width);
_local3 = (0.9 * _local1.width);
};
};
if (xpos > _local3){
xpos = (xpos - 10);
};
if (xpos < _local2){
xpos = (xpos + 10);
};
GetCarRoadPush();
UpdateCarSurface();
}
public function Init(_arg1:int):void{
var _local2:int;
var _local3:Number;
_local2 = 0;
_local3 = 0;
type = _arg1;
controlMode = _local2;
xvel = _local3;
yvel = _local3;
frame = _local3;
frameVel = _local3;
timer = _local3;
hitTimer = _local3;
flashTimer = _local2;
flashFlag = false;
dir = 0;
todir = 0;
health = 1;
zvel = 0;
name = "";
scale = 1;
objectDef = null;
xflip = false;
updateFunction = null;
renderFunction = null;
visible = true;
is3DObj = false;
isPlayer = false;
isAiVehicle = false;
}
public function UpdatePlayer():void{
var _local1:Boolean;
var _local2:Boolean;
var _local3:Boolean;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:int;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:BillboardCollision;
var _local26:Number;
_local1 = false;
_local2 = false;
_local3 = false;
_local4 = false;
_local5 = false;
if (KeyReader.Down(KeyReader.KEY_LEFT)){
_local1 = true;
};
if (KeyReader.Down(KeyReader.KEY_RIGHT)){
_local2 = true;
};
if (KeyReader.Down(KeyReader.KEY_UP)){
_local3 = true;
};
if (KeyReader.Pressed(KeyReader.KEY_SPACE)){
_local4 = true;
};
if (KeyReader.Down(KeyReader.KEY_DOWN)){
_local5 = true;
};
if (KeyReader.Pressed(KeyReader.KEY_X)){
_local4 = true;
};
if (KeyReader.Down(KeyReader.KEY_A)){
_local1 = true;
};
if (KeyReader.Down(KeyReader.KEY_D)){
_local2 = true;
};
if (KeyReader.Down(KeyReader.KEY_S)){
_local5 = true;
};
if (KeyReader.Down(KeyReader.KEY_W)){
_local3 = true;
};
if (_local3){
revValue = (revValue + 0.01);
};
if (!_local3){
revValue = (revValue - 0.01);
};
revValue = Utils.Clamp(0, 1, revValue);
_local6 = Utils.ScaleTo(0.02, 0.2, 0, 1, revValue);
if (Game.overlayMC != null){
_local6 = 0;
revValue = 0;
};
if (controlMode == 2){
revValue = 0;
_local6 = 0;
};
if (Game.levelState == Game.levelState_TimeRunOut){
revValue = 0;
_local6 = 0;
};
SoundPlayer.SetVolume(Game.engineSound0, _local6);
if (Game.levelState == Game.levelState_LevelStart){
if (turboStartFlag == 0){
if (_local3){
turboStartFlag = 1;
_local16 = (Defs.fps * 2.6);
_local17 = (Defs.fps * 3);
trace(((((Game.levelStateTimer2 + " ") + _local16) + " ") + _local17));
if ((((Game.levelStateTimer2 >= _local16)) && ((Game.levelStateTimer2 <= _local17)))){
Stats.SetLevelStat(Game.currentLevel, "turbostart", 1);
turboStartFlag = 2;
};
};
};
Game.road.camHeight = (Game.road.camHeight + ((Game.road.raceCamHeight - Game.road.camHeight) * 0.08));
if (Game.road.renderZPos < zpos){
_local18 = ((zpos - Game.road.renderZPos) * 0.05);
if (_local18 < 1){
_local18 = 1;
};
Game.road.renderZPos = (Game.road.renderZPos + _local18);
};
return;
};
if (Game.road == null){
return;
};
if (turboStartFlag == 2){
UpdateGenTurboFire();
turboStartFlag = 3;
turboTimer = (2 * Defs.fps);
turboMode = 1;
turboVel = 0;
Game.InitPreRaceOverlay(4, Defs.fps);
SoundPlayer.Play(SoundPlayer.SOUND_TURBO);
};
braking = false;
_local7 = 1500;
_local8 = Game.player_xacc;
_local9 = Game.player_xmax;
_local10 = Game.player_turboMinSpeed;
_local11 = Game.player_turboMaxTime;
_local12 = Game.player_turboMaxRechargeTime;
_local13 = Game.player_turboAccel;
_local14 = Game.player_turboDecel;
_local15 = Game.player_turboMaxVel;
if (turboMode == 0){
if ((((zvel >= _local10)) && (_local4))){
UpdateGenTurboFire();
turboTimer = _local11;
turboMode = 1;
turboVel = 0;
Game.InitPreRaceOverlay(3);
SoundPlayer.Play(SoundPlayer.SOUND_TURBO);
};
} else {
if (turboMode == 1){
turboVel = (turboVel + _local13);
if (turboVel >= _local15){
turboVel = _local15;
};
turboTimer--;
if (turboTimer <= 0){
turboMode = 2;
turboTimer = _local12;
};
} else {
if (turboMode == 2){
turboVel = (turboVel - _local14);
if (turboVel <= 0){
turboVel = 0;
};
turboTimer--;
if (turboTimer <= 0){
turboMode = 0;
};
};
};
};
if (controlMode == 0){
if (_local1){
if (zvel > 0){
xvel = (xvel - _local8);
if (xvel < -(_local9)){
xvel = -(_local9);
};
};
} else {
if (_local2){
if (zvel > 0){
xvel = (xvel + _local8);
if (xvel > _local9){
xvel = _local9;
};
};
} else {
if (xvel > 0){
xvel = (xvel - _local8);
if (xvel < 0){
xvel = 0;
};
} else {
xvel = (xvel + _local8);
if (xvel > 0){
xvel = 0;
};
};
};
};
xpos = (xpos + xvel);
xpos = (xpos - GetCarRoadPush());
if (xpos > _local7){
xpos = _local7;
};
if (xpos < -(_local7)){
xpos = -(_local7);
};
_local19 = Game.road.GetRoadChangeX(zpos);
if (zvel == 0){
_local19 = 0;
};
Game.playerRot = (Game.playerRot - (_local19 * 40));
if (Game.playerRot > 0x0500){
Game.playerRot = (Game.playerRot - 0x0500);
};
if (Game.playerRot < 0){
Game.playerRot = (Game.playerRot + 0x0500);
};
_local20 = Game.player_zacc;
_local21 = Game.player_zdec;
_local22 = (Game.player_zdec * 2);
_local23 = Game.player_zmax;
_local24 = Game.road.GetRoadWidth(zpos);
if ((((xpos < -(_local24))) || ((xpos > _local24)))){
_local23 = (_local23 * 0.75);
GenerateSideParticles();
};
if (Game.levelState == Game.levelState_TimeRunOut){
_local3 = false;
};
if (_local3){
_local26 = ((1 / _local23) * zvel);
_local26 = (1 - _local26);
if (_local26 < 0.1){
_local26 = 0.1;
};
zvel = (zvel + (_local20 * _local26));
} else {
if (_local5){
Stats.AddLevelStat(Game.currentLevel, "braketime", 1);
zvel = (zvel - _local22);
if (zvel <= 0){
zvel = 0;
};
braking = true;
} else {
zvel = (zvel - _local21);
if (zvel < 0){
zvel = 0;
};
};
};
if (zvel >= _local23){
Stats.AddLevelStat(Game.currentLevel, "timeatfullspeed", (1 / Defs.fps));
zvel = _local23;
};
Game.AddScore((((zvel + turboVel) * (zvel + turboVel)) * 0.1));
zpos = (zpos + (zvel + turboVel));
Game.road.renderZPos = zpos;
UpdateCarSurface();
_local25 = Game.CarSceneryCollision(this);
if (_local25 != null){
PlayerResetTurbo();
if (_local25.type == 1){
controlMode = 1;
graphicID = GraphicObjects.gfx_playerspin;
frame = 0;
frameVel = 0.4;
SoundPlayer.Play(SoundPlayer.SOUND_CRASH);
} else {
if (_local25.type == 2){
controlMode = 2;
graphicID = GraphicObjects.gfx_playercrash;
frame = 0;
frameVel = 0.3;
SoundPlayer.Play(SoundPlayer.SOUND_BIGCRASH);
Stats.AddLevelStat(Game.currentLevel, "crashes", 1);
};
};
};
} else {
if (controlMode == 1){
if (PlayAnimation()){
controlMode = 0;
graphicID = GraphicObjects.gfx_player;
};
xvel = 0;
if (_local1){
xvel = -5;
};
if (_local2){
xvel = 5;
};
xpos = (xpos + xvel);
zvel = (zvel - 0.04);
zpos = (zpos + zvel);
Game.road.renderZPos = zpos;
skidVolume = 0;
} else {
if (controlMode == 2){
xvel = 0;
if (PlayAnimation()){
};
zvel = (zvel - 0.1);
zpos = (zpos + zvel);
Game.road.renderZPos = zpos;
if (zvel < 0){
if (xpos < 0){
crashResetPos = -200;
} else {
crashResetPos = 200;
};
zvel = 0;
controlMode = 3;
graphicID = GraphicObjects.gfx_player;
};
skidVolume = 0;
} else {
if (controlMode == 3){
xpos = (xpos + ((crashResetPos - xpos) * 0.1));
if (Math.abs((xpos - crashResetPos)) < 2){
controlMode = 0;
};
};
};
};
};
SoundPlayer.SetVolume(Game.skidSound0, skidVolume);
}
public function GetCarRoadPush():Number{
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:int;
var _local5:*;
var _local6:Number;
var _local7:int;
var _local8:GameObj;
_local1 = Game.road.GetRoadChangeX(zpos);
_local2 = zvel;
_local4 = Game.player_roadpushvelexp;
_local3 = 0;
while (_local3 < (_local4 - 1)) {
_local2 = (_local2 * _local2);
_local3++;
};
_local5 = ((_local1 * _local2) * Game.player_roadpush);
if (isPlayer){
if (Math.abs(_local5) > Game.player_smokeminvel){
skidVolume = (skidVolume + 0.1);
if (skidVolume > 1){
skidVolume = 1;
};
} else {
skidVolume = (skidVolume - 0.1);
if (skidVolume < 0){
skidVolume = 0;
};
};
_local6 = Game.road.GetRoadWidth(zpos);
if ((((xpos >= -(_local6))) && ((xpos <= _local6)))){
if (Math.abs(_local5) > Game.player_smokeminvel){
_local7 = Game.road.GetRoadSurfaceSplashM(zpos);
if (Utils.RandBetweenInt(0, 1000) > 300){
_local8 = GameObjects.AddObj((xpos - 50), ypos, zpos);
_local8.InitSkidSmoke(this, _local5, _local7);
};
if (Utils.RandBetweenInt(0, 1000) > 300){
_local8 = GameObjects.AddObj((xpos + 50), ypos, zpos);
_local8.InitSkidSmoke(this, _local5, _local7);
};
};
};
};
return (_local5);
}
public function InitTurboFire(_arg1:GameObj, _arg2:Number, _arg3:Boolean){
is3DObj = true;
xflip = false;
turboSide = _arg3;
graphicID = GraphicObjects.gfx_turbofire;
updateFunction = UpdateTurboFire;
frame = 0;
frameVel = 1;
xvel = _arg1.xvel;
zvel = _arg1.zvel;
xvel = -(_arg2);
parentObj = _arg1;
}
function UpdateGravity(){
yvel = (yvel + Game.gravity);
if (yvel > 6){
yvel = Game.maxFallSpeed;
};
ypos = (ypos + yvel);
}
public function InitPlayer(){
is3DObj = true;
visible = false;
ypos = 0;
yvel = 0;
xvel = 0;
graphicID = GraphicObjects.gfx_player;
isPlayer = true;
PlayerResetTurbo();
skidVolume = 0;
revValue = 0;
angle_x = 0;
angle_y = 0;
turboStartFlag = 0;
}
public function InitOverlay(_arg1:int, _arg2:int){
graphicID = GraphicObjects.gfx_preraceoverlay;
updateFunction = UpdateOverlay;
frame = _arg1;
timer = (Defs.fps * 0.7);
scale = 4;
if (_arg2 != 0){
controlMode = 1;
timer1 = _arg2;
visible = false;
};
}
function Anim_FromVel():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:*;
_local1 = GraphicObjects.GetNumFrames(graphicID);
_local2 = xvel;
_local3 = yvel;
_local4 = Math.atan2(_local3, _local2);
frame = ((_local1 / (Math.PI * 2)) * -(_local4));
if (frame < 0){
frame = (frame + _local1);
};
if (frame > _local1){
frame = (frame - _local1);
};
frame = (frame + (_local1 / 2));
if (frame > _local1){
frame = (frame - _local1);
};
}
public function InitSkidSmoke(_arg1:GameObj, _arg2:Number, _arg3:int){
is3DObj = true;
graphicID = (GraphicObjects.gfx_skidsmoke + _arg3);
updateFunction = UpdateSkidSmoke;
frame = 0;
frameVel = 1;
xpos = (xpos + (_arg1.angle_x * -25));
xpos = (xpos + Utils.RandBetweenFloat(-5, 5));
ypos = (ypos + Utils.RandBetweenFloat(0, -2));
xvel = _arg1.xvel;
zvel = _arg1.zvel;
xvel = -(_arg2);
}
function RenderBlockCollision():void{
var _local1:Rectangle;
var _local2:Rectangle;
if ((Debug.debugMode & 4) == 0){
return;
};
if (objectDef == null){
return;
};
if (objectDef.colRects.length == 0){
return;
};
for each (_local2 in objectDef.colRects) {
_local1 = _local2.clone();
_local1.x = (_local1.x + xpos);
_local1.y = (_local1.y + ypos);
_local1.x = (_local1.x - Game.scrollX);
_local1.y = (_local1.y - Game.scrollY);
main.screenBD.fillRect(_local1, 1082163328);
};
for each (_local2 in objectDef.shieldColRects) {
_local1 = _local2.clone();
_local1.x = (_local1.x + xpos);
_local1.y = (_local1.y + ypos);
_local1.x = (_local1.x - Game.scrollX);
_local1.y = (_local1.y - Game.scrollY);
main.screenBD.fillRect(_local1, 1082163200);
};
}
public function CycleAnimation():void{
var _local1:Number;
var _local2:int;
_local1 = frameVel;
_local2 = GraphicObjects.GetNumFrames(graphicID);
frame = (frame + _local1);
if (frame >= _local2){
frame = (frame - _local2);
};
if (frame < 0){
frame = (frame + _local2);
};
}
function GenerateSideParticles(){
var _local1:int;
var _local2:GameObj;
if (zvel < 1){
return;
};
_local1 = 0;
if (xpos < 0){
_local1 = Game.road.GetRoadSurfaceSplashL(zpos);
} else {
_local1 = Game.road.GetRoadSurfaceSplashR(zpos);
};
if (Utils.RandBetweenInt(0, 1000) > 300){
_local2 = GameObjects.AddObj((xpos - 50), ypos, zpos);
_local2.InitSkidSmoke(this, 0, _local1);
};
if (Utils.RandBetweenInt(0, 1000) > 300){
_local2 = GameObjects.AddObj((xpos + 50), ypos, zpos);
_local2.InitSkidSmoke(this, 0, _local1);
};
}
public function PlayAnimationEx():Boolean{
var _local1:Boolean;
var _local2:*;
_local1 = false;
frame = (frame + frameVel);
_local2 = (maxFrame - minFrame);
if (frame > maxFrame){
if (frame > maxFrame){
frame = maxFrame;
_local1 = true;
};
};
if (frame < minFrame){
frame = minFrame;
_local1 = true;
};
return (_local1);
}
function RenderNormally(){
if (is3DObj){
return;
};
if (scale != 1){
GraphicObjects.RenderAtScaled(graphicID, frame, main.screenBD, xpos, ypos, xflip, scale);
} else {
GraphicObjects.RenderAt(graphicID, frame, main.screenBD, xpos, ypos, xflip);
};
}
public function PlayAnimation():Boolean{
var _local1:int;
_local1 = (GraphicObjects.GetNumFrames(graphicID) - 1);
frame = (frame + frameVel);
if (frame > _local1){
frame = _local1;
return (true);
};
return (false);
}
function UpdateGenTurboFire(){
var _local1:GameObj;
_local1 = GameObjects.AddObj(0, 0, (zpos - 10));
_local1.InitTurboFire(this, 0, false);
_local1 = GameObjects.AddObj(0, 0, (zpos - 10));
_local1.InitTurboFire(this, 0, true);
}
function UpdateTurboFire(){
var _local1:int;
var _local2:int;
var _local3:int;
zpos = parentObj.zpos;
_local1 = int(Math.floor(parentObj.frame));
ypos = parentObj.ypos;
if (turboSide == false){
_local2 = (_local1 / 7);
_local3 = (_local1 % 7);
_local1 = ((_local2 * 7) + (6 - _local3));
};
xpos = (parentObj.xpos + turboOffsetsX[_local1]);
if (turboSide == false){
xpos = (parentObj.xpos - turboOffsetsX[_local1]);
};
ypos = (ypos + turboOffsetsY[_local1]);
CycleAnimation();
if (parentObj.turboMode != 1){
active = false;
};
}
public function GetDirBetween(_arg1, _arg2, _arg3, _arg4):Number{
var _local5:*;
_local5 = Math.atan2((_arg4 - _arg2), (_arg3 - _arg1));
return (_local5);
}
public function CycleAnimationEx():Boolean{
var _local1:Boolean;
var _local2:*;
_local1 = false;
frame = (frame + frameVel);
_local2 = (maxFrame - minFrame);
if (frame > maxFrame){
frame = (frame - _local2);
_local1 = true;
};
if (frame < minFrame){
frame = (frame + _local2);
_local1 = true;
};
return (_local1);
}
public function Render():void{
if (visible == false){
return;
};
if (renderFunction != null){
renderFunction();
} else {
RenderNormally();
};
}
public function InitAIVehicle(_arg1:int=0, _arg2:Boolean=false){
var _local3:RoadSeg;
var _local4:AICarInfo;
beenOvertaken = false;
isAiVehicle = true;
updateFunction = UpdateAIVehicle;
visible = false;
type = _arg1;
_local3 = Game.road.GetRoadSeg(zpos);
xpos = Utils.RandBetweenFloat((-0.9 * _local3.width), (0.9 * _local3.width));
if (_local3.rangeMin <= 1){
if (Utils.RandBetweenInt(0, 100) < 50){
xpos = (Utils.RandBetweenFloat(-0.9, _local3.rangeMin) * _local3.width);
} else {
xpos = (Utils.RandBetweenFloat(_local3.rangeMax, 0.9) * _local3.width);
};
};
ypos = 0;
zpos = (Game.goPlayer.zpos + Game.ai_gendist);
xvel = Utils.RandBetweenFloat(-5, 5);
xvel2 = xvel;
is3DObj = true;
graphicID = (GraphicObjects.gfx_aivehicle00 + type);
frame = 0;
timer = 0;
zveloff = 0;
yvel = 0;
ypos = 0;
_local4 = Game.ai_carInfoList[type];
zacc = _local4.accel;
zvel = Utils.RandBetweenFloat(_local4.maxRangeMin, _local4.maxRangeMax);
speed = zvel;
if (_arg2){
zvel = 0;
};
}
function RenderWallCollision():void{
var _local1:int;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if ((Debug.debugMode & 8) == 0){
return;
};
if (objectDef == null){
return;
};
if (objectDef.collisionCircleOffsets.length == 0){
return;
};
_local1 = 0;
while (_local1 < objectDef.collisionCircleOffsets.length) {
_local2 = objectDef.collisionCircleOffsets[_local1].x;
_local3 = objectDef.collisionCircleOffsets[_local1].y;
_local4 = objectDef.collisionCircleRadii[_local1];
_local2 = (_local2 + xpos);
_local2 = (_local2 - Game.scrollX);
_local3 = (_local3 + ypos);
_local3 = (_local3 - Game.scrollY);
Utils.RenderCircle(main.screenBD, _local2, _local3, _local4, 4294967295);
_local1++;
};
}
function SetAnim(_arg1:int){
var _local2:int;
graphicID = _arg1;
_local2 = (GraphicObjects.GetNumFrames(graphicID) - 1);
if (frame >= _local2){
frame = 0;
};
}
public function Update():void{
oldxpos = xpos;
oldypos = ypos;
if (updateFunction != null){
updateFunction();
};
}
function UpdateSkidSmoke(){
zvel = (zvel * 0.99);
xvel = (xvel * 0.99);
xpos = (xpos + xvel);
zpos = (zpos + zvel);
if (PlayAnimation()){
active = false;
};
}
public function PlayerResetTurbo(){
turboMode = 2;
turboVel = 0;
turboTimer = Game.player_turboMaxRechargeTime;
}
}
}//package
Section 42
//GameObjects (GameObjects)
package {
import flash.events.*;
class GameObjects {
public static var numobjs;
static var m:Main;
public static var zorder:Array;
public static var objs:Array;
public function GameObjGroup(){
}
public static function Update():void{
var _local1:int;
_local1 = 0;
while (_local1 < objs.length) {
if (objs[_local1].active == true){
objs[_local1].Update();
};
_local1++;
};
}
public static function ForEachActive(_arg1:Function):void{
var _local2:GameObj;
var _local3:Array;
_local3 = new Array();
for each (_local2 in objs) {
if (_local2.active){
_arg1(_local2);
};
};
}
public static function InitOnce(_arg1:Main, _arg2:int){
var _local3:*;
numobjs = _arg2;
m = _arg1;
objs = new Array();
zorder = new Array(numobjs);
_local3 = 0;
while (_local3 < numobjs) {
objs.push(new GameObj(m, 0, 0));
_local3++;
};
}
public static function ClearAll(){
var _local1:int;
_local1 = 0;
while (_local1 < numobjs) {
objs[_local1].active = false;
_local1++;
};
}
public static function AddObj(_arg1:Number, _arg2:Number, _arg3:Number):GameObj{
var _local4:int;
var _local5:GameObj;
_local4 = 0;
while (_local4 < numobjs) {
if (objs[_local4].active == false){
_local5 = objs[_local4];
_local5.active = true;
_local5.zpos = _arg3;
_local5.xpos = _arg1;
_local5.ypos = _arg2;
_local5.startx = _arg1;
_local5.starty = _arg2;
_local5.startz = _arg3;
_local5.Init(0);
return (objs[_local4]);
};
_local4++;
};
trace("ERROR! NO FREE OBJECTS");
return (null);
}
public static function Render():void{
var _local1:GameObj;
var _local2:Array;
_local2 = new Array();
for each (_local1 in objs) {
if (((_local1.active) && (_local1.visible))){
_local2.push(_local1);
};
};
_local2.sortOn("zpos", (Array.NUMERIC | Array.DESCENDING));
for each (_local1 in _local2) {
_local1.Render();
};
}
}
}//package
Section 43
//GameOverFailScreen (GameOverFailScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class GameOverFailScreen extends MovieClip {
public var textScore:TextField;
public var buttonGameNinja:MovieClip;
public var buttonSubmitScore:MovieClip;
public var buttonContinue:SimpleButton;
public function GameOverFailScreen(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 44
//GraphicObjects (GraphicObjects)
package {
import flash.display.*;
import flash.text.*;
import flash.geom.*;
public class GraphicObjects {
public static const gfx_panel_buttons = 83;
public static const gfx_turbofire = 62;
public static const gfx_skidsmoke01 = 71;
public static const gfx_skidsmoke02 = 72;
public static const gfx_skidsmoke03 = 73;
public static const gfx_skidsmoke04 = 74;
public static const gfx_skidsmoke05 = 75;
public static const gfx_skidsmoke07 = 77;
public static const gfx_skidsmoke08 = 78;
public static const gfx_skidsmoke06 = 76;
public static const gfx_playerbrake = 13;
public static const gfx_playerspin = 11;
public static const gfx_aivehicle00 = 40;
public static const gfx_aivehicle01 = 41;
public static const gfx_aivehicle03 = 43;
public static const gfx_aivehicle04 = 44;
public static const gfx_aivehicle05 = 45;
public static const gfx_aivehicle02 = 42;
public static const gfx_objects = 20;
public static const gfx_panel_turbo = 82;
public static const road_maxw:int = 1300;
public static const gfx_preraceoverlay = 63;
public static const gfx_player = 10;
public static const gfx_font1 = 190;
public static const gfx_font2 = 191;
public static const gfx_font3 = 192;
public static const gfx_scaletest = 61;
public static const gfx_billboards = 30;
public static const gfx_skidsmoke = 70;
public static const gfx_playercrash = 12;
public static const gfx_panel_speedo = 81;
public static const gfx_background = 50;
public static const gfx_panel_back = 80;
public static const gfx_fontblack = 193;
static var count:int;
public static var stringCharBitmap:Bitmap;
public static var stringCharX:Number;
static var graphicobjs:Array;
public static var stringCharY:Number;
static var idList:Array;
static var scanLines:Array;
static var main:Main;
public static function RenderStringAt(_arg1:BitmapData, _arg2:int, _arg3:Number, _arg4:Number, _arg5:String, _arg6:int=0, _arg7:Boolean=false):int{
var _local8:int;
var _local9:int;
var _local10:int;
_local8 = 0;
stringCharX = _arg3;
stringCharY = _arg4;
_local9 = 0;
while (_local9 < _arg5.length) {
_local10 = int(_arg5.charCodeAt(_local9));
if (_local10 < 0){
_local10 = 0;
};
if (_local10 > 127){
_local10 = 127;
};
RenderAt(_arg2, _local10, _arg1, stringCharX, stringCharY);
if (_arg7){
stringCharX = (stringCharX + _arg6);
_local8 = (_local8 + _arg6);
} else {
stringCharBitmap = GetBitmap(_arg2, _local10);
stringCharX = (stringCharX + stringCharBitmap.width);
stringCharX = (stringCharX + _arg6);
_local8 = (_local8 + stringCharBitmap.width);
_local8 = (_local8 + _arg6);
};
_local9++;
};
return (_local8);
}
public static function GetBitmap(_arg1:int, _arg2:int, _arg3:Boolean=false):Bitmap{
var _local4:int;
_local4 = idList[_arg1];
if (_arg3){
return (graphicobjs[_local4].frames[_arg2].bitmaps[1]);
};
return (graphicobjs[_local4].frames[_arg2].bitmaps[0]);
}
public static function RenderAtSplit(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number){
var _local6:int;
_local6 = idList[_arg1];
graphicobjs[_local6].frames[_arg2].RenderAtSplit(_arg3, _arg4, _arg5);
}
public static function GetXOffset(_arg1:int, _arg2:int, _arg3:Boolean=false):Number{
var _local4:int;
_local4 = idList[_arg1];
if (_arg3){
return (graphicobjs[_local4].frames[_arg2].xoffsets[1]);
};
return (graphicobjs[_local4].frames[_arg2].xoffsets[0]);
}
public static function GetStringWidth(_arg1:BitmapData, _arg2:int, _arg3:String, _arg4:int=0, _arg5:Boolean=false):int{
var _local6:int;
var _local7:int;
var _local8:int;
_local6 = 0;
_local7 = 0;
while (_local7 < _arg3.length) {
_local8 = int(_arg3.charCodeAt(_local7));
if (_local8 < 0){
_local8 = 0;
};
if (_local8 > 127){
_local8 = 127;
};
if (_arg5){
_local6 = (_local6 + _arg4);
} else {
stringCharBitmap = GetBitmap(_arg2, _local8);
_local6 = (_local6 + stringCharBitmap.width);
_local6 = (_local6 + _arg4);
};
_local7++;
};
return (_local6);
}
public static function GetWidth(_arg1:int, _arg2:int, _arg3:Boolean=false):int{
var _local4:int;
_local4 = idList[_arg1];
if (_arg3){
return (graphicobjs[_local4].frames[_arg2].bitmaps[1].width);
};
return (graphicobjs[_local4].frames[_arg2].bitmaps[0].width);
}
public static function RenderNumberAt(_arg1:BitmapData, _arg2:int, _arg3:Number, _arg4:Number, _arg5:int){
var _local6:Array;
var _local7:int;
var _local8:int;
var _local9:Boolean;
var _local10:int;
var _local11:int;
var _local12:Bitmap;
_local6 = new Array();
_local7 = _arg5;
_local8 = 0;
while (_local8 < 11) {
_local10 = (_local7 % 10);
_local6.push(_local10);
_local7 = (_local7 / 10);
_local8++;
};
_local9 = false;
_local8 = (_local6.length - 1);
while (_local8--) {
_local11 = _local6[_local8];
if ((((_local9 == false)) && (!((_local11 == 0))))){
_local9 = true;
};
if (_local9){
RenderAt(_arg2, (_local11 + 48), _arg1, _arg3, _arg4);
_local12 = GetBitmap(_arg2, (_local11 + 48));
_arg3 = (_arg3 + _local12.width);
};
(_local8 >= 0);
};
return (_arg3);
}
public static function GetNumFrames(_arg1:int):int{
var _local2:int;
_local2 = idList[_arg1];
return (graphicobjs[_local2].frames.length);
}
public static function RenderAtScaled(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:Number=1){
var _local8:int;
_local8 = idList[_arg1];
graphicobjs[_local8].frames[_arg2].RenderAtScaled(_arg3, _arg4, _arg5, _arg6, _arg7);
}
public static function AddScanLineBitmapScaled(_arg1:MovieClip){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Bitmap;
var _local8:BitmapData;
var _local9:Matrix;
var _local10:Bitmap;
var _local11:BitmapData;
var _local12:Matrix;
var _local13:Bitmap;
var _local14:BitmapData;
var _local15:Number;
scanLines = new Array();
_arg1.gotoAndStop(1);
_arg1.width;
_local2 = _arg1.width;
_local3 = _arg1.height;
_local3 = (_local3 - 4);
_local7 = new Bitmap();
_local8 = new BitmapData(_local2, _local3, false, 0);
_local8.draw(_arg1);
_local7.bitmapData = _local8;
_local9 = new Matrix();
_local4 = 0;
while (_local4 < _local3) {
_local10 = new Bitmap();
_local11 = new BitmapData(_local2, 1, false, 0);
_local12 = new Matrix();
_local12.translate(0, -(_local4));
_local11.draw(_local8, _local12, null, null, null, true);
_local13 = new Bitmap();
_local14 = new BitmapData(road_maxw, road_maxw, false, 0);
_local6 = 1;
while (_local6 < road_maxw) {
_local9.identity();
_local15 = (Number(_local6) / road_maxw);
_local9.scale(_local15, 1);
_local9.translate(0, _local6);
_local14.draw(_local11, _local9, null, null, null, true);
_local6++;
};
_local13.bitmapData = _local14;
scanLines.push(_local13);
_local4++;
};
}
public static function RenderAtAlpha(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAtAlpha(_arg3, _arg4, _arg5, _arg6);
}
public static function GetYOffset(_arg1:int, _arg2:int, _arg3:Boolean=false):Number{
var _local4:int;
_local4 = idList[_arg1];
if (_arg3){
return (graphicobjs[_local4].frames[_arg2].yoffsets[1]);
};
return (graphicobjs[_local4].frames[_arg2].yoffsets[0]);
}
public static function GetPixelAt(_arg1:int, _arg2:int, _arg3:int, _arg4:int):uint{
var _local5:int;
var _local6:Bitmap;
var _local7:uint;
_local5 = idList[_arg1];
_local6 = graphicobjs[_local5].frames[_arg2].bitmaps[0];
_local7 = _local6.bitmapData.getPixel32(_arg3, _arg4);
return (_local7);
}
public static function AddFont(_arg1:int, _arg2:TextFormat):void{
var _local3:DisplayObj;
_local3 = new DisplayObj(null, 0, 0);
_local3.CreateFont(_arg2);
idList[_arg1] = count;
graphicobjs.push(_local3);
count++;
}
public static function GetHeught(_arg1:int, _arg2:int, _arg3:Boolean=false):int{
var _local4:int;
_local4 = idList[_arg1];
if (_arg3){
return (graphicobjs[_local4].frames[_arg2].bitmaps[1].height);
};
return (graphicobjs[_local4].frames[_arg2].bitmaps[0].height);
}
public static function RenderAtAdditive(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAtAdditive(_arg3, _arg4, _arg5, _arg6);
}
public static function GetScanLineBitmap(_arg1:int):Bitmap{
return (scanLines[_arg1]);
}
public static function AddScanLineBitmap(_arg1:MovieClip){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Bitmap;
var _local7:BitmapData;
var _local8:Bitmap;
var _local9:BitmapData;
var _local10:Matrix;
scanLines = new Array();
_arg1.gotoAndStop(1);
_local2 = _arg1.width;
_local3 = _arg1.height;
_local6 = new Bitmap();
_local7 = new BitmapData(_local2, _local3, false, 0);
_local7.draw(_arg1);
_local6.bitmapData = _local7;
_local4 = 0;
while (_local4 < _local3) {
_local8 = new Bitmap();
_local9 = new BitmapData(_local2, 1, false, 0);
_local10 = new Matrix();
_local10.translate(0, -(_local4));
_local9.draw(_local7, _local10);
_local8.bitmapData = _local9;
scanLines.push(_local8);
_local4++;
};
}
public static function RenderAtRot(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean){
var _local8:int;
_local8 = idList[_arg1];
if (_arg7){
graphicobjs[_local8].frames[_arg2].RenderAtRotBurned(_arg3, _arg4, _arg5, _arg6);
} else {
graphicobjs[_local8].frames[_arg2].RenderAtRot(_arg3, _arg4, _arg5, _arg6);
};
}
public static function RenderAtRotScaled(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false, _arg7:Number=1, _arg8:Number=0){
var _local9:int;
_local9 = idList[_arg1];
graphicobjs[_local9].frames[_arg2].RenderAtRotScaled(_arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public static function RenderAt(_arg1:int, _arg2:int, _arg3:BitmapData, _arg4:Number, _arg5:Number, _arg6:Boolean=false){
var _local7:int;
_local7 = idList[_arg1];
graphicobjs[_local7].frames[_arg2].RenderAt(_arg3, _arg4, _arg5, _arg6);
}
public static function Add(_arg1:int, _arg2:DisplayObj):void{
idList[_arg1] = count;
graphicobjs.push(_arg2);
count++;
}
public static function InitOnce(_arg1:Main):void{
main = _arg1;
graphicobjs = new Array();
idList = new Array(200);
count = 0;
AddFont(gfx_font1, main.tf_scorespr);
AddFont(gfx_font2, main.tf_scorespr1);
AddFont(gfx_fontblack, main.tf_scoresprblack);
Add(gfx_player, new DisplayObj(new PlayerCar(), 1, 0));
Add(gfx_playerspin, new DisplayObj(new PlayerCarSpin(), 1, 0));
Add(gfx_playercrash, new DisplayObj(new PlayerCarCrash(), 1, 0));
Add(gfx_playerbrake, new DisplayObj(new PlayerCarBrakeLights(), 1, 0));
Add(gfx_billboards, new DisplayObj(new Billboards(), 1, 2));
Add(gfx_aivehicle00, new DisplayObj(new Car01(), 1, 0));
Add(gfx_aivehicle01, new DisplayObj(new Car02(), 1, 0));
Add(gfx_aivehicle02, new DisplayObj(new Car03(), 1, 0));
Add(gfx_aivehicle03, new DisplayObj(new Car04(), 1, 0));
Add(gfx_aivehicle04, new DisplayObj(new Car05(), 1, 0));
Add(gfx_aivehicle05, new DisplayObj(new Car06(), 1, 0));
Add(gfx_background, new DisplayObj(new Background(), 1, 0));
Add(gfx_turbofire, new DisplayObj(new TurboFire(), 1, 0));
Add(gfx_preraceoverlay, new DisplayObj(new PreRaceOverlay(), 1, 0));
Add(gfx_skidsmoke, new DisplayObj(new SkidSmoke(), 1, 0));
Add(gfx_skidsmoke01, new DisplayObj(new SkidSmoke01(), 1, 0));
Add(gfx_skidsmoke02, new DisplayObj(new SkidSmoke02(), 1, 0));
Add(gfx_skidsmoke03, new DisplayObj(new SkidSmoke03(), 1, 0));
Add(gfx_skidsmoke04, new DisplayObj(new SkidSmoke04(), 1, 0));
Add(gfx_skidsmoke05, new DisplayObj(new SkidSmoke05(), 1, 0));
Add(gfx_skidsmoke06, new DisplayObj(new SkidSmoke06(), 1, 0));
Add(gfx_panel_back, new DisplayObj(new PanelBack(), 1, 0));
Add(gfx_panel_speedo, new DisplayObj(new Speedo(), 1, 0));
Add(gfx_panel_turbo, new DisplayObj(new Turbo(), 1, 0));
Add(gfx_panel_buttons, new DisplayObj(new PanelButtons(), 1, 0));
AddScanLineBitmapScaled(new RoadSurface());
}
public static function GetScaledScanLineBitmap(_arg1:int, _arg2:int):Bitmap{
return (scanLines[_arg1]);
}
}
}//package
Section 45
//HelpScreen (HelpScreen)
package {
import flash.display.*;
public dynamic class HelpScreen extends MovieClip {
public var buttonContinue:SimpleButton;
}
}//package
Section 46
//KeyReader (KeyReader)
package {
import flash.events.*;
import flash.display.*;
public class KeyReader {
static const KEY_LEFT = 37;
static const KEY_UP = 38;
static const KEY_DOWN = 40;
static const KEY_3 = 51;
static const KEY_5 = 53;
static const KEY_7 = 55;
static const KEY_1 = 49;
static const KEY_2 = 50;
static const KEY_4 = 52;
static const KEY_6 = 54;
static const KEY_8 = 56;
static const KEY_9 = 57;
static const KEY_A = 65;
static const KEY_B = 66;
static const KEY_C = 67;
static const KEY_E = 69;
static const KEY_F = 70;
static const KEY_G = 71;
static const KEY_H = 72;
static const KEY_I = 73;
static const KEY_J = 74;
static const KEY_D = 68;
static const KEY_M = 77;
static const KEY_N = 78;
static const KEY_O = 79;
static const KEY_P = 80;
static const KEY_Q = 81;
static const KEY_R = 82;
static const KEY_L = 76;
static const KEY_T = 84;
static const KEY_U = 85;
static const KEY_V = 86;
static const KEY_W = 87;
static const KEY_X = 88;
static const KEY_Y = 89;
static const KEY_K = 75;
static const KEY_0 = 58;
static const KEY_Z = 90;
static const KEY_S = 83;
static const KEY_SPACE = 32;
static const KEY_RIGHT = 39;
static var keysPressed:Array;
static var keysDown:Array;
public static function Pressed(_arg1:int):Boolean{
return (keysPressed[_arg1]);
}
static function keyUpListener(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
keysDown[_local2] = 0;
}
public static function Down(_arg1:int):Boolean{
return (!((keysDown[_arg1] == 0)));
}
static function keyDownListener(_arg1:KeyboardEvent):void{
var _local2:int;
_local2 = _arg1.keyCode;
var _local3 = keysDown;
var _local4 = _local2;
var _local5 = (_local3[_local4] + 1);
_local3[_local4] = _local5;
}
public static function UpdateOncePerFrame():void{
var _local1:int;
_local1 = 0;
while (_local1 < 0x0100) {
if (keysDown[_local1] == 1){
keysPressed[_local1] = true;
var _local2 = keysDown;
var _local3 = _local1;
var _local4 = (_local2[_local3] + 1);
_local2[_local3] = _local4;
} else {
keysPressed[_local1] = false;
};
_local1++;
};
}
public static function InitOnce(_arg1:Stage){
var _local2:int;
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyUpListener);
_arg1.focus = _arg1;
keysDown = new Array(0x0100);
keysPressed = new Array(0x0100);
_local2 = 0;
while (_local2 < 0x0100) {
keysDown[_local2] = int(0);
keysPressed[_local2] = Boolean(false);
_local2++;
};
}
}
}//package
Section 47
//Kong (Kong)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class Kong {
static var root:Object;
static var kongregate;
static var isLoaded:Boolean = false;
public static function InitOnce(_arg1:Object){
var _local2:Object;
var _local3:Object;
var _local4:String;
var _local5:URLRequest;
var _local6:Loader;
if (Licensors.IsAtKongregate() == false){
return;
};
root = _arg1;
_local2 = root.loaderInfo.loader;
_local3 = LoaderInfo(root.loaderInfo).parameters;
_local4 = ((_local3.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
trace(("API path: " + _local4));
isLoaded = false;
_local5 = new URLRequest(_local4);
_local6 = new Loader();
_local6.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
_local6.load(_local5);
root.addChild(_local6);
}
static function loadComplete(_arg1:Event):void{
kongregate = _arg1.target.content;
kongregate.services.connect();
trace(("\n" + kongregate.services));
trace(("\n" + kongregate.user));
trace(("\n" + kongregate.scores));
trace(("\n" + kongregate.stats));
isLoaded = true;
}
public static function SubmitScore(_arg1:Number, _arg2:String){
if (isLoaded == false){
return;
};
trace(((("Kong Score: " + _arg2) + " ") + _arg1));
if (Licensors.IsAtKongregate() == false){
return;
};
kongregate.scores.submit(_arg1, _arg2);
}
public static function SubmitStat(_arg1:Number, _arg2:String){
if (isLoaded == false){
return;
};
trace(((("Kong Stat: " + _arg2) + " ") + _arg1));
if (Licensors.IsAtKongregate() == false){
return;
};
kongregate.stats.submit(_arg2, _arg1);
}
}
}//package
Section 48
//Licensors (Licensors)
package {
public class Licensors {
public static const LICENSOR_BIGFISH = 6;
public static const LICENSOR_SHOCKWAVE = 11;
public static const LICENSOR_ANDKON = 5;
public static const LICENSOR_NOBRANDING = 12;
public static const LICENSOR_KING = 10;
public static const LICENSOR_KONGREGATE = 1;
public static const LICENSOR_KIBA = 13;
public static const LICENSOR_MINDJOLT = 4;
public static const LICENSOR_ARMORGAMES = 8;
public static const LICENSOR_MINICLIP = 2;
public static const LICENSOR_DOOF = 3;
public static const LICENSOR_BUBBLEBOX = 7;
public static const LICENSOR_GAMENINJA_LOCKED = 15;
public static const LICENSOR_GAMEZHERO = 9;
public static const LICENSOR_GAMENINJA_VIRAL = 14;
public static const LICENSOR_NONE = 0;
static var licensor:int = 14;
public static function IsHosted():Boolean{
if (licensor == LICENSOR_NONE){
return (false);
};
if (licensor == LICENSOR_ANDKON){
return (true);
};
if (licensor == LICENSOR_BIGFISH){
return (true);
};
if (licensor == LICENSOR_KONGREGATE){
if (SiteLock.GetDomain() == "kongregate.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_MINICLIP){
if (SiteLock.GetDomain() == "miniclip.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_DOOF){
if (SiteLock.GetDomain() == "doof.com"){
return (true);
};
return (false);
};
if (licensor == LICENSOR_MINDJOLT){
return (false);
};
return (false);
}
public static function InitOnce():void{
if (licensor == LICENSOR_MINDJOLT){
};
}
public static function IsAtKongregate():Boolean{
if (SiteLock.GetDomain() == "kongregate.com"){
return (true);
};
return (false);
}
public static function GetLicensor():int{
return (licensor);
}
public static function CanUseMochiAds():Boolean{
if (licensor == LICENSOR_NONE){
return (true);
};
if (licensor == LICENSOR_KONGREGATE){
return (true);
};
if (licensor == LICENSOR_MINICLIP){
return (false);
};
if (licensor == LICENSOR_DOOF){
return (false);
};
if (licensor == LICENSOR_MINDJOLT){
return (true);
};
if (licensor == LICENSOR_ANDKON){
return (false);
};
if (licensor == LICENSOR_BIGFISH){
return (false);
};
if (licensor == LICENSOR_ARMORGAMES){
return (false);
};
if (licensor == LICENSOR_GAMEZHERO){
return (false);
};
if (licensor == LICENSOR_KING){
return (false);
};
if (licensor == LICENSOR_SHOCKWAVE){
return (false);
};
return (true);
}
public static function SetLicensor(_arg1:int):void{
licensor = _arg1;
}
public static function CanUseMochiBot():Boolean{
if (licensor == LICENSOR_ARMORGAMES){
return (false);
};
if (licensor == LICENSOR_SHOCKWAVE){
return (false);
};
return (true);
}
}
}//package
Section 49
//Line (Line)
package {
import flash.geom.*;
public class Line {
public var udx:Number;
public var nx:Number;
public var ny:Number;
public var dir:Number;
public var udy:Number;
public var dy:Number;
public var y0:Number;
public var y1:Number;
public var dx:Number;
public var normalDir:Number;
public var length:Number;
public var boundingRect:Rectangle;
public var x0:Number;
public var x1:Number;
public function Line(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
x0 = _arg1;
y0 = _arg2;
x1 = _arg3;
y1 = _arg4;
CalcNormal();
CalcBoundingRect();
}
function CalcNormal():void{
dir = Math.atan2((y1 - y0), (x1 - x0));
normalDir = (dir - (Math.PI * 0.5));
nx = Math.cos(normalDir);
ny = Math.sin(normalDir);
dx = (x1 - x0);
dy = (y1 - y0);
length = Math.sqrt(((dx * dx) + (dy * dy)));
udx = Math.cos(dir);
udy = Math.sin(dir);
}
function CalcBoundingRect():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = x0;
_local2 = x1;
if (_local1 > _local2){
_local1 = x1;
_local2 = x0;
};
_local3 = y0;
_local4 = y1;
if (_local3 > _local4){
_local3 = y1;
_local4 = y0;
};
boundingRect = new Rectangle(_local1, _local3, ((_local2 - _local1) + 1), ((_local4 - _local3) + 1));
}
}
}//package
Section 50
//Main (Main)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
import flash.ui.*;
public dynamic class Main extends MovieClip {
public var tf_scorespr:TextFormat;
var framecounter:int;// = 0
public var tf_scorespr2:TextFormat;
var cheatMode:Boolean;
var levelTimer:Number;
var ftime:Number;
var scrollY:Number;// = 0
public var tf_scorespr1:TextFormat;
private var trackB:Bitmap;
private var screenB:Bitmap;
var fcount:Number;// = 0
public var backgroundMC:MovieClip;
var extraframe:Boolean;// = false
var levelTimerMax:Number;
public var mochiScores;
public var screenBD:BitmapData;
public var trackBD:BitmapData;
var gameState:int;// = 0
var currentTime:Number;// = 0
var secondCounter:Number;// = 0
public var fps:Number;
public var tf_scoresprblack:TextFormat;
static const gameState_HIGHSCORES = 5;
static const gameState_TITLE = 0;
static const gameState_LEVEL_PLAY = 2;
public static var theStage:Stage;
static var theRoot:MovieClip;
public function Main(){
currentTime = 0;
gameState = gameState_TITLE;
scrollY = 0;
fcount = 0;
extraframe = false;
framecounter = 0;
secondCounter = 0;
super();
theRoot = this;
theStage = this.root.stage;
SetEverythingUpOnce();
}
function calcFrameTime(){
var _local1:Number;
var _local2:Number;
_local1 = currentTime;
currentTime = getTimer();
extraframe = false;
fcount = (fcount + (currentTime - _local1));
_local2 = (1000 / Defs.fps);
if (fcount > (_local2 * 2)){
extraframe = true;
fcount = (fcount - _local2);
};
while (fcount > _local2) {
fcount = (fcount - _local2);
};
if (currentTime < _local1){
_local1 = (currentTime - 100);
};
if (currentTime > (_local1 + (100 * 10))){
_local1 = (100 * 10);
};
ftime = ((1 / (1000 / Defs.fps)) * (currentTime - _local1));
framecounter++;
secondCounter = (secondCounter + (currentTime - _local1));
if (secondCounter > 1000){
fps = ((Number(framecounter) / secondCounter) * 1000);
framecounter = 0;
secondCounter = 0;
};
ftime = 1;
}
function addedToStage(_arg1:Event){
SetEverythingUpOnce1();
}
private function CreateTextField(_arg1:TextFormat, _arg2:Number, _arg3:Number, _arg4:String):TextField{
var _local5:TextField;
_local5 = new TextField();
_local5.selectable = false;
_local5.embedFonts = true;
_local5.autoSize = TextFieldAutoSize.CENTER;
_local5.x = _arg2;
_local5.y = _arg3;
_local5.text = _arg4;
_local5.setTextFormat(_arg1);
addChild(_local5);
return (_local5);
}
function AddMovieClip(_arg1:Number, _arg2:Number, _arg3:MovieClip):MovieClip{
_arg3.x = _arg1;
_arg3.y = _arg2;
addChild(_arg3);
return (_arg3);
}
function InitLevel(){
InitStageForGame();
Particles.Reset();
MouseControl.Reset();
Particles.Reset();
GameObjects.ClearAll();
Game.InitLevel();
}
function InitStageNoBackground(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
}
function SetEverythingUpOnce1():void{
theRoot = this;
theStage = this.root.stage;
MochiBot.track(this, "4254e6ff");
Kong.InitOnce(this.root);
MusicPlayer.InitOnce();
KeyReader.InitOnce(theStage);
MouseControl.InitOnce(theStage);
SoundPlayer.InitOnce(this);
PauseMenu.InitOnce(this);
Particles.InitOnce(this, 1000);
GameObjects.InitOnce(this, 300);
InitDrawScreen();
InitFonts();
GraphicObjects.InitOnce(this);
addEventListener(Event.ENTER_FRAME, run);
InitStage();
Game.Init(this);
SetGameState(gameState_TITLE);
}
function RunTitle(){
}
function SetEverythingUpOnce():void{
if (stage == null){
addEventListener(Event.ADDED_TO_STAGE, addedToStage);
} else {
SetEverythingUpOnce1();
};
}
function InitFonts():void{
var _local1:Font;
_local1 = new Font20();
tf_scorespr = new TextFormat();
tf_scorespr1 = new TextFormat();
tf_scorespr2 = new TextFormat();
tf_scoresprblack = new TextFormat();
tf_scorespr.font = _local1.fontName;
tf_scorespr.size = 10;
tf_scorespr.color = 4294967040;
tf_scorespr1.font = _local1.fontName;
tf_scorespr1.size = 20;
tf_scorespr1.color = 4294967040;
tf_scorespr2.font = _local1.fontName;
tf_scorespr2.size = 16;
tf_scorespr2.color = 4294967040;
tf_scoresprblack.font = _local1.fontName;
tf_scoresprblack.size = 12;
tf_scoresprblack.color = 0;
}
function Render(){
this.x = 0;
this.y = 0;
Game.Render();
}
function InitDrawScreen():void{
screenBD = new BitmapData(Defs.displayarea_w, Defs.displayarea_h, true, 0);
screenB = new Bitmap(screenBD);
trackBD = new BitmapData(Defs.displayarea_w, Defs.roadarea_h, true, 0);
trackB = new Bitmap(trackBD);
}
function SetGameState(_arg1:int):void{
gameState = _arg1;
Mouse.show();
switch (gameState){
case gameState_TITLE:
TitleScreenState.Init(this);
break;
case gameState_HIGHSCORES:
break;
case gameState_LEVEL_PLAY:
InitLevel();
break;
};
}
function InitStage(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
addChild(screenB);
screenB.x = 0;
screenB.y = 0;
}
function run(_arg1:Event):void{
KeyReader.UpdateOncePerFrame();
SoundPlayer.UpdateOncePerFrame();
MusicPlayer.UpdateOncePerFrame();
if (Game.sitelock){
if (SiteLock.IsLocked()){
return;
};
};
calcFrameTime();
switch (gameState){
case gameState_TITLE:
TitleScreenState.Update(this);
break;
case gameState_HIGHSCORES:
break;
case gameState_LEVEL_PLAY:
RunLevel();
break;
};
}
function InitStageForGame(){
var _local1:int;
_local1 = (this.numChildren - 1);
while (_local1 >= 0) {
removeChildAt(_local1);
_local1--;
};
addChild(screenB);
screenB.x = 0;
screenB.y = 0;
}
function RunLevel(){
if (KeyReader.Pressed(KeyReader.KEY_P)){
if (PauseMenu.IsPaused()){
PauseMenu.Unpause();
} else {
PauseMenu.Pause();
};
};
if (PauseMenu.IsPaused() == false){
Game.UpdateGameplay();
};
Render();
}
}
}//package
Section 51
//Matrix3 (Matrix3)
package {
public class Matrix3 {
public var y2:Number;
public var z2:Number;
public var z0:Number;
public var y0:Number;
public var x0:Number;
public var x1:Number;
public var x2:Number;
public var z1:Number;
public var y1:Number;
public function Matrix3():void{
Init();
}
public function Init(){
var _local1:Number;
var _local2:Number;
_local1 = 1;
_local2 = 0;
x0 = _local1;
y0 = _local2;
z0 = _local2;
x1 = _local2;
y1 = _local1;
z1 = _local2;
x2 = _local2;
y2 = _local2;
z2 = _local1;
}
}
}//package
Section 52
//menuScreen (menuScreen)
package {
import flash.display.*;
public dynamic class menuScreen extends MovieClip {
public var menupalm2:MovieClip;
public var buttonLongAnimals:SimpleButton;
public var buttonMoreGames:SimpleButton;
public var menupalm1:MovieClip;
public var buttonPlay:SimpleButton;
public var buttonHelp:SimpleButton;
public var cloud2:MovieClip;
public var buttonGameNinja:MovieClip;
public var cloud1:MovieClip;
public var cloud3:MovieClip;
public function menuScreen(){
addFrameScript(0, frame1);
}
function frame1(){
menupalm1.gotoAndPlay(1);
menupalm2.gotoAndPlay(20);
cloud1.gotoAndPlay(1);
cloud2.gotoAndPlay(200);
cloud3.gotoAndPlay(350);
}
}
}//package
Section 53
//MochiAd (MochiAd)
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.net.*;
import flash.system.*;
public class MochiAd {
public static function getVersion():String{
return ("2.3");
}
public static function showTimedAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
MochiAd.showInterLevelAd(_arg1);
}
public static function _allowDomains(_arg1:String):String{
var _local2:String;
_local2 = _arg1.split("/")[2].split(":")[0];
Security.allowDomain("*");
Security.allowDomain(_local2);
Security.allowInsecureDomain("*");
Security.allowInsecureDomain(_local2);
return (_local2);
}
public static function load(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var depth:Number;
var mc:MovieClip;
var wh:Array;
var lv:URLVariables;
var k:String;
var server:String;
var hostname:String;
var lc:LocalConnection;
var name:String;
var loader:Loader;
var f:Function;
var g:Function;
var req:URLRequest;
var v:Object;
var options = _arg1;
DEFAULTS = {server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
if (!MochiAd._isNetworkAvailable()){
return (null);
};
try {
if (clip._mochiad_loaded){
return (null);
};
} catch(e:Error) {
throw (new Error("MochiAd requires a clip that is an instance of a dynamic class. If your class extends Sprite or MovieClip, you must make it dynamic."));
};
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, "_mochiad", depth);
wh = MochiAd._getRes(options, clip);
options.res = ((wh[0] + "x") + wh[1]);
options.server = (options.server + options.id);
delete options.id;
clip._mochiad_loaded = true;
if (clip.loaderInfo.loaderURL.indexOf("http") == 0){
options.as3_swf = clip.loaderInfo.loaderURL;
};
lv = new URLVariables();
for (k in options) {
v = options[k];
if (!(v is Function)){
lv[k] = v;
};
};
server = lv.server;
delete lv.server;
hostname = _allowDomains(server);
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.lc = lc;
lv.lc = name;
lv.st = getTimer();
loader = new Loader();
f = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
mc._mochiad_ctr_failed = true;
};
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, f);
g = function (_arg1:Object):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
MochiAd.unload(clip);
};
loader.contentLoaderInfo.addEventListener(Event.UNLOAD, g);
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader.load(req);
mc.addChild(loader);
mc._mochiad_ctr = loader;
return (mc);
}
public static function sendHighScore(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["sendHighScore", _arg1], _arg2, _arg3);
return (true);
}
public static function _parseOptions(_arg1:Object, _arg2:Object):Object{
var _local3:Object;
var _local4:String;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = {};
for (_local4 in _arg2) {
_local3[_local4] = _arg2[_local4];
};
if (_arg1){
for (_local4 in _arg1) {
_local3[_local4] = _arg1[_local4];
};
};
if (_local3.clip == undefined){
throw (new Error("MochiAd is missing the 'clip' parameter. This should be a MovieClip, Sprite or an instance of a class that extends MovieClip or Sprite."));
};
_arg1 = _local3.clip.loaderInfo.parameters.mochiad_options;
if (_arg1){
_local5 = _arg1.split("&");
_local6 = 0;
while (_local6 < _local5.length) {
_local7 = _local5[_local6].split("=");
_local3[unescape(_local7[0])] = unescape(_local7[1]);
_local6++;
};
};
if (_local3.id == "test"){
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
};
return (_local3);
}
public static function _isNetworkAvailable():Boolean{
return (!((Security.sandboxType == "localWithFile")));
}
public static function _cleanup(_arg1:Object):void{
var idx:Number;
var k:String;
var lc:LocalConnection;
var f:Function;
var mc = _arg1;
if (("lc" in mc)){
lc = mc.lc;
f = function ():void{
try {
lc.client = null;
lc.close();
} catch(e:Error) {
};
};
setTimeout(f, 0);
};
idx = DisplayObjectContainer(mc).numChildren;
while (idx > 0) {
idx = (idx - 1);
DisplayObjectContainer(mc).removeChildAt(idx);
};
for (k in mc) {
delete mc[k];
};
}
public static function unload(_arg1:Object):Boolean{
if (((_arg1.clip) && (_arg1.clip._mochiad))){
_arg1 = _arg1.clip;
};
if (!_arg1._mochiad){
return (false);
};
if (_arg1._mochiad.onUnload){
_arg1._mochiad.onUnload();
};
delete _arg1._mochiad_loaded;
delete _arg1._mochiad;
return (true);
}
public static function showInterLevelAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showInterLevelAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
MochiAd._cleanup(mc);
options.ad_finished();
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
mc.unloadAd = function ():void{
MochiAd.unload(clip);
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = (_arg1 - 250);
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Number;
var _local3:Boolean;
var _local4:Number;
if (!this.parent){
delete this.onEnterFrame;
delete this.fadeFunction;
return;
};
_local1 = this.parent._mochiad_ctr;
_local2 = (getTimer() - this.started);
_local3 = false;
if (!chk.showing){
_local4 = _local1.loaderInfo.bytesTotal;
if ((((_local4 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local2 > chk.ad_timeout){
options.ad_failed();
_local3 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local3 = true;
};
if (_local2 > chk.ad_msec){
_local3 = true;
};
if (_local3){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function _getRes(_arg1:Object, _arg2:Object):Array{
var _local3:Object;
var _local4:Number;
var _local5:Number;
var _local6:Array;
_local3 = _arg2.getBounds(_arg2.root);
_local4 = 0;
_local5 = 0;
if (typeof(_arg1.res) != "undefined"){
_local6 = _arg1.res.split("x");
_local4 = parseFloat(_local6[0]);
_local5 = parseFloat(_local6[1]);
} else {
_local4 = (_local3.xMax - _local3.xMin);
_local5 = (_local3.yMax - _local3.yMin);
};
if ((((_local4 == 0)) || ((_local5 == 0)))){
_local4 = _arg2.stage.stageWidth;
_local5 = _arg2.stage.stageHeight;
};
return ([_local4, _local5]);
}
public static function createEmptyMovieClip(_arg1:Object, _arg2:String, _arg3:Number):MovieClip{
var _local4:MovieClip;
_local4 = new MovieClip();
if (((false) && (_arg3))){
_arg1.addChildAt(_local4, _arg3);
} else {
_arg1.addChild(_local4);
};
_arg1[_arg2] = _local4;
_local4["_name"] = _arg2;
return (_local4);
}
public static function _loadCommunicator(_arg1:Object):MovieClip{
var DEFAULTS:Object;
var clip:Object;
var clipname:String;
var server:String;
var depth:Number;
var mc:MovieClip;
var lv:URLVariables;
var k:String;
var lc:LocalConnection;
var name:String;
var req:URLRequest;
var loader:Loader;
var options = _arg1;
DEFAULTS = {com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, DEFAULTS);
options.swfv = 9;
options.mav = MochiAd.getVersion();
clip = options.clip;
clipname = ("_mochiad_com_" + options.id);
if (!MochiAd._isNetworkAvailable()){
return (null);
};
if (clip[clipname]){
return (clip[clipname]);
};
server = (options.com_server + options.id);
MochiAd._allowDomains(server);
delete options.id;
delete options.com_server;
depth = options.depth;
delete options.depth;
mc = createEmptyMovieClip(clip, clipname, depth);
lv = new URLVariables();
for (k in options) {
lv[k] = options[k];
};
lc = new LocalConnection();
lc.client = mc;
name = ["", Math.floor(new Date().getTime()), Math.floor((Math.random() * 999999))].join("_");
lc.allowDomain("*", "localhost");
lc.allowInsecureDomain("*", "localhost");
lc.connect(name);
mc.name = name;
mc.lc = lc;
lv.lc = name;
mc._id = 0;
mc._queue = [];
mc.rpcResult = function (_arg1:Object):void{
var _local3:Array;
var _local4:Array;
var _local5:Number;
var _local6:Object;
var _local7:Object;
_arg1 = parseInt(_arg1.toString());
_local3 = mc._callbacks[_arg1];
if (typeof(_local3) == "undefined"){
return;
};
delete mc._callbacks[_arg1];
_local4 = [];
_local5 = 2;
while (_local5 < _local3.length) {
_local4.push(_local3[_local5]);
_local5++;
};
_local5 = 1;
while (_local5 < arguments.length) {
_local4.push(arguments[_local5]);
_local5++;
};
_local6 = _local3[1];
_local7 = _local3[0];
if (((_local7) && ((typeof(_local6) == "string")))){
_local6 = _local7[_local6];
};
if (typeof(_local6) == "function"){
_local6.apply(_local7, _local4);
};
};
mc._didConnect = function (_arg1:String):void{
var _local2:Array;
var _local3:Function;
var _local4:Number;
var _local5:Array;
mc._endpoint = _arg1;
_local2 = mc._queue;
delete mc._queue;
_local3 = mc.doSend;
_local4 = 0;
while (_local4 < _local2.length) {
_local5 = _local2[_local4];
_local3.apply(this, _local5);
_local4++;
};
};
mc.doSend = function (_arg1:Array, _arg2:Object, _arg3:Object):void{
var _local5:Number;
var _local6:LocalConnection;
var _local7:Array;
var _local8:Number;
if (mc._endpoint == null){
_local7 = [];
_local8 = 0;
while (_local8 < arguments.length) {
_local7.push(arguments[_local8]);
_local8++;
};
mc._queue.push(_local7);
return;
};
mc._id = (mc._id + 1);
_local5 = mc._id;
mc._callbacks[_local5] = [_arg2, ((_arg3) || (_arg2))];
_local6 = new LocalConnection();
_local6.send(mc._endpoint, "rpc", _local5, _arg1);
};
mc._callbacks = {};
mc._callbacks[0] = [mc, "_didConnect"];
lv.st = getTimer();
req = new URLRequest((server + ".swf"));
req.contentType = "application/x-www-form-urlencoded";
req.method = URLRequestMethod.POST;
req.data = lv;
loader = new Loader();
loader.load(req);
mc.addChild(loader);
mc._mochiad_com = loader;
return (mc);
}
public static function showPreGameAd(_arg1:Object):void{
var DEFAULTS:Object;
var clip:Object;
var ad_msec:Number;
var ad_timeout:Number;
var fadeout_time:Number;
var mc:MovieClip;
var wh:Array;
var w:Number;
var h:Number;
var chk:MovieClip;
var bar:MovieClip;
var bar_color:Number;
var bar_background:Number;
var bar_outline:Number;
var backing_mc:MovieClip;
var backing:Object;
var inside_mc:MovieClip;
var inside:Object;
var outline_mc:MovieClip;
var outline:Object;
var complete:Boolean;
var unloaded:Boolean;
var f:Function;
var r:MovieClip;
var options = _arg1;
DEFAULTS = {ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:0xFF8A00, background:16777161, outline:13994812, ad_started:function ():void{
if ((this.clip is MovieClip)){
this.clip.stop();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_finished:function ():void{
if ((this.clip is MovieClip)){
this.clip.play();
} else {
throw (new Error("MochiAd.showPreGameAd requires a clip that is a MovieClip or is an instance of a class that extends MovieClip. If your clip is a Sprite, then you must provide custom ad_started and ad_finished handlers."));
};
}, ad_loaded:function (_arg1:Number, _arg2:Number):void{
}, ad_failed:function ():void{
trace("[MochiAd] Couldn't load an ad, make sure your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}};
options = MochiAd._parseOptions(options, DEFAULTS);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0){
options.ad_started();
options.ad_finished();
return;
};
clip = options.clip;
ad_msec = 11000;
ad_timeout = options.ad_timeout;
delete options.ad_timeout;
fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)){
options.ad_failed();
options.ad_finished();
return;
};
options.ad_started();
mc = clip._mochiad;
mc["onUnload"] = function ():void{
var fn:Function;
MochiAd._cleanup(mc);
fn = function ():void{
options.ad_finished();
};
setTimeout(fn, 100);
};
wh = MochiAd._getRes(options, clip);
w = wh[0];
h = wh[1];
mc.x = (w * 0.5);
mc.y = (h * 0.5);
chk = createEmptyMovieClip(mc, "_mochiad_wait", 3);
chk.x = (w * -0.5);
chk.y = (h * -0.5);
bar = createEmptyMovieClip(chk, "_mochiad_bar", 4);
bar.x = 10;
bar.y = (h - 20);
bar_color = options.color;
delete options.color;
bar_background = options.background;
delete options.background;
bar_outline = options.outline;
delete options.outline;
backing_mc = createEmptyMovieClip(bar, "_outline", 1);
backing = backing_mc.graphics;
backing.beginFill(bar_background);
backing.moveTo(0, 0);
backing.lineTo((w - 20), 0);
backing.lineTo((w - 20), 10);
backing.lineTo(0, 10);
backing.lineTo(0, 0);
backing.endFill();
inside_mc = createEmptyMovieClip(bar, "_inside", 2);
inside = inside_mc.graphics;
inside.beginFill(bar_color);
inside.moveTo(0, 0);
inside.lineTo((w - 20), 0);
inside.lineTo((w - 20), 10);
inside.lineTo(0, 10);
inside.lineTo(0, 0);
inside.endFill();
inside_mc.scaleX = 0;
outline_mc = createEmptyMovieClip(bar, "_outline", 3);
outline = outline_mc.graphics;
outline.lineStyle(0, bar_outline, 100);
outline.moveTo(0, 0);
outline.lineTo((w - 20), 0);
outline.lineTo((w - 20), 10);
outline.lineTo(0, 10);
outline.lineTo(0, 0);
chk.ad_msec = ad_msec;
chk.ad_timeout = ad_timeout;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function ():void{
var _local1:Number;
_local1 = (100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)));
if (_local1 > 0){
this.parent.alpha = (_local1 * 0.01);
} else {
MochiAd.unload(clip);
delete this["onEnterFrame"];
};
};
complete = false;
unloaded = false;
f = function (_arg1:Event):void{
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
complete = true;
if (unloaded){
MochiAd.unload(clip);
};
};
clip.loaderInfo.addEventListener(Event.COMPLETE, f);
if ((clip.root is MovieClip)){
r = (clip.root as MovieClip);
if (r.framesLoaded >= r.totalFrames){
complete = true;
};
};
mc.unloadAd = function ():void{
unloaded = true;
if (complete){
MochiAd.unload(clip);
};
};
mc.adLoaded = options.ad_loaded;
mc.adjustProgress = function (_arg1:Number):void{
var _local2:Object;
_local2 = mc._mochiad_wait;
_local2.server_control = true;
_local2.showing = true;
_local2.started = getTimer();
_local2.ad_msec = _arg1;
};
chk["onEnterFrame"] = function ():void{
var _local1:Object;
var _local2:Object;
var _local3:Number;
var _local4:Boolean;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Object;
var _local10:Number;
var _local11:Number;
if (((!(this.parent)) || (!(this.parent.parent)))){
delete this["onEnterFrame"];
return;
};
_local1 = this.parent.parent.root;
_local2 = this.parent._mochiad_ctr;
_local3 = (getTimer() - this.started);
_local4 = false;
_local5 = _local1.loaderInfo.bytesTotal;
_local6 = _local1.loaderInfo.bytesLoaded;
if (complete){
_local6 = Math.max(1, _local6);
_local5 = _local6;
};
_local7 = ((100 * _local6) / _local5);
_local8 = ((100 * _local3) / chk.ad_msec);
_local9 = this._mochiad_bar._inside;
_local10 = Math.min(100, Math.min(((_local7) || (0)), _local8));
_local10 = Math.max(this.last_pcnt, _local10);
this.last_pcnt = _local10;
_local9.scaleX = (_local10 * 0.01);
if (!chk.showing){
_local11 = _local2.loaderInfo.bytesTotal;
if ((((_local11 > 0)) || (("number" == "undefined")))){
chk.showing = true;
chk.started = getTimer();
} else {
if (_local3 > chk.ad_timeout){
options.ad_failed();
_local4 = true;
};
};
};
if (this.parent._mochiad_ctr_failed){
options.ad_failed();
_local4 = true;
};
if (_local3 > chk.ad_msec){
_local4 = true;
};
if (((complete) && (_local4))){
if (this.server_control){
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
};
};
};
doOnEnterFrame(chk);
}
public static function showPreloaderAd(_arg1:Object):void{
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
MochiAd.showPreGameAd(_arg1);
}
public static function fetchHighScores(_arg1:Object, _arg2:Object, _arg3:Object=null):Boolean{
var _local4:MovieClip;
_local4 = MochiAd._loadCommunicator({clip:_arg1.clip, id:_arg1.id});
if (!_local4){
return (false);
};
_local4.doSend(["fetchHighScores", _arg1], _arg2, _arg3);
return (true);
}
public static function doOnEnterFrame(_arg1:MovieClip):void{
var f:Function;
var mc = _arg1;
f = function (_arg1:Object):void{
if (((("onEnterFrame" in mc)) && (mc.onEnterFrame))){
mc.onEnterFrame();
} else {
_arg1.target.removeEventListener(_arg1.type, arguments.callee);
};
};
mc.addEventListener(Event.ENTER_FRAME, f);
}
}
}//package
Section 54
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 55
//MouseControl (MouseControl)
package {
import flash.events.*;
import flash.display.*;
public class MouseControl {
public static var mouseVelX:Number = 0;
public static var mouseVelY:Number = 0;
public static var mouseOldPosX:Number = 0;
public static var mouseOldPosY:Number = 0;
public static var mousePosX:Number = 0;
public static var mousePosY:Number = 0;
public static var buttonPressed:Boolean = false;
public static var buttonReleased:Boolean = false;
public static function MouseHandler(_arg1:MouseEvent):void{
mousePosX = _arg1.stageX;
mousePosY = _arg1.stageY;
mouseVelX = (mousePosX - mouseOldPosX);
mouseVelY = (mousePosY - mouseOldPosY);
mouseOldPosX = mousePosX;
mouseOldPosY = mousePosY;
}
public static function InitOnce(_arg1:Stage):void{
_arg1.addEventListener(MouseEvent.MOUSE_MOVE, MouseHandler);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, MouseClickHandler);
_arg1.addEventListener(MouseEvent.MOUSE_UP, MouseUpHandler);
}
public static function MouseUpHandler(_arg1:MouseEvent):void{
buttonPressed = false;
buttonReleased = true;
}
public static function Reset():void{
buttonPressed = false;
buttonReleased = false;
}
public static function MouseClickHandler(_arg1:MouseEvent):void{
buttonPressed = true;
buttonReleased = false;
}
}
}//package
Section 56
//MusicPlayer (MusicPlayer)
package {
import flash.media.*;
import flash.utils.*;
import flash.net.*;
public class MusicPlayer {
public static var currentStreamID:int = -1;
static var musicSound1:Sound;
static var lastMusicID = -1;
static var musicSoundTransform1:SoundTransform;
static var musicChannel1:SoundChannel = null;
static var currentMusicID:int = -1;
static var doMusic:Boolean;
static var musicChannel:SoundChannel = null;
static var streamChannelFlags:Array;
static var musicSoundTransform:SoundTransform;
static var musicSound:Sound;
static var streamSound:Sound = null;
static var streamChannels:Array;
static var streamChannelVolumes:Array;
public static function InitOnce():void{
doMusic = Game.soundon;
lastMusicID = -1;
currentMusicID = -1;
streamChannels = new Array();
streamChannelFlags = new Array();
streamChannelVolumes = new Array();
}
public static function StartMusic(_arg1:String){
var classRef:Class;
var m:Sound;
var musicName = _arg1;
if (doMusic == false){
return;
};
if (musicChannel != null){
musicChannel.stop();
};
try {
classRef = (getDefinitionByName(musicName) as Class);
} catch(e:Object) {
classRef = null;
};
if (classRef == null){
trace(("Music Error: Can't find sound " + musicName));
} else {
m = (new (classRef) as Sound);
musicSoundTransform = new SoundTransform(1, 0);
musicSound = m;
musicChannel = musicSound.play(0, 999999, musicSoundTransform);
};
lastMusicID = 0;
}
public static function StopMusic(){
var _local1:int;
var _local2:SoundChannel;
var _local3:int;
_local1 = 0;
while (_local1 < streamChannels.length) {
_local3 = streamChannelFlags[_local1];
if ((((_local3 == 0)) || ((_local3 == 1)))){
_local3 = 2;
};
streamChannelFlags[_local1] = _local3;
_local1++;
};
if (musicChannel != null){
musicChannel.stop();
};
}
public static function StartStream(_arg1:int){
var _local2:URLRequest;
var _local3:SoundLoaderContext;
var _local4:SoundTransform;
streamSound = new Sound();
if (_arg1 == 0){
_local2 = new URLRequest("http://games.mochiads.com/c/g/heatrush/HeatRush_Tune0.mp3");
};
if (_arg1 == 1){
_local2 = new URLRequest("http://games.mochiads.com/c/g/heatrush/HeatRush_Tune1.mp3");
};
if (_arg1 == 2){
_local2 = new URLRequest("http://games.mochiads.com/c/g/heatrush/HeatRush_Tune2.mp3");
};
if (_arg1 == 3){
_local2 = new URLRequest("http://games.mochiads.com/c/g/heatrush/HeatRush_Tune3.mp3");
};
currentStreamID = _arg1;
_local3 = new SoundLoaderContext(1000, true);
_local4 = new SoundTransform(0);
streamSound.load(_local2, _local3);
streamChannels.push(streamSound.play(0, 999999, _local4));
streamChannelFlags.push(int(0));
streamChannelVolumes.push(Number(0));
}
public static function UpdateOncePerFrame(){
var _local1:Number;
var _local2:Boolean;
var _local3:int;
var _local4:SoundChannel;
var _local5:int;
var _local6:Number;
var _local7:SoundTransform;
var _local8:*;
var _local9:*;
var _local10:*;
_local1 = 0.02;
_local2 = false;
_local3 = 0;
while (_local3 < streamChannels.length) {
_local4 = streamChannels[_local3];
_local5 = streamChannelFlags[_local3];
_local6 = streamChannelVolumes[_local3];
if (_local5 == 0){
_local7 = _local4.soundTransform;
_local6 = (_local6 + _local1);
if (_local6 >= 1){
_local6 = 1;
_local5 = 1;
};
_local7.volume = _local6;
_local4.soundTransform = _local7;
} else {
if (_local5 == 1){
_local7 = _local4.soundTransform;
_local7.volume = _local6;
_local4.soundTransform = _local7;
} else {
if (_local5 == 2){
_local7 = _local4.soundTransform;
_local6 = (_local6 - _local1);
if (_local6 <= 0){
_local4.stop();
_local5 = 3;
_local2 = true;
};
_local7.volume = _local6;
_local4.soundTransform = _local7;
} else {
if (_local5 == 3){
};
};
};
};
streamChannelFlags[_local3] = _local5;
streamChannels[_local3] = _local4;
streamChannelVolumes[_local3] = _local6;
if (!doMusic){
_local7 = _local4.soundTransform;
_local7.volume = 0;
_local4.soundTransform = _local7;
};
_local3++;
};
if (_local2){
_local8 = new Array();
_local9 = new Array();
_local10 = new Array();
_local3 = 0;
while (_local3 < streamChannels.length) {
_local4 = streamChannels[_local3];
_local5 = streamChannelFlags[_local3];
_local6 = streamChannelVolumes[_local3];
if (_local5 != 3){
_local8.push(_local5);
_local9.push(_local4);
_local10.push(_local6);
};
_local3++;
};
streamChannelFlags = _local8;
streamChannels = _local9;
streamChannelVolumes = _local10;
};
if (!doMusic){
if (musicChannel != null){
_local7 = musicChannel.soundTransform;
_local7.volume = 0;
musicChannel.soundTransform = _local7;
};
} else {
if (musicChannel != null){
_local7 = musicChannel.soundTransform;
_local7.volume = 1;
musicChannel.soundTransform = _local7;
};
};
}
public static function ToggleSound(){
doMusic = (doMusic == false);
}
public static function IsCurrentStream(_arg1:int):Boolean{
if (_arg1 == currentStreamID){
return (true);
};
return (false);
}
}
}//package
Section 57
//ObjectDef (ObjectDef)
package {
import flash.geom.*;
public class ObjectDef {
var type:int;
var exportName:String;
var collisionCircleOffsets:Array;
var animIDs:Array;
var particleExplodeID:int;
var initFuncName:String;
var maxHealth:Number;
var colRects:Array;
var collisionCircleRadii:Array;
var animNames:Array;
var shieldColRects:Array;
var shotControllers:Array;
var pathAnimType:int;
public function ObjectDef(_arg1:String, _arg2:int, _arg3:Rectangle){
animNames = new Array();
animIDs = new Array();
colRects = new Array();
shieldColRects = new Array();
collisionCircleOffsets = new Array();
collisionCircleRadii = new Array();
exportName = _arg1;
type = _arg2;
colRects.push(_arg3.clone());
maxHealth = 1;
initFuncName = "";
shotControllers = new Array();
particleExplodeID = -1;
}
public function AddColRect(_arg1:Rectangle){
colRects.push(_arg1.clone());
}
public function GetAnimIDFromName(_arg1:String):int{
var _local2:int;
var _local3:int;
_local2 = animNames.length;
_local3 = 0;
while (_local3 < _local2) {
if (animNames[_local3] == _arg1){
return (animIDs[_local3]);
};
_local3++;
};
trace(((("ERROR: Can't find anim name " + _arg1) + " on object ") + exportName));
return (40);
}
public function SetPathAnimType(_arg1:int){
pathAnimType = _arg1;
}
public function DoesAnimIDExist(_arg1:String):Boolean{
var _local2:int;
var _local3:int;
_local2 = animNames.length;
_local3 = 0;
while (_local3 < _local2) {
if (animNames[_local3] == _arg1){
return (true);
};
_local3++;
};
return (false);
}
public function AddShieldColRect(_arg1:Rectangle){
shieldColRects.push(_arg1.clone());
}
public function SetInitFunc(_arg1:String){
initFuncName = _arg1;
}
public function AddCollisionCircle(_arg1:Number, _arg2:Number, _arg3:Number){
collisionCircleOffsets.push(new Point(_arg1, _arg2));
collisionCircleRadii.push(_arg3);
}
public function SetParticle(_arg1:int){
particleExplodeID = _arg1;
}
public function SetHealth(_arg1:Number){
maxHealth = _arg1;
}
public function AddAnim(_arg1:String, _arg2:int){
animNames.push(_arg1);
animIDs.push(_arg2);
}
}
}//package
Section 58
//ObjectDefs (ObjectDefs)
package {
import flash.geom.*;
public class ObjectDefs {
static var list:Array;
public static function Init(){
var _local1:ObjectDef;
list = new Array();
_local1 = new ObjectDef("Player", 0, new Rectangle(-10, -30, 20, 40));
_local1.AddCollisionCircle(0, -17, 15);
_local1.AddCollisionCircle(0, -31, 15);
_local1.AddCollisionCircle(0, -45, 15);
list.push(_local1);
}
public static function GetObjectDefByExportName(_arg1:String){
var _local2:ObjectDef;
var _local3:int;
var _local4:int;
_local4 = list.length;
_local3 = 0;
while (_local3 < _local4) {
_local2 = list[_local3];
if (_local2.exportName == _arg1){
return (_local2);
};
_local3++;
};
trace(("ERROR: ObjectDefs can't find object exportname " + _arg1));
return (null);
}
}
}//package
Section 59
//PanelBack (PanelBack)
package {
import flash.display.*;
public dynamic class PanelBack extends MovieClip {
}
}//package
Section 60
//PanelButtons (PanelButtons)
package {
import flash.display.*;
public dynamic class PanelButtons extends MovieClip {
}
}//package
Section 61
//Particle (Particle)
package {
class Particle {
var graphicID:int;
public var yvel:Number;
var timer:Number;
var active:Boolean;
var maxframe:int;
var counter:int;
var speed:Number;
var updateFunction:Function;
var dir:Number;
var startx:Number;
var starty:Number;
var xpos:Number;
var alpha:Number;
var alphaAdd:Number;
public var xvel:Number;
var frame:Number;
var frameVel:Number;
var visible:Boolean;
var ypos:Number;
function CycleAnimation():Boolean{
frame = (frame + frameVel);
if (frame >= maxframe){
frame = 0;
return (true);
};
return (false);
}
function UpdateAnimAndStop(){
xpos = (xpos + xvel);
ypos = (ypos + yvel);
if (PlayAnimation()){
active = false;
};
}
public function InitExplode(_arg1:int){
dir = Utils.RandCircle();
speed = Utils.RandBetweenFloat(6, 18);
graphicID = _arg1;
maxframe = (GraphicObjects.GetNumFrames(graphicID) - 1);
alpha = 1;
frame = 0;
frameVel = 1;
alphaAdd = Utils.RandBetweenFloat(-0.01, -0.03);
}
function PlayAnimation():Boolean{
frame = (frame + frameVel);
if (frame >= maxframe){
frame = maxframe;
return (true);
};
return (false);
}
function UpdateExplode(){
xvel = (Math.cos(dir) * speed);
yvel = (Math.sin(dir) * speed);
xpos = (xpos + xvel);
ypos = (ypos + yvel);
frame = (frame + frameVel);
if (frame >= maxframe){
frame = maxframe;
};
speed = (speed - 0.3);
if (speed <= 0){
speed = 0;
active = false;
};
}
function UpdateVelsTimer(){
xpos = (xpos + xvel);
ypos = (ypos + yvel);
timer--;
if (timer <= 0){
active = false;
};
}
}
}//package
Section 62
//Particles (Particles)
package {
import flash.geom.*;
public class Particles {
public static const type_dust = 0;
static var max:int;
static var list:Array;
static var main:Main;
static var nextIndex:int;
public function Particles():void{
}
public static function Add(_arg1:Number, _arg2:Number):Particle{
var _local3:Number;
var _local4:Number;
var _local5:Particle;
_local5 = list[nextIndex];
nextIndex++;
if (nextIndex >= max){
nextIndex = 0;
};
_local5.active = true;
_local5.timer = 0;
_local5.alpha = 1;
_local5.alphaAdd = 0;
_local5.visible = true;
_local5.xpos = _arg1;
_local5.ypos = _arg2;
return (_local5);
}
public static function GetNextIndex():int{
return (nextIndex);
}
public static function Reset(){
var _local1:int;
nextIndex = 0;
_local1 = 0;
while (_local1 < max) {
list[_local1].active = false;
_local1++;
};
}
public static function Update(_arg1:Number){
var _local2:int;
var _local3:Particle;
_local2 = 0;
while (_local2 < max) {
_local3 = list[_local2];
if (_local3.active == true){
_local3.updateFunction();
};
_local2++;
};
}
public static function InitOnce(_arg1:Main, _arg2:int):void{
var _local3:int;
main = _arg1;
max = _arg2;
nextIndex = 0;
list = new Array(max);
_local3 = 0;
while (_local3 < max) {
list[_local3] = new Particle();
list[_local3].active = false;
_local3++;
};
}
public static function CountActive():int{
var _local1:int;
var _local2:int;
_local1 = 0;
_local2 = 0;
while (_local2 < max) {
if (list[_local2].active){
_local1++;
};
_local2++;
};
return (_local1);
}
public static function Render(_arg1:Main){
var _local2:int;
var _local3:Particle;
var _local4:Number;
var _local5:Number;
_local2 = 0;
while (_local2 < max) {
_local3 = list[_local2];
if (((_local3.active) && (_local3.visible))){
_local4 = _local3.xpos;
_local5 = _local3.ypos;
GraphicObjects.RenderAt(_local3.graphicID, int(_local3.frame), _arg1.screenBD, _local4, _local5);
};
_local2++;
};
}
}
}//package
Section 63
//PauseMenu (PauseMenu)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public class PauseMenu {
static var active:Boolean;
static var pauseMC:MovieClip;
static var main:Main;
public function PauseMenu():void{
}
public static function buttonQuitPressed(_arg1:MouseEvent){
Unpause();
Game.main.SetGameState(Main.gameState_TITLE);
}
public static function buttonSoundPressed(_arg1:MouseEvent){
var _local2:Boolean;
_local2 = MusicPlayer.doMusic;
if (_local2 == true){
};
_local2 = SoundPlayer.doSFX;
SoundPlayer.doSFX = (_local2 == false);
if (MusicPlayer.doMusic){
pauseMC.selectedSound.gotoAndStop(2);
} else {
pauseMC.selectedSound.gotoAndStop(1);
};
}
public static function buttonContinuePressed(_arg1:MouseEvent){
Unpause();
}
public static function buttonHelpPressed(_arg1:MouseEvent){
TitleScreenState.InitHelp();
}
public static function InitOnce(_arg1:Main):void{
main = _arg1;
active = false;
}
public static function Pause():void{
Game.pause = true;
Mouse.show();
pauseMC = new PauseMenuScreen();
main.addChild(pauseMC);
pauseMC.buttonQuit.addEventListener(MouseEvent.CLICK, buttonQuitPressed, false, 0, true);
pauseMC.buttonContinue.addEventListener(MouseEvent.CLICK, buttonContinuePressed, false, 0, true);
pauseMC.buttonHelp.addEventListener(MouseEvent.CLICK, buttonHelpPressed, false, 0, true);
TitleScreenState.GameNinjaButton(pauseMC.buttonGameNinja, "heatrushpause");
active = true;
}
public static function Unpause():void{
active = false;
Game.main.removeChild(pauseMC);
pauseMC = null;
KeyReader.InitOnce(Game.main.stage);
Game.pause = false;
}
public static function IsPaused():Boolean{
return (active);
}
}
}//package
Section 64
//PauseMenuScreen (PauseMenuScreen)
package {
import flash.display.*;
public dynamic class PauseMenuScreen extends MovieClip {
public var buttonHelp:SimpleButton;
public var buttonQuit:SimpleButton;
public var buttonGameNinja:MovieClip;
public var buttonContinue:SimpleButton;
}
}//package
Section 65
//PlayerCar (PlayerCar)
package {
import flash.display.*;
public dynamic class PlayerCar extends MovieClip {
}
}//package
Section 66
//PlayerCarBrakeLights (PlayerCarBrakeLights)
package {
import flash.display.*;
public dynamic class PlayerCarBrakeLights extends MovieClip {
}
}//package
Section 67
//PlayerCarCrash (PlayerCarCrash)
package {
import flash.display.*;
public dynamic class PlayerCarCrash extends MovieClip {
}
}//package
Section 68
//PlayerCarSpin (PlayerCarSpin)
package {
import flash.display.*;
public dynamic class PlayerCarSpin extends MovieClip {
}
}//package
Section 69
//Poly (Poly)
package {
import flash.display.*;
import flash.geom.*;
public class Poly {
var param0:String;
var param1:String;
var subTypeName:String;
var active:Boolean;
var name:String;
var pointList:Array;
var typeName:String;
var boundingRectangle:Rectangle;
var iparam0:int;
var lineList:Array;
var closed:Boolean;
var hitCallback:Object;
var type:int;
var catmullRomLength:Number;
public static const polytype_WALL = 1;
public static const polytype_CEILING = 6;
public static const polytype_ZONE = 3;
public static const polytype_PATH = 0;
public static const polytype_FLOOR = 5;
public static const polytype_OVERLAY = 4;
public static const polytype_TRIGGER = 2;
public function Poly(_arg1:String, _arg2:int, _arg3:Number, _arg4:Number):void{
lineList = new Array();
active = true;
type = _arg2;
name = _arg1;
boundingRectangle = null;
hitCallback = null;
closed = false;
pointList = new Array();
pointList.push(new Point(_arg3, _arg4));
}
function PointOnCurve(_arg1:Number, _arg2:Point, _arg3:Point, _arg4:Point, _arg5:Point):Point{
var _local6:Point;
var _local7:Number;
var _local8:Number;
_local6 = new Point();
_local7 = (_arg1 * _arg1);
_local8 = (_local7 * _arg1);
_local6.x = (0.5 * ((((2 * _arg3.x) + ((-(_arg2.x) + _arg4.x) * _arg1)) + (((((2 * _arg2.x) - (5 * _arg3.x)) + (4 * _arg4.x)) - _arg5.x) * _local7)) + ((((-(_arg2.x) + (3 * _arg3.x)) - (3 * _arg4.x)) + _arg5.x) * _local8)));
_local6.y = (0.5 * ((((2 * _arg3.y) + ((-(_arg2.y) + _arg4.y) * _arg1)) + (((((2 * _arg2.y) - (5 * _arg3.y)) + (4 * _arg4.y)) - _arg5.y) * _local7)) + ((((-(_arg2.y) + (3 * _arg3.y)) - (3 * _arg4.y)) + _arg5.y) * _local8)));
return (_local6);
}
public function GetPoint(_arg1:int):Point{
return (new Point(pointList[_arg1].x, pointList[_arg1].y));
}
public function GetPointNormal(_arg1:int):Point{
return (new Point(lineList[_arg1].nx, lineList[_arg1].ny));
}
public function GetPointOnCatmullRom(_arg1:Number):Point{
var _local2:int;
var _local3:int;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Number;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Point;
_local2 = GetNumPoints();
if (_local2 < 4){
return (new Point(0, 0));
};
_local3 = (_local2 - 1);
_local8 = (Number(_local3) * _arg1);
_local9 = _local8;
_local10 = (_local9 - 1);
_local11 = _local9;
_local12 = (_local9 + 1);
_local13 = (_local9 + 2);
if (_local10 < 0){
_local10 = 0;
};
if (_local12 > (_local2 - 1)){
_local12 = (_local2 - 1);
};
if (_local13 > (_local2 - 1)){
_local13 = (_local2 - 1);
};
_local4 = pointList[_local10];
_local5 = pointList[_local11];
_local6 = pointList[_local12];
_local7 = pointList[_local13];
_local14 = (_local9 + 1);
_local15 = ((1 / Number(_local3)) * _local9);
_local16 = ((1 / Number(_local3)) * _local14);
_local17 = ((1 / (_local16 - _local15)) * (_arg1 - _local15));
_local18 = PointOnCurve(_local17, _local4, _local5, _local6, _local7);
return (_local18);
}
public function AddLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Line;
var _local6:Rectangle;
_local5 = new Line(_arg1, _arg2, _arg3, _arg4);
lineList.push(_local5);
pointList.push(new Point(_arg3, _arg4));
if (boundingRectangle == null){
boundingRectangle = _local5.boundingRect;
} else {
_local6 = boundingRectangle.clone();
boundingRectangle = _local6.union(_local5.boundingRect);
};
}
public function GetLine(_arg1:int):Line{
return (lineList[_arg1]);
}
public function CalculateCatmullRomLength(){
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Point;
var _local6:Point;
var _local7:Point;
_local1 = new Array();
_local3 = GetNumPoints();
if (_local3 < 4){
catmullRomLength = 0;
} else {
_local4 = 0;
while (_local4 < 1) {
_local5 = GetPointOnCatmullRom(_local4);
_local1.push(_local5);
_local4 = (_local4 + 0.025);
};
};
catmullRomLength = 0;
_local2 = 0;
while (_local2 < (_local1.length - 2)) {
_local6 = _local1[_local2];
_local7 = _local1[(_local2 + 1)];
catmullRomLength = (catmullRomLength + Utils.DistBetweenPoints(_local6.x, _local6.y, _local7.x, _local7.y));
_local2++;
};
_local1 = null;
}
public function Finish(_arg1:Boolean){
var _local2:Line;
var _local3:Line;
var _local4:Line;
var _local5:Rectangle;
if (_arg1){
_local2 = lineList[0];
_local3 = lineList[(lineList.length - 1)];
_local4 = new Line(_local3.x1, _local3.y1, _local2.x0, _local2.y0);
lineList.push(_local4);
_local5 = boundingRectangle.clone();
boundingRectangle = _local5.union(_local4.boundingRect);
};
closed = _arg1;
}
public function GetCatmullRomLength():Number{
return (catmullRomLength);
}
public function GetNumLines():int{
return (lineList.length);
}
public function OffsetFromStartPoint(){
var _local1:*;
var _local2:*;
var _local3:int;
var _local4:Line;
_local1 = -(pointList[0].x);
_local2 = -(pointList[0].y);
_local3 = 0;
while (_local3 < pointList.length) {
pointList[_local3].x = (pointList[_local3].x + _local1);
pointList[_local3].y = (pointList[_local3].y + _local2);
_local3++;
};
_local3 = 0;
while (_local3 < lineList.length) {
_local4 = lineList[_local3];
lineList[_local3].x0 = (_local4.x0 + _local1);
_local4.x1 = (_local4.x1 + _local1);
_local4.y0 = (_local4.y0 + _local2);
_local4.y1 = (_local4.y1 + _local2);
_local3++;
};
}
public function DrawCatmullRom(_arg1:BitmapData, _arg2:uint, _arg3:Number, _arg4:Number){
var _local5:int;
var _local6:Number;
var _local7:Point;
_local5 = GetNumPoints();
if (_local5 < 4){
return;
};
_local6 = 0;
while (_local6 < 1) {
_local7 = GetPointOnCatmullRom(_local6);
_arg1.setPixel32((_local7.x + _arg3), (_local7.y + _arg4), _arg2);
_local6 = (_local6 + 0.001);
};
}
public function GetNumPoints():int{
return (pointList.length);
}
public static function FindAllByType(_arg1:int, _arg2:Array):Array{
var _local3:Array;
var _local4:Poly;
_local3 = new Array();
for each (_local4 in _arg2) {
if (_local4.type == _arg1){
_local3.push(_local4);
};
};
return (_local3);
}
public static function FindByName(_arg1:String, _arg2:Array):Poly{
var _local3:Poly;
for each (_local3 in _arg2) {
if (_local3.name == _arg1){
return (_local3);
};
};
return (null);
}
public static function FindIndexByName(_arg1:String, _arg2:Array):int{
var _local3:int;
var _local4:Poly;
_local3 = 0;
for each (_local4 in _arg2) {
if (_local4.name == _arg1){
return (_local3);
};
_local3++;
};
return (-1);
}
}
}//package
Section 70
//PreGameOverlay (PreGameOverlay)
package {
import flash.display.*;
public dynamic class PreGameOverlay extends MovieClip {
public var info:MovieClip;
public function PreGameOverlay(){
addFrameScript(0, frame1, 28, frame29, 60, frame61);
}
function frame1(){
}
function frame29(){
stop();
Game.BetweenLevelsOverlay_Done(0);
}
function frame61(){
stop();
Game.BetweenLevelsOverlay_Done(1);
}
}
}//package
Section 71
//PreRaceOverlay (PreRaceOverlay)
package {
import flash.display.*;
public dynamic class PreRaceOverlay extends MovieClip {
}
}//package
Section 72
//Road (Road)
package {
import flash.display.*;
import flash.geom.*;
public class Road {
var realZStep:Number;
var globalHill:Number;// = 0.01
var raceCamHeight:Number;
public var labels:Array;
var objDistFadeStart:Number;
var name:String;
var globalCurve:Number;// = 0.01
var alphaColTrans:ColorTransform;
var aiCarSpawnPoints:Array;
var billboards:Array;
var road:Array;
var numRoadSegsToDraw:int;
var goalZPos:int;
var roadColors:Array;
var aiZoneList:Array;
var highestY:Number;// = 9999
public var renderZPos:Number;// = 0
var maxObjDist:Number;
var bd:BitmapData;
var highestYZ:Number;// = 9999
var roadBlock:Array;
var roadLen:int;
var camHeight:Number;
var lastAiRangePos:int;
var lastHillPos:int;
var roadBlocks:Array;
var roadDrawSegs:Array;
var aiCarBaseStep:int;
var pickupRotFrame:int;// = 0
var lapLen:int;
var lastBendPos:int;
public function Road(){
globalCurve = 0.01;
globalHill = 0.01;
renderZPos = 0;
highestY = 9999;
highestYZ = 9999;
pickupRotFrame = 0;
super();
roadBlocks = new Array();
}
function GetBillboardIdFromName(_arg1:String):int{
var _local2:Billboard;
for each (_local2 in billboards) {
if (_local2.name == _arg1){
return (_local2.frame);
};
};
return (0);
}
public function GetRoadLabel(_arg1:int):RoadLabel{
return (labels[_arg1]);
}
function AddBillboardRange(_arg1:int, _arg2:int, _arg3:int, _arg4:Number, _arg5:int, _arg6:int, _arg7:Number, _arg8:Number, _arg9:int){
var _local10:int;
var _local11:int;
var _local12:RoadSeg;
var _local13:Number;
var _local14:Number;
_local11 = (_arg1 + _arg2);
if (_local11 > roadLen){
_local11 = roadLen;
};
_local10 = _arg1;
while (_local10 < _local11) {
_local12 = road[_local10];
_local13 = Utils.RandBetweenFloat(_arg5, _arg6);
_local14 = Utils.RandBetweenFloat(_arg7, _arg8);
if (_arg3 == 0){
_local12.AddObj(_local13, _local14, _local10, _arg9, false);
};
if (_arg3 == 1){
_local12.AddObj((_local13 + _local12.width), _local14, _local10, _arg9, true);
};
if (_arg3 == -1){
_local12.AddObj((-(_local12.width) - _local13), _local14, _local10, _arg9, false);
};
_local10 = (_local10 + _arg4);
};
}
public function GetRoadSurfaceType(_arg1:Number):int{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2].surfacetype);
}
function RoadFromXml(){
var _local1:XML;
var _local2:XML;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:*;
var _local12:int;
var _local13:int;
var _local14:uint;
var _local15:RoadSeg;
var _local16:int;
_local1 = GetRoadXml();
lastBendPos = 0;
lastHillPos = 0;
lastAiRangePos = 0;
roadColors = new Array();
_local7 = Utils.RandBetweenInt(128, 0x0100);
_local8 = _local7;
_local9 = _local7;
_local3 = 0;
while (_local3 < 8) {
_local14 = (((4278190080 | (_local9 << 16)) | (_local8 << 8)) | _local7);
roadColors.push(_local14);
_local7 = (_local7 - 8);
_local8 = (_local8 - 8);
_local9 = (_local9 - 8);
if (_local7 < 0){
_local7 = 0;
};
if (_local8 < 0){
_local8 = 0;
};
if (_local9 < 0){
_local9 = 0;
};
_local3++;
};
_local3 = 0;
while (_local3 < roadLen) {
road[_local3].changeX = 0;
road[_local3].changeY = 0;
_local3++;
};
_local10 = (((4278190080 | (uint(_local1.base.@edgecolr) << 16)) | (uint(_local1.base.@edgecolg) << 8)) | uint(_local1.base.@edgecolb));
_local11 = GetSurfaceTypeFromName(_local1.base.@surfacetype);
_local3 = 0;
while (_local3 < roadLen) {
_local15 = road[_local3];
_local15.width = _local1.base.@width;
_local15.surface = _local1.base.@surface;
_local15.surfacetype = _local11;
_local15.colL = _local10;
_local15.colR = _local10;
_local15.rangeMin = 1000;
_local15.rangeMax = 1000;
_local3++;
};
_local3 = 0;
while (_local3 < _local1.edge.length()) {
_local2 = _local1.edge[_local3];
AddEdge(int(_local2.@z), int(_local2.@dist), int(_local2.@side), int(_local2.@colr), int(_local2.@colg), int(_local2.@colb), int(_local2.@splash));
_local3++;
};
_local3 = 0;
while (_local3 < _local1.surfacetype.length()) {
_local2 = _local1.surfacetype[_local3];
AddSurfaceType(int(_local2.@z), int(_local2.@dist), GetSurfaceTypeFromName(_local2.@type));
_local3++;
};
_local3 = 0;
while (_local3 < _local1.surface.length()) {
_local2 = _local1.surface[_local3];
AddSurface(int(_local2.@z), int(_local2.@dist), int(_local2.@surface), int(_local2.@splash));
_local3++;
};
_local3 = 0;
while (_local3 < _local1.width.length()) {
_local2 = _local1.width[_local3];
AddWidth(int(_local2.@z), int(_local2.@dist), int(_local2.@width), int(_local2.@crossdist));
_local3++;
};
_local3 = 0;
while (_local3 < _local1.bend.length()) {
_local2 = _local1.bend[_local3];
AddBend(int(_local2.@z), int(_local2.@dist), int(_local2.@curve));
_local3++;
};
_local3 = 0;
while (_local3 < _local1.hill.length()) {
_local2 = _local1.hill[_local3];
AddHill(int(_local2.@z), int(_local2.@dist), int(_local2.@curve));
_local3++;
};
_local3 = 0;
while (_local3 < _local1.noairange.length()) {
_local2 = _local1.noairange[_local3];
AddAiRange(int(_local2.@z), int(_local2.@dist), Number(_local2.@min), Number(_local2.@max));
_local3++;
};
_local12 = GetBillboardIdFromName("Gantry_Split");
_local13 = GetBillboardIdFromName("Gantry_Goal");
_local3 = 0;
while (_local3 < _local1.billboard.length()) {
_local2 = _local1.billboard[_local3];
_local16 = GetBillboardIdFromName(_local2.@type);
AddBillboardRange(int(_local2.@z), int(_local2.@dist), int(_local2.@side), Number(_local2.@frequency), Number(_local2.@x0), Number(_local2.@x1), Number(_local2.@y0), Number(_local2.@y1), _local16);
if ((((_local16 == _local12)) || ((_local16 == _local13)))){
goalZPos = int(_local2.@z);
};
_local3++;
};
}
function Render():void{
var _local1:XML;
var _local2:int;
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:Array;
var _local8:GameObj;
var _local9:*;
var _local10:Number;
var _local11:int;
var _local12:int;
var _local13:Number;
var _local14:Number;
var _local15:int;
var _local16:V3;
var _local17:V3;
var _local18:V3;
var _local19:RoadSeg;
var _local20:RoadDrawSeg;
var _local21:RoadDrawSeg;
var _local22:Array;
var _local23:*;
var _local24:*;
var _local25:*;
var _local26:int;
var _local27:*;
var _local28:*;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Rectangle;
var _local37:Number;
var _local38:int;
var _local39:Array;
var _local40:*;
var _local41:Rectangle;
var _local42:Point;
var _local43:Rectangle;
var _local44:int;
var _local45:int;
var _local46:int;
var _local47:int;
var _local48:int;
var _local49:Number;
var _local50:Number;
var _local51:Number;
var _local52:RoadObj;
var _local53:RoadObj;
var _local54:Number;
var _local55:int;
var _local56:Number;
var _local57:uint;
var _local58:uint;
var _local59:uint;
var _local60:int;
var _local61:int;
var _local62:int;
var _local63:int;
var _local64:int;
var _local65:int;
var _local66:Array;
var _local67:Bitmap;
var _local68:Number;
var _local69:int;
var _local70:Number;
var _local71:Number;
bd = Game.main.trackBD;
_local1 = GetRoadXml();
_local2 = int(_local1.background.@frame);
_local3 = uint(_local1.background.@colr);
_local4 = uint(_local1.background.@colg);
_local5 = uint(_local1.background.@colb);
_local6 = (((4278190080 | (_local3 << 16)) | (_local4 << 8)) | _local5);
numRoadSegsToDraw = _local1.info.@drawdist;
_local7 = new Array();
for each (_local8 in GameObjects.objs) {
if (((_local8.active) && (_local8.is3DObj))){
_local7.push(_local8);
};
};
_local9 = -(_local1.info.@zoffset);
_local10 = _local1.info.@fov;
Game.camera.fov = _local10;
_local11 = (int(renderZPos) + _local9);
if (_local11 < 0){
_local11 = 0;
};
_local12 = (_local11 + numRoadSegsToDraw);
_local13 = (_local11 * realZStep);
_local14 = (_local12 * realZStep);
_local16 = new V3();
_local17 = new V3();
_local18 = new V3();
_local22 = new Array();
_local22.push(GraphicObjects.GetBitmap(GraphicObjects.gfx_objects, 0));
_local22.push(GraphicObjects.GetBitmap(GraphicObjects.gfx_objects, 1));
_local23 = -(Game.goPlayer.xpos);
_local24 = camHeight;
_local25 = 0;
highestY = 9999;
highestYZ = 9999;
_local26 = 0;
_local27 = 0;
_local28 = 0;
_local15 = _local11;
while (_local15 < _local12) {
_local19 = road[_local15];
_local20 = roadDrawSegs[_local26];
_local20.rs = _local19;
_local20.surface = _local19.surface;
_local20.z = _local25;
_local20.cx = _local23;
_local20.cy = _local24;
_local20.wz = (_local25 + (_local11 * realZStep));
_local25 = (_local25 + realZStep);
_local27 = (_local27 + _local19.changeX);
_local28 = (_local28 + _local19.changeY);
_local23 = (_local23 + _local27);
_local24 = (_local24 + _local28);
_local26++;
_local15++;
};
_local29 = Defs.displayarea_w2;
_local30 = Defs.roadarea_h2;
_local26 = 0;
_local15 = _local11;
while (_local15 < _local12) {
_local19 = road[_local15];
_local20 = roadDrawSegs[_local26];
_local20.surface = _local19.surface;
_local49 = (_local20.cx - _local19.width);
_local50 = (_local20.cx + _local19.width);
_local51 = _local20.cy;
_local16.FromXYZ(_local49, _local51, _local20.z);
_local17.FromXYZ(_local50, _local51, _local20.z);
_local16.PerspectiveTransform1(_local10);
_local17.PerspectiveTransform1(_local10);
_local16.x1 = (_local16.x1 + _local29);
_local16.y1 = (_local16.y1 + _local30);
_local17.x1 = (_local17.x1 + _local29);
_local20.objs = new Array();
if (_local26 < maxObjDist){
_local20.objs = new Array();
for each (_local52 in _local19.objs) {
_local18.FromXYZ((_local20.cx + _local52.xpos), _local52.ypos, _local20.z);
_local18.PerspectiveTransform1(_local10);
_local53 = new RoadObj();
_local53.type = _local52.type;
_local53.xflip = _local52.xflip;
_local53.xpos = (_local18.x1 + _local29);
_local53.ypos = (_local18.y1 + _local30);
_local53.ypos1 = _local18.y1;
_local20.objs.push(_local53);
};
};
_local20.x0 = _local16.x1;
_local20.x1 = _local17.x1;
_local20.ypos = _local16.y1;
_local26++;
if (_local16.y1 < highestY){
highestY = _local16.y1;
highestYZ = _local20.z;
};
_local15++;
};
_local31 = roadDrawSegs[0].cy;
_local32 = roadDrawSegs[-(_local9)].cy;
_local33 = (_local32 - _local31);
_local15 = 0;
while (_local15 < _local26) {
_local20 = roadDrawSegs[_local15];
roadDrawSegs[_local15].ypos = (_local20.ypos - _local33);
_local15++;
};
highestY = (highestY - _local33);
for each (_local8 in _local7) {
_local54 = _local8.zpos;
if ((((_local54 >= _local11)) && ((_local54 < _local12)))){
_local55 = (_local54 - _local11);
_local20 = roadDrawSegs[_local55];
_local21 = roadDrawSegs[(_local55 + 1)];
_local56 = ((_local54 - _local11) * realZStep);
_local18.FromXYZ((_local8.xpos + _local20.cx), _local8.ypos, _local56);
_local18.PerspectiveTransform1(_local10);
_local53 = new RoadObj();
_local53.type = 0;
_local53.xpos = (_local18.x1 + _local29);
_local53.ypos = (_local18.y1 + _local30);
_local53.zpos = _local56;
_local53.ypos1 = _local18.y1;
_local53.gameObject = _local8;
_local20.objs.push(_local53);
};
};
bd.fillRect(new Rectangle(0, 0, Defs.displayarea_w, highestY), _local6);
_local34 = Game.playerRot;
_local35 = (highestY + 1);
GraphicObjects.RenderAt(GraphicObjects.gfx_background, _local2, bd, _local34, _local35);
GraphicObjects.RenderAt(GraphicObjects.gfx_background, _local2, bd, (_local34 - 0x0500), _local35);
_local36 = new Rectangle();
_local38 = 0;
_local39 = roadColors;
_local40 = 3;
_local41 = new Rectangle();
_local42 = new Point(0, 0);
_local43 = new Rectangle(0, 0);
_local44 = Defs.roadarea_h;
_local45 = 0;
_local46 = 0;
_local47 = 0;
_local48 = (GraphicObjects.road_maxw - 1);
_local15 = (_local26 - 1);
while (_local15 >= 1) {
_local20 = roadDrawSegs[_local15];
_local21 = roadDrawSegs[(_local15 - 1)];
_local57 = _local20.rs.colL;
_local58 = _local20.rs.colR;
_local59 = _local39[_local20.surface];
_local60 = int(_local20.ypos);
_local61 = int(_local21.ypos);
_local62 = int(_local20.z);
_local63 = int(_local21.z);
if (_local60 >= _local61){
} else {
if (_local20.z < highestYZ){
};
};
_local64 = (_local61 - _local60);
if (_local64 == 0){
if (_local60 == _local47){
_local46++;
} else {
_local47 = _local60;
_local36.x = _local20.x0;
_local36.y = _local20.ypos;
_local36.width = (_local20.x1 - _local20.x0);
_local36.height = (_local64 + 1);
_local45++;
if (_local36.x >= 0){
_local43.x = 0;
_local43.y = _local36.y;
_local43.width = _local36.x;
_local43.height = _local36.height;
bd.fillRect(_local43, _local57);
};
if ((_local36.x + _local36.width) < 640){
_local68 = (_local36.x + _local36.width);
_local43.x = _local68;
_local43.y = _local36.y;
_local43.width = (640 - _local68);
_local43.height = _local36.height;
bd.fillRect(_local43, _local58);
};
_local65 = _local20.wz;
_local65 = (_local65 & 511);
_local65 = (_local65 >> 1);
_local66 = roadBlocks[_local20.surface];
_local67 = GraphicObjects.GetScaledScanLineBitmap(_local66[_local65], _local36.width);
if (_local67 != null){
_local69 = _local36.width;
if (_local69 > (_local48 - 1)){
_local69 = _local48;
};
_local43.x = 0;
_local43.y = _local69;
_local43.width = (_local36.width - 1);
_local43.height = 1;
_local42.x = _local36.x;
_local42.y = _local36.y;
bd.copyPixels(_local67.bitmapData, _local43, _local42);
};
};
} else {
if (_local60 == _local47){
_local46++;
} else {
_local47 = _local60;
_local70 = ((_local21.x0 - _local20.x0) / Number(_local64));
_local71 = ((_local21.x1 - _local20.x1) / Number(_local64));
_local49 = _local20.x0;
_local50 = _local20.x1;
if (_local61 > _local44){
_local61 = _local44;
};
if (_local60 < 0){
_local60 = 0;
};
_local37 = _local60;
while (_local37 <= _local61) {
_local36.x = _local49;
_local36.y = _local37;
_local36.width = (_local50 - _local49);
_local36.height = 1;
_local45++;
if (_local36.x >= 0){
_local43.x = 0;
_local43.y = _local36.y;
_local43.width = _local36.x;
_local43.height = _local36.height;
bd.fillRect(_local43, _local57);
};
if ((_local36.x + _local36.width) < 640){
_local68 = (_local36.x + _local36.width);
_local43.x = _local68;
_local43.y = _local36.y;
_local43.width = (640 - _local68);
_local43.height = _local36.height;
bd.fillRect(_local43, _local58);
};
_local65 = _local20.wz;
_local65 = (_local65 & 511);
_local65 = (_local65 >> 1);
_local66 = roadBlocks[_local20.surface];
_local67 = GraphicObjects.GetScaledScanLineBitmap(_local66[_local65], _local36.width);
if (_local67 != null){
_local69 = _local36.width;
if (_local69 > _local48){
_local69 = _local48;
};
_local43.x = 0;
_local43.y = _local69;
_local43.width = (_local36.width - 1);
_local43.height = 1;
_local42.x = _local36.x;
_local42.y = _local36.y;
bd.copyPixels(_local67.bitmapData, _local43, _local42);
};
_local49 = (_local49 + _local70);
_local50 = (_local50 + _local71);
_local37++;
};
};
};
for each (_local52 in _local20.objs) {
RenderBlock(_local52, _local20);
};
_local15--;
};
}
function InitBillboardData(){
var _local1:XML;
var _local2:int;
var _local3:XML;
var _local4:Billboard;
var _local5:int;
var _local6:XML;
var _local7:BillboardCollision;
billboards = new Array();
_local1 = ExternalData.xml;
_local2 = 0;
while (_local2 < _local1.billboard.length()) {
_local3 = _local1.billboard[_local2];
_local4 = new Billboard();
_local4.name = _local3.@name;
_local4.frame = int(_local3.@frame);
_local4.yoffset = Number(_local3.@yoffset);
_local5 = 0;
while (_local5 < _local3.collision.length()) {
_local6 = _local3.collision[_local5];
_local7 = new BillboardCollision();
_local7.xoffset = Number(_local6.@xoff);
_local7.yoffset = 0;
_local7.type = int(_local6.@type);
_local7.radius = Number(_local6.@radius);
_local4.collisions.push(_local7);
_local5++;
};
billboards.push(_local4);
_local2++;
};
}
function AddAiRange(_arg1:int, _arg2:int, _arg3:Number, _arg4:Number){
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:RoadSeg;
if (_arg1 < 0){
_arg1 = lastAiRangePos;
};
_local5 = (_arg2 + _arg1);
if (_local5 > roadLen){
_local5 = roadLen;
};
_local7 = (_local5 - _arg1);
_local8 = (Math.PI / _local7);
_local9 = 0;
_local6 = _arg1;
while (_local6 < _local5) {
_local10 = road[_local6];
_local10.rangeMin = _arg3;
_local10.rangeMax = _arg4;
_local6++;
};
lastAiRangePos = _local5;
}
function RenderBlock(_arg1:RoadObj, _arg2:RoadDrawSeg){
var _local3:Boolean;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
var _local8:GameObj;
var _local9:Boolean;
var _local10:V3;
var _local11:V3;
var _local12:int;
var _local13:Bitmap;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Rectangle;
var _local20:Number;
var _local21:Number;
var _local22:Rectangle;
var _local23:Matrix;
var _local24:Number;
var _local25:RoadSeg;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
_local3 = false;
_local4 = _arg1.ypos;
_local5 = _arg1.zpos;
_local4 = _arg2.ypos;
_local5 = _arg2.z;
_local6 = _arg1.xpos;
_local7 = _arg1.type;
_local8 = _arg1.gameObject;
_local9 = false;
_local10 = new V3();
_local11 = new V3();
if (_local8 == null){
_local14 = GraphicObjects.gfx_billboards;
_local12 = _local7;
_local9 = _arg1.xflip;
} else {
_local25 = _arg2.rs;
_local14 = _local8.graphicID;
_local26 = (_local8.xpos - Game.goPlayer.xpos);
_local10.FromXYZ(_local26, 0, _local5);
_local10.PerspectiveTransform(0, 0, Game.camera.fov);
if (_local8.isPlayer){
_local3 = true;
if ((((_local8.controlMode == 0)) || ((_local8.controlMode == 3)))){
_local26 = (_local8.xvel * 0.2);
_local26 = Utils.Clamp(-3, 3, _local26);
_local28 = _arg2.rs.changeY;
_local28 = (_local28 * 80);
_local28 = Utils.Clamp(-2, 2, _local28);
if (((_local8.braking) && ((_local8.zvel > 5)))){
_local28 = (_local28 + 1);
_local28 = Utils.Clamp(-2, 2, _local28);
};
_local12 = (17 + int(_local26));
_local12 = (_local12 + (int(_local28) * 7));
_local8.frame = _local12;
_local8.angle_x = _local26;
_local8.angle_y = _local28;
} else {
_local12 = _local8.frame;
};
} else {
if (_local8.isAiVehicle){
_local28 = _arg2.rs.changeY;
_local28 = (_local28 * 20);
_local28 = Utils.Clamp(-2, 2, _local28);
_local26 = (_local10.x1 * 0.02);
_local27 = _arg2.rs.changeX;
_local27 = (_local27 * 10);
_local26 = (_local26 - _local27);
_local26 = Utils.Clamp(-2, 2, _local26);
_local12 = (12 + int(_local26));
_local12 = (_local12 + (int(_local28) * 5));
} else {
_local12 = _local8.frame;
};
};
};
_local13 = GraphicObjects.GetBitmap(_local14, _local12, _local9);
_local15 = GraphicObjects.GetXOffset(_local14, _local12, _local9);
_local16 = GraphicObjects.GetYOffset(_local14, _local12, _local9);
_local17 = _local13.width;
_local18 = _local13.height;
_local10.FromXYZ(_local15, _local16, _local5);
_local11.FromXYZ((_local15 + _local17), (_local16 + _local18), _local5);
_local10.PerspectiveTransform(0, 0, Game.camera.fov);
_local11.PerspectiveTransform(0, 0, Game.camera.fov);
_local4 = (_local4 - _arg1.ypos1);
_local10.x1 = (_local10.x1 + _local6);
_local10.y1 = (_local10.y1 + _local4);
_local11.x1 = (_local11.x1 + _local6);
_local11.y1 = (_local11.y1 + _local4);
if (_arg2.z > highestYZ){
if (_local10.y1 > highestY){
return;
};
};
_local19 = new Rectangle(_local10.x1, _local10.y1, ((_local11.x1 - _local10.x1) + 1), ((_local11.y1 - _local10.y1) + 1));
_local20 = (Number(_local19.width) / Number(_local17));
_local21 = (Number(_local19.height) / Number(_local18));
_local22 = _local19;
_local23 = new Matrix();
_local23.scale(_local20, _local21);
_local23.translate(_local10.x1, _local10.y1);
_local24 = _local5;
if (_local24 < (objDistFadeStart * realZStep)){
bd.draw(_local13, _local23, null, null, _local22, true);
} else {
_local29 = Utils.ScaleTo(1, 0, (objDistFadeStart * realZStep), (maxObjDist * realZStep), _local24);
alphaColTrans.alphaMultiplier = _local29;
bd.draw(_local13, _local23, alphaColTrans, null, _local22);
};
if (_local3){
if (_local8.braking){
_local14 = GraphicObjects.gfx_playerbrake;
_local13 = GraphicObjects.GetBitmap(_local14, _local12, _local9);
_local15 = GraphicObjects.GetXOffset(_local14, _local12, _local9);
_local16 = GraphicObjects.GetYOffset(_local14, _local12, _local9);
_local17 = _local13.width;
_local18 = _local13.height;
_local10.FromXYZ(_local15, _local16, _local5);
_local11.FromXYZ((_local15 + _local17), (_local16 + _local18), _local5);
_local10.PerspectiveTransform(0, 0, Game.camera.fov);
_local11.PerspectiveTransform(0, 0, Game.camera.fov);
_local4 = (_local4 - _arg1.ypos1);
_local10.x1 = (_local10.x1 + _local6);
_local10.y1 = (_local10.y1 + _local4);
_local11.x1 = (_local11.x1 + _local6);
_local11.y1 = (_local11.y1 + _local4);
_local19 = new Rectangle(_local10.x1, _local10.y1, ((_local11.x1 - _local10.x1) + 1), ((_local11.y1 - _local10.y1) + 1));
_local20 = (Number(_local19.width) / Number(_local17));
_local21 = (Number(_local19.height) / Number(_local18));
_local22 = _local19;
_local23 = new Matrix();
_local23.scale(_local20, _local21);
_local23.translate(_local10.x1, _local10.y1);
bd.draw(_local13, _local23, null, null, _local22, true);
};
};
}
public function GetRoadObjects(_arg1:Number):Array{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2].objs);
}
function GetRoadXml():XML{
var _local1:XML;
var _local2:XML;
_local1 = ExternalData.xml;
_local2 = _local1.road[Game.currentLevel];
return (_local2);
}
function AddWidth(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:RoadSeg;
_local5 = (_arg2 + _arg1);
if (_local5 > roadLen){
_local5 = roadLen;
};
_local7 = road[_arg1].width;
_local8 = road[(_local5 - 1)].width;
_local6 = _arg1;
while (_local6 < _local5) {
_local9 = road[_local6];
_local9.width = _arg3;
_local6++;
};
_local6 = _arg1;
while (_local6 < _local5) {
road[_local6].width = _local7;
if (_local7 < _arg3){
_local7++;
};
if (_local7 > _arg3){
_local7--;
};
if (_local7 == _arg3){
break;
};
_local6++;
};
_local6 = _local5;
while (_local6 > _arg1) {
road[_local6].width = _local8;
if (_local8 < _arg3){
_local8++;
};
if (_local8 > _arg3){
_local8--;
};
if (_local8 == _arg3){
break;
};
_local6--;
};
}
public function GetRoadChangeY(_arg1:Number):Number{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2].changeY);
}
public function GetRoadChangeX(_arg1:Number):Number{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2].changeX);
}
function AddBend(_arg1:int, _arg2:int, _arg3:Number){
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:RoadSeg;
if (_arg1 < 0){
_arg1 = lastBendPos;
};
_local4 = (_arg2 + _arg1);
if (_local4 > roadLen){
_local4 = roadLen;
};
_local6 = (_local4 - _arg1);
_local7 = (Math.PI / _local6);
_local8 = 0;
_local5 = _arg1;
while (_local5 < _local4) {
_local9 = road[_local5];
_local9.changeX = ((Math.sin(_local8) * _arg3) * globalCurve);
_local8 = (_local8 + _local7);
_local5++;
};
lastBendPos = _local4;
}
function AddEdge(_arg1:int, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int){
var _local8:int;
var _local9:int;
var _local10:uint;
var _local11:RoadSeg;
_local9 = (_arg1 + _arg2);
if (_local9 > roadLen){
_local9 = roadLen;
};
_local10 = (((4278190080 | (_arg4 << 16)) | (_arg5 << 8)) | _arg6);
_local8 = _arg1;
while (_local8 < _local9) {
_local11 = road[_local8];
if (_arg3 == -1){
_local11.colL = _local10;
_local11.splashL = _arg7;
} else {
if (_arg3 == 1){
_local11.colR = _local10;
_local11.splashR = _arg7;
} else {
_local11.colL = _local10;
_local11.colR = _local10;
_local11.splashL = _arg7;
_local11.splashR = _arg7;
};
};
_local8++;
};
}
function GetSurfaceTypeFromName(_arg1:String):int{
var _local2:int;
_local2 = 0;
if (_arg1 == "tarmac"){
_local2 = 0;
};
if (_arg1 == "bumpy"){
_local2 = 1;
};
if (_arg1 == "wet"){
_local2 = 2;
};
return (_local2);
}
function AddSurfaceType(_arg1:int, _arg2:int, _arg3:int){
var _local4:int;
var _local5:int;
var _local6:RoadSeg;
_local5 = (_arg1 + _arg2);
if (_local5 > roadLen){
_local5 = roadLen;
};
_local4 = _arg1;
while (_local4 < _local5) {
_local6 = road[_local4];
_local6.surfacetype = _arg3;
_local4++;
};
}
function AddSurface(_arg1:int, _arg2:int, _arg3:int, _arg4:int){
var _local5:int;
var _local6:int;
var _local7:RoadSeg;
_local6 = (_arg1 + _arg2);
if (_local6 > roadLen){
_local6 = roadLen;
};
_local5 = _arg1;
while (_local5 < _local6) {
_local7 = road[_local5];
_local7.surface = _arg3;
_local7.splashM = _arg4;
_local5++;
};
}
public function GetRoadSurfaceSplashL(_arg1:Number):int{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2].splashL);
}
function GenerateAiVehicleSpawnPoints(){
var _local1:Number;
var _local2:RoadAIZone;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Point;
aiCarSpawnPoints = new Array();
_local1 = aiCarBaseStep;
for each (_local2 in aiZoneList) {
_local3 = (_local1 * _local2.density);
_local4 = 0;
_local4 = _local2.z0;
while (_local4 < _local2.z1) {
_local5 = Utils.RandBetweenInt(0, _local3);
_local6 = new Point((_local4 + _local5), _local2.type);
aiCarSpawnPoints.push(_local6);
_local4 = (_local4 + _local3);
};
};
aiCarSpawnPoints.sortOn("x", Array.NUMERIC);
trace(((("spawn: " + aiCarSpawnPoints.length) + " ") + aiCarSpawnPoints[0]));
}
function InitRoad():void{
var _local1:XML;
var _local2:XML;
var _local3:XML;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
trace(("starting road currentlevel = " + Game.currentLevel));
_local1 = GetRoadXml();
InitBillboardData();
alphaColTrans = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
aiCarSpawnPoints = null;
aiCarBaseStep = int(_local1.info.@aigenstep);
name = _local1.info.@name;
lapLen = int(_local1.info.@length);
roadLen = int(_local1.info.@length);
maxObjDist = _local1.info.@objdist;
objDistFadeStart = (maxObjDist - 100);
realZStep = _local1.info.@zstep;
camHeight = _local1.info.@camheight;
raceCamHeight = _local1.info.@camheight;
goalZPos = roadLen;
globalCurve = Number(_local1.base.@curvemul);
globalHill = Number(_local1.base.@hillmul);
roadDrawSegs = new Array(10000);
_local4 = 0;
while (_local4 < 10000) {
roadDrawSegs[_local4] = new RoadDrawSeg();
_local4++;
};
aiZoneList = new Array();
_local6 = 0;
while (_local6 < _local1.aizone.length()) {
_local3 = _local1.aizone[_local6];
aiZoneList.push(new RoadAIZone(Number(_local3.@z), Number(_local3.@dist), Number(_local3.@density), int(_local3.@cartype)));
_local6++;
};
road = new Array(roadLen);
_local4 = 0;
while (_local4 < roadLen) {
road[_local4] = new RoadSeg();
road[_local4].width = 500;
_local4++;
};
labels = new Array();
labels.push(new RoadLabel(0, "Start"));
_local6 = 0;
while (_local6 < _local1.label.length()) {
_local3 = _local1.label[_local6];
labels.push(new RoadLabel(_local3.@z, _local3.@text));
_local6++;
};
roadBlocks = new Array();
_local6 = 0;
while (_local6 < _local1.roadsegment.length()) {
_local3 = _local1.roadsegment[_local6];
roadBlock = new Array();
_local4 = 0;
while (_local4 < _local3.pattern.length()) {
_local2 = _local3.pattern[_local4];
_local7 = int(_local2.@value);
_local8 = int(_local2.@repeat);
_local5 = 0;
while (_local5 < _local8) {
roadBlock.push(_local7);
_local5++;
};
_local4++;
};
roadBlocks.push(roadBlock);
_local6++;
};
RoadFromXml();
GenerateAiVehicleSpawnPoints();
}
function AddHill(_arg1:int, _arg2:int, _arg3:Number){
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:RoadSeg;
if (_arg1 < 0){
_arg1 = lastHillPos;
};
_local4 = (_arg2 + _arg1);
if (_local4 > roadLen){
_local4 = roadLen;
};
_local6 = (_local4 - _arg1);
_local7 = (Math.PI / _local6);
_local8 = 0;
_local5 = _arg1;
while (_local5 < _local4) {
_local9 = road[_local5];
_local9.changeY = ((Math.sin(_local8) * _arg3) * globalHill);
_local8 = (_local8 + _local7);
_local5++;
};
lastHillPos = _local4;
}
public function GetRoadSurfaceSplashM(_arg1:Number):int{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2].splashM);
}
public function GetRoadWidth(_arg1:Number):Number{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2].width);
}
public function GetRoadSurfaceSplashR(_arg1:Number):int{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2].splashR);
}
public function GetRoadSeg(_arg1:Number):RoadSeg{
var _local2:int;
_local2 = int(_arg1);
if (_local2 < 0){
_local2 = 0;
};
if (_local2 >= road.length){
_local2 = (road.length - 1);
};
return (road[_local2]);
}
}
}//package
Section 73
//RoadAIZone (RoadAIZone)
package {
public class RoadAIZone {
var density:Number;
var z0:Number;
var z1:Number;
var type:int;
public function RoadAIZone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:int){
z0 = _arg1;
z1 = (z0 + _arg2);
density = (1 / _arg3);
type = _arg4;
}
}
}//package
Section 74
//RoadDrawSeg (RoadDrawSeg)
package {
import flash.display.*;
import flash.geom.*;
public class RoadDrawSeg {
var x1:Number;
var rs:RoadSeg;
var peakL:Number;
var peakR:Number;
var objs:Array;
var b:Bitmap;
var wz:Number;
var m:Matrix;
var cx:Number;
var x0:Number;
var r:Rectangle;
var z:Number;
var ypos:Number;
var surface:int;
var cy:Number;
public function RoadDrawSeg(){
m = new Matrix();
b = null;
r = new Rectangle();
ypos = 0;
x0 = 0;
x1 = 0;
z = 0;
wz = 0;
objs = new Array();
rs = null;
}
}
}//package
Section 75
//RoadLabel (RoadLabel)
package {
public class RoadLabel {
var zpos:int;
var name:String;
public function RoadLabel(_arg1:int, _arg2:String){
zpos = _arg1;
name = _arg2;
}
}
}//package
Section 76
//RoadObj (RoadObj)
package {
public class RoadObj {
public var xflip:Boolean;
public var zpos:Number;
public var gameObject:GameObj;
public var ypos1:Number;
public var type:int;
public var ypos:Number;
public var xpos:Number;
public function RoadObj(){
ypos = 0;
ypos1 = 0;
zpos = 0;
xpos = 0;
type = 0;
xflip = false;
gameObject = null;
}
}
}//package
Section 77
//RoadSeg (RoadSeg)
package {
public class RoadSeg {
var splashL:int;
var width:Number;
var splashR:int;
var splashM:int;
var colL:uint;
var rangeMin:Number;
var colR:uint;
var objs:Array;
var surfacetype:int;
var changeX:Number;
var changeY:Number;
var surface:int;
var rangeMax:Number;
var type:int;
public function RoadSeg(){
type = 0;
width = 300;
changeX = 0;
changeY = 0;
surface = 0;
surfacetype = 0;
colL = 0;
colR = 0;
objs = new Array();
rangeMin = 100;
rangeMax = 200;
splashL = 0;
splashM = 0;
splashR = 0;
}
public function AddObj(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:int, _arg5:Boolean){
var _local6:RoadObj;
_local6 = new RoadObj();
_local6.type = _arg4;
_local6.xpos = _arg1;
_local6.ypos = _arg2;
_local6.zpos = _arg3;
_local6.xflip = _arg5;
objs.push(_local6);
}
}
}//package
Section 78
//RoadSurface (RoadSurface)
package {
import flash.display.*;
public dynamic class RoadSurface extends MovieClip {
}
}//package
Section 79
//SaveData (SaveData)
package {
import flash.net.*;
public class SaveData {
static var id:String = "HeatRush93";
public static function Clear():void{
var _local1:SharedObject;
_local1 = SharedObject.getLocal(id);
_local1.clear();
_local1.close();
_local1.flush();
trace("SaveData Data Cleared");
trace(("len: " + _local1.size));
}
public static function Save():void{
var _local1:int;
var _local2:SharedObject;
var _local3:Array;
var _local4:Upgrade;
var _local5:Array;
var _local6:Achievement;
var _local7:Array;
_local2 = SharedObject.getLocal(id);
if (_local2 == null){
trace("SO null");
return;
};
if (_local2.size == 0){
trace("SO size 0");
};
_local2.clear();
_local3 = new Array();
for each (_local4 in Upgrades.list) {
_local3.push(_local4.gotit);
};
_local2.data.upgrades = _local3;
_local5 = new Array();
for each (_local6 in Achievements.list) {
_local5.push(_local6.complete);
};
_local2.data.achievements = _local5;
_local7 = new Array();
_local1 = 0;
while (_local1 < 10) {
_local7.push(Game.levelsUnlocked[_local1]);
_local1++;
};
_local2.data.levelsUnlocked = _local7;
_local2.close();
trace("Saved Data OK");
}
public static function Load():void{
var _local1:SharedObject;
var _local2:int;
var _local3:Array;
var _local4:Upgrade;
var _local5:Array;
var _local6:Achievement;
_local1 = SharedObject.getLocal(id);
if (_local1 == null){
trace((("Shared Object: " + id) + " is null"));
return;
};
if (_local1.size == 0){
trace((("Shared Object: " + id) + " size=0"));
_local1.close();
return;
};
_local3 = _local1.data.upgrades;
_local2 = 0;
for each (_local4 in Upgrades.list) {
_local4.gotit = _local3[_local2];
_local2++;
};
_local5 = _local1.data.achievements;
_local2 = 0;
for each (_local6 in Achievements.list) {
_local6.complete = _local5[_local2];
_local2++;
};
_local2 = 0;
while (_local2 < 10) {
Game.levelsUnlocked[_local2] = _local1.data.levelsUnlocked[_local2];
_local2++;
};
_local1.close();
trace("Loaded data OK");
}
public static function DontLoad():void{
}
public static function Exists():Boolean{
var _local1:SharedObject;
_local1 = SharedObject.getLocal(id);
if (_local1 == null){
trace((("Shared Object: " + id) + " null"));
return (false);
};
if (_local1.size == 0){
trace((("Shared Object: " + id) + " size 0"));
_local1.close();
return (false);
};
_local1.close();
return (true);
}
public static function DontSave():void{
}
}
}//package
Section 80
//SFX_BigCrash (SFX_BigCrash)
package {
import flash.media.*;
public dynamic class SFX_BigCrash extends Sound {
}
}//package
Section 81
//SFX_Crash (SFX_Crash)
package {
import flash.media.*;
public dynamic class SFX_Crash extends Sound {
}
}//package
Section 82
//SFX_Crash01 (SFX_Crash01)
package {
import flash.media.*;
public dynamic class SFX_Crash01 extends Sound {
}
}//package
Section 83
//SFX_Crash02 (SFX_Crash02)
package {
import flash.media.*;
public dynamic class SFX_Crash02 extends Sound {
}
}//package
Section 84
//SFX_Crash03 (SFX_Crash03)
package {
import flash.media.*;
public dynamic class SFX_Crash03 extends Sound {
}
}//package
Section 85
//SFX_Skid (SFX_Skid)
package {
import flash.media.*;
public dynamic class SFX_Skid extends Sound {
}
}//package
Section 86
//SFX_Turbo (SFX_Turbo)
package {
import flash.media.*;
public dynamic class SFX_Turbo extends Sound {
}
}//package
Section 87
//SingleUpgrade (SingleUpgrade)
package {
import flash.display.*;
import flash.text.*;
public dynamic class SingleUpgrade extends MovieClip {
public var textName:TextField;
public var textHowTo:TextField;
}
}//package
Section 88
//SiteLock (SiteLock)
package {
import flash.events.*;
public class SiteLock {
static var miniclip_locked:Boolean = false;
static var sitelockActive:Boolean = false;
public static function InitOnce():void{
}
static function onValidDomain(_arg1:Event):void{
trace("Miniclip sitelock OK");
miniclip_locked = false;
}
public static function IsLocked():Boolean{
var _local1:String;
_local1 = GetDomain();
if (Licensors.GetLicensor() == Licensors.LICENSOR_GAMENINJA_LOCKED){
if (_local1 != "gameninja.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_KONGREGATE){
if (_local1 != "kongregate.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_SHOCKWAVE){
if (_local1 != "shockwave.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_KING){
if (((!((_local1 == "king.com"))) && (!((_local1 == "midasplayer.com"))))){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_GAMEZHERO){
if (_local1 != "gamezhero.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_ARMORGAMES){
if (_local1 != "armorgames.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_BUBBLEBOX){
if (_local1 != "bubblebox.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_ANDKON){
if (_local1 != "andkon.com"){
return (true);
};
return (false);
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_BIGFISH){
if (((((((((((!((_local1 == "bigfishgames.com"))) && (!((_local1 == "bigfishgames.de"))))) && (!((_local1 == "bigfishgames.fr"))))) && (!((_local1 == "bigfishgames.es"))))) && (!((_local1 == "bigfishgames.mx"))))) && (!((_local1 == "bigfishgames.jp"))))){
return (true);
};
return (false);
};
return (false);
}
public static function GetDomain():String{
var _local1:String;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local1 = Main.theStage.loaderInfo.url;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
return (_local4);
}
public static function GetDomainFromUrl(_arg1:String):String{
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local2 = (_arg1.indexOf("://") + 3);
_local3 = _arg1.indexOf("/", _local2);
_local4 = _arg1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
return (_local4);
}
static function onInvalidDomain(_arg1:Event):void{
trace("Miniclip sitelock INVALID");
miniclip_locked = true;
}
}
}//package
Section 89
//SkidSmoke (SkidSmoke)
package {
import flash.display.*;
public dynamic class SkidSmoke extends MovieClip {
}
}//package
Section 90
//SkidSmoke01 (SkidSmoke01)
package {
import flash.display.*;
public dynamic class SkidSmoke01 extends MovieClip {
}
}//package
Section 91
//SkidSmoke02 (SkidSmoke02)
package {
import flash.display.*;
public dynamic class SkidSmoke02 extends MovieClip {
}
}//package
Section 92
//SkidSmoke03 (SkidSmoke03)
package {
import flash.display.*;
public dynamic class SkidSmoke03 extends MovieClip {
}
}//package
Section 93
//SkidSmoke04 (SkidSmoke04)
package {
import flash.display.*;
public dynamic class SkidSmoke04 extends MovieClip {
}
}//package
Section 94
//SkidSmoke05 (SkidSmoke05)
package {
import flash.display.*;
public dynamic class SkidSmoke05 extends MovieClip {
}
}//package
Section 95
//SkidSmoke06 (SkidSmoke06)
package {
import flash.display.*;
public dynamic class SkidSmoke06 extends MovieClip {
}
}//package
Section 96
//SoundPlayer (SoundPlayer)
package {
import flash.media.*;
import flash.utils.*;
public class SoundPlayer {
public static const minPlayTime = 3;
public static const SOUND_MAX = 8;
public static const SOUND_TURBO = 3;
public static const SOUND_HITCAR = 1;
public static const SOUND_ENGINELOOP = 2;
public static const SOUND_CRASH = 5;
public static const SOUND_SKID = 0;
static const maxSounds = 8;
public static const SOUND_BIGCRASH = 4;
static var channel:SoundChannel;
public static var startTimes:Array;
static var active = false;
public static var sound:Sound;
public static var soundTransform:SoundTransform;
static var main:Main;
static var playingFlag:Boolean;
public static var sounds:Array;
static var timer:Timer;
public static var lengths:Array;
static var Instances:Array;
static var st:SoundTransform = null;
public static var soundTransforms:Array;
static var doSFX:Boolean;
public static var soundChannels:Array;
public static function UpdateOncePerFrame(){
}
static function AddSound(_arg1:Number, _arg2:Number){
startTimes.push((_arg1 * 1000));
lengths.push((_arg2 * 1000));
sounds.push(null);
}
public static function StartLoop(_arg1:int):SoundChannel{
var _local2:SoundChannel;
var _local3:Sound;
if (sounds[_arg1] != null){
_local3 = sounds[_arg1];
_local2 = _local3.play(0, 9999999, new SoundTransform(0, 0));
return (_local2);
};
return (null);
}
public static function InitOnce(_arg1:Main):void{
var _local2:int;
var _local3:SoundPlay;
doSFX = Game.soundon;
main = _arg1;
Instances = new Array(maxSounds);
_local2 = 0;
while (_local2 < maxSounds) {
_local3 = new SoundPlay();
_local3.Clear();
Instances[_local2] = _local3;
_local2++;
};
startTimes = new Array();
lengths = new Array();
sounds = new Array();
soundChannels = new Array();
soundTransforms = new Array();
AddSound1(new SFX_Skid());
AddSound1(new SFX_Crash03());
AddSound1(new EngineLoop());
AddSound1(new SFX_Turbo());
AddSound1(new SFX_Crash01());
AddSound1(new SFX_Crash02());
soundTransform = new SoundTransform(1, 0);
active = true;
playingFlag = false;
st = new SoundTransform(0);
}
public static function Play(_arg1:int, _arg2:int=0):void{
var _local3:SoundTransform;
var _local4:Sound;
var _local5:int;
var _local6:SoundPlay;
if (doSFX == false){
return;
};
if (sounds[_arg1] != null){
_local4 = sounds[_arg1];
_local3 = new SoundTransform();
_local4.play(0, _arg2);
} else {
_local5 = 0;
while (_local5 < maxSounds) {
_local6 = Instances[_local5];
if (_local6.Active() == false){
_local6.Play(_arg1);
return;
};
_local5++;
};
};
}
static function AddSound1(_arg1:Sound){
sounds.push(_arg1);
startTimes.push(0);
lengths.push(0);
}
public static function ToggleSound(){
doSFX = (doSFX == false);
}
public static function SetVolume(_arg1:SoundChannel, _arg2:Number){
if (_arg1 == null){
return;
};
st.volume = _arg2;
if (doSFX == false){
st.volume = 0;
};
_arg1.soundTransform = st;
}
}
}//package
import flash.events.*;
import flash.media.*;
import flash.utils.*;
class SoundPlay {
private var channel:SoundChannel;
private var timer:Timer;
private var playingFlag;
private function SoundPlay(){
}
private function timerHandler(_arg1:TimerEvent):void{
timer.stop();
channel.stop();
playingFlag = false;
}
public function Clear():void{
playingFlag = false;
timer = null;
}
public function Active():Boolean{
return (playingFlag);
}
public function Play(_arg1:int):void{
channel = SoundPlayer.sound.play(SoundPlayer.startTimes[_arg1], 1, SoundPlayer.soundTransform);
timer = new Timer(SoundPlayer.lengths[_arg1]);
timer.addEventListener(TimerEvent.TIMER, timerHandler);
timer.start();
playingFlag = true;
}
}
Section 97
//Speedo (Speedo)
package {
import flash.display.*;
public dynamic class Speedo extends MovieClip {
}
}//package
Section 98
//Stats (Stats)
package {
public class Stats {
static var overallStats:Array;
static var levelStats:Array;
public static function EndLevel(_arg1:int){
var _local2:Array;
var _local3:Stat;
_local2 = levelStats[_arg1];
for each (_local3 in _local2) {
trace(((("Stat: " + _local3.name) + " -> ") + _local3.value.toString()));
};
}
public static function GetLevelStat(_arg1:int, _arg2:String):Number{
var _local3:Array;
var _local4:Stat;
_local3 = levelStats[_arg1];
for each (_local4 in _local3) {
if (_local4.name == _arg2){
return (_local4.value);
};
};
return (0);
}
public static function SetLevelStat(_arg1:int, _arg2:String, _arg3:Number){
var _local4:Array;
var _local5:Stat;
_local4 = levelStats[_arg1];
for each (_local5 in _local4) {
if (_local5.name == _arg2){
_local5.value = _arg3;
};
};
}
public static function AddLevelStat(_arg1:int, _arg2:String, _arg3:Number){
var _local4:Array;
var _local5:Stat;
_local4 = levelStats[_arg1];
for each (_local5 in _local4) {
if (_local5.name == _arg2){
_local5.value = (_local5.value + _arg3);
};
};
}
public static function InitOnce(){
var _local1:int;
var _local2:int;
overallStats = new Array();
levelStats = new Array(10);
_local2 = levelStats.length;
_local1 = 0;
while (_local1 < _local2) {
levelStats[_local1] = new Array();
_local1++;
};
CreateLevelStat("finishtime", 100000);
CreateLevelStat("hitcars", 0);
CreateLevelStat("crashes", 0);
CreateLevelStat("overtake", 0);
CreateLevelStat("timeatfullspeed", 0);
CreateLevelStat("braketime", 0);
CreateLevelStat("turbostart", 0);
}
public static function StartLevel(_arg1:int){
var _local2:Array;
var _local3:Stat;
_local2 = levelStats[_arg1];
for each (_local3 in _local2) {
_local3.Reset();
};
}
static function CreateLevelStat(_arg1:String, _arg2:Number){
var _local3:int;
var _local4:int;
var _local5:Stat;
_local4 = levelStats.length;
_local3 = 0;
while (_local3 < _local4) {
_local5 = new Stat(_arg1, _arg2);
levelStats[_local3].push(_local5);
_local3++;
};
}
}
}//package
class Stat {
private var value:Number;
private var name:String;
private var initialValue:Number;
private function Stat(_arg1:String, _arg2:Number){
name = _arg1;
value = _arg2;
initialValue = _arg2;
}
public function Reset(){
value = initialValue;
}
}
Section 99
//TitleScreenState (TitleScreenState)
package {
import flash.events.*;
import flash.display.*;
import flash.net.*;
import mochi.as3.*;
public class TitleScreenState {
static var main:Main;
static var helpMC:MovieClip;
static var gameNinjaReferralString:String;
static var titleMC:MovieClip;
static var creditsMC:MovieClip;
public static var scoreName:String = "YourName";
public static function buttonSubmitScorePressed(_arg1:MouseEvent){
var _local2:String;
_local2 = titleMC.buttonSubmitScore.textName.text;
titleMC.buttonSubmitScore.visible = false;
TitleScreenState.SubmitScore(_local2);
}
public static function Help_buttonContinuePressed(_arg1:MouseEvent){
main.removeChild(helpMC);
helpMC = null;
}
public static function GameOverFailed_buttonContinuePressed(_arg1:MouseEvent){
main.removeChild(titleMC);
titleMC = null;
main.SetGameState(Main.gameState_TITLE);
}
public static function buttonHelpPressed(_arg1:MouseEvent){
InitHelp();
}
public static function GameNinjaTitleButtonPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://gameninja.com/?ref=heatrushpreroll"), "_blank");
}
public static function InitHelp(){
helpMC = main.AddMovieClip(0, 0, new HelpScreen());
helpMC.buttonContinue.addEventListener(MouseEvent.CLICK, Help_buttonContinuePressed);
}
public static function SubmitScore(_arg1:String){
var s:String;
var u:URLRequest;
var vars:URLVariables;
var _name = _arg1;
scoreName = _name;
if ((((Licensors.GetLicensor() == Licensors.LICENSOR_GAMENINJA_VIRAL)) || ((Licensors.GetLicensor() == Licensors.LICENSOR_GAMENINJA_LOCKED)))){
s = "http://www.gameninja.com/getscores/heatrush.php";
u = new URLRequest(s);
u.method = URLRequestMethod.GET;
vars = new URLVariables();
vars.username = _name;
vars.score = Game.currentScore.toString();
u.data = vars;
try {
sendToURL(u);
} catch(e:Error) {
trace(e.message);
};
navigateToURL(new URLRequest("http://www.gameninja.com/high-scores/heatrush.html"), "_blank");
};
}
public static function buttonCreditsBackPressed(_arg1:MouseEvent){
Game.main.removeChild(creditsMC);
creditsMC = null;
}
public static function GameNinjaButtonPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest(("http://gameninja.com/?ref=" + gameNinjaReferralString)), "_blank");
}
static function buttonLongAnimalsPressed(_arg1:MouseEvent){
navigateToURL(new URLRequest("http://www.longanimalsgames.com"), "_blank");
}
public static function InitGameOverFailed(){
trace("Stopping loops here");
Game.StopLoops();
titleMC = main.AddMovieClip(0, 0, new GameOverFailScreen());
titleMC.buttonContinue.addEventListener(MouseEvent.CLICK, GameOverFailed_buttonContinuePressed);
Kong.SubmitStat(Game.currentScore, "Score");
titleMC.buttonSubmitScore.textName.text = scoreName;
titleMC.buttonSubmitScore.buttonSubmitScore.addEventListener(MouseEvent.CLICK, buttonSubmitScorePressed);
TitleScreenState.GameNinjaButton(titleMC.buttonGameNinja, "heatrushend");
if (Game.startLevel == 0){
titleMC.buttonSubmitScore.visible = true;
} else {
titleMC.buttonSubmitScore.visible = false;
};
titleMC.textScore.text = ("Final Score: " + Game.currentScore);
}
public static function buttonMoreGamesPressed(_arg1:MouseEvent){
if (Licensors.GetLicensor() == Licensors.LICENSOR_GAMENINJA_LOCKED){
navigateToURL(new URLRequest("http://gameninja.com/?ref=heatrushmoregames"), "_blank");
};
if (Licensors.GetLicensor() == Licensors.LICENSOR_GAMENINJA_VIRAL){
navigateToURL(new URLRequest("http://gameninja.com/?ref=heatrushmoregames"), "_blank");
};
}
public static function Update(_arg1:Main){
}
public static function GameNinjaButton(_arg1:MovieClip, _arg2:String="heatrushmain"){
gameNinjaReferralString = _arg2;
if ((((Licensors.GetLicensor() == Licensors.LICENSOR_GAMENINJA_VIRAL)) || ((Licensors.GetLicensor() == Licensors.LICENSOR_GAMENINJA_LOCKED)))){
_arg1.visible = true;
_arg1.addEventListener(MouseEvent.CLICK, GameNinjaButtonPressed);
_arg1.useHandCursor = true;
_arg1.buttonMode = true;
};
}
public static function MovieFinished(){
Game.InitGame();
}
public static function buttonStartPressed(_arg1:MouseEvent){
Game.main.removeChild(titleMC);
titleMC = null;
Game.InitGame();
}
public static function Init(_arg1:Main){
main = _arg1;
Game.StopLoops();
MusicPlayer.StopMusic();
MusicPlayer.StartStream(3);
main.InitStage();
titleMC = main.AddMovieClip(0, 0, new menuScreen());
titleMC.buttonPlay.addEventListener(MouseEvent.CLICK, buttonStartPressed);
titleMC.buttonHelp.addEventListener(MouseEvent.CLICK, buttonHelpPressed);
titleMC.buttonMoreGames.addEventListener(MouseEvent.CLICK, buttonMoreGamesPressed);
titleMC.buttonLongAnimals.addEventListener(MouseEvent.CLICK, buttonLongAnimalsPressed);
GameNinjaButton(titleMC.buttonGameNinja, "heatrushgame");
}
public static function buttonCreditsPressed(_arg1:MouseEvent){
Game.main.addChild(creditsMC);
creditsMC.buttonBack.addEventListener(MouseEvent.CLICK, buttonCreditsBackPressed);
}
}
}//package
Section 100
//Turbo (Turbo)
package {
import flash.display.*;
public dynamic class Turbo extends MovieClip {
}
}//package
Section 101
//TurboFire (TurboFire)
package {
import flash.display.*;
public dynamic class TurboFire extends MovieClip {
}
}//package
Section 102
//Upgrade (Upgrade)
package {
class Upgrade {
var gotit:Boolean;
var name:String;
function Upgrade(_arg1:String){
name = _arg1;
gotit = false;
}
}
}//package
Section 103
//UpgradeAwardedScreen (UpgradeAwardedScreen)
package {
import flash.display.*;
import flash.text.*;
public dynamic class UpgradeAwardedScreen extends MovieClip {
public var buttonExit:SimpleButton;
public var textDescription:TextField;
public var textAchievement:TextField;
}
}//package
Section 104
//Upgrades (Upgrades)
package {
public class Upgrades {
public static var list:Array;
public static function InitOnce(){
var _local1:XML;
var _local2:int;
list = new Array();
_local1 = ExternalData.xml;
_local2 = 0;
while (_local2 < _local1.achievement.length()) {
list.push(new Upgrade(_local1.achievement[_local2].@unlock));
_local2++;
};
}
public static function Unlock(_arg1:String){
var _local2:Upgrade;
for each (_local2 in list) {
if (_local2.name == _arg1){
_local2.gotit = true;
trace((("Upgrade: " + _local2.name) + " unlocked"));
};
};
}
public static function AddToStats(){
var _local1:Upgrade;
for each (_local1 in list) {
if (_local1.gotit){
if (_local1.name == "Forged Pistons"){
Game.player_zmax = (Game.player_zmax + Game.playerupgrade_maxspeed);
};
if (_local1.name == "High Flow Fuel Pump"){
Game.player_zmax = (Game.player_zmax + Game.playerupgrade_maxspeed);
};
if (_local1.name == "Induction Kit"){
Game.player_zmax = (Game.player_zmax + Game.playerupgrade_maxspeed);
};
if (_local1.name == "Uprated Cams"){
Game.player_zacc = (Game.player_zacc + Game.playerupgrade_accel);
};
if (_local1.name == "Large Bore Exhaust"){
Game.player_zacc = (Game.player_zacc + Game.playerupgrade_accel);
};
if (_local1.name == "Vented Discs"){
Game.player_zdec = (Game.player_zdec + Game.playerupgrade_decel);
};
if (_local1.name == "6 Pot Calipers"){
Game.player_zdec = (Game.player_zdec + Game.playerupgrade_decel);
};
if (_local1.name == "Braided Hoses"){
Game.player_zdec = (Game.player_zdec + Game.playerupgrade_decel);
};
if (_local1.name == "Ceramic Turbo"){
Game.player_turboMaxVel = (Game.player_turboMaxVel + Game.playerupgrade_turbomax);
};
if (_local1.name == "Recirculating Dump Valve"){
Game.player_turboMaxVel = (Game.player_turboMaxVel + Game.playerupgrade_turbomax);
};
if (_local1.name == "Charge Cooler"){
Game.player_turboMaxVel = (Game.player_turboMaxVel + Game.playerupgrade_turbomax);
};
if (_local1.name == "Charge Cooler"){
Game.player_turboMaxRechargeTime = (Game.player_turboMaxRechargeTime + Game.playerupgrade_turborecharge);
};
if (_local1.name == "Short Steering Rack"){
Game.player_xacc = (Game.player_xacc + Game.playerupgrade_xacc);
};
if (_local1.name == "Racing Wheel"){
Game.player_xacc = (Game.player_xacc + Game.playerupgrade_xacc);
};
if (_local1.name == "Lowered Springs"){
Game.player_roadpush = (Game.player_roadpush + Game.playerupgrade_roadpush);
};
if (_local1.name == "Performance Dampers"){
Game.player_roadpush = (Game.player_roadpush + Game.playerupgrade_roadpush);
};
if (_local1.name == "Racing Tyres"){
Game.player_roadpush = (Game.player_roadpush + Game.playerupgrade_roadpush);
};
};
};
}
}
}//package
Section 105
//UpgradesScreen (UpgradesScreen)
package {
import flash.display.*;
public dynamic class UpgradesScreen extends MovieClip {
public var buttonExit:SimpleButton;
}
}//package
Section 106
//Utils (Utils)
package {
import flash.display.*;
import flash.geom.*;
public class Utils {
static function RandBetweenFloat(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = (Math.random() * (_arg2 - _arg1));
_local3 = (_local3 + _arg1);
return (_local3);
}
public static function DegToRad(_arg1:Number):Number{
return ((((Math.PI * 2) / 360) * _arg1));
}
public static function LimitNumber(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg3 < _arg1){
_arg3 = _arg1;
};
if (_arg3 > _arg2){
_arg3 = _arg2;
};
return (_arg3);
}
public static function ScaleTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local6 = (_arg4 - _arg3);
_local7 = (_arg2 - _arg1);
_local8 = ((1 / _local6) * (_arg5 - _arg3));
_local8 = ((_local7 * _local8) + _arg1);
return (_local8);
}
public static function DP2(_arg1:Number):Number{
var _local2:Number;
_local2 = (Math.ceil((_arg1 * 100)) / 100);
return (_local2);
}
public static function DP3(_arg1:Number):Number{
var _local2:Number;
_local2 = (Math.ceil((_arg1 * 1000)) / 1000);
return (_local2);
}
public static function DP4(_arg1:Number):Number{
var _local2:Number;
_local2 = (Math.ceil((_arg1 * 10000)) / 10000);
return (_local2);
}
public static function NumberToString2DP(_arg1:Number):String{
var _local2:String;
var _local3:int;
var _local4:int;
_local2 = DP2(_arg1).toString();
_local3 = _local2.lastIndexOf(".");
if (_local3 == -1){
_local2.concat(".00");
} else {
_local4 = _local2.length;
if (_local3 == (_local4 - 1)){
_local2.concat("0");
};
};
return (_local2);
}
public static function DP1(_arg1:Number):Number{
var _local2:Number;
_local2 = (Math.ceil((_arg1 * 10)) / 10);
return (_local2);
}
static function DotProduct(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
_local5 = ((_arg1 * _arg3) + (_arg2 * _arg4));
return (_local5);
}
static function RenderDotLine(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:int, _arg7:uint):void{
var _local8:int;
var _local9:int;
var _local10:Number;
var _local11:Number;
_local9 = _arg6;
_local10 = ((_arg4 - _arg2) / Number(_local9));
_local11 = ((_arg5 - _arg3) / Number(_local9));
_local8 = 0;
while (_local8 < _local9) {
_arg2 = (_arg2 + _local10);
_arg3 = (_arg3 + _local11);
_arg1.setPixel32(int(_arg2), int(_arg3), _arg7);
_local8++;
};
}
static function SideOfLine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Boolean{
var _local7:Number;
_local7 = DotProduct((_arg3 - _arg1), (_arg4 - _arg2), (_arg5 - _arg1), (_arg6 - _arg2));
if (_local7 < 0){
return (false);
};
return (true);
}
static function RenderRectangle(_arg1:BitmapData, _arg2:Rectangle, _arg3:uint):void{
RenderDotLine(_arg1, _arg2.left, _arg2.top, _arg2.right, _arg2.top, 100, _arg3);
RenderDotLine(_arg1, _arg2.left, _arg2.bottom, _arg2.right, _arg2.bottom, 100, _arg3);
RenderDotLine(_arg1, _arg2.left, _arg2.top, _arg2.left, _arg2.bottom, 100, _arg3);
RenderDotLine(_arg1, _arg2.right, _arg2.top, _arg2.right, _arg2.bottom, 100, _arg3);
}
static function RandBetweenInt(_arg1:int, _arg2:int):int{
var _local3:int;
_local3 = (Math.random() * ((_arg2 - _arg1) + 1));
_local3 = (_local3 + _arg1);
return (_local3);
}
static function DotProductAng(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local3 = Math.cos(_arg1);
_local4 = Math.sin(_arg1);
_local5 = Math.cos(_arg2);
_local6 = Math.sin(_arg2);
_local7 = ((_local3 * _local5) + (_local4 * _local6));
return (_local7);
}
public static function RandCircle():Number{
return ((Math.random() * (Math.PI * 2)));
}
public static function RadToDeg(_arg1:Number):Number{
return (((360 / (Math.PI * 2)) * _arg1));
}
static function Dist2BetweenPoints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (((_local5 * _local5) + (_local6 * _local6)));
}
public static function CounterToSecondsString(_arg1:int, _arg2:Boolean=false):String{
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Number;
_local3 = "";
if (_arg2){
_local4 = (_arg1 / (int(Defs.fps) * 60));
_local5 = (_arg1 % (int(Defs.fps) * 60));
_local6 = (_local5 / int(Defs.fps));
_local7 = (_local5 % int(Defs.fps));
_local3 = (_local3 + (_local4.toString() + ":"));
_local3 = (_local3 + (_local6.toString() + ":"));
_local8 = ((100 / Defs.fps) * Number(_local7));
_local3 = (_local3 + Math.floor(_local8).toString());
} else {
_local6 = (_arg1 / int(Defs.fps));
_local7 = (_arg1 % int(Defs.fps));
_local3 = (_local3 + (_local6.toString() + ":"));
_local8 = ((100 / Defs.fps) * Number(_local7));
_local3 = (_local3 + Math.floor(_local8).toString());
};
return (_local3);
}
public static function LineLength(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
if (_arg3 < _arg1){
_arg3 = _arg1;
};
if (_arg3 > _arg2){
_arg3 = _arg2;
};
return (_arg3);
}
static function DistBetweenPoints(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
var _local5:Number;
var _local6:Number;
_local5 = (_arg3 - _arg1);
_local6 = (_arg4 - _arg2);
return (Math.sqrt(((_local5 * _local5) + (_local6 * _local6))));
}
public static function ScaleBetween(_arg1:Number, _arg2:Number, _arg3:Number):Number{
var _local4:Number;
_local4 = ((_arg2 - _arg1) * _arg3);
_local4 = (_arg1 + _local4);
return (_local4);
}
static function RenderCircle(_arg1:BitmapData, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:uint):void{
var _local6:int;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:Number;
var _local11:Number;
_local6 = 100;
_local7 = ((Math.PI * 2) / _local6);
_local9 = 0;
_local8 = 0;
while (_local8 < _local6) {
_local10 = (_arg2 + (Math.cos(_local9) * _arg4));
_local11 = (_arg3 + (Math.sin(_local9) * _arg4));
_local9 = (_local9 + _local7);
_arg1.setPixel32(int(_local10), int(_local11), _arg5);
_local8++;
};
}
}
}//package
Section 107
//V3 (V3)
package {
public class V3 {
public var x1:Number;
public var active:Boolean;
public var z:Number;
public var y1:Number;
public var color:uint;
public var x:Number;
public var y:Number;
public var type:int;
public var z1:Number;
public function PerspectiveTransform1(_arg1:Number){
var _local2:Number;
var _local3:Number;
_local2 = 1.1;
z1 = z;
_local3 = (_local2 / (_local2 + z1));
_local3 = (_local3 * _arg1);
x1 = (x * _local3);
y1 = (y * _local3);
}
public function MatrixTransform(_arg1:Matrix3):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (((x * _arg1.x0) + (y * _arg1.x1)) + (z * _arg1.x2));
_local3 = (((x * _arg1.y0) + (y * _arg1.y1)) + (z * _arg1.y2));
_local4 = (((x * _arg1.z0) + (y * _arg1.z1)) + (z * _arg1.z2));
x = _local2;
y = _local3;
z = _local4;
}
public function FromV3(_arg1:V3):void{
x = _arg1.x;
y = _arg1.y;
z = _arg1.z;
}
public function FromXYZ(_arg1:Number, _arg2:Number, _arg3:Number):void{
x = _arg1;
y = _arg2;
z = _arg3;
}
public function PerspectiveTransform(_arg1:Number, _arg2:Number, _arg3:Number){
var _local4:Number;
var _local5:Number;
_local4 = 1.1;
z1 = z;
_local5 = (_local4 / (_local4 + z1));
_local5 = (_local5 * _arg3);
x1 = (_arg1 + (x * _local5));
y1 = (_arg2 + (y * _local5));
}
}
}//package
Section 108
//Vec (Vec)
package {
import flash.geom.*;
public class Vec {
public var speed:Number;
public var rot:Number;
public function Vec(){
rot = 0;
speed = 0;
}
public function Add(_arg1:Vec){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = (Math.cos(rot) * speed);
_local3 = (Math.sin(rot) * speed);
_local4 = (Math.cos(_arg1.rot) * _arg1.speed);
_local5 = (Math.sin(_arg1.rot) * _arg1.speed);
_local6 = (_local2 + _local4);
_local7 = (_local3 + _local5);
rot = Math.atan2(_local7, _local6);
speed = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
}
public function Set(_arg1:Number, _arg2:Number){
rot = _arg1;
speed = _arg2;
}
public function GetUnitYComponent():Number{
return (Math.sin(rot));
}
public function dotRot(_arg1:Number):Number{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = Math.cos(rot);
_local3 = Math.sin(rot);
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
_local6 = ((_local2 * _local4) + (_local3 * _local5));
return (_local6);
}
function NormalizeRot():void{
while (rot < 0) {
rot = (rot + (Math.PI * 2));
};
while (rot > (Math.PI * 2)) {
rot = (rot - (Math.PI * 2));
};
}
public function GetUnitTangent():Point{
var _local1:Number;
var _local2:Point;
_local1 = (rot + (Math.PI * 0.5));
_local2 = new Point(Math.cos(_local1), Math.sin(_local1));
return (_local2);
}
public function NearRot(_arg1:Number, _arg2:Number):Boolean{
var _local3:Number;
var _local4:Number;
_local3 = (rot - _arg1);
_local4 = Math.abs(_local3);
if (_local3 > Math.PI){
if (_arg1 < rot){
_arg1 = (_arg1 + (Math.PI * 2));
} else {
_arg1 = (_arg1 - (Math.PI * 2));
};
_local3 = (rot - _arg1);
};
if (Math.abs(_local3) <= _arg2){
return (true);
};
return (false);
}
public function SetAng(_arg1:Number){
rot = _arg1;
}
public function GetYComponent():Number{
return ((Math.sin(rot) * speed));
}
public function GetXComponent():Number{
return ((Math.cos(rot) * speed));
}
public function AddRot(_arg1:Number):void{
rot = (rot + _arg1);
NormalizeRot();
}
public function GetUnitXComponent():Number{
return (Math.cos(rot));
}
}
}//package