solved a seed ugly displaying

This commit is contained in:
bizcochito 2021-03-16 17:36:54 +01:00
parent cb129bdf9f
commit b81d7213c3
No known key found for this signature in database
GPG Key ID: 4A514B3A7A673EB6
1 changed files with 6 additions and 6 deletions

View File

@ -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"))