As former Flash user I have found that “A Better Approach to External Modules” blog post by Jonathan gives an excellent insight into the way how to make code modular and easier to control. BUT! As former Flash user I have BIG problem with “targeting” of variables and methods. This is really driving me crazy last two days…please help!!!
I’ll try to describe the problem the best I can:
I have two lua files “one.lua” and “two.lua” which are loaded in the main.lua file with “require” (as seen in the example below). Questions are:
-
How to call function x (main.lua) from one.lua file?
-
How to call function y (two.lua) from one.lua file?
-
How to read variable v (main.lua) from two.lua file?
Thanks! [import]uid: 101952 topic_id: 19741 reply_id: 319741[/import]