Adding Enemies
An RTS game has maps, units, and many other things, but there is one game mechanic that cannot be left out, which is combat. However, to have a good and challenging battle system in place, we need more than units; we need to have enemies.
In this chapter, we are going to implement different enemy types, such as Orcs and Golems, against whose attacks it will be a real challenge for the player to defend themself, and the mighty Red Dragon, which we are going use later as the boss of our level.
By the end of this chapter, you will have learned how to create a flexible system for adding different enemies, spawning the enemies in the existing maps, and reusing most of the unit components to expand and create unique features for the enemies. You will also learn how to create damage feedback in the UI that will display the damage done to each unit and enemy, as well as how to calculate the damage considering the configuration.
In this chapter, we will cover the following...