Advice: New scene per game stage or a one scene per game

Dear All,
I am planning my first game in Corona. I am a newbie and I have a high level design question.

My game will have multiple stages (50 planned as of now). All stages will use almost similar logic, but not 100 percent same logic. Each stage will use a mix of new and old graphic assets from the previous stage.

Is it better to have each level of the game in a separate scene (module), thus creating a new scene of the storyboard API for each level or should I have one scene that plays around with the graphics and everything.

thanks [import]uid: 144827 topic_id: 29824 reply_id: 329824[/import]

Personally I would go with one .lua file to control all levels, and set different parameters/rules/graphics depending on the level.

This way if you change something which is applicable to all levels - say a physics setting or the look of the HUD, you don’t have to make the change 50 times.

[import]uid: 93133 topic_id: 29824 reply_id: 119606[/import]

I agree with Nick. It would be much more beneficial to have 1 scene handle all the gameplay.

I.E. gameloop.lua

Gameloop could then load in each level and make minor UI or gameplay changes based on the level being loaded.

Each level could then consist of a few settings tables that point to assets and configure how Gameloop handles that level.

Regards,
Brian [import]uid: 158289 topic_id: 29824 reply_id: 119802[/import]

Thanks for your input. I have another question, may be I will ask it here.

What will be the right method to use a single variable to point to multiple image assets (only one at a time)? e.g. I have ten images and only one of them will be in the display hierarchy at any time. So I will like to have one variable for all the images.

Should I make the variable nil before pointing it to another image. I do not want to leak memory:

local var1 = display.newImage(…)
// usage
display.remove(var1)
//after sometime
var1 = display.newImage(“another image”)

local var1 = display.newImage(…)
// usage
display.remove(var1)
var1 = nil
//after sometime
var1 = display.newImage(“another image”)

regards [import]uid: 144827 topic_id: 29824 reply_id: 119856[/import]

Personally I would go with one .lua file to control all levels, and set different parameters/rules/graphics depending on the level.

This way if you change something which is applicable to all levels - say a physics setting or the look of the HUD, you don’t have to make the change 50 times.

[import]uid: 93133 topic_id: 29824 reply_id: 119606[/import]

I agree with Nick. It would be much more beneficial to have 1 scene handle all the gameplay.

I.E. gameloop.lua

Gameloop could then load in each level and make minor UI or gameplay changes based on the level being loaded.

Each level could then consist of a few settings tables that point to assets and configure how Gameloop handles that level.

Regards,
Brian [import]uid: 158289 topic_id: 29824 reply_id: 119802[/import]

Thanks for your input. I have another question, may be I will ask it here.

What will be the right method to use a single variable to point to multiple image assets (only one at a time)? e.g. I have ten images and only one of them will be in the display hierarchy at any time. So I will like to have one variable for all the images.

Should I make the variable nil before pointing it to another image. I do not want to leak memory:

local var1 = display.newImage(…)
// usage
display.remove(var1)
//after sometime
var1 = display.newImage(“another image”)

local var1 = display.newImage(…)
// usage
display.remove(var1)
var1 = nil
//after sometime
var1 = display.newImage(“another image”)

regards [import]uid: 144827 topic_id: 29824 reply_id: 119856[/import]