How to get a working level selector screen?

Hey everyone,

For my game, I need to add a ‘level select’ screen. Basically, I want 5 level select boxes, and if each of those is clicked, a bunch of levels show up under that sub-section. Something like angry birds has, to be exact. Here is a picture of what I am trying to achieve: http://www.google.com/imgres?um=1&hl=en&safe=active&sa=N&biw=1280&bih=601&tbm=isch&tbnid=3B7puaEyTkbb0M:&imgrefurl=http://www.mobygames.com/game/macintosh/angry-birds/screenshots/gameShotId,490927/&docid=NS6n9TckRb_hQM&imgurl=http://www.mobygames.com/images/shots/l/490927-angry-birds-macintosh-screenshot-the-level-select-screen-some.jpg&w=1280&h=800&ei=dB5WUKbzNpSC9QSbzoGwBw&zoom=1&iact=hc&vpx=99&vpy=152&dur=5682&hovh=177&hovw=284&tx=211&ty=84&sig=104262756097045811500&page=1&tbnh=101&tbnw=161&start=0&ndsp=18&ved=1t:429,r:0,s:0,i:76

Thanks for your help! [import]uid: 175550 topic_id: 31028 reply_id: 331028[/import]

You can try to use storyboard.
each level select box will be an image with a event listener attached.

[lua]local selectBox1 = display.newImage( “image1.png” )
selectBox1.tag = “box1”

local selectBox2 = display.newImage( “image2.png” )
selectBox2.tag = “box2”

local selectBox3 = display.newImage( “image3.png” )
selectBox3.tag = “box3”

local functionon onBoxTap(event)
local t = event.target
if(t.tag = “box1”) then
storyboard.gotoScene(“subsection1.lua”)
elseif(t.tag = “box2”) then
storyboard.gotoScene(“subsection2.lua”)
elseif(t.tag = “box3”) then
storyboard.gotoScene(“subsection3.lua”)
end
end
image1:addEventListener (“tap”, onBoxTap )
image2:addEventListener (“tap”, onBoxTap )
image3:addEventListener (“tap”, onBoxTap )[/lua]
You can also do it without using storyboard. [import]uid: 138389 topic_id: 31028 reply_id: 124067[/import]

Thanks so much for your reply! [import]uid: 175550 topic_id: 31028 reply_id: 124071[/import]

You have some codes of level selections with slides too. [import]uid: 116842 topic_id: 31028 reply_id: 124346[/import]

You can try to use storyboard.
each level select box will be an image with a event listener attached.

[lua]local selectBox1 = display.newImage( “image1.png” )
selectBox1.tag = “box1”

local selectBox2 = display.newImage( “image2.png” )
selectBox2.tag = “box2”

local selectBox3 = display.newImage( “image3.png” )
selectBox3.tag = “box3”

local functionon onBoxTap(event)
local t = event.target
if(t.tag = “box1”) then
storyboard.gotoScene(“subsection1.lua”)
elseif(t.tag = “box2”) then
storyboard.gotoScene(“subsection2.lua”)
elseif(t.tag = “box3”) then
storyboard.gotoScene(“subsection3.lua”)
end
end
image1:addEventListener (“tap”, onBoxTap )
image2:addEventListener (“tap”, onBoxTap )
image3:addEventListener (“tap”, onBoxTap )[/lua]
You can also do it without using storyboard. [import]uid: 138389 topic_id: 31028 reply_id: 124067[/import]

Thanks so much for your reply! [import]uid: 175550 topic_id: 31028 reply_id: 124071[/import]

You have some codes of level selections with slides too. [import]uid: 116842 topic_id: 31028 reply_id: 124346[/import]