function highScore(newScore)
saveDir = love.filesystem.getSaveDirectory()
saveFile = "highscore.txt"
saveFileExists = love.filesystem.exists(saveFile)
if saveFileExists then
localHighScore = love.filesystem.read(saveFile)
localHighScore = tonumber(localHighScore)
else
localHighScore = 0
end
if newScore > localHighScore then
localHighScore = newScore
end
love.filesystem.write(saveFile, localHighScore)
return localHighScore
end
function highScore(newScore)
saveDir = love.filesystem.getSaveDirectory()
saveFile = "highscore.txt"
saveFileExists = love.filesystem.exists(saveFile)
if saveFileExists then
localHighScore = love.filesystem.read(saveFile)
localHighScore = tonumber(localHighScore)
else
localHighScore = 0
end
if newScore > localHighScore then
localHighScore = newScore
end
love.filesystem.write(saveFile, localHighScore)
return localHighScore
end