Why does my code only work for 1 sec, and then changing the scene back again?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | function function1 ( event ) if _G.objects == 0 then Runtime:removeEventListener( "touch", function1) director:changeScene( "menu", "moveFromLeft" ) elseif _G.objects > 0 then -- Alot of event.x and event.y detection code else -- some other stuff end end |