Conquering Ciros Week 7: Piercing-Elemental Synergy Rework

Published February 25, 2024
Advertisement

This Week's Tasks:

As I mentioned last week, the Piercing-Elemental synergy has needed some reworking and refactoring. Because it's designed to duplicate the current projectile instead of spawning some new projectile, the behavior depends on the original crystal. I ended up making a separate script for each Piercing crystal, rather than just having one script that attaches to each projectile and covers all cases.

It's not as elegant of a solution as the other synergies, but I think it was necessary for both readability and functionality. Each of the scripts have the same general idea, and the Update looks something like this:

Some crystals also have code to manage rotation and speed more directly (like Slash and Bounce, which need to rotate). The code was adapted from the original ability scripts, but couldn't just use the entire script because of how many dependencies it has on non-existent things. For example, the duplicated projectile wouldn't have a crystal as a parent or any connected crystals. I also moved the calculation of closestEnemy into Update for Slash and Bounce to give them strong homing effects.

This also means I have to use a switch to add each script, as shown here:

I think the functionality is pretty good at this point, but it may need adjustment in the future, and would need maintaining if we decide to add new crystals. That was my biggest concern with this implementation, since the other synergies should work for any crystal, even if we add it later on in development.

GIFs of each projectile:

There is still a lot of room to tweak the specifics. For example, Bounce doesn't feel very strong because it despawns after hitting one enemy, so that could be changed. Critical Hit also needs its speed and rotation to be tweaked eventually.

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement