Exemple #1
0
 @Override
 void setMaxHealth(int max) {
   int actual = (int) (max - getHealth());
   maxHealth.set(actual);
   modifyHealth(max - getHealth());
   healthBar.maxHealth = actual;
 }
Exemple #2
0
  public BossZombie(
      double x,
      double y,
      ManagerService managers,
      boolean isServer,
      ZombiePathFinder pathFinder,
      ShopManager shop,
      EntityKey key) {

    super(SPRITE_ID, x, y, managers, isServer, pathFinder, shop, key);
    this.shop = shop;
    healthBar = new HealthBar(this);
    maxHealth = new NetVar.nInt(100, "maxHealth", objClass);
    maxHealth.event =
        new NetVar.OnChange<Integer>() {
          @Override
          public void onChange(NetVar<Integer> var, Connection c) {
            healthBar.maxHealth = var.get();
          }
        };
  }