better world gen
This commit is contained in:
28
Program.cs
28
Program.cs
@@ -15,17 +15,33 @@ internal class Program
|
||||
|
||||
window.Player = player;
|
||||
|
||||
for (int x = 0; x < 4; x++)
|
||||
{
|
||||
for (int y = 0; y < 4; y++)
|
||||
{
|
||||
Chunk chunk = new Chunk(x, y);
|
||||
Console.WriteLine("Generating map...");
|
||||
|
||||
int worldSizeX = 32;
|
||||
int worldSizeY = 32;
|
||||
|
||||
float maxI = worldSizeX * worldSizeY;
|
||||
int i = 0;
|
||||
int lastPercentage = 0;
|
||||
|
||||
for (int x = 0; x < worldSizeX; x++)
|
||||
{
|
||||
for (int y = 0; y < worldSizeY; y++)
|
||||
{
|
||||
i++;
|
||||
Chunk chunk = new Chunk(x, y);
|
||||
world.AddChunk(chunk);
|
||||
|
||||
int percentage = (int)((i / maxI) * 100);
|
||||
if (percentage > lastPercentage)
|
||||
{
|
||||
lastPercentage = percentage;
|
||||
Console.WriteLine((percentage).ToString() + "%");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// xmax ymin gör bugg
|
||||
Console.WriteLine("Generated " + maxI.ToString() + " chunks");
|
||||
|
||||
Renderer.SetWorld(world);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user