Stand-alone games as modules?
Posted: Thu Jan 03, 2019 12:30 am
A slightly belated Happy New Year!
I have several small puzzle games that I have written each consisting of a single main.lua file and a few image and sound resources. Is there an effective way to call them as modules? I am imagining having a main.lua file that displays a simple menu and puzzle1.lua, puzzle2.lua, etc., in the same folder, and the player being able to launch them from the menu.
I've played around a bit with require() without any luck. I also wondered if os.execute() might be an option? I welcome any thoughts.
I have several small puzzle games that I have written each consisting of a single main.lua file and a few image and sound resources. Is there an effective way to call them as modules? I am imagining having a main.lua file that displays a simple menu and puzzle1.lua, puzzle2.lua, etc., in the same folder, and the player being able to launch them from the menu.
I've played around a bit with require() without any luck. I also wondered if os.execute() might be an option? I welcome any thoughts.