How reyso/penalty_kick_opengl works
Main Components
• Game Engine / Core Loop – Represented by main.cpp, which orchestrates the game loop, input handling, and overall flow.
• Game Logic Module – Implemented in functionalities.cpp/functionalities.h and constants.h. This is where game rules, state changes (e.g., penalty mechanics), and simulation logic are handled.
• Resource Management – Your “resources” directory (and its duplicate in build) holds a variety of assets such as textures (grass.bmp, texture.txt), sounds (goal.mp3, whistle.wav, etc.), fonts, and other configuration files. You may also want to include the two Python scripts (fontloader.py and textureloader.py) as part of an “Asset/Resource Loader” component.
• Build/Deployment Layer – Using CMake (CMakeLists.txt and the entire “build” folder) to organize builds and dependencies.
Relationships and Interactions
• The Main Game Loop (main.cpp) should be at the center, initiating the game and coordinating interactions.
• It calls into the Game Logic Module to update game state (e.g., handling penalties, scoring, etc.) and into the Rendering Subsystem for drawing frames.
• The Rendering Subsystem, built on OpenGL, interacts with the Resource Manager to load necessary assets (textures, fonts, sound files) during initialization.
• Python scripts (textureloader.py and fontloader.py) serve as auxiliary tools and may be invoked during preprocessing or as part of a resource management pipeline.
• The build system (CMake) is responsible for compiling these components and linking them properly.
Architectural Patterns and Design Principles
• Separation of Concerns – Game logic is kept separate from rendering and resource management.
• Dependency Management – The build system with CMake maintains proper dependencies across modules.
• Resource Abstraction – Assets are externalized in dedicated directories, ensuring that game data (textures, audio, etc.) is decoupled from the code.
Final Reminders for the Principal Software Engineer
• Review the CMakeLists.txt and the build directory structure as they reinforce the overall modular build architecture.
• Avoid oversimplification; it’s best to split the project into as many logical components as possible to capture all essential architectural elements.