wip procgen

This commit is contained in:
asrael 2025-11-09 06:30:17 -06:00
parent a653eae745
commit 79a678f162
No known key found for this signature in database
GPG key ID: 2786557804DFAE24
18 changed files with 1317 additions and 127 deletions

View file

@ -459,4 +459,21 @@ function pxl8.world_is_loaded(world)
return C.pxl8_world_is_loaded(world)
end
function pxl8.world_generate(world, params)
local c_params = ffi.new("pxl8_procgen_params")
c_params.type = params.type or C.PXL8_PROCGEN_CAVE
c_params.width = params.width or 32
c_params.height = params.height or 32
c_params.depth = params.depth or 0
c_params.seed = params.seed or 0
c_params.density = params.density or 0.45
c_params.iterations = params.iterations or 4
c_params.type_params = nil
return C.pxl8_world_generate(world, c_params)
end
pxl8.PROCGEN_CAVE = C.PXL8_PROCGEN_CAVE
pxl8.PROCGEN_DUNGEON = C.PXL8_PROCGEN_DUNGEON
pxl8.PROCGEN_TERRAIN = C.PXL8_PROCGEN_TERRAIN
return pxl8