--image
credits = Image.load("datas/credits.png")

--sons
mback = Sound.load("datas/MenuBack.wav",false)

--variable d'état
State =  "credits1"

--boucle principale

while true do

pad = Controls.read()
oldpad = Controls.read()

if State == "credits1" then

screen:clear()
screen:blit(0, 0, credits)
screen.waitVblankStart(50)
State = "credits2" 
end

if State == "credits2" then
screen:clear()
screen:blit(0, 0, credits)
end

if (pad:cross() and State == "credits2") then
mback:play()
State = "exit"
end

if State == "exit" then
screen.waitVblankStart(15)
dofile ("menu.lua")
end

screen.waitVblankStart()
screen.flip()
end 