Hi, Ive been trying to modularize my code, which utilizes director class. I have 50 lvls in my game, and for the most part, only a few variables change from level to level, and I figured it would be much better to have just 1 lua file with the majority of the code in it. I cant figure out how to do it though with director.
I have 1 file called modularizedLevelCode, and then the other 50 level files. Ive tried a few different things… ex: In the modularizedLevel file, I have
module(..., package.seeall)
function new()
local gameGroup = display.newGroup
"code............."
return gameGroup
end
and then in the lvl file…
module(..., package.seeall)
require"modularizedLevelCode"
modularizedLevelCode.new()
end
which doesnt work… I get errors for the director class file. Line 118 and 137 I believe… anyway, Ive tried it several different ways, and no luck… so if anyone knows how to do it, Id appreciate some direction.
[import]uid: 28912 topic_id: 11264 reply_id: 311264[/import]