refactor: Reverse noisy transition between sand and stone layers
This commit is contained in:
parent
206e9eb5cc
commit
9c49af57cb
@ -47,10 +47,10 @@ function getOrCreateChunk(chunkX, chunkY) {
|
|||||||
const noiseThreshold = y / 10; // 0 at the top, 1 at row 10
|
const noiseThreshold = y / 10; // 0 at the top, 1 at row 10
|
||||||
|
|
||||||
if (random() > noiseThreshold) {
|
if (random() > noiseThreshold) {
|
||||||
chunkData[y * CHUNK_SIZE + x] = STONE;
|
chunkData[y * CHUNK_SIZE + x] = SAND;
|
||||||
} else {
|
} else {
|
||||||
// Randomly choose between sand and empty space
|
// Randomly choose between stone and empty space
|
||||||
chunkData[y * CHUNK_SIZE + x] = random() < 0.7 ? SAND : EMPTY;
|
chunkData[y * CHUNK_SIZE + x] = random() < 0.7 ? STONE : EMPTY;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Below the transition zone, it's all stone
|
// Below the transition zone, it's all stone
|
||||||
|
Loading…
x
Reference in New Issue
Block a user