Implementation of HUD-elements, PotatoPirates
|
This week I have been working on implementing our HUD into the game. Our HUD consists of:
Screen-shot from the game with visible HUD-elements in combat mode:
Starting out I built a HUD-class to manage all the elements for the HUD, and used a draw function to draw the HUD-elements as simple textures. Some of the draw functions had to be remade later in order to be able to include animation. Since our game will have the option of changing the resolution, through the options menu, all measurements for the HUD-objects, sizes of the objects and their placement on the screen, were made as a relation to the width and height of the window in which the game runs. This prevents odd stretching and weird placement changes of objects when changing game resolution without requiring some more complicated scaling function to be called. Not all of the HUD-elements have been properly implemented yet, since the functions they are linked to does not yet exist. Those functions will be worked on and added to the beta-version of the game. For instance we have the altimeter that will inform the player of their airplanes height when turning off the plane engine. This feature has not yet been implemented in the game, and as such the HUD-altimeter is for now just a cosmetic object without any functionality linked to it. Screen-shot from the game with visible HUD-elements in stealth mode:
There are also some more HUD-elements that will be implemented later, such as the indicators for our power-ups. The HUD-class so far has an update function that takes relevant parameters from the player class and updates the HUD. It also has a draw function that takes a sprite-batch and draws to the screen, and a text draw function that is used to draw any text for the HUD on the screen, such as the numerical indicator on the ammo. The biggest problems I had during the creation of the HUD-class was to make it work together with our classes for animation and drawing text to the screen, thankfully our lead programmer Pontus Berglund helped me find good solutions to the problems in a short time. Next week we will be working towards the beta-version and add more functionality. That will be interesting |


