Skip to main content

Directory Structure

The project follows a well-organized structure with assets categorized by type and function:
Assets/
├── Animations/          # Animation controllers and clips
│   └── CoinsAnimation/  # Coin collection animations
├── Audio/               # Sound effects and music
│   ├── Music/          # Background music tracks
│   └── Sounds/         # Sound effects (jump, coin, death)
├── Fonts/              # Custom fonts for UI
├── InputSystem/        # Unity Input System configuration
├── Materials/          # Physics materials and shaders
├── Prefabs/            # Reusable game objects
│   ├── Coins/         # Coin prefab variants
│   ├── Map/           # Level and map elements
│   └── Sprites/       # Sprite-based prefabs
├── Scenes/            # Unity scene files
├── ScriptableObjects/ # ScriptableObject asset instances
├── Scripts/           # C# game logic
│   ├── Player/        # Player movement and controls
│   ├── SceneLogic/    # Scene management scripts
│   ├── Score/         # Scoring system
│   └── ScriptableObjectsScripts/ # SO definitions
├── Sprites/           # 2D sprite assets
│   ├── Character/     # Player character sprites
│   ├── Coins/        # Coin sprite sheets
│   ├── Icons/        # UI icons
│   └── Tiles/        # Level tileset sprites
└── TextMesh Pro/      # TextMesh Pro assets

Major Folders

Scripts/

The Scripts directory contains all C# game logic, organized by responsibility:
Contains all player-related scripts:
  • PlayerInput.cs - Handles horizontal movement and character flipping
  • PlayerJump.cs - Complex jump mechanics including double jump and wall sliding
  • PlayerDeath.cs - Death handling logic
  • CollisionDetection.cs - Ground and wall collision detection
Manages scene transitions and game flow:
  • MainMenu.cs - Title screen functionality
  • FinishGame.cs - Level completion and death handling
  • ResetGame.cs - Game restart logic
  • QuitGame.cs - Application exit handling
Handles the scoring system:
  • Coin.cs - Collectible coin behavior
  • ScoreSystem.cs - Score tracking and management
  • ScoreUpdate.cs - Real-time score UI updates
  • ShowFinalScore.cs - End screen score display
ScriptableObject-based systems:
  • Powerup.cs - Abstract base class for power-up effects
  • PowerUpPickUp.cs - Power-up collection logic
  • JumpBoost.cs - Jump enhancement power-up
Global game systems:
  • CameraController.cs - Follows player movement
  • MusicManager.cs - Manages audio playback for game events

Sprites/

Organized by visual content type:
  • Character/ - Player sprite sheets with walk and jump animations
  • Coins/ - Collectible coin sprites and animation frames
  • Icons/ - UI elements and icons
  • Tiles/ - Level building blocks for platforms and obstacles

Audio/

Audio assets separated by usage:
  • Music/ - Background music tracks (e.g., MainTheme.ogg)
  • Sounds/ - Sound effects for actions like LongJump.wav, CoinFx.wav

Prefabs/

Reusable game objects grouped by context:
  • Coins/ - Pre-configured coin collectibles
  • Map/ - Level elements (platforms, spikes, finish line)
  • Sprites/ - Sprite-based game objects

InputSystem/

Unity Input System configuration:
  • BasicInput.inputactions - Input action mappings
  • InputSystem.inputsettings.asset - Input system settings

ScriptableObjects/

Runtime instances of ScriptableObject assets (power-up configurations, etc.)

Asset Organization Principles

From CONVENTIONS.md, the project follows these organizational principles:

Context-Based Organization

Assets are organized by their context and usage in the game. Related resources are grouped together based on when and how they’re loaded:
  • Resources that load together are stored together
  • Descriptive naming makes file purposes immediately clear
  • Grouping considers loading requirements and data dependencies

Example Structure

Assets/Audio/Sounds/LongJump.wav
Assets/Audio/Music/MainTheme.ogg
Assets/Sprites/Character/PlayerWalk.png
Assets/Sprites/Coins/GoldCoin.png

File Naming Conventions

The project strictly follows these naming conventions from CONVENTIONS.md:

Directory Naming

  • Format: TitleCase
  • Examples: Assets/Sprites, Assets/Fonts, Assets/InputSystem
  • Rule: No spaces or special characters allowed

File Naming

  • Format: TitleCase
  • Examples: MainMenu.cs, PlayerInput.cs, CoinFx.wav
  • Rule: Descriptive names that indicate file content and purpose

Code File Naming

  • C# files match their class names exactly
  • One public class per file
  • Example: PlayerJump class lives in PlayerJump.cs

Asset File Naming

Descriptive names that reveal purpose:
  • LongJump.wav - Audio for extended jump
  • MainTheme.ogg - Primary background music
  • PlayerWalk.png - Character walking animation sprite

Important Rules

Spaces and special characters MUST BE ALWAYS avoided in files/directory namingUse TitleCase concatenation instead of spaces:
  • Good: PlayerInput.cs, CoinAnimation
  • Bad: Player Input.cs, Coin-Animation

Loading Strategy

Resources are organized with loading requirements in mind:
  • Per-Scene Assets: Grouped by scene usage (Title, Gameplay, Ending)
  • Shared Assets: Fonts and UI elements accessible throughout
  • On-Demand Assets: Prefabs instantiated during gameplay
  • Persistent Assets: Music and global managers
This structure ensures efficient memory usage and clear separation of concerns throughout the game’s lifecycle.

Build docs developers (and LLMs) love