🎉 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 11: Two New Enemies

Published March 31, 2024
Advertisement

This Week's Work:

My goal for my last sprint of Ciros work was to implement two more enemy types, with placeholder sprites that will be added and animated by another team member.

Both enemy types are stationary, but they both have some form of projectile, which doesn't really exist for any other enemies except for the boss, so that needed a fresh implementation.

The first enemy shoots out a homing projectile when in range of the player. The homing script was easy to copy over from the boss script, but getting the attack range was tricky because of how contact damage works with Unity colliders.

Homing Projectile script

I wanted to add a second collider as a child object of the enemy, and use that collider for attack range only, but it ended up doing contact damage to the player whenever the player entered the attack range. Rather than changing the Enemy script to ignore specific colliders, which could cause more issues down the line, I just did a manual calculation of the distance between the two objects and activated the projectile when the distance was small enough.

I tried to make this script as scalable as possible so that we could easily incorporate different types of projectiles, cooldowns, or radii.

The other enemy type spawns a sort of shockwave with 3 phases, going from smallest to largest. They're basically just concentric circles, so I used a script to edit the local scale for each phase with a certain delay.

I'm having issues uploading GIFs at the moment, but here are a couple screenshots of the enemies attacking, still with placeholder assets:

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