Beefing up the enemy AI
At the moment, Dragon
is just a sprite drawn on the screen with an AI system that just sits idle in the background. So, let's expand on this and give our Dragons some muscle power.
As stated earlier, to keep the player engaged, you need to have a varied amount of enemies in the battle and they need to be challenging enough to make the player think and apply tactics.
The enemy profile/controller
First, we'll create a new profile for the enemies, starting off with a new enumeration for the enemy class. Create a new C# script named EnemyClass
in Assets\Scripts\Classes
and replace its contents with the following code:
public enum EnemyClass { Dragon, Blob, NastyPeiceOfWork }
I've used just a couple of examples, as we will only ...
Get Mastering Unity 2D Game Development - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.