Hi and welcome to this weeks devlog!
This week I’ve been programming an enemy that we posted about a few weeks ago, the Core Guards!
These enemies are designed to be a bit more capable than other enemies in the game so far. Equipped with both a shield and a large sword, they are much more challenging to bypass and kill.
Player prediction
I started with getting them to predict an incoming attack from the player.

This works by testing things like if the player is facing them and/or moving towards them. If the player is moving towards an enemy, there is a high chance for an attack so it makes sense to shield and walk backwards away from the danger.
Attacking the player
Next up was being able to attack the player with their sword!

As you can see in the GIF above, the player is able to block an incoming attack with the shield.
The sword’s collision shape was set up per frame to provide a precise and fair collision against the player. No one likes taking damage when it looks like they didn’t get hit.
Below you can see the red sword overlay that I used to position the lines precisely with each attack frame.

After some testing we realized it was still too easy to simply double jump up and over the core guards. We want this enemy to be a challenge so we extended the length of the sword to make it harder to jump over an attack.
Of course this put the collision lines I had set up out of sync as you can see bellow so I had to do them all again from scratch.

Reacting to damage
The final step was making them react to damage from the player.

The player has two methods of attack; front on, or from above using a downwards stab. The core guards react differently to both types.
For a front on attack they react with their shield in order to prevent any more damage.
For a downwards stab they react by swinging their sword over their head to prevent the player from being able to do further damage from above.
That was it for all the basic functionalities. They can deal damage, block incoming damage and react appropriately to any damage they happen to take. There is still polish left to do on things like damage effects but we didn’t get to that this week.
We hope you enjoyed this devlog. Thanks for reading!
0 comments