kevglass wrote:
Using game states you can sometimes see that render() is called on the state before enter() is. This seems counter-intuitive, however it's due to allowing transitions to have the greatest flexibility possible.
Fade transitions for instance call render() on the state that is being transitioned to before enter() since they need to have the state drawn before they draw the fade in colour across the top.
If you're finding render() fails because you initialised something in the enter() method that hasn't been called yet the suggestion is:
* Null check things to be initialized
* Have a flag indicating when the state has been entered and check that.
Kev
It's called multi-threading.