Files
voxel/Program.cs
2025-09-29 10:55:37 +02:00

50 lines
1.2 KiB
C#

using OpenTK.Mathematics;
using Voxel;
internal class Program
{
private static void Main(string[] args)
{
int sizeX = 800;
int sizeY = 600;
string title = "Game";
World world = new World();
Window window = new Window(sizeX, sizeY, title);
Player player = new Player(world, Vector3.Zero);
window.Player = player;
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() + "%");
}
}
}
Console.WriteLine("Generated " + maxI.ToString() + " chunks");
Renderer.SetWorld(world);
window.Run();
}
}