🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Conquering Ciros Week 4: Elemental-Summoning Synergy

Published February 05, 2024
Advertisement

This Week's Work:

This is the last synergy planned for feature-completeness. They'll all need some polish and juiciness for the full release, but having the mechanics working was priority #1. This synergy spawns a non-damaging “tornado” projectile, which acts similarly to the Black Hole crystal ability, although instead of applying attraction as an effect, it keeps the enemies directly next to it for the duration of the attack.

The Tornado grabbing a group of enemies and pulling them with it

Here is the main function for spawning and controlling the tornado itself. It's pretty much the same as the Mine Dropper synergy code, with a canSpawn check to enforce a cooldown, and just instantiating a prefab at the position of the crystal. I did have to add some lines to get the nearest enemy and move the tornado towards it, but that was all in pre-existing code elsewhere.

The team recommended that I reuse Justin's code from the Flail ability to make sure that enemies stay connected to the tornado 100% of the time. Attraction wouldn't be as consistent since it has a slower speed, and might not keep up with the tornado. This made it pretty straightforward, since I just had to adjust his code a little bit to make it work. Overall the script is pretty basic, and might see some optimizations going forward if we run into performance issues.

The relativePositions list was a neat way of keeping the enemies spread out, rather than just having them squish into each other. It makes the effect look more natural in my opinion. I had already put a collider on the prefab, so rather than doing math to figure out the radius necessary to grab an enemy, I just used the radius from the collider. Other than that, the collider is unused, since it doesn't deal damage.

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