Time for action – Expanding Awesome Game
We're going to change the way the spawners work so that enemies will only spawn off screen. That way they won't suddenly appear in our view. This experiment is a bit long, so you may want to read through it real quick before diving in, and go slow so you don't miss any of the steps!
First thing's first! Let's get rid of the restriction on the
TestEnemy
class that makes them wait until we're in range before they start moving toward us. When they spawn, we want them to immediately start moving toward us. Change this line:else if(!bFreeze && VSize(Location - Enemy.Location) < FollowDistance)
To this:
else if(!bFreeze)
Now the enemies will move toward us no matter how far away from us they are. Since we don't need the
FollowDistance
variable anymore, let's change its name and refine our movement behavior a bit. At the top ofTestEnemy
, rename theFollowDistance
variable like this:var float MovementSpeed;
And rename and change the default...