After programming several games, and attempting at a more complex game, I encountered certain problems, at which point I decided that it was time to look at AppStates, CustomControls, and multi-threading. So far I’ve only looked at appstates, and I have a few questions:
- How do I pass an instance of main (and variables) to the AppState when it’s initalized.
I tried this by adding them to the beginning of the method where you define the variables it recieves, but at “stateManager.attach(myAppState);”
I couldn’t figure out how to send the variables.
-
Once I’ve done “app.getState(MyAppState.class).setSomething(blah);” does the value magically change, or do I have to call somthing in theI did some more messing with it, and only managed to confuse myself even more : how do I
AppState and tell it to recieve the variable?
even use the above command? It lets me send something like a node, but I can’t figure out how to obtain the node within the AppState.
- Am I right in thinking that the AppState is to manage methods that would take up lots of time, freeing up game time, and clearing up lag (similar to
multi-threading)