if that is the case, how will the VM adds to the size of the app? In here we have a limitation of 20MB for over the air download, bigger than that will have to go either itunes/wifi to install the app.
Also, it seems that every lua file will be included automatically when the project is run, I am assuming we shouldn't/cannot use lua's "require"? I can see as the project gets bigger, in certain part of the game we might not want to load everything, just the necessary parts?
Afaik, the compiled size of Lua VM is ~150kb. Usually the images and sounds takes most of the 20mb.
Also, it seems that every lua file will be included automatically when the project is run
You're right.
Also, it seems that every lua file will be included automatically when the project is run, I am assuming we shouldn't/cannot use lua's "require"? I can see as the project gets bigger, in certain part of the game we might not want to load everything, just the necessary parts?
We usually find easier to simply remove the unused Lua files from project instead of removing all related require calls. But after your suggestion, we start to consider enabling/disabling the automatic execution of Lua files. (For example, you may right click a Lua file and exclude it from execution, then use require to load it whenever you want)
Comments
As you said, localizing variables (and also using strict.lua) is recommended.
Also, it seems that every lua file will be included automatically when the project is run, I am assuming we shouldn't/cannot use lua's "require"? I can see as the project gets bigger, in certain part of the game we might not want to load everything, just the necessary parts?
You're right. We usually find easier to simply remove the unused Lua files from project instead of removing all related require calls. But after your suggestion, we start to consider enabling/disabling the automatic execution of Lua files. (For example, you may right click a Lua file and exclude it from execution, then use require to load it whenever you want)
Thank you
something like
With gideros, one of the options may be to wrap each scene into a function like
But I agree with you. Loading each scene with require is more elegant and more memory efficient.