Daily progress: Day 1 Shield Strength.

Adding in Shield Strength.

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.

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.

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!

Game Developer in the making~

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store