10 years ago by Oliver
Hello people!
I made a little plugin (my first one, im new with impactjs), and its body looks like this:
so.... whenever y try to use this plugin in my player entity doing something like this:
and try to edit the layers with weltmeister i get this error:
Uncaught TypeError: undefined is not a function
I dont know why i get this error, my fast and easy solution by now is commenting this line:
this.celdasdibujadas = new ig.Dibujaceldas();
And (while the game gets a error) weltmeister works like a charm. But i want to use this plugin in dozens of entities so commenting the line in every single entity wont be aviable option anymore... could you please help me get a solution for this problem?
Thanks! (and sorry for the horrible english)
I made a little plugin (my first one, im new with impactjs), and its body looks like this:
ig.module( 'plugins.dibujaceldas' ) .requires( 'impact.game' ) .defines(function(){ ig.Dibujaceldas = ig.Class.extend({ staticInstantiate: function(i) { return !ig.Dibujaceldas.instance ? null : ig.Dibujaceldas.instance; }, init: function() { ig.Dibujaceldas.instance = this; }, Dibujarceldas: function (posicionx, posiciony, pasosadar) { }, }); });
so.... whenever y try to use this plugin in my player entity doing something like this:
init: function( x, y, settings ) { this.parent(x, y, settings); this.celdasdibujadas = new ig.Dibujaceldas(); this.queceldaspinto = this.celdasdibujadas.Dibujarceldas(ig.game.zeldax, ig.game.zelday, this.pasos); },
and try to edit the layers with weltmeister i get this error:
Uncaught TypeError: undefined is not a function
I dont know why i get this error, my fast and easy solution by now is commenting this line:
this.celdasdibujadas = new ig.Dibujaceldas();
And (while the game gets a error) weltmeister works like a charm. But i want to use this plugin in dozens of entities so commenting the line in every single entity wont be aviable option anymore... could you please help me get a solution for this problem?
Thanks! (and sorry for the horrible english)