Skip to content

metintnc/RunCube3D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RunCube3D - MyFirstGame 🏃‍♂️

A physics-based 3D endless runner developed using the Unity game engine and C#, featuring dynamic camera angles. It offers reflex-oriented gameplay similar to Geometry Dash.

🎮 Gameplay & Features

Beyond a basic runner game, this project was built to test and develop specific game mechanics:

  • Physics-Based Movement: Fluid movement mechanics developed using Rigidbody.
  • Dynamic Camera System: A smart camera tracking system that changes its angle and height based on the player's position (Z-axis), offering cinematic transitions (CameraFollow.cs).
  • Ragdoll Death Effect: Instead of a standard "Game Over" screen, upon hitting a trap, the character shatters into pieces with a physics-based explosion force applied (Control.cs).
  • Persistent Death Counter: A system using DontDestroyOnLoad and the Singleton Design Pattern to carry data across scenes and track the player's total death count (olumsayac.cs).
  • Regional Difficulty: Jump force and camera angle change dynamically via code in specific map regions (based on Z coordinates).

🕹️ Controls

  • Movement (Left/Right): A / D or Left Arrow / Right Arrow
  • Jump: Space

🛠️ Technical Details and Code Structure

The project is designed with a modular structure following Object-Oriented Programming (OOP) principles.

1. Character Controller (Control.cs)

  • Manages player movement via the physics engine (linearVelocity).
  • Uses an advanced Ground Check mechanism utilizing Physics.CheckSphere.
  • Upon colliding with traps (Trap tag), it destroys the character, instantiates a Ragdoll prefab, and applies an explosion effect using AddExplosionForce.

2. Camera Follow (CameraFollow.cs)

  • Follows the player smoothly using Vector3.Lerp and Quaternion.Lerp.
  • Hardcoded Level Design: Dynamically changes the camera's Height (Y) and follow distance using if-else blocks based on the player's Z position to alter the game atmosphere.

3. Game Loop and Singleton (olumsayac.cs & RestartGame.cs)

  • Singleton Pattern: Ensures the death counter is managed via a single instance so it doesn't reset in every scene.
  • Scene Management: Provides a fast game loop (retry mechanic) by reloading the scene directly upon restart.

📸 Screenshots

image image image image image image

About

My first 3D game project developed with Unity. A geometry-dash style runner with physics-based movement and dynamic level design.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors