So the game loads in this order: stateOne --> stateTwo --> stateThree
I save the x and y coordinates into files called ShipY.lua, and ShipX.lua, both of which return a number.
I do this by:
Code: Select all
local file_shipx = love.filesystem.newFile("ShipX.lua")
local file_shipy = love.filesystem.newFile("ShipY.lua")
starmapone.ship.save_shipX = love.filesystem.load("ShipX.lua")()
starmapone.ship.save_shipY = love.filesystem.load("ShipY.lua")()
starmapone.ship.x = starmapone.ship.save_shipX
starmapone.ship.y = starmapone.ship.save_shipY
Code: Select all
love.filesystem.write("ShipX.lua", "return "..strmp.ship.x)
love.filesystem.write("ShipY.lua", "return "..strmp.ship.y)
Does anyone know why this is happening?