How bbugday/tetris works
Main Components
• Application / Entry Point: Highlight the main entry (from Main.cpp) where the Application class in Application.cpp is initialized. This component is responsible for setting up the game window and managing the overall game loop.
• Game Core: Indicate the Game module (Game.cpp/Game.h) that contains the central logic for handling gameplay and the game loop.
• State Management: Mark the State components such as MenuState, GameState, EndState, and the StateStack. These represent the different screens or modes of the game, and the state stack pattern is used to manage transitions.
• Resource Handling: Include the ResourceHandling module (ResourceHolder and ResourceIdentifiers) which is used to load and manage game assets like textures, fonts, and other resources needed for rendering.
• Piece Handling: Represent the Piece component (Piece.h) that likely encapsulates the Tetris pieces’ logic.
Relationships and Interactions
• That the Main/Entry Point initializes the Application.
• The Application is responsible for creating the window (via SFML) and initializing the Game Core.
• The piece logic, likely used from within the GameState, should be depicted as part of the game loop that computes moves, piece rotations, and collision detections.
Architectural Patterns and Design Principles
• Separation between the game’s core logic and resource management. This separation supports decoupling and better scalability.
• Game loop as a central design element that continuously updates states and renders using SFML.