local data
local quit = true
function love.load()
cmd = require('require.lovecmd')
if not love.filesystem.exists('sav.klopman') then
data = {}
print('Oh! Hello there. I must have been expecting you.')
else
data = love.filesystem.load('sav.klopman')
print('Ah, welcome back, dear player. Ready to continue playing?')
end
end
function love.quit()
if quit then
print('Are you sure you want to save before quitting?')
quit = false
else
io.write('sav.klopman')
return quit
end
return true
end
Now don't ask me why I chose '.klopman' as the extension, but can you help me fix it?
io.write writes to the standard output by default, or in other words, the same place the print function writes to.
Since you do want to use love.filesystem functions instead of lua's io ones, for file manipulation, you should use love.filesystem.write instead.
Also, it wouldn't hurt actually writing something into the file... but of course, you can have a bunch of empty files too, i'm not here to judge.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.