User Interface

HUD
The player interface includes 5 main elements:
Progress — Slider showing the level progress (by distance). Also displays the meters traveled.
RocketLauncher — Button to activate rocket attack. Launches rockets when pressed (if available).
Level — Label displaying the current level number, e.g., Level 3.
Money — Label showing the player’s current currency amount.
PauseButton — Pause button. Stops the game and opens the settings window when pressed.
Screens & Windows
Object prefabs: Assets/StaticAssets/Prefabs/Windows...
Window and screen objects are not initially present in the scene hierarchy. They are created (instantiated) dynamically upon first use.
All windows and screens created during the application's runtime are placed into a special preconfigured object called Screens, which exists in the scene hierarchy from the start. The Screens object is registered in the Zenject container.

Five objects are used:
LaunchScreen

TutorialScreen

SettingsWindow

CompleteScreen

FailScreen

How to add a new window or screen:
Resources for the tutorial can be found in the Discord channel (fag): Discord
Create a prefab with the corresponding visual, e.g., MyWindow.
Create a script to manage the window, e.g., MyWindow.cs.
Ensure it is placed within its own unique namespace.
Confirm that it inherits from WindowBase.
Implement the abstract methods.
Attach the MyWindow.cs script to the MyWindow prefab.


Add an enum key for accessing the window. Path:
Assets/Scripts/Runtime/Infrastructure/Enums

Register the window in the
WindowAssetsConfigconfig.

Open the
WindowService.csclass and register the window creation call inside theCreateWindow(WindowType)method.

Add a test button to the HUD, for example, OpenMyWindow, and attach the script
OpenWindowButton.csto it.

Enter Play Mode; clicking the OpenMyWindow button will display the window labeled MyWindow.

Last updated