Interface Gallery
Tiny Gear
Coded what data and text needed to be presented on-screen.
High Score
Context
Displaying and updating a high score based on player performance.Highlight
When the player dies, the accumulated points they have collected thus far are compared to the existing record. If the newly acquired total is higher, it replaces the previous best.Invite
Please refer to the image above for a visual reference. In theif
statement, the iScore
(current points) is compared to iLeaderboards
(high score). If it is lower, both values are displayed as-is. Otherwise, if it is higher, the else if
conditional is executed, storing the new value in a static integer variable and updating the leaderboard record.
Inspector
Context
Using Unity’s component system to set and display the default high score value.Highlight
When the player launches the game for the first time, the high score is set to zero. Rather than writing this directly in code, it was more efficient to assign the default value using a component in the Inspector. This streamlined the process and reduced unnecessary steps.Invite
Please refer to the image above for a visual reference. The example shown is of a Canvas Renderer, one of the components used in this setup.Points
Context
Showing the points the player accumulates throughout gameplay.Highlight
Created a function to output on-screen text that reflects the current score. This display updates in real time whenever the player performs an action that increases their points.Points
Please refer to the image above for a visual reference. The code snippet demonstrates how the data is shown as text:sScore
is a string reading “SCORE,” and beneath it, iScore
displays the corresponding integer value.
Start
Context
Introducing a button that begins the game once selected.Highlight
This was a straightforward setup. When the player interacts with the button, a method is triggered that loads the scene where gameplay begins.Invite
Please refer to the image above for a visual reference. The method shown loads thecMain
scene, signalling the game to launch.