
collectgarbage()

menuload,message = loadfile("menu.lua")
if menuload == nil then
screen:clear()
screen:print(0,0,"LOAD FAILED",Color.new(255,0,0))
screen:print(0,10,message,Color.new(255,255,255))
screen.flip()
end
   
   backgroundCache = Image.load("backgrounds/credits.png")
   cursor = Image.load("backgrounds/selector.png") ------load cursor
   
   selected = 1
   maxselected = 1
   oldpad = Controls.read() 

while true do

 if selected > maxselected then
   selected = 1
   elseif selected <= 0 then
   selected = maxselected
   end


   padmenu = Controls.read()

   screen.waitVblankStart(6)

   screen:blit(0, 0, backgroundCache, false)


   screen:blit(03, 230, cursor)


if padmenu:cross() and oldpad:cross() ~= padmenu:cross() then
menuload()
end


screen.flip()
oldpad = padmenu
end