--- a/savegame/savegame.lua +++ b/savegame/savegame.lua @@ -8,24 +8,18 @@ savegame.data.statistics = {} -local threadChannel, saveThread - -- Load an existing savegame JSON file, if it exists. function savegame.load() local savejson = love.filesystem.read("savedata.json") if savejson ~= nil then savegame.data = json.decode(savejson) end - - threadChannel = love.thread.getChannel("savegame_channel") - saveThread = love.thread.newThread("savegame/save_thread.lua") - saveThread:start() end -- Save the current data to file. Keep in mind this is usually -- done automatically by savegame.set(). function savegame.save() - threadChannel:push(savegame.data) + love.filesystem.write("savedata.json", json.encode(savegame.data)) end local saveDelta = 0