예제 #1
0
  public void startNewGame(int players_race) {
    if (this.img_cache.areImagesLoaded()) {
      i_game_stage = STAGE_PLAYING_GAME;

      // log.add("Game started!");
      log.clear();
      log.add("Use the menu on the left to select what to build.");
      log.add("Build units by clicking on the map.");

      game_data = new GameData(this, players_race, num_w.getNumber(), num_h.getNumber());

      input_msgs.clear();
      icon_panel = new IconPanel(this, 20, 50);
      icon_panel.reset();

      // Create starting units
      sprites = new ThreadSafeArrayList();

      new UnitMiningPlatform(this, 0, 0, 0);
      this.game_data.map_data.map[0][0].minerals = MapGen.MAX_MINERALS;
      int x = num_w.getNumber() - 1;
      int y = num_h.getNumber() - 1;
      new UnitMiningPlatform(this, x, y, 1);
      this.game_data.map_data.map[x][y].minerals = MapGen.MAX_MINERALS;

      menus.clear();

      map_update_interval.fireInterval();
    } else {
      log.add("Still loading images!  Please wait...");
    }
  }
예제 #2
0
 public void clearLog() {
   log.clear();
 }