Phase I — Progress report — Shield health

In today's update will go over the shield hit point system I have added to the game. I almost implemented a great animated shield shader as well, but I’m not across the shader system yet so keep an eye out for that one in the future.

Shield health

I’ve changed the way the shield operates in-game. Previously the shield gave the player a free hit and the shield would deactivate. With the implementation of the ammo system, the difficulty has increased a lot so I have added some hit points to the shield.

The shield now has 3 stages, full health, damaged and critical. All 3 stages are differentiated by a colour change. The colours can be set in the inspector at will.

The changes to the code only required adding a shield health check instead of just deactivating the shield if the player took damage while the shield was active.

We check the shield health using a switch statement and adjust the colours according to what we have in the inspector whenever the player takes damage while the shield is active.

Now, all we need is to see it in action.

That's all for now.




Unity developer with a love of learning all things programming.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why do I receive an error from the Image Acquisition Toolbox when using an IEEE-1394 camera?

Decentralized Ordering Service with Peer-Org-Owned Orderers


8 Business Reasons Why You Should Consider Making APIs

Raiden Pulse #8: News from September and October

Programming in Python to Make a Quiz about Linux & Bash

Google Summer of Code’17 @ LibreHealth

How has the technology industry changed over years?

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
Luke Duckett

Luke Duckett

Unity developer with a love of learning all things programming.

More from Medium

Ledge Grab System: Part IV

Setting a professional Unity layout

47 High Quality Plugins on Unity Asset Store-Essential Tools for Unity Developers

Structuring Your Unity Code For Production: Important Best Practices