print("Loading fairgrounds setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_fairgrounds.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_fairgrounds.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(-63, 15);
addWaypoint(-99, -34);
addWaypoint(-46, -71);
addWaypoint(6, -81);
addWaypoint(62, -61);
addWaypoint(97, -23.6);
addWaypoint(42.5, 9.67);
addWaypoint(-13.3, 19.735);






--set Camera Extents
autoCameraExtents();

--set Obstacles
--texture, size X, size Y, position X, position Y, direction 
--building
addObstacleBox(map_Building, 33.4, 33.9, 1.46, -35.80, PI * 0.000);
addObstacleBox(map_Building, 68.7, 16.1, -136.125, 32.88, PI * 0.000);
addObstacleBox(map_Building, 23.6, 23.2, 88.9, 44.96, PI * 0.000);
addObstacleBox(map_Building, 39.7, 24.1, 106.4, 52.36, PI * 0.000);






--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);



