How fafato1/tictac works
Project Type and Purpose
• This is a *game template* / *framework* built with CMake that:
• Fetches and builds the external raylib engine
• Compiles your game code (in C or C++)
• Loads assets from an assets folder
• It provides a simple example (main.cpp) showing how to bootstrap raylib and use the Core/UI modules.
File Structure
• Top-level:
• CMakeLists.txt + CMakeSettings.json → build system
• README.md, LICENSE → docs/legal
• assets/ → image, sound, other runtime resources
• sources/ → your game’s source code
• Under sources/:
• Core/ → game-logic classes (Core, Game)
• UI/ → UI framework (UIManager, BaseUI, Screens)
• lib/ → small helper (resource_dir.h)
• main.cpp → entry point, instantiates Core & UI
• CMake FetchContent will pull raylib, link it into the build alongside your sources.
README Insights
• It explains:
• How raylib is fetched and compiled
• Asset‐path macro (ASSETS_PATH) for runtime loading
• Switching between C and C++
a. Main Components
1. Build System Layer
• CMake (CMakeLists.txt + CMakeSettings.json)
• FetchContent → raylib (external)
2. Runtime Engine Layer
• raylib library
3. Application Layer
• main.cpp (EntryPoint)
• Core Module
• UI Module
• assets folder
b. Relationships & Interactions
• Build System → compiles → raylib + your sources
• main.cpp → initializes → raylib window & context
• main.cpp → uses → Core API (Game loop, state)
• Core Module ↔ UI Module (Core updates game state; UIManager renders screens based on state)
• Both Core and UI → request assets → via ASSETS_PATH → assets/
c. Architectural Patterns / Principles
• Layered architecture:
• Build / infrastructure (CMake, raylib)
• Domain logic (Core / Game)
• Presentation (UI, Screens)
• Separation of concerns: game logic vs. UI vs. build orchestration
• Modular design: private/public headers, clear module boundaries
d. Key Technologies / Frameworks
• CMake + FetchContent
• raylib (graphics/audio/input engine)
• Standard C / C++ (switchable via CMake)
Putting It All Together
• Under Runtime, place “Application”:
• A central “main.cpp” node
• To the left, “Core Module” (Core.h/.cpp, Game.h/.cpp)
• To the right, “UI Module” (UIManager, BaseUI, Screens)
• Core and UI to main.cpp; connect both to Assets