Boss Arriving Part-3: Health & Final Wave- Game Dev Series 54

S.J. Jason Liu
3 min readJun 19, 2021

Objective: Create health bar of the boss and add boss to final wave.

It looks more crazy with some damage animation!

With special movement and attacking methods, now should be a wonderful chance to defeat our boss.

In this article, we will create the health bar of the boss and send it into our spawning routing.

Health bar

Create a new slider under Canvas and adjust anything you need like what we did in the previous articles.

Cyborg Orb got a long health bar!

In the UIManager script, create a public method to update the slider value.

And in our Boss script, set the health limit to 100 with an integer. Then create a LaserHit() method as in Enemy script, we can create a damage calculation in it.

And don’t forget to set the maximum value of slider in UIManager.

With this LaserHit() method, boss will lost 2 health per damage, which means you need 50 shot to defeat the boss!

Put it in routine

Now we can create the last wave to reveal the boss.

In our SpawnManager script, under the waves end, add some lines to it to start the boss wave.

In our spawning rules, when the wave counts is equal to the number we set for the maximum wave, it will stop spawning. We just need to enable the boss right before the spawning loop is about to finish.

And that is pretty much everything we need to do in SpawnManager. When the waves is over, it will release the boss to finish the job.

Bonus animation

You can also create some animation to it to make it more like alive.

This is the damage animation.

And use the trigger in LaserHit() method to make a transition.

Demonstration of animation transition.

Boss is finally ready. Prepare for a fully challenge till the end to fight the boss!

--

--

S.J. Jason Liu

A passionate gamer whose goal is to work in video game development.