Skip to content

Commit c05d050

Browse files
authored
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.
1 parent b06917a commit c05d050

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

3d/voxel/world/terrain_generator.gd

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ static func flat(chunk_position: Vector3i) -> Dictionary:
2727

2828
for x in Chunk.CHUNK_SIZE:
2929
for z in Chunk.CHUNK_SIZE:
30-
data[Vector3i(x, 0, z)] = 3
30+
data[Vector3i(x, 2, z)] = 3 # Grass.
31+
data[Vector3i(x, 1, z)] = 2 # Dirt.
32+
data[Vector3i(x, 0, z)] = 2 # Dirt.
33+
data[Vector3i(x, -1, z)] = 9 # Bedrock (can't be destroyed due to its Y coordinate).
3134

3235
return data
3336

0 commit comments

Comments
 (0)