Hello, I’m creating a 2D sidescroller and I’m extremely new to Unity. I’m wondering how I could make a large boss battle enemy, where it’s a giant ear of corn that has multiple waves for attacks, each getting progressively more difficult as they go. I was wondering how I’d be able to pull that off? I’m very new to coding as a whole so please keep the answers simple and easy to understand, thanks!
If I am going to be honest it is a bit complex. First off you need some sort of health system to give both you and the boss health. The boss’s max health should be much higher than the players obviously. Maybe you can have it so the corn loses some of its peaces each wave. So say there is 4 waves which I think is perfect for a boss. The first wave have some simple basic enemies that will give you items to help you face the boss’s next wave. The second wave you should have an attack that does an increased amount of damage than any of his attacks so far. If you are left surviving then you once again get the same wave of simple mobs. The next two waves should be hard work. Make the mobs much harder and the final attack all of his kernels popping off. Now his angry and much faster but is also much weaker. So first off. Start with the simplest thing which is a script for health.
Here is an example:
//The max health of the creature
//you are adding the script to.
public int maxHealth = 100;
//The health the creature currently has.
private int currentHealth;
void Start () {
//On start set it's health to full health.
currentHealth = maxHealth;
}
void TakeHealth(int DamageAmount)
{
//If you want this to do damage then
//set the damage value as a negative number.
currentHealth += DamageAmount;
}
Next you are going to need some sort of system of attacking. That is all up to your imagination. If you would like more help feel free to comment on my answer :D.