game with different stages

hii…everyone

i am new to corona  and lua so i have some problems in making my game…i want to develop a game with different stages (near about 50).so i am totally confused how to organize  the basic structure of our program.i just dont know any api which can control this kind of situation .in all different stages many of lines are similar and i dont know how to avoid same type of coding again and again in this situation.i have searched same type of problem in forum them many of post suggested to implement module method…well i dont know how it can be done…and one more thing i want to know is that  what are the performance issues in this type of situation .

i mean graphics for every stage plus coding, is corona okay with such type of complexity and what measures  should i take to make performance of this app better and how to save memory,?

really need some suggestion

Generally speaking there are two ways to attack this problem.

  1. if your levels/stages can be described in data (image file names, x, y coordinates of objects, etc.) then you can have a big table of level data and use a single game module that reads that data, draws and runs the level. This reduces code quite a bit. 

  2. If your levels are drastically different you may have to code each stage differently.

Now somewhere in between, lives a world where you may have unique features but it’s mostly data driven. At this point you would pull the unique gameplay code out into it’s own module.

As an example I’m building a side scrolling sci-fi shooter. I have multiple enemy types that have different behaviors. Each enemy type has its own .lua file that I can require into my game.lua and use when I need it. In other words, game.lua doesn’t have the enemy code in it.

Rob

thanks rob…

this will be very helpful

Maybe try use Tiledto build levels for your game. More information you can find in Using Tiled Map Editor for level design with Corona.

thanks@ idurniat

i am just not familiar with it  but i am trying to learn how to use it

@ idurniat

when i try to run it gives the error “The application was unable to start correctly (0xc000007b)”.

@cs9782501 My nick starts with the letter L like Lucas which is my name:)

This postsuggest install Visual C++ Redistributable Packages for Visual Studio 2013. I have installed

Visual C++ Redistributable Packages for Visual Studio 2013 (x86)

Visual C++ Redistributable Packages for Visual Studio 2015 (x86)

Visual C++ Redistributable Packages for Visual Studio 2013 (x64)

Visual C++ Redistributable Packages for Visual Studio 2015 (x64)

Tiled (0.18.0) works fine on my computer (Win7 64bit)

@ ldurniat 

srry it was a mistake  i was typing without wearing my specs  :smiley:

and thanks for helping me…i will try it and let u know .

ldurniat

thanks…finally it starts

Generally speaking there are two ways to attack this problem.

  1. if your levels/stages can be described in data (image file names, x, y coordinates of objects, etc.) then you can have a big table of level data and use a single game module that reads that data, draws and runs the level. This reduces code quite a bit. 

  2. If your levels are drastically different you may have to code each stage differently.

Now somewhere in between, lives a world where you may have unique features but it’s mostly data driven. At this point you would pull the unique gameplay code out into it’s own module.

As an example I’m building a side scrolling sci-fi shooter. I have multiple enemy types that have different behaviors. Each enemy type has its own .lua file that I can require into my game.lua and use when I need it. In other words, game.lua doesn’t have the enemy code in it.

Rob

thanks rob…

this will be very helpful

Maybe try use Tiledto build levels for your game. More information you can find in Using Tiled Map Editor for level design with Corona.

thanks@ idurniat

i am just not familiar with it  but i am trying to learn how to use it

@ idurniat

when i try to run it gives the error “The application was unable to start correctly (0xc000007b)”.

@cs9782501 My nick starts with the letter L like Lucas which is my name:)

This postsuggest install Visual C++ Redistributable Packages for Visual Studio 2013. I have installed

Visual C++ Redistributable Packages for Visual Studio 2013 (x86)

Visual C++ Redistributable Packages for Visual Studio 2015 (x86)

Visual C++ Redistributable Packages for Visual Studio 2013 (x64)

Visual C++ Redistributable Packages for Visual Studio 2015 (x64)

Tiled (0.18.0) works fine on my computer (Win7 64bit)

@ ldurniat 

srry it was a mistake  i was typing without wearing my specs  :smiley:

and thanks for helping me…i will try it and let u know .

ldurniat

thanks…finally it starts