Skip to content

Repository files navigation

TradeRun 🏃‍♂️💹

License: GPL v3 Engine Language

TradeRun is an interactive 3D endless runner that gamifies stock market trading. Built with Unity and C#, the game challenges players to make real-time buy and sell decisions by swiping, all while navigating a dynamic, procedurally generated world. It integrates backend services like Firebase for leaderboards and Google Mobile Ads for monetization, delivering a complete and engaging mobile gaming experience.


🔗 Play & Store Links


🛠️ Architecture & Tech Stack

TradeRun's architecture is designed for a responsive and state-driven gameplay experience, leveraging modern Unity features and robust backend services.

  • Game Engine: Unity 3D
  • Programming Language: C#
  • UI Framework: Unity UI with TextMeshPro
  • Input System: Unity's Enhanced Touch API for swipe gestures and the new Input System for keyboard controls.
  • Backend Services:
    • Firebase Firestore: Powers the real-time global leaderboard and syncs player progression data.
    • Firebase Authentication: Manages user accounts and identity.
    • Google Mobile Ads: Integrated for banner, interstitial, and rewarded video ads.
  • Key Technical Implementations:
    • State-Driven UI Management: A centralized GameUIManager controls the flow between various game states (main menu, gameplay, pause, game over), ensuring a clean separation of concerns.
    • Procedural World Generation: The WorldGenerator class dynamically creates the game environment and provides real-time price data, ensuring unique runs every time.
    • Event-Driven Systems: Decoupled components communicate through C# events, such as portfolio updates (onAvgPriceUpdateEvent) and tutorial actions.
    • Contextual Guidance System: An intelligent CheeringManager provides players with dynamic, real-time hints and feedback based on their in-game actions and market conditions.

📸 Key Features

  • Intuitive Swipe Controls: Buy, sell, and switch lanes with simple and responsive swipe gestures.
  • Dynamic Trading Simulation: Navigate a 3D world where the path represents real-time stock chart data, including Bollinger Bands.
  • Comprehensive Tutorial: An in-depth, multi-panel GuideManager onboarding new players to the core mechanics.
  • Player Progression & Levels: Earn cash from profitable trades to level up and unlock new milestones.
  • Global Leaderboards: Compete with players worldwide for the highest rank, powered by Firebase.
  • Monetization Ready: Fully integrated with Google Mobile Ads for rewarded videos and other ad formats.

🚀 Local Development Setup

Prerequisites

  • Unity Hub with a Unity 2021.3 LTS (or newer) version installed.
  • Android Build Support and iOS Build Support modules installed in Unity.
  • A configured Firebase project with Authentication and Firestore enabled.
  • A configured Google AdMob account.

Installation

  1. Clone the repository:

    git clone https://github.com/kanchana123/traderun.git
    cd traderun
  2. Open the project in Unity Hub:

    • Launch Unity Hub.
    • Click "Add" and navigate to the cloned traderun directory.
    • Select the project to open it in the Unity Editor.
  3. Configure Firebase:

    • Download your google-services.json (for Android) and GoogleService-Info.plist (for iOS) from your Firebase project settings.
    • Place google-services.json in the Assets/ directory.
    • Place GoogleService-Info.plist in the Assets/ directory.
  4. Resolve Dependencies:

    • The project uses the External Dependency Manager for Unity (EDM4U) to handle Firebase and AdMob libraries.
    • Upon opening the project, the resolver should run automatically. You can also force it to run by navigating to Assets > External Dependency Manager > Android Resolver > Force Resolve and Assets > External Dependency Manager > iOS Resolver > Install Cocoapods.
  5. Run the Game:

    • Open the main game scene (e.g., located in Assets/Scenes/).
    • Press the "Play" button in the Unity Editor to start the game.

📜 License

This project is licensed under the GPLv3 License. See the LICENSE file for details.

About

TradeRun: A 3D endless runner game built with Unity that gamifies stock market trading. Features procedural generation, Firebase leaderboards, and AdMob integration.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages