bianco = Color.new(255,255,255)
rosso = Color.new(255,0,0)
pic = Image.load("SYSTEM/resources/background/usedbackground/backg.png")
bar = Image.load("SYSTEM/resources/other/bar.png")
LS = Image.load("SYSTEM/resources/other/LS.png")

SelectedC = 45
timerC = 0
timerD = 0


while true do
pad = Controls.read()

Mp3me.play()
if Mp3me.gettime() == Mp3me.songTime() then
Mp3me.stop()
Mp3me.load("SYSTEM/resources/music/SND1.mp3")
Mp3me.play()
end

screen:blit(0,0,pic)
screen:blit(90,30,LS)
screen:blit(102,SelectedC,bar)

screen:print(77,5,"LEVEL SELECTION MENU :",rosso)
screen:print(77,6,"LEVEL SELECTION MENU :",rosso)

screen:print(110,46,"-  Level 1",bianco)
screen:print(110,56,"-  Level 2",bianco)
screen:print(110,66,"-  Level 3",bianco)
screen:print(110,76,"-  Level 4",bianco)
screen:print(110,86,"-  Level 5",bianco)
screen:print(110,96,"-  Level 6",bianco)
screen:print(110,106,"-  Level 7",bianco)
screen:print(110,116,"-  Level 8",bianco)
screen:print(110,126,"-  Level 9",bianco)
screen:print(110,136,"-  Level 10",bianco)
screen:print(110,146,"-  Level 11",bianco)
screen:print(110,156,"-  Level 12",bianco)
screen:print(110,166,"-  Level 13",bianco)
screen:print(110,176,"-  Level 14",bianco)
screen:print(110,186,"-  Level 15",bianco)
screen:print(110,196,"-  Level 16",bianco)
screen:print(110,206,"-  Level 17",bianco)


if pad:up() then timerC = timerC + 1 end
if not pad:up() then timerC = 0 end
if timerC == 1 then SelectedC = SelectedC - 10 end

if pad:down() then timerD = timerD + 1 end
if not pad:down() then timerD = 0 end 
if timerD == 1 then SelectedC = SelectedC + 10 end

if SelectedC == 215 then SelectedC = 205 end
if SelectedC == 35 then SelectedC = 45 end

if SelectedC == 45 then screen:print(110,46,"-> Level 1",rosso) end
if SelectedC == 55 then screen:print(110,56,"-> Level 2",rosso) end
if SelectedC == 65 then screen:print(110,66,"-> Level 3",rosso) end
if SelectedC == 75 then screen:print(110,76,"-> Level 4",rosso) end
if SelectedC == 85 then screen:print(110,86,"-> Level 5",rosso) end
if SelectedC == 95 then screen:print(110,96,"-> Level 6",rosso) end
if SelectedC == 105 then screen:print(110,106,"-> Level 7",rosso) end
if SelectedC == 115 then screen:print(110,116,"-> Level 8",rosso) end
if SelectedC == 125 then screen:print(110,126,"-> Level 9",rosso) end
if SelectedC == 135 then screen:print(110,136,"-> Level 10",rosso) end
if SelectedC == 145 then screen:print(110,146,"-> Level 11",rosso) end
if SelectedC == 155 then screen:print(110,156,"-> Level 12",rosso) end
if SelectedC == 165 then screen:print(110,166,"-> Level 13",rosso) end
if SelectedC == 175 then screen:print(110,176,"-> Level 14",rosso) end
if SelectedC == 185 then screen:print(110,186,"-> Level 15",rosso) end
if SelectedC == 195 then screen:print(110,196,"-> Level 16",rosso) end
if SelectedC == 205 then screen:print(110,206,"-> Level 17",rosso) end



if SelectedC == 45 and pad:cross() then dofile("SYSTEM/GAME/index1.lua")end
if SelectedC == 55 and pad:cross() then dofile("SYSTEM/GAME/index2.lua")end
if SelectedC == 65 and pad:cross() then dofile("SYSTEM/GAME/index3.lua")end
if SelectedC == 75 and pad:cross() then dofile("SYSTEM/GAME/index4.lua")end
if SelectedC == 85 and pad:cross() then dofile("SYSTEM/GAME/index5.lua")end
if SelectedC == 95 and pad:cross() then dofile("SYSTEM/GAME/index6.lua")end
if SelectedC == 105 and pad:cross() then dofile("SYSTEM/GAME/index7.lua")end
if SelectedC == 115 and pad:cross() then dofile("SYSTEM/GAME/index8.lua")end
if SelectedC == 125 and pad:cross() then dofile("SYSTEM/GAME/index9.lua")end
if SelectedC == 135 and pad:cross() then dofile("SYSTEM/GAME/index10.lua")end
if SelectedC == 145 and pad:cross() then dofile("SYSTEM/GAME/index11.lua")end
if SelectedC == 155 and pad:cross() then dofile("SYSTEM/GAME/index12.lua")end
if SelectedC == 165 and pad:cross() then dofile("SYSTEM/GAME/index13.lua")end
if SelectedC == 175 and pad:cross() then dofile("SYSTEM/GAME/index14.lua")end
if SelectedC == 185 and pad:cross() then dofile("SYSTEM/GAME/index15.lua")end
if SelectedC == 195 and pad:cross() then dofile("SYSTEM/GAME/index16.lua")end
if SelectedC == 205 and pad:cross() then dofile("SYSTEM/GAME/index17.lua")end





screen:print(10,240,"Press X to CONFIRM",rosso)
screen:print(10,250,"Press O to return to the MAIN MENU",rosso)
if pad:circle() and timer3>20 then dofile("SYSTEM/resources/menu/menu.lua") end

screen.waitVblankStart()
screen.flip()
screen:clear()
end
