At the moment, I'm working on a small game project using LUA and the love2d framework. Using this framework, I've made my own assets (i.e. button images, form images, etc), and using these assets I've been able to make a functional application, but not yet a game. In my project, I plan on having several scenes, and I'm not quite sure whether my method for scene management/switching is efficient/safe to use (safe, as in minimal bugs). So the process I'm using is as follows:

if scene_selector.active_scene == "splash" then
else
end
else
end
end


    -- Misc Vars
active_scene = "splash"
version = nil

-- Resources
cre = nil
xp = nil

-- End Vars

-- Global Script Indicator
calls = {}
calls.active_scene = active_scene
calls.version = version
return calls


and sceneSplash/sceneMainMenu are links to lua files which act as the scenes. Each file manages its own updates, which are passed through by the main.lua - found by the love.update and love.draw functions which are passed through to the forms relevant load/update/draw functions. I'm aiming at using about 10 forms, 3 variable files and 2 misc function files (file management/encryption/IO operations/logging/etc).

So the TL;DR version is - is it efficient/safe (safe in terms of minimal bugs) to pass through draw and update functions from main.lua to other lua script files?

So far, the process works without any bugs, even when I go back to a previously accessed 'scene', so I assume the process will work 'safely' when I'm using more scenes.

To answer your question, it's perfectly safe and common to let other functions (in potentially other files) update or draw parts their responsible for (or everything if you'd like that). The important thing to keep in mind is that drawing things to the screen outside of the love.draw() function, or functions called from that one, will have no effect, because the screen is cleared before love.draw() is invoked in your main.lua script.

Now, as to your question about efficiency; all function calls have a minimal overhead. Calling functions from love.update() or love.draw() does not produce any extra overhead when compared to any other function call in Lua.

I'm also "playing" with love2d.

You can spare a bounch of if .. elseif if you use a generic scene like this :

if currentScene.loaded == false then

currentScene.unload() --if you need to releas resurces.. invoce gc .. ecc