print("Loading River Split Setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_riversplit.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_riversplit.tga");
setGameMode(3);
gofile("setViewDistance.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(132, 10);
wp1 = addWaypoint(73, -16);
wp2 = addWaypoint(-37, -42);
wp3 = addWaypoint(-142, -66);

wp4 = addWaypoint(-103, 42);
wp5 = addWaypoint(-51, 49.5);
wp6 = addWaypoint(25, 50);
wp7 = addWaypoint(72, 46);

--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, 114.5, 5, 20, -39, PI * 0.077);
addObstacleBox(map_Building, 116, 4, 15.5, -17.5, PI * 0.077);
addObstacleBox(map_Building, 8, 4, -42.8, -29.6, PI * -0.18);
addObstacleBox(map_Building, 8, 4, -36.47, -54.8, PI * -0.66);
addObstacleBox(map_Building, 9, 4, 78.23, -26.67, PI * -0.14);
addObstacleBox(map_Building, 8, 4, 72.25, -1.05, PI * -0.64);

addObstacleBox(map_Building, 77, 4, -15.0, 58.5, PI * 0.00);
addObstacleBox(map_Building, 77, 4, -14.5, 41, PI * 0.00);
addObstacleBox(map_Building, 7, 2.5, -55.5, 59.7, PI * -0.22);
addObstacleBox(map_Building, 7, 2.5, -54.3, 39.5, PI * -0.72);
addObstacleBox(map_Building, 7, 2.5, 25, 60.0, PI * -0.72);
addObstacleBox(map_Building, 7, 2.5, 25.95, 39.8, PI * -0.22);

addObstacleBox(map_Building, 24, 4, -48.5, 27, PI * 0.55);
addObstacleBox(map_Building, 24, 4, -42.5, 11, PI * 0.55);
addObstacleBox(map_Building, 26, 4, -36, -14, PI * 0.60);

addObstacleBox(map_Building, 26, 4, 32, 29, PI * -0.31);
addObstacleBox(map_Building, 26, 4, 48, 4.5, PI * -0.325);

addObstacleBox(map_Building, 26, 4, -15.0, -63.5, PI * 0.53);
addObstacleBox(map_Building, 26, 4, -12.5, -89, PI * 0.50);

addObstacleBox(map_Building, 26, 4, 74.0, -42, PI * 0.54);
addObstacleBox(map_Building, 53, 4, 84.0, -80, PI * 0.59);

addObstacleBox(map_Building, 26, 4, -52.5, 71.5, PI * 0.50);
addObstacleBox(map_Building, 26, 4, -56.5, 95, PI * 0.715);

addObstacleBox(map_Building, 26, 4, 22.5, 73, PI * 0.37);
addObstacleBox(map_Building, 26, 4, 34.5, 94, PI * 0.42);

--setup enemy spawn points
spawn1_X = -230;
spawn1_Y = -50;
spawn2_X = 230;
spawn2_Y = 0;
spawn3_X = -230;
spawn3_Y = -50;
spawn4_X = -230;
spawn4_Y = -50;


--setup Player: Car, audio listener, and camera follow
player = addBeing(playerCar, -115.0, -20.0, -PI * 0.55, 1);
setPlayerBeing(player);
setMobHealth(player, getPlayerHealth());

setWeapon(player, 1, playerWeapon1);
setWeapon(player, 2, playerWeapon2);



