Code: Select all
if pad:cross() then
ShowOptions()
end
end
here is what my option menu coding is
Code: Select all
function ShowOptions()
screen:blit(0, 0, IMGOptionsMenu)
screen:blit(340, 84, IMGSlow)
screen:blit(356, 127, IMGNormal2)
screen:blit(366, 174, IMGFast)
screen:blit(366, 174, IMGBack)
if selectedOption == 1 then
screen:blit(340, 84, IMGSlow2)
screen:blit(356, 127, IMGNormal)
screen:blit(366, 174, IMGFast)
screen:blit(366, 174, IMGBack)
elseif selectedOption == 2 then
screen:blit(340, 84, IMGSlow)
screen:blit(356, 127, IMGNormal2)
screen:blit(366, 174, IMGFast)
screen:blit(366, 174, IMGBack)
elseif selectedOption == 3 then
screen:blit(340, 84, IMGSlow)
screen:blit(356, 127, IMGNormal)
screen:blit(366, 174, IMGFast2)
screen:blit(366, 174, IMGBack)
elseif selectedOption == 4 then
screen:blit(340, 84, IMGSlow)
screen:blit(356, 127, IMGNormal)
screen:blit(366, 174, IMGFast)
screen:blit(366, 174, IMGBack2)
end
screen.waitVblankStart()
screen.flip()
end
pad = Controls.read()
if pad:left() then
if selectedOption > 1 then
selectedOption=selectedOption-1
end
end
if pad:right() then
if selectedOption < 3 then
selectedOption=selectedOption+1
end
end
if pad:cross() then
if selectedOption == 1 then
ballspeed = 100
selectedOption == 4
elseif selectedOption == 2 then
ballspeed = 200
selectedOption == 4
elseif selectedOption == 3 then
ballspeed = 300
selectedOption == 4
elseif selectedOption == 4 then
Menu()
end
end
and this is my varible for selectOption
Code: Select all
selectedOption = 2 --[[
1 - slow;
2 - normal;
3 - fast;
4 - back;
]]--