Time for action – Reverting our code
Now let's get the test code out of here!
The first thing we need to do is open the
AwesomeTestMap
and delete the placedAwesomeEnemy
there. Save the map and exit the editor.Next, let's take out the
placeable
keyword from the top ofAwesomeEnemy
:class AwesomeEnemy extends AwesomeActor;
Now let's change
AwesomeEnemy
'sTakeDamage
function back to what it was before we started these experiments:event TakeDamage(int DamageAmount, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { if(EventInstigator != none && EventInstigator.PlayerReplicationInfo != none) WorldInfo.Game.ScoreObjective(EventInstigator.PlayerReplicationInfo, 1); if(AwesomeEnemySpawner(Owner) != none) AwesomeEnemySpawner(Owner).EnemyDied(); Destroy(); }
Now in
AwesomeGame
, let's change theEnemiesLeft
default property back to 10:EnemiesLeft=10
Finally, let's add...