I am saving the game scores using dataSaver.save(), but not able to retrieve them.Here is my code
Here is what I have tried:
--in init()
self.sets = {}
self.sets[1] = 0
--in EnterFrame
if collision then
sets = dataSaver.load("|D|Scores")
for _, val in pairs(Scores) do
table.insert(self.sets, val) --value in self.sets are not getting inserted
end
table.sort(self.sets)
self.Highest = self.sets[#self.sets]
else
count = count + 1
dataSaver.save("|D|Scores", count)
end
Comments
Try the next in your main.lua
http://www.gamasutra.com/blogs/ArtursSosins/20131129/205956/Learning_Gideros_in_10_easy_steps.php
https://github.com/ar2rsawseen/dataSaver
[-] Liasoft
Don't use load and save table in OnEnterFrame!
Try saving Score in global parameter and when you need it save the value in table by dataSaver