
I whant to save most global variables.
There is no tutorials online and all the other love2ders posts did not solve my problems.

Hope someone can help me
( I Will Include The Zip file And The Love File )



Code: Select all
function love.load()
-- your code for loading
-- Load saved number of clicks (the extra braces are because love.filesystem.read returns 2 values, but we only need 1st)
Clicks = tonumber((love.filesystem.read("save.txt"))) or 0
-- your code for loading
end
function love.quit()
-- Save clicks when game is quited
love.filesystem.write("save.txt", tostring(Clicks))
end
You're probably right, but I'll try anyway.BrotSagtMist wrote: ↑Wed Jun 29, 2022 8:12 am The other thread is pretty detailed in the basics. If he still doesnt get it, its a lost case.
I don't believe this has been pointed out yet, but there's a big difference between memory objects, like a table, and files. You can't directly put a table into a file. A file is either binary data (a stream of hex characters) or a string of regular ASCII characters (things you can type with your keyboard).
Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 7 guests