mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-31 09:49:06 +03:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user