Project Directory Structure?

Hi everyone! I’m wondering if all of your project files (source code, images, sounds) all need to be in the same directory or if you’re allowed to create subfolders for better organization (e.g., a folder for all of your graphics, a folder for your sound effects, etc.).

I thought I read somewhere that Corona requires a completely flat directory structure, but I did some searching and I couldn’t find a concrete answer.

Thanks for the help :slight_smile: [import]uid: 82003 topic_id: 20024 reply_id: 320024[/import]

You can use subfolders :slight_smile:

I usually lay my projects out like this
ROOT :

code
Image folder
sound folder [import]uid: 84637 topic_id: 20024 reply_id: 78169[/import]

Oh, fantastic :slight_smile: Thanks for the quick response :slight_smile: [import]uid: 82003 topic_id: 20024 reply_id: 78176[/import]

Starting with a recent version of Corona SDK, Lua files can now reside within subfolders. You merely need to replace the slashes in the path with dots:

Classes/myLuaFile.lua -\> require( "Classes.myLuaFile" )

For loading sprites and such, use normal paths:

Assets/Images/myImage.png -\> display.newImage( "Assets/Images/myImage.png" )

Ahh, that’s good to know. I wouldn’t have guessed that there would be a difference :slight_smile: Thanks dejay! [import]uid: 82003 topic_id: 20024 reply_id: 78199[/import]

A very important note - if you are using subfolders do NOT use “Resources” as a subfolder name.

Doing so will cause all kinds of issues during submission (iOS.)

Peach [import]uid: 52491 topic_id: 20024 reply_id: 78246[/import]

Ooh, another “gotcha.” Thanks for the warning, Peach! [import]uid: 82003 topic_id: 20024 reply_id: 78404[/import]

Is it safe to put sound files in a “sound” subfolder now when you’re building for Android? I read before that this usually causes conflicts when building for Android. It works great on iOS though but I’m not sure if Android was fixed. Thanks! [import]uid: 44127 topic_id: 20024 reply_id: 79572[/import]

I am a bit confused - does this mean that we can put .lua files in subfolders for Android apps? Corona API documentation still states that this is iOS only. So can we actually put .lua files in subfolders regardless of the platform we’re targeting ?
Thanks
N [import]uid: 80100 topic_id: 20024 reply_id: 98290[/import]

I have just about everything in subfolders (code, textures, audio…), and I’ve had no problems running my game on iOS or Android. The documentation must be out of date :slight_smile: [import]uid: 82003 topic_id: 20024 reply_id: 98298[/import]