O'Reilly logo

UnrealScript Game Programming Cookbook by Dave Voyles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying a bar for the player's ammo

Visualizing our player's health is essential, but their ammunition count is nearly just as important. Games in recent memory have taken alternative approaches to illustrate this kind of information, including the Halo series, which displays the current ammo count on the end of the rifle.

We could mimic this with Scaleform, but again, that's a discussion for another day. We're going to keep things simple again, as we aren't using Scaleform. So let's get started with displaying our ammo bar!

Getting ready

Open your IDE and have it ready to edit our TutorialHUD class again. We're only going to make changes to this class, all of which will be similar to what we've done already as now we've established a solid base ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required