HUD
|
This artifact was done during the previous week of production, but I want to write a bit about it. The task I did was implementinting a HUD in our game. What I have implemented so far is a health indicator, in a traditional style with hearts representing health, and an indicator for the teleport charge/cooldown and whether the power-up is active. Below we can see the two HUD elements in action.
As we can see the hearts get dimmed when the health point representing is lost. This was achieved by having the whole health bar be a single image with 5 hearts, then the image sprite cycles according to the health. It works fairly elegantly by simply assigning the current sprite to be the same number as the health, then it is just a matter of ordering the heart sprites array to correspond to the health. So, HP of 5 would make the sprite to be element 5 in the array, which is the sprite with all 5 hearts filled in. The teleport charge indicator was actually implemented by Alexander, our other programmer, but it is tied to the cooldown indicator which I implemented. The teleport indicator can be seen in a GIF posted below. How it works is a greyscale version of the picture, placed behind the colored one. Then the colored one is filled in through code, where the cooldown is first converted to be a float between 0 and 1, that value is then used for the image fill, this results in a nice visualization of the teleport cooldown. The cooldown is fairly slow so it’s not very visible in the GIF above, which shows the “charge” indicator, as our teleport skill requires a short charge before it happens. This charge indicator however has the same visual result, just that the fill amount gets decreased to more you charge, rather than the other way around for when the teleport is on cooldown. For the power up icon the player simply holds a boolean “poweredUp” and then the HUD image is set active or inactive accordingly. This can be seen below.
The HUD works for now, but we have already planned improvements to the readability, however these are mostly a matter of art assets and implementing the new and improved HUD will not be too much work using this as a framework. Some things we have discussed is adding the teleport charge/cooldown on a reticle instead of the corner since it will allow the player to focus on the game. Another one is adding a background to the health sprite so the hearts dont blend into the background. |



