if the first field =nil i want it to try to use the second field
[lua] local secondsLeft = 20 * 60 – 20 minutes * 60 seconds
local clockText = display.newText(“20:00”, display.contentCenterX, 80)
local function updateTime()
– decrement the number of seconds
secondsLeft = secondsLeft - 1
– time is tracked in seconds. We need to convert it to minutes and seconds
local minutes = math.floor( secondsLeft / 60 )
local seconds = secondsLeft % 60
– make it a string using string format.
local timeDisplay = string.format( “%02d:%02d”, minutes, seconds )
clockText.text = timeDisplay
if timeDisplay == “19:40” then
–IF THIS IS NIL I WANT THE FUNCTION TO CHANGE TO–
field:removeSelf()
–I WANT IT TO CHANGE TO THIS–
field2:removeSelf()
clockText:removeSelf()
composer.gotoScene(“menu”)
end
end
– run them timer
local countDownTimer = timer.performWithDelay( 1000, updateTime, secondsLeft )
[/lua]