mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
14 lines
537 B
GDScript
14 lines
537 B
GDScript
tool
|
|
extends TerramanLevelGenerator
|
|
|
|
|
|
func _generate_chunk(chunk: TerraChunk) -> void:
|
|
chunk.channel_ensure_allocated(TerraChunkDefault.DEFAULT_CHANNEL_TYPE, 1)
|
|
chunk.channel_ensure_allocated(TerraChunkDefault.DEFAULT_CHANNEL_ISOLEVEL, 0)
|
|
|
|
var s : OpenSimplexNoise = OpenSimplexNoise.new()
|
|
|
|
for x in range(-chunk.margin_start, chunk.size_x + chunk.margin_end):
|
|
for z in range(-chunk.margin_start, chunk.size_x + chunk.margin_end):
|
|
chunk.set_voxel(s.get_noise_2d(x, z) * 10.0, x, z, TerraChunkDefault.DEFAULT_CHANNEL_ISOLEVEL)
|