Game Client - Hexmare/NetworkRPGTemplate GitHub Wiki
The game client starts with Main.Java
This extends SimpleApplication and in simpleInitApp attaches the MainMenuState.
MainMenuState loads the Nifty Interface, and loads the startscreen. Startscreen provides a Username dialog, serverhost dialog and start button.
When Start is pressed the startGame() function of GameGuiController is called.
startGame * captures the Username provided, and stores it in MainMenuState ( This will probably be moved ) * calls connectToServer() from MainMenuState
MainMenuState.connectToServer() * adds the ConnectionState to the application.
ConnectionState * Creates the SpiderMonkey client * Adds a Connection Observer * Initiates the connection
When the Connection is made and the connection event takes place, Connection state * Instance of RemoteGameClient is created * Instance of the Servers Entity system is obtained. * Certain Entity sets are created
ConnectionState updateLoop monitors to see if GamePlayState has been created and creates if it hasn't.
RemoteGameClient * Incoming message handler for the client.
GamePlayState * adds EntityDataState * adds WorldState * adds ModelState * adds PlayerState * Creates entityset of the players
WorldState * Loads BulletAppState * Loads Scene
ModelState * Used by both Client and Server * Keeps track of all models in the game * Updates model positions in the game
PlayerState * Handles user input *