Impact

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

1 decade ago by yatayata

realizing this is unsupported territory but...
I am getting this error within the loadLevel() method of my game:

TypeError: Result of expression 'ig.game' [null] is not an object

loadLevel: function( data ) {
     this.parent( data );
      for( var i = 0; i < this.backgroundMaps.length; i++ ) {
         this.backgroundMaps[i].chunkSize = 256;
         this.backgroundMaps[i].preRender = true;
     }

   //FIXME: Result of expression 'ig.game' [null] is not an object
   var tilesize = ig.game.backgroundMaps[0].tilesize;

 ....

does iOS impact handle level setup differently?

1 decade ago by dominic

It&039;s an old-ish problem that is still present in the Impact version that comes with iOSImpact. You could try to replace all the .js files in #lib/impact/ with the ones from the newest version: 1.18a. I didn't try it - maybe there are other problems with the newest version and iOSImpact.

Otherwise, the workaround for your particular problem is simple: in your main.js put this in the first line of your Game&039;s #init() method:
ig.game = this;

More in this thread.
Page 1 of 1
« first « previous next › last »