Creating The Boss Fight! (Part 2: The Shield Generator’s Setup & Movement)
As part of the Boss fight, the five Shield Generators will need to be destroyed first. Until they’re all destroyed, they will fully protect the Boss.
Today’s Objective: Create the code to spawn any number of Shield Generators I want, and have them rotate around the Boss’s main body.
First, I’ll create a new empty GameObject called “Boss”.
This will be the root object for all the Boss’s parts. I’ll create a placeholder child object with a Sprite Renderer component under this, just so that I can see the Boss for now.
I’ll also create another empty GameObject under the Boss called “Generator Rotator”, which will be the parent of all spawned Shield Generators.
Then I’ll create a new script called “BossShieldGenManager” and place it on the “Boss” GameObject:
Add a simple Trail Renderer component to make it even better!
In tomorrow’s post, Part 3, I will be working on the 2nd stage of the fight, the two Sentries (previously called the “Secondary Guns”).