A Look into the Player's Abilities


In this blog post, I will dive into the ins and outs of the player's abilities and explain how/why they work the way they do. When brainstorming ideas for our game, we struggled to nail down an idea. After one of our group members suggested the idea that we currently have, we all immediately jumped on it. As a programmer, I started thinking about different mechanics we could implement that would tie into our theme. 

The first mechanic I decided to implement was "Shield Block". This ability is used whenever the player has the shield equipped and bumps into an enemy. 


The way I set this up had to do with measuring the direction of contact between the enemy and the shield and applying force in that direction to the enemy. After colliding with each enemy, I grab their Rigidbody and NavMeshAgent components to be able to modify them as needed. I then normalized the force applied to their Rigidbodies to keep it consistent and made sure to disable the enemies' AI component while they were stunned.


The next mechanic that was implemented was the projectile system. This is set up to be triggered whenever the player clicks the left mouse button and will launch a projectile when pressed. The projectile will charge up for about half a second and then launch in the direction of the mouse's position. After launching, a particle effect leaves a trail behind the projectile and explodes on impact. 

The final mechanic I'm going to talk about is the Ultimate Ability. This ability consists of a streak of light that will chain between the 5 closest enemies when activated. The ability becomes available when the player's holy bar reaches full capacity. After pressing "Q" the streak will start at the player's location and move between the five closest enemies. After using the ability, the bar will fully deplete and the player will need to wait until it's full to be able to use it again. 

One of my group members was able to set up the lightning mechanic and I was the one who put it into our game and made it work the way it does. The script loops through all enemies, organizes them from closest to farthest, and draws a line between each one every 0.3 seconds.  After the line hits the enemy, they will dissolve immediately.  This is a small snippet from the code that shows the section that draws each line between the enemies and destroys them. 

I hope you all enjoyed this breakdown of the player's abilities and I can't wait to let you all finally play with them!

Get Beyond the Clouds