Fixed content generation, cleaned up project, v1.2.0

This commit is contained in:
Nicola Sovic
2022-04-06 23:18:13 +02:00
parent 9ad62b8b79
commit 16568360a0
67 changed files with 44 additions and 3567 deletions

View File

@@ -15,35 +15,41 @@ public class NoiseGenerator
Color32 low;
Color32 high;
int chance = rand.Next(1, 101);
string tiletype = "";
if (chance > 85 && chance <= 100)
{
samples = calculateSamplesForest(tile);
low = new Color32(0, 150, 0, 255);
high = new Color32(0, 110, 20, 255);
tiletype = "Forest";
}
else if (chance > 70 && chance <= 85)
{
samples = calculateSamplesMountain(tile);
low = new Color32(0, 150, 0, 255);
high = new Color32(140, 140, 140, 255);
tiletype = "Mountain";
}
else if (chance > 55 && chance <= 70)
{
samples = calculateSamplesLake(tile);
low = new Color32(30, 110, 190, 255);
high = new Color32(0, 150, 0, 255);
tiletype = "Lake";
}
else if (chance > 40 && chance <= 55)
{
samples = calculateSamplesRiver(tile);
low = new Color32(30, 160, 190, 255);
high = new Color32(0, 150, 0, 255);
tiletype = "River";
}
else
{
samples = calculateSamplesPlane(tile);
low = new Color32(0, 150, 0, 255);
high = new Color32(0, 185, 0, 255);
tiletype = "Plane";
}
float lowestValue = 10;
@@ -74,6 +80,7 @@ public class NoiseGenerator
vertices[i].y = samples[i] * 3;
}
applyMesh(tile, vertices, mesh, colors);
tile.GetComponent<Tile>().setType(tiletype);
}
private void resetMesh(GameObject tile)