print("Loading driven setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_drivein.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_drivein.tga");
setGameMode(1);
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
addWaypoint(-123, 34);
addWaypoint(-70, 32);
addWaypoint(9, 10);
addWaypoint(65, -26);
addWaypoint(31, -77);
addWaypoint(-32, -32);
addWaypoint(-112, -25);





--set Camera Extents
autoCameraExtents();

--set Obstacles
--texture, size X, size Y, position X, position Y, direction 
--building
addObstacleBox(map_Building, 40.2, 24.9, -58.07, -60.40, PI * 0.000);
addObstacleBox(map_Building, 24.4, 23.4, -75.95, -67.517, PI * 0.000);

addObstacleBox(map_Building, 36.7, 8.0, -120.99, 99.48, PI * 1.75330);
addObstacleBox(map_Building, 30.9, 8.0, -94.96, 80.038, PI * 1.8472);
addObstacleBox(map_Building, 22.4, 8.0, -73.51, 72.227, PI * 1.957823);
addObstacleBox(map_Building, 22.5, 8.3, -55.026, 72.054, PI * 0.033423);
addObstacleBox(map_Building, 31.4, 7.7, -32.5613, 80.212, PI * 0.157563);
addObstacleBox(map_Building, 32.0, 7.7, -8.524, 98.8, PI * 0.253852);





--addObstacleSprite(map_PropFighter, 2.8, 22, 0, -25.5, PI * -0.00, 30, 25);

--addTopSprite(map_PropFighter, 30, 25, 33, -25.5, PI * -0.20);




--setup enemy spawn points
spawn1_X = -220;
spawn1_Y = 60;
spawn2_X = 100;
spawn2_Y = -120;
spawn3_X = -220;
spawn3_Y = 60;
spawn4_X = -220;
spawn4_Y = 60;

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

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



