How bachlv/supermariodx works
Main Components
• Game Engine Core – Represented by the Game class along with the main loop (in Game.cpp/Game.h), it coordinates updates, rendering, and game state transitions.
• Renderer/Graphics Layer – Components such as Textures, Sprites, Animations, and TileMap handling (found in Textures.cpp, Sprites.cpp, Animations.cpp, TileMap.cpp) are responsible for drawing scenes using the DirectX API.
• Scene/Level Management – The “scenes” folder contains configurations, map files, sprite definitions, and object placements for different levels (e.g., world-1-1, world-1-4, menu). The Scene classes (Scene.cpp, SceneMenu.cpp, ScenePlayer.cpp) control scene transitions and initialization.
• Input Manager – The Input class (Input.cpp, Input.h) captures user commands (keyboard controls) for basic movement, running, jumping, etc.
• Game Objects & Entities – Individual game elements (Mario, Goomba, Koopa, Brick, Coin, etc.) each have their own source files (e.g., Mario.cpp/Mario.h, Goomba.cpp/Goomba.h) that define behavior and attributes. They are managed and updated within the game’s main loop.
• Collision/Physics Module – The Collision components (Collision.cpp, Collision.h) and related object logic engage to detect interactions between game objects.
Relationship and Interactions
• The Game Engine Core sits at the center, initiating the game loop where it consistently updates the Scene Manager.
• The Scene Manager loads a specific level or menu scene (using configuration files from the “scenes” directory) and instantiates game objects specific to that scene.
• The Input Manager collects player commands and sends them to the Game Engine Core, which in turn updates game objects or triggers scene transitions.
• Collision and physics logic process the game objects’ interactions during each update cycle.
• The Camera component adjusts the viewport based on player movement to follow the protagonist.
Architectural Patterns & Technologies
• Layered/Modular Architecture: The separation into modules (input, rendering, scene management, game objects) ensures a clean division of responsibilities.
• Component-Based Game Objects: The uniform handling of different game entities (like Mario, Koopa, etc.) hints at object-oriented, component-driven design.
• Resource and Asset Management: The structure of the “assets” folder and scene configurations clearly delineate external resources from code.
• Use of DirectX API for rendering (as mentioned in the README) strongly influences the design of the graphics layer.