--COLOURS--

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

--IMAGES--

background = Image.load("IMAGES/multiplayermenu.png")
car1right = Image.load("IMAGES/CAR1/car1right.png")
car2left = Image.load("IMAGES/CAR2/car2left.png")
dragster1 = Image.load("IMAGES/dragster1.png")
dragster2= Image.load("IMAGES/dragster2.png")
cone = Image.load("IMAGES/cone.png")
multiplayercontrolsscreen = Image.load("IMAGES/multiplayercontrolsscreen.png")
multiplayerdragracecontrolsscreen = Image.load("IMAGES/multiplayerdragracecontrolsscreen.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:blit(0,0,background)


screen:fontPrint(font1,120,115," Back",black)
screen:fontPrint(font1,120,155," Championship",black)
screen:fontPrint(font1,120,195," Drag Race",black)
screen:fontPrint(font1,120,235," Dodge",black)



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

if current == 2 then
screen:fontPrint(font1,120,155,"Championship",red)
screen:blit(45,130,car1right)
screen:blit(395,130,car2left)
end

if current == 3 then
screen:fontPrint(font1,120,195,"Drag Race",red)
screen:blit(35,170,dragster1)
screen:blit(395,170,dragster2)
end

if current == 4 then
screen:fontPrint(font1,120,235,"Dodge",red)
screen:blit(55,220,cone)
screen:blit(395,220,cone)
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)
dofile("FILES/mainmenu.lua")
end

if pad:cross() and current == 2 then
Wav.play(false, 1)
screen:blit(0,0,multiplayercontrolsscreen)
screen:flip()
screen.waitVblankStart(200)
dofile("FILES/MULTIPLAYER/championshiprace1.lua")
end

    
if pad:cross() and current == 3 then
Wav.play(false, 1)
screen:blit(0,0,multiplayerdragracecontrolsscreen)
screen:flip()
screen.waitVblankStart(200)
dofile("FILES/MULTIPLAYER/dragrace1.lua")
end
        
if pad:cross() and current == 4 then
Wav.play(false, 1)
screen:blit(0,0,unavailable)
screen:flip()
screen.waitVblankStart(200)
--dofile("FILES/MULTIPLAYER/dodgerace1.lua")
end



if current == 5 then
current = 1
end
if current == 0 then
current = 4
end


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






































