Gameplay Features Gallery
Tiny Gear
Coded all mechanics and systems from the ground up.
Game Over
Context
Coding the game to end automatically whenever the player dies.Highlight
The system continuously tracks the player's status. When it detects they’ve been defeated, a canvas appears with an option to restart the level from the beginning.Invite
Please refer to the image above for a visual reference. This script is attached to one of the grey enemy racks. When something collides with it, it checks if the tag is the same as the sting insPlayer
.
Garbage Collection
Context
Freeing up memory to maintain a smooth and stable gameplay experience.Highlight
Enemies, platforms, and the player are continuously instantiated and destroyed throughout gameplay. To avoid performance degradation, their associated game object variables must be properly cleared.Invite
Please refer to the image above for a visual reference. It demonstrates what occurs once enemy and platform sets exit the on-screen area,Destroy
is called on cDOther
, followed by nullifying the reference.
Input
Context
Creating the controls that allow the player to interact with their character in the game.Highlight
Since this is a one-button genre game, the only action available to the player is jumping. This mechanic helps the player avoid enemy obstacles.Invite
Please refer to the image above for a visual reference. In this example, whenever the spacebar is pressed, the player can move horizontally in either a negative or positive direction, determined by thebIsRackLeft
and bIsRackRight
booleans, which indicate the player’s position on the screen. If the player is on the left side, they must jump right, and vice versa.
Optimization
Context
Maintaining consistent control schemes across multiple operating systems.Highlight
Dedicated control setups were created for gameplay within Unity’s editor, iOS, macOS, Windows, and tvOS. The appropriate scheme is automatically selected based on the platform the player is using, ensuring seamless interaction regardless of the operating system.Invite
Please refer to the image above for a visual reference. Shown here are several#if
preprocessor directives, including UNITY_EDITOR
, UNITY_IOS
, UNITY_STANDALONE_OSX
, UNITY_STANDALONE_WIN
, and UNITY_TVOS
, each calling their own functions with distinct input logic.
Randomization
Context
Executing logic that ensures a completely different enemy and platform layout for every replay.Highlight
Enemies and platforms have been organized into distinct sets, each featuring a unique arrangement. When one needs to be spawned, a random number is generated to determine which set will appear.Invite
Please refer to the image above for a visual reference. TheiRacksRandom
integer has an arbitrary value stored within it. Afterwards, several if
statements compare it to a set of numbers. When a match is found, a corresponding game object prefab is loaded into the game.