How matheus0214/platform-game-raylib-c works
Project Type and Purpose
• This is a small C “game” or interactive application structured around screens, player logic, assets (UI, fonts), and configuration.
• It uses a Makefile build system augmented by Bear (to generate compile_commands.json) and clangd as the language server.
Main Architectural Components
A. Build & Tooling
• Makefile + Bear
• clangd (language server)
B. Core Executable
• src/main.c
C. Module Layers
1. Configuration Module
– include/configs/config.h
– Holds global constants, build‐time flags
2. Asset Management Module
– src/assets.c, include/utils/assets.h
– Loads UI elements, fonts, other media from assets/
3. Screen Management Module
– src/screens.c, include/screens/screens.h
– Individual screens:
– Main menu (src/screens/main_menu.c, include/screens/main_menu.h)
– Level 1 (src/screens/level_1.c, include/screens/level_1.h)
4. Player Module
– src/player.c, include/player/player.h
– Player state, input handling, physics
D. Resources
– assets/ui/
– assets/fonts/
Component Relationships and Data Flow
• The Core Executable (“Main”) initializes subsystems in this order:
1. Config module → sets up global parameters
2. Asset Manager → loads assets into memory
3. Screen Manager → pushes initial screen (main menu)
4. Player Module (tied into screen update loops)
Architectural Patterns / Principles
• Layered architecture:
1. Presentation (Screens + Assets)
2. Domain (Player logic)
3. Configuration & Utilities
• Single‐entry point (main.c), separation of concerns for each module.
• Modularity: each feature lives in its own directory under include/ and src/.