I have a game where when something happens, it will make dead = true…I know that changing dead to true works, but I need when dead = true for it to go to another function…
I have this but it doesnt work:
[lua]
function updateGameDone()
director:changeScene( “ending”, “moveFromLeft”)
print(“scene changing to ending”)
return true
end
local event = {
name = “dead”,
dead == true
}
Runtime:dispatchEvent( event )
Runtime:addEventListener(“dead”, updateGameDone)
[/lua]
Thanks in advance