This forum is read only and just serves as an archive. If you have any questions, please post them on

8 years ago by fugufish

Any way of selectively loading modules at the start?

eg: I want to load only the module below, if i'm on mobile. If not, i'll load another module

.defines(function() {
	EntityPlayerMobile= ig.Entity.extend({


the reason is because we can't afford pre-loading all modules for all versions , especially if the game is huge.

8 years ago by StuartTresadern

I assume this is more to do with assets rather than the modules ? if so you could create a custom loader to load resources based on device.

Another Option is to detect the device and load different Versions of the game. I was sure Dominic had a PHP example of this but I can't find it at the Moment (if i do I will upadte the thread).

8 years ago by vincentpiel

it would seem more easy to handle the entities you want to spawn before the game starts, and then spawn the right one :

var EntityPlayer = ? EntityPlayerMobile : EntityPlayerBrowser;
var EntityBadGuy = ? EntityBadGuyMobile : EntityBadGuyBrowser;
and then use within a game : this.spawnEntity(EntityPlayer, ..., ... ) ;
Page 1 of 1
« first « previous next › last »