How can I make a main menu (level selector)?

I can’t believe I am re-writing this… I cba to write it all again.
I shall do in-brief. *skips to questions*

Can/How can I do levels using "require(“level1”) etc?
How can you stop requiring something? (my main menu is a .lua itself)

another thing - offtopic, forum based:
how can I find posts/threads I have made? I am used to vbullitin but can’t find here :confused:
I guess I will refresh the page until I find out. [import]uid: 79135 topic_id: 14205 reply_id: 314205[/import]

Is your question “how can i go to a specific lua file via a level selector” ?

There are countless ways of doing this, however I will provide an example using the director class :

[code]
function new()
local localGroup = display.newGroup()

local function goToLevel(event)
local target = event.target

director:changeScene(target.scene, “fade”)
localGroup:removeSelf()
localGroup = nil

return true
end
local levels = {}

–Add two level images to the level table
levels[1] = display.newImage(“level1.png”)
levels[1].scene = “level1” --Assign the level button a level name (with the .lua ommitted)
localGroup:insert(levels[1])

levels[2] = display.newImage(“level2.png”)
levels[2].scene = “level2” --Assign the level button a level name (with the .lua ommitted)
localGroup:insert(levels[2])

–Add event listeners for all level buttons
for i = 1, #levels do
levels[i]:addEventListener(“touch”, goToLevel)
end

return localGroup
end
[/code] [import]uid: 84637 topic_id: 14205 reply_id: 52359[/import]

^ This is why corona is the best.

Thank you, only thing that I am gutted about is that apps do not build to my phone (I believe ansca dropped the hardware) so I can only simulate it and not test truly.
My friend has a mac which I hope to build the app on later :slight_smile: [import]uid: 79135 topic_id: 14205 reply_id: 52387[/import]

Glad to help :slight_smile: [import]uid: 84637 topic_id: 14205 reply_id: 52389[/import]