--COLOURS--

red = Color.new(200,0,0)
blue = Color.new(0,0,200)
black = Color.new(0,0,0)

--IMAGES--

background = Image.load("IMAGES/mainmenu.png")
unavailable = Image.load("IMAGES/unavailable.png")

--FONTS--

font1 = Font.load("FONTS/font1.ttf")
font1:setPixelSizes(40,40)

--SOUNDS--

--Wav.load("SOUNDS/menuselection.wav", 0)
Wav.load("SOUNDS/menuclick.wav", 1)



current = 1

while true do

oldpad = pad
pad = Controls.read()

screen:clear()
screen:blit(0,0,background)



--TEMPORARY--
if pad:triangle() then
dofile("FILES/MULTIPLAYER/championshiprace3.lua")
end
--TEMPORARY--



screen:fontPrint(font1,120,115," Single player",black)
screen:fontPrint(font1,120,155," Multi player",black)
screen:fontPrint(font1,120,195," Credits",black)
screen:fontPrint(font1,120,235," Exit",black)



if current == 1 then
screen:fontPrint(font1,120,115,"Single player",red)
end

if current == 2 then
screen:fontPrint(font1,120,155,"Multi player",red)
end

if current == 3 then
screen:fontPrint(font1,120,195,"Credits",red)
end

if current == 4 then
screen:fontPrint(font1,120,235,"Exit",red)
end



if pad:up() and oldpad:up() ~= pad:up() then
current = current - 1
--Wav.play(false, 0)
end

if pad:down() and oldpad:down() ~= pad:down() then
current = current + 1
--Wav.play(false, 0)
end

    
     -- FUNCTIONS --
     
    
if pad:cross() and current == 1 then
Wav.play(false, 1)
screen:blit(0,0,unavailable)
screen:flip()
screen.waitVblankStart(140)
--dofile("FILES/SINGLEPLAYER/singleplayermenu.lua")
end

if pad:cross() and current == 2 then
Wav.play(false, 1)
dofile("FILES/MULTIPLAYER/multiplayermenu.lua")
end

    
if pad:cross() and current == 3 then
Wav.play(false, 1)
dofile("FILES/credits.lua")
end
        
if pad:cross() and current == 4 then
Wav.play(false, 1)
System.quit()
end
   
    
if current == 5 then
current = 1
end
if current == 0 then
current = 4
end


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



































