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);
}
}
}