[Resolved] Introduction and Quick Question

Hi All, I’m a web developer who is in need of adding mobile development to some of my applications and to my company’s skill-set. After spending some time evaluating the various development frameworks out there, I’m pretty sure we’re going with Corona to be our platform of choice. So far my experience with it has been wonderful. It’s fun just prototyping proof-of-concept apps and playing with the tutorials.

Since mobile development in general and Lua/Corona in particular are brand new to me, I expect I’ll be spending some quality time here on the forums, so I wanted to say hi :wink:

I also have a quick question about project organization out the gates… I’ve seen some vague references to the idea that all a project’s lua files should be in the same root folder. Is this necessarily true? Is it convention or will it cause problems down the road to put library/module code in sub folders? What about images/audio? Ideally, I’d like to have something like:

[blockcode]
Project Folder/
config.lua
build.settings
main.lua
app/
screens/
levels/
objects/
lib/
media/
images/
audio/
[/blockcode]

I’ve played around a bit with this kind of structure in some little demo apps, and things seem to run fine in the simulator, but I’ve seen some strange issues and ‘this app has been corrupted’ messages and misc bugs on actual devices (only tested on Android so far, but have never seen anything at all when building straight sample or tutorial code). Just curious about this…

Thanks in advance for any insight and/or best practices. I’m really looking forward to being part of the Corona Community!!!

-Gk [import]uid: 146648 topic_id: 27091 reply_id: 327091[/import]

You can put everything in subfolders except your main.lua, config.lua and build.settings files.

For code files in subdirectories you don’t use a forward slash in the declaration you use a period.

Eg:

--You require code in subdirectories like this  
local game = require("lib.game")  
  
--As opposed to   
local game = require("lib/game")  

For everything else you use the forward slashes [import]uid: 84637 topic_id: 27091 reply_id: 110013[/import]

Brilliant!!! Thanks so much for the tip! [import]uid: 146648 topic_id: 27091 reply_id: 110137[/import]

Glad to help :slight_smile: [import]uid: 84637 topic_id: 27091 reply_id: 110139[/import]