Here is a small example of somthing that can save your score:
--Storage
function setup()
score = 0
displayMode(FULLSCREEN)
end
function draw()
background(127, 127, 127, 255)
score = readLocalData("score", 0)
fill(0, 0, 0, 255)
text("Score: " ..score, 500, 500)
score = score + 1
saveLocalData("score", score)
text("Move your finger to clear the score", 200, 300)
end
function touched(t)
if t.state == MOVING then
clearLocalData()
end
end