Пример #1
0
  public Player() {
    PlayerLevel = 1;
    CurrentExp = 0;
    this.showPauseMenu = false;
    this.showTowerSelectMenu = false;
    this.placingTower = false;
    this.mouseButton0 = false;
    this.mouseButton1 = false;
    // Keeps track of if there was an interactive click this update cycle. If so
    // other mouse actions are blocked until both mouse buttons are not clicked
    this.mouseWait = true;

    // Setup towerUI
    TowerSelectUI = new UI();
    TowerSelectUI.addButton(
        "Towermenutitle",
        "towerselectbutton",
        TILE_SIZE,
        TILE_SIZE * 12); // Title bar, no functionality
    TowerSelectUI.addButton("Towercannonblue", "cannonbaseblue", TILE_SIZE * 1, TILE_SIZE * 13);

    CurrentTowerType = TowerType.CannonBlue;
    CurrentAOEType = AOEType.NULL;
    for (AOEType a : AOEType.values()) {
      a.resetCooldown(); // All AOEs are initially available
      a.incrementCooldown(a.cooldown);
    }

    Cash = 0; // These are modified when setup() is called
    Lives = 0;

    Tower.Setup();
  }
Пример #2
0
 private void placeAOE(int x, int y) {
   CurrentAOEType.makeAOE(x, y);
   CurrentAOEType.resetCooldown();
   placingAOE = false;
 }