Skip to content

Repository files navigation

Endless Runner Game

A high-octane 3D endless runner built in Unity. Survive the track by switching lanes, sliding under barriers, and leaping over obstacles while collecting coins in a dynamically generated world.

Unity Version C# Platform URP

Stars Forks License


Table of Contents


Overview

Endless Runner Game is a lightweight, highly modular 3D endless runner designed to showcase clean code architecture and core gameplay loops in Unity. Players must navigate a continuously spawning, accelerating track utilizing a three-lane movement system.

Built with the Universal Render Pipeline (URP), this project features robust audio management, dynamic object pooling (tile spawning), and a clean, responsive UI system. It serves as an excellent foundational template for portfolio presentation, rapid prototyping, or expanding into a full-scale mobile/PC release.


Key Features

Feature Description
🛣️ Dynamic Lane Control Smooth, responsive transition mechanics between three distinct lanes.
🦘 Parkour Mechanics Context-sensitive jump and slide actions to dodge varying obstacle heights.
♾️ Infinite Generation Optimized dynamic tile spawning and cleanup system for infinite, memory-efficient gameplay.
📈 Progressive Difficulty Automatic forward movement with a gradual speed acceleration cap to increase tension.
🪙 Risk/Reward Economy Collectible coins strategically placed to challenge player routing and increase scores.
🔊 Immersive Audio Persistent singleton-based audio manager for seamless BGM and distinct SFX.

Screenshots

Gameplay

Endless Runner Gameplay

Navigate the dynamically generated track, avoid obstacles, switch lanes, and collect coins as the game speed increases.

Main Menu & Game Over

Endless Runner Main Menu
Main Menu
Endless Runner Game Over Screen
Game Over Screen

Gameplay Mechanics & Controls

Action Control Input System Response
Start Game Left Mouse Click Transitions from Main Menu to gameplay state.
Lane Switch Left/Right Arrows Smoothly interpolates the player's X-axis to the adjacent lane.
Jump Up Arrow / Space Applies vertical force (only if grounded) to clear low obstacles.
Slide Down Arrow Triggers slide animation and dynamically shrinks the character's collider.

Objective: Survive as long as possible, maximize your coin count, and adapt to the increasing speed without colliding with any track obstacles.


Tech Stack & Environment

  • Game Engine: Unity 6.4.5f1 (6000.4.5f1 LTS recommended)
  • Render Pipeline: Universal Render Pipeline (URP)
  • Scripting: C# (Object-Oriented Design)
  • UI Framework: Unity UI & TextMeshPro
  • Target Platforms: Windows / macOS / WebGL

Project Architecture

The codebase is structured for readability, making it highly extensible for future mechanics (like power-ups or enemies).

Core Scripts

  • PlayerMovement.cs: The core state machine handling physics, input parsing, lane logic, and collision detection.
  • TileManager.cs: Handles procedural level generation. Spawns new track prefabs ahead of the player and destroys trailing ones to maintain optimal performance.
  • PlayerManager.cs: Controls the high-level game state (Start, Pause, Game Over) and manages the UI score updates.
  • AudioManager.cs & Sounds.cs: A scalable, persistent audio system utilizing arrays of custom sound classes for easy inspector tweaking.

Directory Structure

Assets/
├── Animations/       # Player state animations (Run, Jump, Slide, Crash)
├── Materials/        # URP-compatible materials
├── Models/           # 3D meshes for player, obstacles, and environment
├── Prefabs/          # Reusable GameObjects (Track Tiles, Coins, Obstacles)
├── Scenes/           # MainMenu, Level (Gameplay)
├── Scripts/          # Core logic, divided by responsibility
└── Sounds/           # BGM and SFX audio clips


Getting Started

Prerequisites

  • Unity Hub installed.
  • Unity Editor version 6000.4.5f1 (or a closely compatible Unity 6 build).

Installation

  1. Clone the repository:
   git clone [https://github.com/zeeshan020dev/Endless-Runner-Game.git](https://github.com/zeeshan020dev/Endless-Runner-Game.git)
  1. Open in Unity: Add the project folder via Unity Hub and open it. Allow Unity to resolve packages from manifest.json.
  2. Configure Build Settings:
  • Go to File > Build Settings.
  • Ensure Assets/Scenes/MainMenu.unity is at index 0.
  • Ensure Assets/Scenes/Level.unity is at index 1.
  1. Play: Open the MainMenu scene and press the Play button in the editor.

Roadmap

  • Power-up System: Invincibility shields, coin magnets, and score multipliers.
  • Mobile Optimization: Implement touch/swipe gesture controls for iOS/Android builds.
  • Environment Biomes: Dynamic visual swapping of tiles as the run progresses.
  • Data Persistence: Local saving for High Scores and Total Coins using PlayerPrefs or JSON.
  • Game Feel Polish: Camera shake on near-misses, particle bursts on coin pickup.

Contributing

Contributions, issues, and feature requests are highly encouraged! This is a great project for learning Unity mechanics.

  1. Fork the project.
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the Branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

License

This project currently does not have an explicit open-source license. (If you intend for others to use/modify this code, consider adding an MIT or Apache-2.0 license file to the root directory.)


Author

Click the box below to visit the author's GitHub profile and explore more projects, open-source work, and contributions.

Muhammad Zeeshan Islam
Muhammad Zeeshan Islam

💻 📖

Releases

Packages

Contributors

Languages