54 lines
1.3 KiB
C#
54 lines
1.3 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);
|
|
|
|
Console.WriteLine("Generating map...");
|
|
|
|
int worldSizeX = 8;
|
|
int worldSizeY = 8;
|
|
|
|
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);
|
|
|
|
Vector3 startPos = new Vector3(15, 64, 15);
|
|
Player player = new Player(startPos, world);
|
|
|
|
window.Tick += player.Tick;
|
|
window.Update += player.Update;
|
|
window.Update += Camera.UpdateFOV;
|
|
|
|
window.Run();
|
|
}
|
|
} |