2 player battle simulator Step 8: Warlock damage and death animations

This step is going to be pretty similar to our previous step as it will be for the death and damage animations for the Warlock instead of the Knight.

Just as in the previous step we will need to add a bunch of new sprites aside from our basic Warlock.

Normal undamaged warlock

Now we need to add a Warlock skin to show that he is taking damage I decided to design mine like this but you can design your however you want.

Damaged Warlock

This is our damaged warlock who flashes red and then goes back to his normal color. And unlike the Knight the entire warlock flashes red as opposed to just his border. Also our Warlock has one more skin.

Ultimate Warlock

This is our Warlock in his ultimate state and this state activates when his health is less than 4. But we will get to that code a little bit later first we need to design the code that will cause the damage animation.

Code for the warlocks damage animation

this is the code for the Warlocks damage animation and it is pretty simple. First it runs forever so whenever the sword is touching the Warlock it will activate this command.

First this command will change the Warlocks skin to warlock damage. then it will broadcast a message to change the warlocks skin to ultimate warlock if the warlocks health is below 4 and if it is not the it will not broadcast the message.

Next we have our ultimate warlock animation code

Ultimate warlock code

This code is fairly straightforward as it double checks the Warlocks health in case the previous code had an issue/glitch and then it changes the warlocks skin to the ultimate warlock.

And last but certainly not least we have the Warlocks death animation.

Warlock death animation

This code is kind of long but that is because the warlock is frequently switching between costumes so it looks like an animation as it runs and it will slowly show the Warlock withering away.

I made a total of 13 costumes for the warlock and the death animation uses 11 of them so it ended up being pretty long it also makes the knight brag about defeating the warlock similary to how the Warlock shouts ¨Filthy Dead Muggle HAHAHAHAHA¨ but obviously the knight isnt as mean or rude as the warlock.

Also this is my last blog post for this game but there will be 2 optional steps Iĺl be posting later this week but I am going to be starting a new series of coding and this game will be a boss fighter game so stay tuned for that.

Thanks for reading my blog and if you want subscribe to my YT channel @Drago Gaming link: https://www.youtube.com/channel/UCrlNUqQVBxLIbdltHQBdcYg?

And if you have any questions feel free to email me. @ [email protected]