changing lua file as main thread
Posted: Sat Aug 31, 2024 9:45 pm
Hi
I realize setting up the structure of my game project menu/animation/game mechanism as three independent love2d executable and relying on os.execute to call each program have some drawback and trying to solve them I read something about running all the .lua file inside a single love thread.
Reading about thread system of love2d I wonder if I could have the main thread reload itself using a new .lua file. The main menu program would be called main.lua and would eventually ask the main love thread to restart itself using a new anim.lua or game.lua file.
Maybe another method could be to have all three thread running together but having them paused and started with the window passed to each of them. But I dont need any inter process since all logic in each program is coded to exchange data using the game save file that is in the same love.filesystem via a shared identity, it is read at startup of each program. Maybe it would be easier to just restart using a different .lua file for main thread.
Thank you
I realize setting up the structure of my game project menu/animation/game mechanism as three independent love2d executable and relying on os.execute to call each program have some drawback and trying to solve them I read something about running all the .lua file inside a single love thread.
Reading about thread system of love2d I wonder if I could have the main thread reload itself using a new .lua file. The main menu program would be called main.lua and would eventually ask the main love thread to restart itself using a new anim.lua or game.lua file.
Maybe another method could be to have all three thread running together but having them paused and started with the window passed to each of them. But I dont need any inter process since all logic in each program is coded to exchange data using the game save file that is in the same love.filesystem via a shared identity, it is read at startup of each program. Maybe it would be easier to just restart using a different .lua file for main thread.
Thank you