Hello everyone
,
(Sorry about another question , just trying to work this out and have no clue no matter what i have looked at)
local function LoadHighscore()
local file = io.open("|D|settings.txt","r")
if not file then
highscore = 0
else
highscore = tonumber(file:read("*line"))
file:close()
end
end
Firstly i have That code to load the highscore on startup and if it dosent exist then put the highscore as 0 then later on when the game ends i have
local function saveScore()
local file=io.open("|D|settings.txt","w+")
file:write(highscore .. "\n")
file:close()
end
That called so it saves the score but when a new game starts the highscore isnt there why is this?
Thanks in advance
Wicked
Comments
http://appcodingeasy.com/Gideros-Mobile/Save-and-load-data-module-for-Gideros-Mobile
-Wicked