print("Loading Test Level")

clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
--setBackGround(map_BackGround, 200, 200, 0, 0);
setBackGround("background2.dds", 200, 200, 0, 0);
setTerrainMap("terraininfo_testlevel.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(100, 0, HALFPI, 0.7);
addBorder(0, -100, 0, 0.7);
addBorder(-100, 0, THREEHALFPI, 0.7);

--setWaypoints
--position X, position Y
addWaypoint(-60, 65);
addWaypoint(50, 65);
addWaypoint(40, -25);
addWaypoint(-60, -30);


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

--set Obstacles
--texture, size X, size Y, position X, position Y, direction 
addObstacleBox(map_Building, 31.5, 31.5, -5.5, 25.5, 3.28);

--misc Mobs
--texture, size X, size Y, position X, position Y, mass, elastic, friction, round 
addMob  (map_Arrow,     6,      6,      40,     0,      5,      0.79,   0.1,    true);
addMobq (map_Default,   6,      18,     -30,    -10,    10,     0.99,   0.1,    false);

--set Waves
--line1 return handle> min Enemies
--lines wave handel, being handle, pos X, pos Y, team, tatic, gun, gun2
wave_1 = addWave(0);
--setWaveEntry(wave_1, car_camino, 0, 0, 2, 0, gun_uziBad);
setWaveEntry(wave_1, car_bird, 60, -220, 2, 0, gun_uziBad, -1);
setWaveEntry(wave_1, car_bird, 65, -210, 2, 0, gun_uziBad, -1);

wave_2 = addWave(1);
setWaveEntry(wave_2, car_xz, 60, -210, 2, 0, gun_uziBad, -1);


--setup Player: Car, audio listener, and camera follow
player = addBeing(playerCar, 20.0, -10.0, 0, 1);
setPlayerBeing(player);
setMobHealth(player, getPlayerHealth());
setWeapon(player, 1, playerWeapon1);
setWeapon(player, 2, playerWeapon2);

--set loot
--carParts, tequlia, fireworks, swag, pills
setStoreCargo(5, 1, 2, 1, 2);
setCargoPrices(0, 0, 0, 0, 0);
setStoreCash(818);
setStoreName("Track Raiders");

setVictoryCommand("gofile(\"stage_missionVictory.lua\")");
setFailureCommand("gofile(\"stage_failure.lua\")");
