Phase II: Player Ammo

Objective: Visualize on screen the ammo count of the player in the form of current/max.

This feature is pretty straightforward to implement. Since there is already an ammo count from a previously added feature, I only need to provide the current ammo and compare it to the max ammo.

In the UIManager script, I create a private Serialized int named maxAmmo and set it to 15.

Then in the UpdateAmmo() method where I update the _ammoCountText.text, I change it to include the maximum ammo.

This will now show the current and maximum ammo amounts.

This is probably the easiest of the new features to add to the game since the framework for it had already been added.

The next article will be about creating a wave system for the enemies.

So until next time, I wish you well on your own coding journey.

I'm a Unity developer.

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

Recommended from Medium

AppFollow 2.6: April Edition

Set up a production Wordpress project

News from Solcial developers as for end of April 2022

Web Development Tools

Paving our way to Serverless Architectures

It’s Time for Great DevEx - Because Happy Developers Write Better Code.

Serverless Computing — Building for the Next Billion Users

An image of servers with the overlay “serverless != no servers”

Coding Interviews: Assessing for Potential

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
Brian Branch

Brian Branch

I'm a Unity developer.

More from Medium

Post Processing in Unity

3rd Person Follow Virtual Camera Explained in Unity’s Cinemachine

Using Light Layers and Volumetric Lighting in Unity’s HDRP

In 6 steps, Add a double jump in Unity