clark Posted April 16, 2014 Share Posted April 16, 2014 Hey!I used to have a bunch of destroy methods on my objects which would essentially stop listening for signals etc. I am a little sketchy with this. But one day, I was having a nightmare with: Phaser.Group.prototype.destroy = function (destroyChildren, soft) { if (this.game === null) { return; } if (typeof destroyChildren === 'undefined') { destroyChildren = true; } if (typeof soft === 'undefined') { soft = false; } this.removeAll(destroyChildren); this.cursor = null; if (!soft) { this.parent.removeChild(this); <---- This, if parent is null? this.game = null; this.exists = false; }};So I ended up just deleting all my destroy() methods on the Game classes. When I updated today to the latest dev build. When I clear the world as part of entering my Game State, I get the same error, with the same problem:this.game.state.start(GameStates.GAME, true, false);I checked on the game state, and there is none of my own shutdown() or destroy() methods on that State so I am pretty sure it is unrelated to my previous issue. I am finding it tough to get a stack trace. EDIT: This does not cause the error, but I am unaware of the byproducts of "not clearing" the world. that.game.state.start(SpotJS.GameStates.GAME, false, false);Does anyone have an idea what is going wrong for me here? Thanks! Link to comment Share on other sites More sharing options...
rich Posted April 16, 2014 Share Posted April 16, 2014 Keep an eye on the dev branch, I'm going through some tests with this today. clark 1 Link to comment Share on other sites More sharing options...
clark Posted April 16, 2014 Author Share Posted April 16, 2014 Cheers mate! Link to comment Share on other sites More sharing options...
GourmetGorilla Posted May 9, 2015 Share Posted May 9, 2015 I was playing around with if I could use 'soft' to remove overlaps etc. But when I try the following I get the error: ReferenceError: soft is not definedsprite.destroy(soft);Is there a way to do this using destroy without killing the sprite? Maybe I'm not understanding 'soft' Link to comment Share on other sites More sharing options...
Recommended Posts