UI/Polish


This is the fifth checkpoint for Last Stand and it's on UI/Polish.

For this checkpoint, I have created a canvas that contains UI of health, stamina, ammo counter and gun indicator. 

First thing I did was the ammo counter. I used a Text UI and a font style which can be found here (Flood, D, 2019) and implemented a code that updates the ammo counter on certain actions. Actions like shooting, reloading and switching guns, by using the variables that contains number of ammo in the gun and number of ammo carried by the player of the gun equipped. Left side of the '/' being the number of ammo in the gun and right side being the number of ammo carried by the player of the gun equipped. 

Second thing I did was the gun indicator. I used a Image UI and used the sprites that can be found here (Arcade Island, 2021) and implemented a code that updates the image based on the gun they equipped. So if they pressed '1' which is for a pistol, the gun indicator will change to a pistol along with their respective ammo count, then '2' for shotgun and '3' for assault rifle. 

Third thing I did was the health bar and stamina bar. I used a Slider UI for both. For health, I implemented the code that updates the slider based on the player health. So if they're on 50 health, the health bar will show that the player has half health. When player pick up a medkit, it will replenish it health to full. For stamina, it depletes when player is sprinting by holding 'left shift', but can recover only if the player is standing still, making it challenging and force player to use their stamina wisely. I first have to implement the stamina by having a current stamina and having a variable called 'staminaDrainRate' with a set value of 10f and while the player is sprinting,  'staminaDrainRate' is being multiplied by Time.deltaTime, which decreases the current stamina until it hits 0. Similarly for recovering stamina, it increases the current stamina instead until it hit the maximum amount. The slider is updated based on the value of the current stamina. 

GIF: Health, Stamina, Ammo counter and Gun indicator UI.


Feedback I have received for the UI says they like how it looks and that it works well. Haven't received any feedback on what I should change about the UI. 

References:

Arcade Island. 2021. Itch.io. [online]. Available at: https://arcadeisland.itch.io/guns-asset-pack-v1 [Accessed 10 October 2024].

Flood, D. 2019. Fontspace. [online]. Available at: https://www.fontspace.com/zombie-apocalypse-font-f29208 [Accessed 14 October 2024]. 

Files

GameTesting.zip Play in browser
28 days ago

Leave a comment

Log in with itch.io to leave a comment.