[ad_1]
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.
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:
[ad_2]
Source link