More background sprites (+ some sprites swing slightly, sprites are less likely to be placed in unreachable places)

This commit is contained in:
Regalis
2016-09-13 21:23:37 +03:00
parent fa15428ed2
commit eae854abbc
11 changed files with 75 additions and 25 deletions

View File

@@ -319,9 +319,17 @@ namespace Barotrauma
pathCells.AddRange(CreateBottomHoles(generationParams.BottomHoleProbability, new Rectangle(
(int)(borders.Width * 0.2f), 0,
(int)(borders.Width * 0.6f), (int)(borders.Height * 0.8f))));
foreach (VoronoiCell cell in cells)
{
if (cell.Center.Y < borders.Height / 2) continue;
cell.edges.ForEach(e => e.OutsideLevel = true);
}
foreach (VoronoiCell cell in pathCells)
{
cell.edges.ForEach(e => e.OutsideLevel = false);
cell.CellType = CellType.Path;
cells.Remove(cell);
}
@@ -653,7 +661,10 @@ namespace Barotrauma
foreach (GraphEdge edge in cell.edges)
{
VoronoiCell adjacent = edge.AdjacentCell(cell);
if (adjacent!=null && !newCells.Contains(adjacent)) newCells.Add(adjacent);
if (adjacent != null && !newCells.Contains(adjacent))
{
newCells.Add(adjacent);
}
}
}

View File

@@ -68,7 +68,9 @@ namespace Barotrauma
public void Update(float deltaTime)
{
dustOffset -= Vector2.UnitY * 10.0f * (float)deltaTime;
dustOffset -= Vector2.UnitY * 10.0f * deltaTime;
backgroundSpriteManager.Update(deltaTime);
}
public void SetWallVertices(VertexPositionTexture[] vertices)
@@ -196,7 +198,6 @@ namespace Barotrauma
public void RenderWalls(GraphicsDevice graphicsDevice, Camera cam)
{
if (wallVertices == null) return;
basicEffect.World = cam.ShaderTransform

View File

@@ -201,6 +201,8 @@ namespace Voronoi2
public bool isSolid;
public bool OutsideLevel;
public Vector2 Center
{
get { return (point1 + point2) / 2.0f; }