refactor: Reverse noisy transition between sand and stone layers

This commit is contained in:
Kacper Kostka (aider) 2025-04-05 15:19:53 +02:00
parent 206e9eb5cc
commit 9c49af57cb

View File

@ -47,10 +47,10 @@ function getOrCreateChunk(chunkX, chunkY) {
const noiseThreshold = y / 10; // 0 at the top, 1 at row 10
if (random() > noiseThreshold) {
chunkData[y * CHUNK_SIZE + x] = STONE;
chunkData[y * CHUNK_SIZE + x] = SAND;
} else {
// Randomly choose between sand and empty space
chunkData[y * CHUNK_SIZE + x] = random() < 0.7 ? SAND : EMPTY;
// Randomly choose between stone and empty space
chunkData[y * CHUNK_SIZE + x] = random() < 0.7 ? STONE : EMPTY;
}
} else {
// Below the transition zone, it's all stone