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

local mainGroup

local tmr

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

    local introbg = display.newImageRect( "assets/backgroundIntro.jpg", 720, 1280 )
    introbg.x = display.contentCenterX
    introbg.y = display.contentCenterY
    mainGroup:insert(introbg)
end

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

    if ( phase == "will" ) then

    elseif ( phase == "did" ) then
        tmr = timer.performWithDelay( 3000, function () composer.gotoScene( "mainMenu", "crossFade", 2500 ) end, 1 )
    end
end

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

    if ( phase == "will" ) then

    elseif ( phase == "did" ) then

    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