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


CI/CD pipeline with Cloud Build and Cloud Run — Configuration

Changing our name to Sliderule

AWS APIGateway and Lambda — a GET Mehod CLI Demo

Building a Dockerfile

What’s the Difference Between Dedicated Server and Cloud Servers?

Underrated Linux Commands

eBay Motors & State Management

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

Simple Player Movement in Unity

How to Win the Race Using Director

My journey becoming a Unity game developer: 2.5D Infinite Runner-Ledge Grab System-Pt4

Creating Fog in Unity