This is what I have so far
local lastMove = GGData:new( "sample" ) lastMove:set( "message", "hello, world" ) print( lastMove:get( "anotherValue" ) ) print( lastMove.message ) local now = os.time() local function checkit() if ( lastMove.anotherValue + 5 \>= now + 10 ) then -- nudge the player local text = display.newText("GOOD", 0,0,"Arial", 20) text.x = display.contentWidth / 2 text.y = display.contentHeight / 2 text:setTextColor(0,255,0) end end local function tik() lastMove.anotherValue = os.time() lastMove.anotherValue = lastMove.anotherValue lastMove:save() print(lastMove:get( "anotherValue" )) checkit() lastMove:save() end timer.performWithDelay(1000, tik, 0)
It works when after 5 seconds it would show the text “Good”, but I’m unable to figure out how do I have the text stay on the screen when the App has been killed from the background or when I reset the simulator.
EDIT: Never mind I got what I did was use a boolean so basically it would be true if seconds has passed. Once is true the boolean would be save making the text still be there because the value is true if is false it goes away.
Thank you very much for pointing me to the right the directions.