Stun Shot Implementation


This week we, as a team, had a lot on our docket between bug fixing and final implementations of core mechanics. While less got done due to unfortunate events, we still were able to implement a strong version of the stun shot. Chance and I worked together to get this mechanic up and running. Chance worked on the player side of things while I worked on the enemy/art side of  things. Some problems I had to overcome with this were stunning each different boss, having activation cues for the stun points on enemies, and making flares that would shoot out from the enemy to swat down the players projectile. This was a mechanic we have wanted since the beginning of the game, so we spent a large amount of time getting it to a point that felt good. There is still a lot of work that can be done on it, but we are happy with it for now.

To tackle the actual stun response from the bosses, there was more work than initially thought. Each boss functions uniquely and has various different components. This meant that there was not a single thing I could point to and say, "Let us disable this one component for all enemies". What I should have done was write a method in each boss script to handle the stun. Instead, it is all handled by the stun point script. That script will find the active boss and toggle what it needs to for the stun. For example, the very first boss disables his animator and boss script on stun while keeping his enemy script active. This would allow the player to still harm the boss while not seeing him move or carry out actions. When the stun ends, most bosses just reenable the pieces that were turned off. The next problem I had to handle was how I wanted the stun points to be available to the player. Each boss uniquely triggers the activation of their stun spot through various methods. The first boss will activate it when he slams his face into the ground. The fourth boss "Hush Bringer" will randomly spawn with them when going in and out of the BG. This was as simple as setting the game object to active when necessary, but the timing and execution of it was specific and time consuming. Lastly, the flares. This was the bulk of my work. When a stun point is active, most bosses will retaliate by shooting white flares out. Collision with these will cause the players projectile to pop. The flares are pooled and instatiated at load of the scene. When they are set to be active, they calculate the distance between their spawn and goal destination. The distance will dictate its initial speed as it decellerates towards goal position. This calculated way of moving the projectiles gives a nice visual look to it as flares that need to travel further will arrive at their destination at the same time as the closer flares with varying speeds.

Leave a comment

Log in with itch.io to leave a comment.