print("Loading warehouse setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_warehouses.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_warehouses.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(-59, 74);
addWaypoint(-116, 62);
addWaypoint(-158, 15);
addWaypoint(-110, -56.5);
addWaypoint(18, -65);
addWaypoint(112, -52);
addWaypoint(157, -14);
addWaypoint(130, 27);
addWaypoint(70, 43);
addWaypoint(-11, 62.5);



--set Camera Extents
autoCameraExtents();

--set Obstacles
--texture, size X, size Y, position X, position Y, direction 
addObstacleBox(map_Building, 56, 51, -84.5, 27, PI * -0.02);

addObstacleBox(map_Building, 20, 12, -37, -17, PI * -0.03);
addObstacleBox(map_Building, 20, 12, -16, -18.5, PI * -0.01);
addObstacleBox(map_Building, 20, 12, 6, -20, PI * -0.03);

addObstacleBox(map_Building, 36, 28, 39, 12, PI * -0.02);
addObstacleBox(map_Building, 36.0, 28, 94.5, 8.0, PI * -0.02);

--misc Mobs
--texture, size X, size Y, position X, position Y, mass, elastic, friction, round, dir 
addGroundMob(map_tireutil,    4,      4,      116,     11,      6,      0.9,   0.1,    true, 0.1);

--texture, size X, size Y, position X, position Y, mass, elastic, friction, round, dir
addGroundMobq(map_barrelblue, 3, 5, -49, 34, 2, 0.9, 0.1, false, 0.5);
addGroundMobq(map_barrelblue, 3, 5, -54, 10, 2, 0.9, 0.1, false, 1.5);



--setup enemy spawn points
spawn1_X = -220;
spawn1_Y = 60;
spawn2_X = 220;
spawn2_Y = -60;
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);



