Hivetek / Planetoid

A spiritual successor to Nade Planet.
GNU General Public License v2.0
1 stars 0 forks source link

Allow for some source code files to be loaded before others in the app loader #17

Open PeterSR opened 9 years ago

PeterSR commented 9 years ago

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.

ttolbol commented 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(); }

PeterSR commented 9 years ago

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.