moved tick to process from physics process

fixed fall speed
improved naming
This commit is contained in:
2025-05-01 22:46:51 +02:00
parent 4462573267
commit ea34b8ecc0
3 changed files with 15 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ public class Level {
GD.Print($"Generating level ({sizeX}:{sizeY}) with {chunksPerX*chunksPerY} chunks ({chunkResX} * {chunkResY})");
image = Image.Create(sizeX, sizeY, false, Image.Format.Rgb8);
image = Image.CreateEmpty(sizeX, sizeY, false, Image.Format.Rgb8);
chunks = new Chunk[chunksPerX, chunksPerY];
int index = 0;
@@ -165,7 +165,7 @@ public class Level {
for (int y = 0; y < chunkResY; y++) {
// TODO: multithreading here! use Chunk.DrawLevel() and stitch images together
if (chunks[cx, cy].Elements[x, y].MarkedForUpdate()) {
if (chunks[cx, cy].Elements[x, y].IsMarkedForUpdate()) {
image.SetPixel(cx * chunkResX + x, cy * chunkResY + y, chunks[cx, cy].Elements[x, y].Color);
chunks[cx, cy].Elements[x, y].MarkForUpdate(false);
}