code cleanup
This commit is contained in:
@@ -17,7 +17,7 @@ public class Level {
|
||||
private int chunkResY;
|
||||
|
||||
public Level(Main main, int sizeX, int sizeY) {
|
||||
GD.Print($"Generating level ({sizeX}:{sizeY})");
|
||||
GD.Print($"Generating level ({sizeX}:{sizeY}) with {chunksX*chunksY} chunks ({chunkResX} * {chunkResY})");
|
||||
|
||||
Resolution = new Vector2I(sizeX, sizeY);
|
||||
chunksX = main.ChunksPerAxis;
|
||||
@@ -26,15 +26,14 @@ public class Level {
|
||||
chunkResX = sizeX / chunksX;
|
||||
chunkResY = sizeY / chunksY;
|
||||
|
||||
GD.Print($"{chunksX}x{chunksY} chunks. {chunkResX}:{chunkResY} res each.");
|
||||
|
||||
image = Image.Create(sizeX, sizeY, false, Image.Format.Rgb8);
|
||||
|
||||
chunks = new Chunk[chunksX, chunksY];
|
||||
int index = 0;
|
||||
// create all chunks
|
||||
for (int x = 0; x < chunksX; x++) {
|
||||
for (int y = 0; y < chunksY; y++) {
|
||||
chunks[x, y] = new Chunk(chunkResX, chunkResY);
|
||||
chunks[x, y] = new Chunk(chunkResX, chunkResY, index++);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +46,6 @@ public class Level {
|
||||
|
||||
if (x > 0) chunks[x, y].NeighborE = chunks[x-1, y];
|
||||
if (x < chunksX-1) chunks[x, y].NeighborW = chunks[x+1, y];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user