Got it resuming, however, i have some strange behavior, upon clicking resume to close the popup and resume the game it seems like i am clicking on booth the resume and the button that lies under everything and covers the entire screen(i use this button so the user can click anywhere on the screen and not on a certain button).so my ship goes up then the game resumes. Is there another way to make the screen clickable? like a big button? so the user don’t have to hit the right button?
It feels strange that then i click the popup and close it then the underlying button also gets clicked?
Here the function for the popup and the underlying button
[lua]–movement of the ship
function ufoMovement(event)
–An if that controls what happens then user hit anywhere on the screen and it goes up
if(event.target.name == “up” and crashed == false) then
–An if that fires an timer then touch began
if(event.phase == “began”) then
tmrUp = timer.performWithDelay(150, engines, 0)
–An elseif that checks then user stops to touch the button
elseif(event.phase == “ended”) then
timer.cancel(tmrUp)
spriteInstance.linearDamping = 0
–An elseif that checks if ufo has crashed then makes spriteInstance the crashedPos
elseif(crashed == true) then
spriteInstance.x = crashedPos
end
end
end
buttonUp:addEventListener(“touch”, ufoMovement)
–function for open the popup and pausing the physics
function pauseGame(event)
if(event.target.name == “pause”)then
physics.pause()
director:openPopUp(“options”, closed)
end
end
pause:addEventListener(“touch”, pauseGame)
–function for closing the popup and start physics
function menuTouch(event)
–An if that fires an timer then touch began
if(event.phase == “began”) then
director:closePopUp()
physics.start()
physics.setGravity(0,5,0)
end
end
options:addEventListener(“touch”, menuTouch)[/lua]
take care
Inkoqnito [import]uid: 90942 topic_id: 16735 reply_id: 62848[/import]