I'm currently trying to make a program that will write '12' to 'test.lua', then print a variable that equals the number in the file. For instance,
Code: Select all
function love.load()
number = {}
local file = love.filesystem.newFile("testing.lua")
love.filesystem.write("testing.lua", "12")
number.y = love.filesystem.load('testing.lua')()
end
function love.draw()
love.graphics.print(number.y, 200, 200)
end
I've opened the file to check it out, the file says '12'. That's it. Just 12.
I've checked the forums for this problem, and other parts of the internet, but have not found a solution.
Thank you.