Tuesday, August 1, 2017

Week 3 - Making a HUD/UI - GAM111

LECTURE:
During this week's lecture, we learnt on how to make a UI - User Interface - or a HUD - Heads-Up Display - for our game. This is useful for our project as it will allow me to keep track on how far the player has gone, in terms of distance, and how many coins the player has attained on their run in the game. With the newfound knowledge of adding in a UI system, I can also add in a pause screen, game over screen and even a main menu screen (all of which are requirements of the project).
We covered some of the objects used under the UI tab in Unity, which were relevant to the project. We covered how to use texts, buttons, images and sliders. Our lecturer went through each one and taught us on how we can manipulate these game objects to do other things. For example, we can use a slider to represent a health bar, a timer and many more.

Code to represent a time bar
The image above shows a code on how I made a time bar during our workshop class this week. First, we had to find the slider within the inspector so we can manipulate the value of the time bar. I also made 2 variables for the damage and the time difference or the time interval. In the void Update() function, it simply means:
If the current time of the game is greater than or equal to the time interval, the slider value (100) will take damage(value), and this will go on every timeDiff(value).

MILESTONE & ACHIEVEMENTS:
An achievement for this week was the fact that I had learned something new in Unity which I can add for the project. Going back on the Jetpack Joyride assignment (if you don't remember, check previous blog post), I can use images to alert the player that they are being targeted by a missile, I can use texts as a means of a tutorial in the beginning of the game to help people who don't know about the game. During our workshop class today, I have managed to get a better understanding on how to implement these features within the project, all that is needed to be done is to put this in my everyday practice.
My milestone for next week is to further improve on my assignment.


No comments:

Post a Comment