Submit Your Own Code

PSP Lua CodeBase : Menu

Description:
This is the code to blit a simple menu.
Right now it will quit if u choose anything you need to fix that.

-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Menu
-- SUBMITTED BY: KIWI

red = Color.new(255, 0, 0)
white = Color.new(255, 255, 255)

--Variables
Select = 1
maxSelect = 2
oldpad = Controls.read()
--loop
while true do
pad = Controls.read()
screen:clear()
--checar decicion
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(334,202,"SINGLE PLAYER", red)
screen:print(334,220,"EXIT",white)
end
if Select == 2 then
screen:print(334,202,"SINGLE PLAYER", white)
screen:print(334,220,"EXIT",red)
end
if pad:cross() and Select == 1 then
break
end
if pad:cross() and Select == 2 then
break
end
screen.waitVblankStart()
screen.flip()
oldpad = pad
end

Back to CodeBase
 

Please welcome anthonyjee, our newest member.

Who's Online:

Total Members: 522
Total Posts: 13085
Total Topics: 1515
Total Categories: 7
Total Boards: 42

Recent Posts:

Re: Hello every body... by DeniseVera
Need help please by Robbynator
Re: Hello every body... by horvathann
Re: background criminal record check by backgroundchecker
background criminal record check by backgroundchecker
Intro to Perl Part 2: What are Scalars? & Examples by Chi Kitory
Intro to Perl Part 1 About Perl and Hello World by Chi Kitory
Re: Trying To Get Rid of the Spammers by Charlie


Copyright © 2006-2009 www.EvilMana.com All rights reserved.
EvilMana Logo by emcp and Charlie