Directory Structure
The project follows a well-organized structure with assets categorized by type and function:Major Folders
Scripts/
The Scripts directory contains all C# game logic, organized by responsibility:Player/
Player/
Contains all player-related scripts:
PlayerInput.cs- Handles horizontal movement and character flippingPlayerJump.cs- Complex jump mechanics including double jump and wall slidingPlayerDeath.cs- Death handling logicCollisionDetection.cs- Ground and wall collision detection
SceneLogic/
SceneLogic/
Manages scene transitions and game flow:
MainMenu.cs- Title screen functionalityFinishGame.cs- Level completion and death handlingResetGame.cs- Game restart logicQuitGame.cs- Application exit handling
Score/
Score/
Handles the scoring system:
Coin.cs- Collectible coin behaviorScoreSystem.cs- Score tracking and managementScoreUpdate.cs- Real-time score UI updatesShowFinalScore.cs- End screen score display
ScriptableObjectsScripts/
ScriptableObjectsScripts/
ScriptableObject-based systems:
Powerup.cs- Abstract base class for power-up effectsPowerUpPickUp.cs- Power-up collection logicJumpBoost.cs- Jump enhancement power-up
Root Scripts
Root Scripts
Global game systems:
CameraController.cs- Follows player movementMusicManager.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 mappingsInputSystem.inputsettings.asset- Input system settings
ScriptableObjects/
Runtime instances of ScriptableObject assets (power-up configurations, etc.)Asset Organization Principles
FromCONVENTIONS.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
File Naming Conventions
The project strictly follows these naming conventions fromCONVENTIONS.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:
PlayerJumpclass lives inPlayerJump.cs
Asset File Naming
Descriptive names that reveal purpose:LongJump.wav- Audio for extended jumpMainTheme.ogg- Primary background musicPlayerWalk.png- Character walking animation sprite
Important Rules
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