-
Book Overview & Buying
-
Table Of Contents
Mastering Unity 2D Game Development - Second Edition
By :
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.
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 be using the Dragon for now. Next, create a new Enemy class C# script in the same folder, as follows:
public class Enemy : Entity
{
public EnemyClass Class;
}
The preceding code...
Change the font size
Change margin width
Change background colour