print("Loading refinery setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_refinery.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_refinery.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(-69.7, 33.3);
wp1 = addWaypoint(-11.75, 30.5);
wp2 = addWaypoint(38.25, 21.534);
wp3 = addWaypoint(55.61, -31.927);
wp4 = addWaypoint(4.6, -60);
wp5 = addWaypoint(-71.7, -72);
wp6 = addWaypoint(-106.8, -41.3);
wp7 = addWaypoint(-106.4, 24.17);
wpx1 = addWaypointEX(17.25, 86.534, wp2, wp2);
wpx2 = addWaypointEX(-97, 90, wp7, wp7);
wpx3 = addWaypointEX(147, -15, wp3, wp3);




--set Camera Extents
autoCameraExtents();

--set Obstacles
--texture, size X, size Y, position X, position Y, direction 
--building
addObstacleBox(map_Building, 17.5, 50.1, -71.64, -1.46, PI * 0.001592);

addObstacleBox(map_Building, 25.3, 28.4, -71.707, 64.16, PI * 2.00);
addObstacleBox(map_Building, 25.3, 28.4, -31.56, 64.5, PI * 2.00);

addObstacleBox(map_Building, 64.9, 31.9, 88.53, 50.54, PI * 0.012732);

addObstacleBox(map_Building, 25.49, 3.6, 9.87, 8.91, PI * 1.992838);
addObstacleBox(map_Building, 18.0, 4.7, 8.965, 6.3076, PI * 1.992838);

addObstacleBox(map_Building, 6.6, 46.5, -180.0389, -76.3856, PI * 1.918033);
addObstacleBox(map_Building, 8.6, 52.5, -158.7, -33.3389, PI * 1.860736);
addObstacleBox(map_Building, 9.6, 43.7, -140.8, 9.304, PI * 1.895751);
addObstacleBox(map_Building, 9.6, 44.89, -128.64, 46.27, PI * 1.936337);
addObstacleBox(map_Building, 10.1, 44.89, -125.437, 88.205, PI * 0.002387);

--texture, size X, size Y, position X, position Y, mass, elastic, friction, round, dir
ballmob = addGroundMobq(map_barrelblue, 3, 5, -10, -2, 2, 0.9, 0.1, false, 0.5);
--addGroundMobq(map_barrelblue, 3, 5, -164, -73, 2, 0.9, 0.1, false, 1.5);
--addGroundMobq(map_barrelblue, 3, 5, -131, -52.5, 2, 0.9, 0.1, false, 2.5);



--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 = -1;
spawn1_Y = -120;
spawn2_X = -1;
spawn2_Y = 120;
spawn3_X = -1;
spawn3_Y = -120;
spawn4_X = -1;
spawn4_Y = -120;

ndc();



