Skip to content

Config Files

Chia-Chuan Tsou (Jason) edited this page Aug 29, 2023 · 7 revisions

Introduction

Newly added config files include WallTowerConfig, WeaponTowerconfig and baseTowerConfig

WallTowerConfig

This config file defines basic variables for wall entities. These variables are overridden by tower.json file when implementing for wall entity.

public class WallTowerConfig {
    public int health = 1;
    public int baseAttack = 0;
    public int cost = 1;
}

WeaponTowerConfig

This config file works in the exact same manner as WallConfigFile and defines variables to weapon tower entities. Also, when implementing these variables are overridden by tower.json file.

public class WeaponTowerConfig {
    public int health = 1;
    public int baseAttack = 0;
    public int cost = 1;
}

baseTowerConfig

This config file creates a new class to implement WeaponTowerConfig and WallTowerConfig. Using this file, weaponTowerConfigs and wallTowerConfigs are called and used in createWeaponTower() and createWallTower() methods.

public class baseTowerConfigs {
    public WeaponTowerConfig weapon = new WeaponTowerConfig();
    public WallTowerConfig wall = new WallTowerConfig();
}

projectileConfig

This config file defines the basic variables for Projectile entities

public class ProjectileConfig extends BaseEntityConfig {
  public int health = 1;
  public int baseAttack = 0;
}

For further information about how config files are handled, please refer to Configuring Entities.

Clone this wiki locally