feat: 'lines' (cave-like structures/tunnels) (WIP)

This commit is contained in:
MihailRis
2024-10-08 02:32:45 +03:00
parent 8813d280dc
commit 116cbd61db
7 changed files with 176 additions and 33 deletions
+23
View File
@@ -0,0 +1,23 @@
-- TODO: delete this file after caves complete implementation
function generate_heightmap(x, y, w, h, seed, s)
local map = Heightmap(w, h)
map:add(0.25)
return map
end
function place_structures(x, z, w, d, seed, hmap, chunk_height)
local placements = {}
do
local sy = math.random() * (chunk_height / 4)
local ey = math.random() * (chunk_height / 4)
local sx = x + math.random() * 20 - 10
local ex = x + math.random() * 20 - 10
local sz = z + math.random() * 20 - 10
local ez = z + math.random() * 20 - 10
table.insert(placements,
{":line", 0, {sx - 10, sy, sz - 10}, {ex + 10, ey, ez + 10}, 2})
end
return placements
end