private static boolean runServer = false; // run a server if true, run a client if false
private static InetAddress serverAddress;
public static void main(String[] args) throws Exception {
askRunServer();
StandardGame game = new StandardGame("Tank Game");
GAME = game;
boolean runGame = GameSettingsPanel.prompt(game.getSettings());
// only start the game if we actually accept the settings
if (runGame) {
game.start();
PhysicsGameState physics = new PhysicsGameState(120f, 2.2f);
PHYSICS = physics;
physics.getPhysicsSpace().setAutoRestThreshold(.5f);
GameStateManager.getInstance().attachChild(physics);
TankGameState tankGameState = new TankGameState(runServer, serverAddress);
GAMESTATE = tankGameState;
tankGameState.init();
NETWORK = tankGameState.getNetwork();
GameStateManager.getInstance().attachChild(tankGameState);
tankGameState.setActive(true);
physics.setActive(true);
} else {
game.shutdown();
}
}