fond = Image.load("images/fond.png")
local v = 0

statut = 0

minuteur = Timer.new()
minuteur:stop()

function lettre(x,y,texte,couleur,temps)
  screen:print(x,y,string.sub(texte,1,v),couleur)
  v = v + 0.25
  if v >= #texte + 1 then
    v = 1
  end
  screen.waitVblankStart()
end

oldpad = Controls.read()

while true do
  screen:clear()
  pad = Controls.read()

  screen:blit(0,0,fond)
  if pad:cross() then
    statut = 1
  elseif statut == 1 then
    screen:print(202,175,"Chargement",Color.new(255,255,255))
    statut = 2
  elseif statut == 2 then
    dofile("lumiere.lua")
  end

  if pad:triangle() then
    System.Quit()
  end
  
  if pad:start() then
    dofile("aide.lua")
  end
  
  screen.waitVblankStart()
  screen:flip()
  oldpad = pad
end
