How keykoder/tetris-android works
And Label Main Components
• Android Application Layer: Represent the overall application managed through Android’s framework.
• UI/Presentation Layer: Include all activity components (GameActivity, LevelSelect, LoginActivity, ProfileActivity, RegisterActivity) as they host the game interface and user interactions.
• Game Engine/Logic Component: Identify the game logic classes such as Board, Replay, SinglePiece, Tetromino, and Vector2D. This is where the core Tetris mechanics are implemented.
• Utility and Data Layer: Include supporting classes like NotifyingArrayList (and its listener), PlayerData, and Utils that help manage data and game state.
• Build and Project Configuration: Although not part of runtime, tools like Gradle (with build.gradle files, gradlew wrappers), AndroidManifest.xml, and configuration files (google-services.json, proguard-rules.pro) are essential for the build and deployment process.
Relationships and Interactions
• A directional connection from the UI/Presentation Layer to the Game Engine indicating that user actions in the activities trigger game logic operations.
• Demonstrate how the Game Engine uses Resource/Asset Layer elements (e.g., layouts, images, sound files) to render game visuals and audio.
Architectural Patterns
• Separation of concerns where Activities handle user interactions and delegate to separate classes (game logic) for the Tetris mechanics.
• The resource management follows the standard Android MVC/MVP style where XML layout files are decoupled from business logic.
• Use of custom utility classes such as NotifyingArrayList suggests an Observer-like pattern for managing state changes in collections.
• Notes on the usage of Gradle as the build tool and Android Manifest file as the entry point of the app configuration.