Level creation?

Hello,

So me and a friend are working on a small app through high school for a hobby. A platform game, and here is my question.

We plan about 140 levels, does this mean a .lua file for every level?? I don’t see how that is very efficient. I am using storyboard, and right now we are just creating a new scene every time a new level loads. What I thought of was making a MASSIVE file, locked by a boolean and if true, the rest of the file (level) is unlocked.

Is there a better way to do this?

Ryley [import]uid: 28237 topic_id: 31209 reply_id: 331209[/import]

You can do it all in one file if you wish; you could have the entire game in a single main.lua file, really. People use one file per level, generally speaking, to spread things out and separate them making it easier to work on specific parts, find things and be organized etc.

You could even break things down so 1-10, 11-20, 21-30 etc each had their logic in one file each, if you really wanted to - it depends on works best for your own style. [import]uid: 52491 topic_id: 31209 reply_id: 124811[/import]

A normal way to set up your game would be (If each level has the same logic like angry birds):

You have one gamescene, which has all the game logic. This scene has a loadlevel function that loads the correct level you want to show the user (Pass a variable to the scene telling which level to show). So one file that contains the code for your game, and 140 files that only contains the level elements for each level(Or as peach said above). Do not duplicate code for your game logic 140 times (or at all)…

So you allways show the same scene to the user, the scene just loads different graphics. [import]uid: 40356 topic_id: 31209 reply_id: 124853[/import]

You can do it all in one file if you wish; you could have the entire game in a single main.lua file, really. People use one file per level, generally speaking, to spread things out and separate them making it easier to work on specific parts, find things and be organized etc.

You could even break things down so 1-10, 11-20, 21-30 etc each had their logic in one file each, if you really wanted to - it depends on works best for your own style. [import]uid: 52491 topic_id: 31209 reply_id: 124811[/import]

A normal way to set up your game would be (If each level has the same logic like angry birds):

You have one gamescene, which has all the game logic. This scene has a loadlevel function that loads the correct level you want to show the user (Pass a variable to the scene telling which level to show). So one file that contains the code for your game, and 140 files that only contains the level elements for each level(Or as peach said above). Do not duplicate code for your game logic 140 times (or at all)…

So you allways show the same scene to the user, the scene just loads different graphics. [import]uid: 40356 topic_id: 31209 reply_id: 124853[/import]