I am having trouble with my pause menu for a simple game I am making. The menu isn’t going away when I click resume. Ideas?
function pause_Game ()
Runtime:removeEventListener( “touch”, track_Touch )
timer.pause( ketchup_Movement_Timer )
timer.pause( spawn_Timer )
timer.pause( game_Timer )
physics.stop( )
pauseGroup = display.newGroup()
group:insert(pauseGroup)
pause_Menu = display.newRoundedRect( 0, 0, 280, 500, 20)
pause_Menu:setFillColor( 150,150,150 )
pause_Menu:setStrokeColor( 180, 180, 180 )
pause_Menu.strokeWidth = 5
pause_Menu.alpha = .7
pause_Menu.x = display.contentCenterX
pause_Menu.y = display.contentCenterY
pauseGroup:insert(pause_Menu)
pause_Text = display.newImage(“Assets/pause_Screen/FK_txtPause.png”)
pause_Text.x = pause_Menu.x
pause_Text.y = display.contentCenterY - (screenHeight/3)
pauseGroup:insert(pause_Text)
button_Resume = display.newImage(“Assets/pause_Screen/FK_btnResume.png”)
button_Resume.x = display.contentCenterX
button_Resume.y = (display.contentCenterY - (screenHeight/5)) +30
button_Menu = display.newImage(“Assets/pause_Screen/FK_btnMenu.png”)
button_Menu.x = pause_Menu.x
button_Menu.y = (display.contentCenterY) +30
button_Restart = display.newImage(“Assets/pause_Screen/FK_btnRestart.png”)
button_Restart.x = pause_Menu.x
button_Restart.y = (display.contentCenterY + (screenHeight/5)) + 30
pauseGroup:insert(button_Resume)
pauseGroup:insert(button_Menu)
pauseGroup:insert(button_Restart)
function resume_Game ()
timer.resume( spawn_Timer )
timer.resume( game_Timer )
timer.resume( ketchup_Movement_Timer )
Runtime:addEventListener(“touch”, track_Touch)
pauseGroup:remove(1, 2, 3, 4, 5)
physics.start()
print(“Resume”)
end
button_Resume:addEventListener( “touch”, resume_Game )
function go_to_home ()
storyboard.gotoScene( “home_Page”, “fade” )
end
button_Menu:addEventListener( “touch”, go_to_home )
function restart_Game ()
end
print(“pause”)
end
pause_Btn:addEventListener( “touch”, pause_Game )
end