j0hnskot Posted May 23, 2014 Share Posted May 23, 2014 Hello there!I spawn some new objects of classes i made and sometimes i need access to properties,variables etc from the current game state.One way was to pass a reference to the constructor like i did with the game object.The other way was to use game.state.callbackContext to access everything i want from the current state.Are there problems doing so? Are there performance issues? Is there something better to do ? Another reference for the same things for example. Thanks! Link to comment Share on other sites More sharing options...
rich Posted May 23, 2014 Share Posted May 23, 2014 To get the current State you can just do this:var state = this.game.state.getCurrentState();Which is probably safer than using the context. Link to comment Share on other sites More sharing options...
j0hnskot Posted May 23, 2014 Author Share Posted May 23, 2014 Well, i must be blind. I lost 30 minutes searching. If only i was reading more carefully. Thanks rich! Link to comment Share on other sites More sharing options...
Recommended Posts