Weapon Stats Display - UQcsse3200/2024-studio-1 GitHub Wiki

Weapon Stats Display

Ammo Counter

The Ammo Counter is a new UI feature that helps players keep track of their ammunition while using ranged weapons. It displays the following:

  • Ammo Shells: A graphical representation of how many bullets are left in the current weapon.

  • Bullet Count: A numerical display showing the exact number of bullets in the current weapon.

  • Reload Functionality: When the player reloads a weapon, the ammo counter disappears for 3 seconds, simulating the reload time before reappearing with the updated ammo count.

    image

This feature significantly improves gameplay by giving players a clear reference for how much ammo they have left and when they are reloading.


Weapon Labels

The Weapon Labels display the number of each type of weapon in the player's inventory. These labels are dynamically initialized based on the character's inventory and will update as the player picks up or drops weapons.

  • Number of Shotguns: Displays how many shotguns the player has in their inventory.

  • Number of Pistols: Shows the count of pistols available to the player.

  • Number of Swords (Melee Weapons): Indicates how many melee weapons (e.g., swords) the player currently holds.

    image

Each label is updated in real-time, reflecting changes in the player's inventory. This feature allows the player to quickly glance at their available weapons without needing to open the inventory menu. These labels are initialized based on the character's starting inventory. The inventory system checks which weapons the player has at the beginning of the game and sets the labels accordingly.