Open PeterSR opened 9 years ago
Can't this be fixed simply by simply dividing the init code into smaller blocks of code. Example, instead of: funcion init(){ < a bunch of code> }
use:
function init(){ somecode1(); somecode2(); somecode3(); }
Yes, this is a great fix for now. But in the long run I have multiple things I would like to improve about the app loader and this is one of them.
Currently all source code files will be loaded async and the fastest to be loaded will be executed first. This ordering is in general unpredictable which is fine, as this is the fastest way to do it, but some essential files could be helpful to have loaded before others. Currently, everything that needs to be set up is done in game.init because it is the only place that we can be certain that all files have been loaded. This is really fine, but the init function is starting to get cluttered. For things such as system and entity setups for ECS, it would be nicer to have these in a separate file.