print("Loading soccer setting")


clear();

--LEVEL SETUP

--set Background
--texture, width, height, position X, position Y
setBackGround("map_soccer.dds", 400, 200, 0, 0);
setTerrainMap("terraininfo_soccer.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
addWaypoint(0, 30);
addWaypoint(-102, 28.6);
addWaypoint(-116, 78);
addWaypoint(-56, 85);
addWaypoint(-2, 77);
addWaypoint(47, 83);
addWaypoint(120, 80);
addWaypoint(125, 57);
addWaypoint(102, 17);



--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, 84, 23, -58, 57, PI * -0.00);
addObstacleBox(map_Building, 84, 23, 58, 57, PI * -0.00);

addObstacleBox(map_Building, 40, 21, -81.6, 55.6, PI * -0.00);
addObstacleBox(map_Building, 40, 21, -33.5, 55.6, PI * -0.00);
addObstacleBox(map_Building, 40, 21,  33.5, 55.6, PI * -0.00);
addObstacleBox(map_Building, 40, 21,  81.6, 55.6, PI * -0.00);

--setup enemy spawn points
spawn1_X = 86;
spawn1_Y = -150;
spawn2_X = 0;
spawn2_Y = 150;
spawn3_X = 86;
spawn3_Y = -150;
spawn4_X = 86;
spawn4_Y = -150;

ballmob = addGroundMobq(map_barrelsoccer, 3, 5, 0, -31, 2, 0.9, 0.1, false, 0.5);

netSetTeamSpawn00(-58, 6, 1.32 * PI);
netSetTeamSpawn01(-58, -62, 1.68 * PI);
netSetTeamSpawn10(58, 6, 0.66 * PI);
netSetTeamSpawn11(58, -62, 0.33 * PI);

netSetGoal0(35, 12, 109, -31, 1.5 * PI);
netSetGoal1(35, 12, -108, -31, 0.5 * PI);
netSetKickOff(0,-30);
netSetBallMob(ballmob);

ndc();
