Level cells that overlap with ruins are removed during level generation (instead of just disabling collisions with them), background sprites can spawn on ruin walls

This commit is contained in:
Regalis
2017-03-23 18:13:28 +02:00
parent 885a8c610c
commit e9e4e5f9d3
4 changed files with 68 additions and 41 deletions

View File

@@ -155,18 +155,14 @@ namespace Voronoi2
for (int i = 1; i < vertices.Length; i++ )
{
GraphEdge ge = new GraphEdge();
ge.point1 = vertices[i-1];
ge.point2 = vertices[i];
GraphEdge ge = new GraphEdge(vertices[i-1], vertices[i]);
System.Diagnostics.Debug.Assert(ge.point1 != ge.point2);
edges.Add(ge);
}
GraphEdge lastEdge = new GraphEdge();
lastEdge.point1 = vertices[0];
lastEdge.point2 = vertices[vertices.Length-1];
GraphEdge lastEdge = new GraphEdge(vertices[0], vertices[vertices.Length-1]);
edges.Add(lastEdge);
@@ -208,6 +204,12 @@ namespace Voronoi2
get { return (point1 + point2) / 2.0f; }
}
public GraphEdge(Vector2 point1, Vector2 point2)
{
this.point1 = point1;
this.point2 = point2;
}
public VoronoiCell AdjacentCell(VoronoiCell cell)
{
if (cell1==cell)