solved a seed ugly displaying
This commit is contained in:
parent
cb129bdf9f
commit
b81d7213c3
12
main.lua
12
main.lua
|
@ -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"))
|
||||||
|
|
Loading…
Reference in New Issue