I have a LOVE project with the following directory structure:
Code: Select all
lib/
middleclass/
middleclass.lua
module1/
init.lua
a.lua
b.lua
...
conf.lua
main.lua
Code: Select all
local class = require('middleclass')
-- ... module1 contents ...
Code: Select all
-- This seems to be required for it to work from the command-line
package.path = 'lib/?.lua;lib/?/?.lua;lib/?/init.lua;?.lua;?/init.lua;' .. package.path
-- This honestly seems to do absolutely nothing
love.filesystem.setRequirePath(package.path)
local module1 = require('module1')
-- ... main.lua contents ...
Code: Select all
$ love .
Code: Select all
$ love my_game.love
However, when I drag and drop the .love file onto the Love.app program (I'm on OS X) or even when I repackage the .app file per the documentation, the game loads module1 properly, but fails to lookup the middleclass module when it is required by module1.
Has anyone else run into a similar problem or have a similar directory structure? I'd love to hear any suggestions (though I'd really like to keep my files organized this way if at all possible).