Jump to content

Questions about extending Phaser.Group


isfuturebright
 Share

Recommended Posts

I have the current set up where Class A extends Phaser.Group. On my GameState I have the following:

create: function(){   this.objOfClassA = new ClassA(this.game);},shutdown: function(){   this.objOfClassA.destroy();}
//Class Afunction ClassA(game) {    Phaser.Group.call(this, game);}ClassA.prototype = Object.create( Phaser.Group.prototype);ClassA.prototype.constructor = ClassA;ClassA.prototype.Leave = function(){   this.game.state.start("MenuState");}; 

Thing is, when I change state from within the group calling the example function Leave there, Phaser throws an error:

 

Line No: 10894
Error Detail: TypeError: 'null' is not an object (evaluating 'this._container.visible = value')
 

Question is: since my objOfClassA is never added to the GameState's display list, is it deleted when I leave the state? If it isn't how would I go on to clean it? Just null it? Assume it would have graphical elements of its own ;)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...