print("Loading raceTrack setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_racetrack.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_racetrack.tga");
setGameMode(3);
gofile("multiplayer/netViewDistance.lua");


--set Sun
--distance X, distance Y
setSunDist(-0.55, 1.0);

--set Dust visual element
setDustElement(vel_dust);
setSkidElement(vel_skid);

--set Borders
--position X, position Y, direction, elasticity
addBorder(0, 100, PI, 0.7);
addBorder(200, 0, HALFPI, 0.7);
addBorder(0, -100, 0, 0.7);
addBorder(-200, 0, THREEHALFPI, 0.7);

--setWaypoints
--position X, position Y
wp0 = addWaypoint(-54, -70);
wp1 = addWaypoint(27, -21);
wp2 = addWaypoint(102, 14);
wp3 = addWaypoint(98, 63);
wp4 = addWaypoint(3, 74);
wp5 = addWaypoint(-115, 53);
wp6 = addWaypoint(-139, -5);
wp7 = addWaypoint(-101, -61);
wpx1 = addWaypointEX(-100, 92, wp5, wp5);
wpx1a = addWaypointEX(-164, 94, wpx1, wpx1);
wpx1b = addWaypointEX(-186, 3, wpx1a, wpx1a);
wpx2 = addWaypointEX(98, 92, wp3, wp3);
wpx2a = addWaypointEX(164, 93, wpx2, wpx2);
wpx2b = addWaypointEX(185, 13,wpx2a, wpx2a);


--set Camera Extents
--max X, min X, max Y, min Y
--setCameraExtents(150.0, -150.0, 62.5, -62.5);
autoCameraExtents();

--set Obstacles
--texture, size X, size Y, position X, position Y, direction 
addObstacleBox(map_Building, 17.5, 65, -87.1, -9.5, -PI * 0.012);
addObstacleBox(map_Building, 36, 29.5, -17.5, 37.0, PI * 0.00);

addObstacleBox(map_Building, 50, 4, -62, 51.6, PI * 0.005);
addObstacleBox(map_Building, 50, 4, -8, 52, PI * 0.005);
addObstacleBox(map_Building, 50, 4, 45, 52.5, PI * 0.00);

addObstacleBox(map_Building, 50, 4, -138.6, 60.5, PI * 0.26);
addObstacleBox(map_Building, 51, 4, -161, 0, PI * 0.500);
addObstacleBox(map_Building, 51, 4, -135, -59, -PI * 0.26);

addObstacleBox(map_Building, 51, 4, 130, -60, PI * 0.24);
addObstacleBox(map_Building, 51, 4, 157, -1.3, PI * 0.500);
addObstacleBox(map_Building, 51, 4, 134.5, 59, -PI * 0.265);

--misc Mobs
--texture, size X, size Y, position X, position Y, mass, elastic, friction, round, dir 
addGroundMob(map_tireutil,    4,      4,      8.8,     41,      6,      0.9,   0.1,    true, 0.1);
addGroundMob(map_tireold,     3,      3,      6,     29,      6,      0.9,   0.1,    true, 0.2);

--texture, size X, size Y, position X, position Y, mass, elastic, friction, round, dir
addGroundMobq(map_barrelblue, 3, 5, 47, -42, 2, 0.9, 0.1, false, 0.5);
addGroundMobq(map_barrelblue, 3, 5, 76, -42, 2, 0.9, 0.1, false, 1.5);


--setup enemy spawn points
spawn1_X = 86;
spawn1_Y = -150;
spawn2_X = 86;
spawn2_Y = 150;
spawn3_X = 86;
spawn3_Y = -150;
spawn4_X = 86;
spawn4_Y = -150;

ndc();



