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

select1=red
select2=red
select3=red
select4=red

select=1

waittime=1

oldpad=Controls.read()
while true do
screen:clear()
pad=Controls.read()
waittime=waittime+1
screen:print(100,100,"Cube",select1)
screen:print(100,120,"Rectangular Prism",select2)
screen:print(100,140,"Cylinder",select3)
screen:print(100,160,"back",select4)

if pad:up() and pad:up() ~= oldpad:up() then
	select=select-1
end
if pad:down() and pad:down() ~= oldpad:down() then
	select=select+1
end

if select==1 then
	select1=green
	else
	select1=red
end

if select==2 then
	select2=green
	else
	select2=red
end

if select==3 then
	select3=green
	else
	select3=red
end

if select==4 then
	select4=green
	else
	select4=red
end
if pad:cross() and select==1 and waittime>10 then
	dofile("./System/cube.lua")
	break;
end
if pad:cross() and select==2 and waittime>10 then
	dofile("./System/prism.lua")
	break;
end
if pad:cross() and select==3 and waittime>10 then
	dofile("./System/cyl.lua")
	break;
end
if pad:cross() and select==4 and waittime>10 then
	dofile("./System/menu.lua")
	break;
end
if select>4 then
select=1 
end
if select<1 then
select=4 
end
screen.waitVblankStart()
screen.flip()
oldpad=pad
end
