Adding opponents to the level
Now that you have an opponent for your thief hero, it is time to let the system spawn a bunch of them at runtime. You’ll be doing this by implementing a spawn system similar to the one used in Chapter 3, Testing the Multiplayer System with a Project Prototype – this time, you’ll create the spawner in C++ instead.
What we want to implement here is an Actor that will have the following features:
- Spawns a few minions at the start of the game.
- Spawns new minions at predefined intervals.
- Spawns the minions in a selected area.
- Randomly selects a minion type every time it spawns. At the moment, we have just one minion type, but in the following chapters, we will add more variations.
Let’s get started.
Creating a spawner class
Start by creating a C++ class that extends from Actor and name it US_MinionSpawner
. Once created, open the .h
file and, in the private
section, add the following declarations...