From b81d7213c330c394eec669296854202dcea89984 Mon Sep 17 00:00:00 2001 From: bizcochito Date: Tue, 16 Mar 2021 17:36:54 +0100 Subject: [PATCH] solved a seed ugly displaying --- main.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.lua b/main.lua index 7cde1aa..64759a3 100644 --- a/main.lua +++ b/main.lua @@ -4,9 +4,9 @@ require "suppfunc" function love.load() -- Personal seed generation personalseed = love.data.encode("string", "hex", love.data.hash("sha256", os.getenv("PATH"))) - notsorandomseed = tonumber(personalseed, 16) - math.randomseed(notsorandomseed) - + notsorandomseed = personalseed + math.randomseed(tonumber(personalseed, 16)) + -- GRAPHICS -- GOOD PIXEL @@ -42,8 +42,8 @@ end function love.keypressed(key) if key == "z" then obj_list = {} - notsorandomseed = os.time() - math.randomseed(notsorandomseed ) + notsorandomseed = love.data.encode("string", "hex", love.data.hash("sha256", os.time())) + math.randomseed(tonumber(notsorandomseed, 16)) generate_museum(0,0,0) end if key == "escape" then @@ -70,7 +70,7 @@ function love.draw() love.graphics.print("x: "..math.floor(g3d.camera.position[1])..", y: "..math.floor(g3d.camera.position[2])..", z: "..math.floor(g3d.camera.position[3]), 20, 40) -- print seed - if notsorandomseed == tonumber(personalseed, 16) then + if notsorandomseed == personalseed then love.graphics.setColor(hexrgb("#FFD700")) love.graphics.print("Seed: "..personalseed, 20, 60) love.graphics.setColor(hexrgb("#ffffff"))