Daily progress: Day 1 Shield Strength.

Adding in Shield Strength.

Rose Owen
2 min readJun 11, 2021

With GameDevHQ, we have been set a task to make this 2D space shooter. At this point in the journey, we have to research how to do a list of tasks to add to this game.

Add Shield Strength:

Currently, after you get a shield and get hit once, it will be removed. We want it to be able to take 3 hits and with each hit, change to show it can take more hits.

Since we wanted to be able to take more than 1 hit, I added in a_shieldCount int variable to keep track of how many shields we have left. Since I’m going to change the color of the shields to show there are more hits, I also made a reference for the shields Renderer.

Since we already had a reference for the shields we can use that to GetComponent for the Renderer.

Next, I add the 3 shields when the player picks up the Shield Pick-up

Now to check how many shields we have and change based on how many we have left. Since we already have one for when we have no shields, we can use that in the switch statement as case 0. After that, we can take away a shield count each time we are hit, along with changing its color.

And here is what this all looks like in action.

Shields done!

With that, another feature is done. Next time I will be adding in an Ammo System and showing it visually and a little bonus at the end, See you there!

--

--