Saving problem
Posted: Tue Feb 25, 2014 2:37 pm
Hi
Can you look at my saving code and say where is error, because my files are not saving numbers in file?
When i restarting game highscore = 0
and second question, i must make file scores.lua, and prepare it?
(Do I need to write in scores.lua?)
Can you look at my saving code and say where is error, because my files are not saving numbers in file?
Code: Select all
function love.update(dt)
var = {}
var.score = seconds
var.highscore = 0
file = love.filesystem.newFile('scores.lua')
file:write("var.highscore = ", var.highscore)
file:close()
dofile("scores.lua")
if var.score > var.highscore then
var.highscore = seconds
end
and second question, i must make file scores.lua, and prepare it?
(Do I need to write in scores.lua
Code: Select all
var.highscore =