diff --git a/mods/testing/init.lua b/mods/testing/init.lua index db6a90b3..204d6e70 100644 --- a/mods/testing/init.lua +++ b/mods/testing/init.lua @@ -1,4 +1,15 @@ minetest.register_globalstep(function(delta) local random = PcgRandom(delta * 1000000) - print(random:next(0, 150)) + + local perlin = PerlinNoise({ + offset = 1, + scale = 1, + spread = { x = 1000, y = 1000, z = 1000 }, + octaves = 10, + persistence = 3, + lacunarity = 2, + }) + + local noisey = perlin:get_2d({ x = random:next(0, 100), y = random:next(0, 100) }) + print(noisey) end) diff --git a/mods/testing/init.tl b/mods/testing/init.tl index 4e9ce81c..30043bbc 100644 --- a/mods/testing/init.tl +++ b/mods/testing/init.tl @@ -1,4 +1,15 @@ minetest.register_globalstep(function(delta: number) local random: PcgRandomObject = PcgRandom(delta * 1000000) - print(random:next(0, 150)) + -- print(random:next(0, 150)) + local perlin: PerlinNoiseObject = PerlinNoise({ + offset = 1, + scale = 1, + spread = {x = 1000, y = 1000, z = 1000}, + octaves = 10, + persistence = 3, + lacunarity = 2 + }) + + local noisey = perlin:get_2d({x = random:next(0, 100), y = random:next(0, 100)}) + print(noisey) end) \ No newline at end of file