This is basically the menu I used in my first few games. You can change it to to be more flexible, and use objects (I don't think you know that yet.)
--Menu
function on.paint(gc)
if not init then
x = 25
y = 65
val = 1
end
gc:drawString("Option 1",40,60,"top")
gc:drawString("Option 2",40,75,"top")
gc:drawString("Option 3",40,90,"top")
gc:drawString("Option 4",40,105,"top")
gc:fillRect(x,y,10,10)
end
function on.arrowKey(dir)
--Moves the cursor
if dir == "up" then
y = y - 15
val = val - 1
elseif dir == "down" then
y = y + 15
val = val + 1
end
--Wrap around
if val == 0 then
y = 110
val = 4
elseif val == 5 then
y = 65
val = 1
end
platform.window:invalidate()
end
function on.enterKey()
if val == "whatever you want" then
"DO THIS"
elseif val == "this option" then
"DO THIS"
end
platform.window:invalidate()
end