print("Loading ghostroad setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_ghostroad.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_ghostroad.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(-97.66, 30.64);
addWaypoint(-18.5, 48);
addWaypoint(63.15, 36.88);
addWaypoint(67.15, -30.18);
addWaypoint(0.15, -45.18);
addWaypoint(-99.8, -28.03);





--set Camera Extents
autoCameraExtents();

--set Obstacles
--texture, size X, size Y, position X, position Y, direction 
--building
addObstacleBox(map_Building, 25.3, 24.0, -55.65, 9.56, PI * 1.9912);
addObstacleBox(map_Building, 18.3, 9.4, -38.97, 7.86, PI * 1.9912);
addObstacleBox(map_Building, 44.9, 23.6, -10.99, 10.072, PI * 0.0);
addObstacleBox(map_Building, 17.0, 17.7, 17.41, 7.86, PI * 0.006366);
addObstacleBox(map_Building, 24.8, 23.0, 25.55, -10.067, PI * 1.9968);
addObstacleBox(map_Building, 9.4, 25.4, -144.56, 50.63, PI * 0.200535);
addObstacleBox(map_Building, 7.599, 25.4, -143.31, 49.60, PI * 1.93315);

--misc Mobs
--texture, size X, size Y, position X, position Y, mass, elastic, friction, round, dir 
addGroundMob(map_tireutil,    4,      4,      -134,     54,      6,      0.9,   0.1,    true, 0.1);
addGroundMob(map_tireold,     3,      3,      -126,     60,      6,      0.9,   0.1,    true, 0.2);

--texture, size X, size Y, position X, position Y, mass, elastic, friction, round, dir
addGroundMobq(map_barrelblue, 3, 5, -144, 29, 2, 0.9, 0.1, false, 0.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 = -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, -74.0, 50.0, PI * 0.505, 1);
setPlayerBeing(player);
setMobHealth(player, getPlayerHealth());

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



