In Tower Defense X, enemies are the primary threat to the player's defenses. To create an enemy, a YAML file should be edited with the appropriate statistics for the entity to be spawned.
YAML file structure
The YAML file structure has a specific format that must be followed. The following fields are required:
Entity: The type of entity to spawn.
Cost: The cost to spawn this enemy. If the cost is negative, summoning the enemy will grant the player coins.
Coins-On-Kill: The number of coins the player will receive upon killing the enemy.
Exp-On-Kill: The amount of experience points the player will receive upon killing the enemy.
Health: The amount of health the enemy has.
Damage: The amount of damage the enemy deals.
Wave-Unlocked: The wave on which the enemy will be available for the player to spawn.
Speed: The speed of the enemy. Speed options include Normal, Normal-High, Normal-Low, High, Low, Very-High, Very-Low, Highest, and Lowest.
Additionally, enemies may have optional Equipment fields that allow for customization of the enemy's appearance.
Example YAML file
The following is an example YAML file with two enemies:
Bosses are stronger enemies that require more strategy to defeat. They have unique characteristics and are unlocked later in the game. To create a boss, follow the same YAML file structure as for regular enemies, but include the Wave-Released field instead of Wave-Unlocked. This field determines the wave on which the boss will spawn.