Hello there,
I was wondering if nesting functions within one another is a bad idea, especially optimization-wise.
Example of what I mean :
local function step1() local function step2() transition.to(object2, {time = 10000, x = 123, onComplete = step3}) end transition.to(object1, {time = 5000, alpha = 0, onComplete = step2}) end
Basically I’m nesting a lot of functions within one another to group them and I’m wondering if it’s a bad idea and I should just separate them out.
Things to note:
- I won’t be needing to call these nested functions outside
- I’ll be calling the function step1 in this example, multiple times throughout the game.
Would appreciate any advice, and I’ve already looked at http://developer.coronalabs.com/content/performance-and-optimization.
Thank you!