Progress Report #3 – UI and HUD Implementations

The current game is now developed on creating HUD and UI (User Interface) that would implement into the game. The UI is meant to provide the game with a basic function to play a new game and leave the game using quit game function.

Basic UI takes a long time to make due to the fact that the codes for it takes awhile and it applies an application point for the code of the game and the development of the game itself as a whole.

 

The basics of the UI interface relies mostly on the use of the editor application, where the game is developed through implementing the script onto the button such that the UI would provide working button for changing scenes and leaving the game.

Leave game = Application.Quit(); Confirm if the application was playing or not

Using an On_Click function, it helps to ensure that the button would do the effect like a switch, where if you press it, you can click on it to start the game or quit the game. In this instance, using On_Click Play helps to play the game. Namely, using this function helps to play the game.

Using a class for scenes, you can redirect the string into the other script.

public static class Scenes
{
public const string Game = “game”;
public const string Title = “title”;
public const string HUD = “HUD”;

}

This is translated into the game such that the code would be put into and create the button to generate the desired effect.

Using delegate, the application can be transferred into the game itself, making the UI interactable in the core aspect of the program.

This helps to interact with the health by typing the function into the playercontroller.

After interacting with the player controller by implementing the health bar into the UI, the same implementation is done with other functions. Time and such. This has to be done in a new scene or else it will overlap with the other functions, which will inevitably be distracting in the long run.

Damage to enemies can be done by using a health script, utilizing basic if variables and using either integers or floats in order to provide the health system. It takes a while, but the gist of the code follows as such:

public void Damage (int value)
{
health -= value;

if (health < 0)
{
health = 0;
if(onDeath != null)
{
onDeath();
}
}

if (OnHealthChange != null)
{
OnHealthChange(health, maxHealth);
}

}
//When hit, damage ensues
void OnHit()
{
Damage(1);
}

This needs to be updated along with the others in order to ensure that the health system is incremented into the game.

———

Basic progress report for this time includes HUD and UI, but not to the point of implementing the script for other development sources such as destroying the object and implementing a character controller that would work in context to the programming. This is something that, honestly, is beyond my capabilities due to my lack of experience in coding. In addition, I have not really added a win function or code in the game controller that fully fleshed out the game with effects that are desired.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s