Improve flat terrain generation in the Voxel demo (#1189)

This adds 2 layers of dirt below the grass layer and a layer of indestructible
bedrock below it so you can't fall off the world.
This commit is contained in:
Hugo Locurcio
2025-04-15 15:03:12 +02:00
committed by GitHub
parent b06917acaa
commit c05d05009b

View File

@@ -27,7 +27,10 @@ static func flat(chunk_position: Vector3i) -> Dictionary:
for x in Chunk.CHUNK_SIZE:
for z in Chunk.CHUNK_SIZE:
data[Vector3i(x, 0, z)] = 3
data[Vector3i(x, 2, z)] = 3 # Grass.
data[Vector3i(x, 1, z)] = 2 # Dirt.
data[Vector3i(x, 0, z)] = 2 # Dirt.
data[Vector3i(x, -1, z)] = 9 # Bedrock (can't be destroyed due to its Y coordinate).
return data