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() function love.load()
-- Personal seed generation -- Personal seed generation
personalseed = love.data.encode("string", "hex", love.data.hash("sha256", os.getenv("PATH"))) personalseed = love.data.encode("string", "hex", love.data.hash("sha256", os.getenv("PATH")))
notsorandomseed = tonumber(personalseed, 16) notsorandomseed = personalseed
math.randomseed(notsorandomseed) math.randomseed(tonumber(personalseed, 16))
-- GRAPHICS -- GRAPHICS
-- GOOD PIXEL -- GOOD PIXEL
@ -42,8 +42,8 @@ end
function love.keypressed(key) function love.keypressed(key)
if key == "z" then if key == "z" then
obj_list = {} obj_list = {}
notsorandomseed = os.time() notsorandomseed = love.data.encode("string", "hex", love.data.hash("sha256", os.time()))
math.randomseed(notsorandomseed ) math.randomseed(tonumber(notsorandomseed, 16))
generate_museum(0,0,0) generate_museum(0,0,0)
end end
if key == "escape" then 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) 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 -- print seed
if notsorandomseed == tonumber(personalseed, 16) then if notsorandomseed == personalseed then
love.graphics.setColor(hexrgb("#FFD700")) love.graphics.setColor(hexrgb("#FFD700"))
love.graphics.print("Seed: "..personalseed, 20, 60) love.graphics.print("Seed: "..personalseed, 20, 60)
love.graphics.setColor(hexrgb("#ffffff")) love.graphics.setColor(hexrgb("#ffffff"))