Time for action – Creating the abstract base class
This boss class will have a few things in common with AwesomeEnemy
, so there are a few things we'll want to separate out into a common parent class.
Create a copy of
AwesomeEnemy.uc
and name itAwesomeEnemy_Minion.uc
.AwesomeEnemy
will now be the parent class for all of our enemies, andAwesomeEnemy_Minion
will take on the functionality of the enemies we've seen so far in our game.We're going to change a lot in
AwesomeEnemy
andAwesomeEnemy_Minion
to get the functionality separated, so let's start withAwesomeEnemy
. As the boss and minion will both be subclassed ofAwesomeEnemy
, but we won't wantAwesomeEnemy
spawned directly anymore, let's declare it asabstract
. Change the declaration inAwesomeEnemy
to this:class AwesomeEnemy extends AwesomeActor abstract;
The variables in this class are fine, so now let's examine the non-state functions.
TakeDamage
is going to have different functionality for both subclasses, so let's deleteTakeDamage...