red = Color.new(255, 0, 0)
white = Color.new(255, 255, 255)
unloadbuff()
-----Menu--------------------------------------------
Select = 1
maxSelect = 5
menuBackground=Image.load("playpsp/bg.png")
oldpad = Controls.read()
----Menu---------------------------------------------
while true do
pad = Controls.read()
screen:clear()
screen:blit(0,0,menuBackground)
----Menu---------------------------------------------
if pad:up() and oldpad:up() ~= pad:up() then
Select = Select - 1
end
if pad:down() and oldpad:down() ~= pad:down() then
Select = Select + 1
end
if Select > maxSelect then
Select = 1
elseif Select <= 0 then
Select = maxSelect
end
if Select == 1 then
screen:print(180,160,"Start playPONG", red)
screen:print(180,180,"Start playPIXFIX",white)
screen:print(180,200,"Credits",white)
screen:print(180,220,"Back to Ipsphone",white)
screen:print(180,240,"Browser",white)
end
if Select == 2 then
screen:print(180,160,"Start playPONG", white)
screen:print(180,180,"Start playPIXFIX",red)
screen:print(180,200,"Credits",white)
screen:print(180,220,"Back to Ipsphone",white)
screen:print(180,240,"Browser",white)
end
if Select == 3 then
screen:print(180,160,"Start playPONG", white)
screen:print(180,180,"Start playPIXFIX",white)
screen:print(180,200,"Credits",red)
screen:print(180,220,"Back to Ipsphone",white)
screen:print(180,240,"Browser",white)
end
if Select == 4 then
screen:print(180,160,"Start playPONG", white)
screen:print(180,180,"Start playPIXFIX",white)
screen:print(180,200,"Credits",white)
screen:print(180,220,"Back to Ipsphone",red)
screen:print(180,240,"Browser",white)
end
if Select == 5 then
screen:print(180,160,"Start playPONG", white)
screen:print(180,180,"Start playPIXFIX",white)
screen:print(180,200,"Credits",white)
screen:print(180,220,"Back to Ipsphone",white)
screen:print(180,240,"Browser",red)
end

if pad:cross() and Select == 1 then
dofile("pongmenu.lua")
end
if pad:cross() and Select == 2 then
dofile("pxlmenu.lua")
end
if pad:cross() and Select == 3 then
credits=Image.load("playpsp/credits.png")
screen.waitVblankStart(300)
screen:blit(0,0,credits)
end
if pad:cross() and Select == 4 then
dofile("main.lua")
end
if pad:cross() and Select == 5 then
dofile("browser.lua")
end

screen.waitVblankStart()
screen.flip()
oldpad = pad
end
