Game Levels

Hi,
I would like to know what is the best approach to define my game levels. My game works as follow,
each level has objects moving on the screen and the player will try to shoot these objects. So in level 1 lets say i have 45 small object moving and once the player completes level one. For all levels i will be using the same object but with a slight change (i.e. objects speed will be increased).
So is it better to use level1.lua, level2.lua, level3.lua … etc) or just use levels.lua and try to to change the level parameters on in a proper way.

My concern here is to memory management and game performance as well.

Thanks [import]uid: 11038 topic_id: 3989 reply_id: 303989[/import]

i wouldn’t worry too much about memory management when building the game. just adhere to good coding principles. breaking up the code is a good thing like you said, level1, level2,…leveln. Once you have the game in place, and programmed it in a structured way, it will be that much easier to optimize. Different people have different approach. That would be my approach.

carlos
[import]uid: 24 topic_id: 3989 reply_id: 12369[/import]

Thanks again carlos. But my problem is with regard to changing screen view, i’m really facing problem in this, i need 1 screen as a welcome screen and startup, sscreens for level1, level2, level3, levelN, and finaly screen for Game over …

Thanks [import]uid: 11038 topic_id: 3989 reply_id: 12481[/import]

In mine I just increase the level and have the speed increase based on the level and either game keeps playing or everything resets and starts with the increased level and speed just be sure to put a cap on the speed or at higher levels the game may not be fun anymore but be impossible
Just the way I like to do it but as Carlos said there are different ways
If you don’t know how to setup for different scenes (gs term) maybe use the director class located in the code exchange [import]uid: 7911 topic_id: 3989 reply_id: 12482[/import]

Ps I never cap the the level just the speed
Or atlease so for I havent [import]uid: 7911 topic_id: 3989 reply_id: 12483[/import]

Thanks fir your reply.
Actualy my game does the same. However, I’m facing problem in the main.lua as currently all levels in my game are generated from one file called configuration.lua which has a a huge array the defined each level. So basically, I just call the position required (level number) and loads all features defined for that level.

Can you please send me the structure of your main.lua to talk a look on what you’ve done. as I’m still facing problem in the re-loading stuff
PS: director generates error in my Cade and that’s why I haven’t used it. Do you use it?
Thanks [import]uid: 11038 topic_id: 3989 reply_id: 12488[/import]

@iphone
eXp Jet 2.0 is not that far along in the code yet and when its complete as you change levels all i need to do is increase the speed and change a few other things but the play never stops it just keeps going and you never know that the level changed its setup so the game get faster and faster until you die and the score is based on your time if you want download exp jet 1.2 its free in the appstore right now so you can see the game play although 2.0 game play will be a little different and not sure if it is going to be time based
however
what do is i never remove anything i might reuse i just move it off screen and set an variable to stop it from doing anything but sit there off screen until i need it again and i setup a function that changes any variables that need to change for the next level
hope this helps
i have my code from uts that does this somewhat but the code is hard to follow as the code is a bit jumbled
give me your email and ill send you the game file to look at after i make some changes to it so it will run without all the other files [import]uid: 7911 topic_id: 3989 reply_id: 12503[/import]

Thanks mate I really appreciate your winderfull support.
My email is: georgeronaldo@gmail.com

Man, I have a small problem and don’t know if you’ve faced it or not. It’s with the simulator, for a month simulator was working fine with me, whenever I open the simulator it opens the iPhone simulator and maximized by default, however, since yesterday it started opening the simulator minized by default and then I need to press Command+= to maximise it. The problem is I need to do this (cmd+r) after each time I change the code.
[import]uid: 11038 topic_id: 3989 reply_id: 12505[/import]

not sure maybe check inside the window menu other then that no clue [import]uid: 7911 topic_id: 3989 reply_id: 12506[/import]

try the director class in codexchange, I am using it currently and it’s been working really well, it also has built in support for transitions [import]uid: 11334 topic_id: 3989 reply_id: 12536[/import]

@jstrahan

Would it be too much to ask for you to send me this game file as well? I am currently testing a few different ways to handle scenes and I would love to see something that is a complete template! My email is kbegemandev (at) gmail (dot) com!

Thanks a lot! [import]uid: 9968 topic_id: 3989 reply_id: 12539[/import]

@indeedyes08
sure although as i said it maybe a bit hard to follow as the code is a little jumbled
ill send you and iphone the file tomorrow when i get home from work if i go to work it depends on the weather if i go or not
sorry i couldnt now but i still have to remove some personal stuff from the code like the OF id # and keys and its getting late got to get atlease 3 hours of sleep before i go to work haha been updating my other computer most of the night sometimes hackintosh can be crazy but if i dont get it going then i tied to the mac mini in the office
HOPING SANTA BRINGS ME A NICE NEW MAC BOOK PRO [import]uid: 7911 topic_id: 3989 reply_id: 12541[/import]