I’ve gone through a fair amount of forum posts about this topic. It seems that creating a separate lua file for each level (if the each level is setup the same) is the “newbie” way of doing it. I see nothing wrong with doing so but I want to do it the right way. My game is kind of similar to Bubble Ball…but not really. The goal is the same on every level except there will be different obstacles. How would I go about creating one lua file to manage all the levels? Can someone show me some example code and explain?
The posts I read on this topic seemed to be case specific, as in the responses people gave would only be helpful to that person’s game.
Just a little more information on my project. I’ll be using composer, there will be a level select screen and each level has a three star rating (not based on score, but on whether the player collected the stars during play on that level).
Thank you.
BTW, I attached a screen shot of one of my levels. Each level will be similar. Your player is the marble at the top. You position him somewhere inside the “cage” and when you’re ready, push the start level button and he falls down. You’ve gotta capture the key and make it to the lock in one swift move. The stars are just extra credit (might possibly give players the ability to unlock a new “marble” for each stage if they collect all the stars for that level.