local composer = require ("composer")
local scene = composer.newScene()

local mainGroup

local tmr

function scene:create( event )
    local mainGroup = self.view

    local textRestarting = display.newText( "Time waits for no one.. \n", 0, 0, native.systemFontBold, 32 )
    textRestarting.x = display.contentCenterX
    textRestarting.y = display.contentCenterY
    mainGroup:insert(textRestarting)
end

function scene:show( event )
    local phase = event.phase

    if ( phase == "will" ) then
        composer.removeScene( "gameLevel" )
    elseif ( phase == "did" ) then
        --Runtime:addEventListener( "touch", goToLevel )
        tmr = timer.performWithDelay( 2000, function () composer.gotoScene( "gameLevel", "crossFade", 2000 ) end, 1 )
    end
end

function scene:hide( event )
    local phase = event.phase

    if ( phase == "will" ) then

    elseif ( phase == "did" ) then
        --Runtime:removeEventListener( "touch", goToLevel )
    end
end

function scene:destroy( event )

end

-- Listener setup
scene:addEventListener( "create", scene )
scene:addEventListener( "show", scene )
scene:addEventListener( "hide", scene )
scene:addEventListener( "destroy", scene )

return scene