This game prototype is a 3D endless runner developed in Unity, featuring core mechanics such as character movement, obstacle avoidance, and collectible items. Players control a character that automatically runs forward, with the ability to switch lanes, jump, and slide to avoid obstacles and gather coins or power-ups. The game includes a scoring system, increasing difficulty over time, and basic UI elements such as menus and score displays.
From a game design perspective, the prototype uses modular level segments to create an endless and re-playable experience. Visual feedback, sound effects, and simple animations enhance player engagement. The design emphasizes quick reflexes, pattern recognition, and incremental challenge, making it accessible yet addictive.
Technically, the project demonstrates fundamental C# scripting in Unity, including input handling, collision detection, object pooling, and UI management. Developers gain experience with Unity’s component system, prefabs, and scene management. Building this prototype helps reinforce skills in object-oriented programming, game loop logic, and rapid prototyping, providing a solid foundation for more advanced game development projects.
[https://drive.google.com/file/d/1ffoLqMVCS_qe02of9n9tG7Lcb5kG8bUY/view?usp=drive_link](https://drive.google.com/file/d/1ffoLqMVCS_qe02of9n9tG7Lcb5kG8bUY/view?usp=drive_link)
Description:
The game continuously generates new level chunks as the player advances, ensuring an endless and varied environment. Chunks are spawned ahead and destroyed when they move behind the camera, maintaining performance and gameplay flow. The system also adjusts chunk speed and gravity for increasing difficulty.
void MoveChunks()
{
for (int i = 0; i < chunks.Count; i++)
{
GameObject chunk = chunks[i];
chunk.transform.Translate(-transform.forward * (moveSpeed * Time.deltaTime));
if (chunk.transform.position.z <= Camera.main.transform.position.z - chunkLength)
{
chunks.Remove(chunk);
Destroy(chunk);
SpawnChunk();
}
}
}
flowchart TD
A[Start Game] --> B[Spawn Starting Chunks]
B --> C[Move Chunks Each Frame]
C --> D{Chunk Behind Camera?}
D -- Yes --> E[Remove & Destroy Chunk]
E --> F[Spawn New Chunk]
D -- No --> C
F --> C
The player character moves smoothly within defined boundaries based on user input. The system uses Unity's new Input System to read movement vectors and applies them to the Rigidbody
, clamping the position to prevent leaving the play area.
void HandleMovement()
{
Vector3 currentPosition = rigidBody.position;
Vector3 moveDirection = new Vector3(movement.x, 0f, movement.y);
Vector3 newPosition = currentPosition + moveDirection * (moveSpeed * Time.fixedDeltaTime);
newPosition.x = Mathf.Clamp(newPosition.x, -xClamp, xClamp);
newPosition.z = Mathf.Clamp(newPosition.z, -zClamp, zClamp);
rigidBody.MovePosition(newPosition);
}
flowchart TD
A[Input Received] --> B[Calculate Move Direction]
B --> C[Apply Move Speed]
C --> D[Clamp Position]
D --> E[Move Player Rigidbody]
Description:
Obstacles and pickups (coins, apples) are spawned at random intervals and positions within each chunk. The system uses spawn chances and lane selection to ensure variety and challenge, while also managing available lanes to prevent overlap.