isfuturebright Posted November 28, 2013 Share Posted November 28, 2013 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: 10894Error 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 More sharing options...
Recommended Posts