File structure and organizing your gaming project

Is there any rule or chapter like “By the book way” on how to organize files and stuff in a gaming project.

I can see in some samples that the main.lua file is super light and then you use a file structure like…

  1. Main.lua

  2. Splashscreen.lua

  3. Mainmenu.lua
    3.1 Play.lua
    3.2 Settings.lua
    3.3 Highscores.lua
    3.4 openfeint & game center

  4. Box1.lua
    4.1 b2level1.lua
    4.2 b2level2.lua

  5. Box2.lua
    5.1 b2level1.lua
    5.2 b2level1.lua

and so on… so is it recommended by the guys & girls at Ansca to use that kind of structure instead of creating a main.lua that holds a lot?

Some guidelines regarding file structures in a gaming project would be great. Would love to see the file structure from Bubble Ball. [import]uid: 22737 topic_id: 6090 reply_id: 306090[/import]

You can organize your code, how you want.

If you have more levels, make them all a separate lua file if you want. If it just restarts the same level and progresses by math, then you can use only the main.lua.

It depends on the size of your project.

All the lua files must be in the main directory though. [import]uid: 6587 topic_id: 6090 reply_id: 21108[/import]

Thank you for confirming my thoughts. So small games and apps can without problems reside inside a single lua file. [import]uid: 22737 topic_id: 6090 reply_id: 21126[/import]

Why not. [import]uid: 9371 topic_id: 6090 reply_id: 21130[/import]