Package net.sertik.genesia.entity

Examples of net.sertik.genesia.entity.Game


    startNewGame.setFont(Assets.getFont(Assets.FONT_COURIERNEW_BOLD_16));
    startNewGame.setCursor(Cursor.HAND);
    startNewGame.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent ae) {
        Game game = new Game();
        game.setDifficulty((Game.Difficulty) gameLevel.getSelectedToggle().getUserData());

        int totalPlayers = (Integer) numberOfPlayers.getSelectedToggle().getUserData();
        for (int i = 0; i < totalPlayers; i++) {
          Player player = new Player();
          player.setComputer(false);
          player.setColor(Player.COLORS[i]);
          switch (game.getDifficulty()) {
            case BEGINNER:
              player.setGold(12000);
            case NORMAL:
              player.setGold(10000);
            case ADVANCED:
              player.setGold(8000);
          }
          game.getPlayers().add(player);
        }
        for (int i = totalPlayers; i < 3; i++) {
          Player player = new Player();
          player.setComputer(true);
          player.setColor(Player.COLORS[i]);
          player.setName(Player.NAMES[i - totalPlayers]);
          switch (game.getDifficulty()) {
            case BEGINNER:
              player.setGold(8000);
            case NORMAL:
              player.setGold(10000);
            case ADVANCED:
              player.setGold(12000);
          }
          game.getPlayers().add(player);
        }

        WorldGenerator worldGenerator = (WorldGenerator) worldCreation.getSelectedToggle().getUserData();
        game.setWorld(worldGenerator.generate(64, 256));

        genesia.setGame(game);
      }
    });
View Full Code Here

TOP

Related Classes of net.sertik.genesia.entity.Game

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.