[lua]
local function hpDetection(event)
if hp == 0 then
composer.gotoScene(“scenes.lobby”)
physics.removeBody(zombie)
physics.removeBody(hero)
zombie:removeSelf()
hero:removeSelf()
Joystick:removeSelf()
AttackButton:removeSelf()
hp:removeSelf()
map:removeSelf()
end
end
Runtime:addEventListener(“enterFrame”,hpDetection)
[/lua]
Why that doesn’t work?