So depending on game context we can swap between different game states. I am not getting where exactly that swapping procedure should be done. .For example, a card game, with 2 players. Then I want to swap the control between these 2 players by pressing a single button. How should it be implemented. That changing state is done in simpleInitApp?
Asking “how do I use a java class to write a game” is just a slight bit more generic and hard to answer The AppState gives you tools and behavior (described in its javadoc) that allow you do manage the switch by yourself (only you know what needs to be done in your game). Most probably the initial trigger for this to happen is some user input callback method and then most of the code of what happens is in the AppStates initialize() and cleanup() methods. Probably not the start of the app, which simpleInitApp() marks.
Copy that. Thanks.