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 jramada, our newest member.

Who's Online: 2 Guests, 1 User
yaustar

Total Members: 555
Total Posts: 13058
Total Topics: 1480
Total Categories: 8
Total Boards: 35

Recent Posts:

Re: Lua Loader? by Buddy4point0
Re: Lua Loader? by osgeld
Re: Lua Loader? by acer5050
Re: Lua Loader? by bumuckl
Re: Lua Loader? by acer5050
Re: Lua Loader? by bumuckl
Lua Loader? by acer5050
Re: PGELua Help - need term for a special rotation fix (mathematical issue) by bumuckl


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