feat: Add color variations for natural elements and dynamic water colors
This commit is contained in:
@@ -83,14 +83,26 @@ function generateHills(chunkX, chunkY, chunkData, random) {
|
||||
// Top layer is grass
|
||||
if (depth === 0) {
|
||||
chunkData[index] = GRASS;
|
||||
// Set metadata with color index for grass
|
||||
const worldX = chunkX * CHUNK_SIZE + x;
|
||||
const worldY = chunkY * CHUNK_SIZE + y;
|
||||
setMetadata(worldX, worldY, { colorIndex: Math.floor(Math.random() * 10) });
|
||||
}
|
||||
// Next few layers are dirt
|
||||
else if (depth < 5) {
|
||||
chunkData[index] = DIRT;
|
||||
// Set metadata with color index for dirt
|
||||
const worldX = chunkX * CHUNK_SIZE + x;
|
||||
const worldY = chunkY * CHUNK_SIZE + y;
|
||||
setMetadata(worldX, worldY, { colorIndex: Math.floor(Math.random() * 10) });
|
||||
}
|
||||
// Deeper layers are stone
|
||||
else {
|
||||
chunkData[index] = STONE;
|
||||
// Set metadata with color index for stone
|
||||
const worldX = chunkX * CHUNK_SIZE + x;
|
||||
const worldY = chunkY * CHUNK_SIZE + y;
|
||||
setMetadata(worldX, worldY, { colorIndex: Math.floor(Math.random() * 10) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user