currently i want to track when the score goes < 1 and then bring up the game over scene.
just wondering how to check the score value after losing health and bring up the game over screen if health is less then 1. i have it down with the following code but it only works once i enter the room and not updated after the health is reduced. i know there was to be a way to do this in one function.
heres what i have
code from start of code
local function lose25Health( self, event )
if event.phase == "began" then
\_G.playerHealth = \_G.playerHealth - 25
storyboard.settings.playerHealth = \_G.playerHealth
storyboard.saveTable(storyboard.settings, "settings.json")
\_G.playerHealthText.text = \_G.playerHealth
print ("loss - 25: now is", \_G.playerHealth )
print ("")
return true
end
end
and here is the code from the enter scene part
if storyboard.settings.playerHealth \< 1 then
print ("Life is BELOW 0")
else
print ("Life is Above 0")
end
[import]uid: 17701 topic_id: 27393 reply_id: 327393[/import]