How stef-gms/flutter-games-endless_runner works
Main Components
• Frontend/Game UI: Highlight the Flutter UI using several screens including Main Menu (found in lib/main_menu), game screen/FlameGame’s components (lib/flame_game), level selection screens (lib/level_selection), and settings screens (lib/settings).
• Game Engine Components: Emphasize the use of Flame’s game engine. Include the FlameGame base along with associated game objects (player, obstacle, background, effects) as separate subcomponents.
• Audio Subsystem: Represent the audio files and controllers (lib/audio) that manage soundtracks and effects (assets/music, assets/sfx).
• Persistence and Settings: Identify the persistence layers for settings and player progress (lib/settings/persistence and lib/player_progress/persistence) that encapsulate low-level storage (using local storage or memory-based approaches).
• Routing and Lifecycle: Include components for navigation and overall app lifecycle management (router in lib/router and app lifecycle in lib/app_lifecycle).
Relationships and Interactions
• How the game components talk to the audio subsystem for triggering sound effects, as well as how they interface with the settings and persistence modules.
• Platform-specific layer as the “shell” that loads the Flutter engine and binds native functionality, while the bulk of the application logic exists in lib.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly delineate UI, game logic, audio, and persistence functionalities.
• Integration Readiness: Detect integration points for external services (logging via the logging package, potential ads or analytics for production) so that they can be noted as optional add-ons.
Relevant Technologies, Frameworks, and Dependencies
• Flutter for UI and multi-platform support.
• Flame for the game engine and managing game objects.
• Shared Preferences for settings storage.
• The logging package for debug and production logging.
• Third-party tools (like flutter_launcher_icons) used for assets management.
• For multi-platform builds, note the directories for iOS, Android, Web, Linux, macOS, and Windows.
• Separate the core game engine (FlameGame and related lib components) from the frontend screens (menus, level selection, settings).
• For each major module, include sub-components where applicable (e.g., under the FlameGame module, show player, obstacle, and background components).
• Integration of persistent data storage for player progress and settings.