print("Loading Canyon Setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_canyon.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_canyon.tga");
setGameMode(3);
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(-107, -7);
addWaypoint(-30, -5);
addWaypoint(40, 11);
addWaypoint(148, -24);
addWaypoint(91, -29);
addWaypoint(48, -26.5);
addWaypoint(8, -15);
addWaypoint(-30, -5);

--set Camera Extents
--max X, min X, max Y, min Y
--setCameraExtents(150.0, -150.0, 62.5, -62.5);
autoCameraExtents();

--set Obstacles
--texture, size X, size Y, position X, position Y, direction 

addObstacleBox(map_Building, 60, 8, 53, -11, PI * -0.067);

addObstacleBox(map_Building, 110, 14, 94, -50, PI * -0.05);
addObstacleBox(map_Building, 100, 18, -8, -39, PI * -0.02);
addObstacleBox(map_Building, 35, 20, -26, -35, PI * 0.075);

addObstacleBox(map_Building, 85, 18, -85, -32, PI * -0.03);
addObstacleBox(map_Building, 20, 20, -128, -33, PI * 0.095);

addObstacleBox(map_Building, 80, 18, -150, -66, PI * 0.35);
addObstacleBox(map_Building, 75, 14, 159, -84, -PI * 0.35);

addObstacleBox(map_Building, 85, 18, -6, 47, PI * 0.15);
addObstacleBox(map_Building, 65, 18, -70, 40, PI * -0.10);
addObstacleBox(map_Building, 127, 16, 84, 37, PI * -0.12);

addObstacleBox(map_Building, 70, 18, -118, 73, PI * -0.28);

addObstacleBox(map_Building, 60, 14, 159, 30, PI * 0.28);
addObstacleBox(map_Building, 60, 14, 182, 76, PI * 0.42);

addObstacleBox(map_Building, 7, 7, 24, -5, PI * 0.67);
addObstacleBox(map_Building, 7, 7, 82, -18, PI * 0.67);
addObstacleBox(map_Building, 4, 4, 42, -35, PI * 0.67);


--setup enemy spawn points
spawn1_X = 260;
spawn1_Y = -50;
spawn2_X = 260;
spawn2_Y = -50;
spawn3_X = 260;
spawn3_Y = -50;
spawn4_X = 260;
spawn4_Y = -50;


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

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



