Package com.jmex.game

Examples of com.jmex.game.StandardGame


  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("StandardGameExample");
    TankGame.GAME = game;
    GameSettingsPanel.prompt(game.getSettings());
    game.start();
   
    NetworkTanksState tankStates = new NetworkTanksState(runServer, serverAddress);
    GameStateManager.getInstance().attachChild(tankStates);
    tankStates.setActive(true);
  }
View Full Code Here


  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();
    }
  }
View Full Code Here

TOP

Related Classes of com.jmex.game.StandardGame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.