- host can respawn

- respawn info texts
- camera clamped to the the upper edge of the level
- fixed submarinebody being generated from all walls (and not just the ones belonging to that specific sub)
This commit is contained in:
Regalis
2016-06-23 18:23:20 +03:00
parent dc7956274c
commit 296c5a14ed
12 changed files with 204 additions and 74 deletions

View File

@@ -17,6 +17,8 @@ namespace Barotrauma
class Level
{
public const float ShaftHeight = 1000.0f;
public static Level Loaded
{
get { return loaded; }
@@ -56,7 +58,7 @@ namespace Barotrauma
private WrappingWall[,] wrappingWalls;
private float shaftHeight;
//private float shaftHeight;
//List<Body> bodies;
private List<VoronoiCell> cells;
@@ -121,7 +123,7 @@ namespace Barotrauma
{
get { return backgroundColor; }
}
public Level(string seed, float difficulty, int width, int height, int siteInterval)
{
this.seed = seed;
@@ -513,7 +515,7 @@ namespace Barotrauma
ShaftBodies = new Body[2];
for (int i = 0; i < 2; i++)
{
ShaftBodies[i] = BodyFactory.CreateRectangle(GameMain.World, 200.0f, 10.0f, 5.0f);
ShaftBodies[i] = BodyFactory.CreateRectangle(GameMain.World, 200.0f, ConvertUnits.ToSimUnits(ShaftHeight), 5.0f);
ShaftBodies[i].BodyType = BodyType.Static;
ShaftBodies[i].CollisionCategories = Physics.CollisionLevel;
@@ -585,7 +587,7 @@ namespace Barotrauma
{
List<WayPoint> wayPoints = new List<WayPoint>();
var newWaypoint = new WayPoint(new Rectangle((int)pathCells[0].Center.X, (int)(borders.Height + shaftHeight), 10, 10), null);
var newWaypoint = new WayPoint(new Rectangle((int)pathCells[0].Center.X, borders.Height, 10, 10), null);
newWaypoint.MoveWithLevel = true;
wayPoints.Add(newWaypoint);
@@ -625,7 +627,7 @@ namespace Barotrauma
//prevWaypoint = newWaypoint;
}
newWaypoint = new WayPoint(new Rectangle((int)pathCells[pathCells.Count - 1].Center.X, (int)(borders.Height + shaftHeight), 10, 10), null);
newWaypoint = new WayPoint(new Rectangle((int)pathCells[pathCells.Count - 1].Center.X, borders.Height, 10, 10), null);
newWaypoint.MoveWithLevel = true;
wayPoints.Add(newWaypoint);