Various improvements

This commit is contained in:
2015-06-10 14:43:57 +03:00
parent 3ab95e13fe
commit 52548b09e1
20 changed files with 45 additions and 55 deletions

View File

@ -144,10 +144,10 @@ namespace TransportGame.Generator
Polygon GeneratePrimitivePolygon(BuildingLot lot)
{
int sides = random.Next(3, 8); // Number of sides
int sides = random.Next(3, 6); // Number of sides
float angle = 2 * (float)Math.PI / sides; // Angle between sides
float radius = random.NextSingle(lot.Size * 0.25f, lot.Size * 0.75f) / 2; // Length of a side
float radius = random.NextSingle(lot.Size * 0.15f, lot.Size * 0.4f); // Length of a side
Vector2 current = lot.Position + new Vector2(random.NextSingle(-lot.Size / 4, lot.Size / 4), random.NextSingle(-lot.Size / 4, lot.Size / 4));
Vector2 dir = new Vector2(random.NextSingle(), random.NextSingle()).Normalized * radius;
@ -185,7 +185,7 @@ namespace TransportGame.Generator
}
else
{
b.LevelHeights[i] = random.NextSingle(0, ConfigManager.Buildgen.MaxBuildingHeight);
b.LevelHeights[i] = random.NextSingle(ConfigManager.Buildgen.MinBuildingHeight, ConfigManager.Buildgen.MaxBuildingHeight);
}
for (int j = 0; j < random.Next(ConfigManager.Buildgen.MaxPolygonsPerLevel); j++)