How chickensoft-games/gamedemo works
Main Components
• Game/Application Core – Represent the general game entry point (the “Main” scenes and the application node defined in src/Main.* and src/app/*). This is where the overall lifecycle (initialization, saving/loading, and two-phase initialization) is managed.
• Domain & Logic Layer – Show the domain repositories, shared logic blocks, and state machines. For example, include separate domain folders for the game, app, and player along with the corresponding state machine definitions (states defined in subdirectories like src/app/state/states, src/game/state/states, src/player/state/states, etc.).
• Presentation/UI – Illustrate the different UI nodes such as the menu (src/menu), pause menu, win menu, and in-game UI. Emphasize that these components are linked to their respective state machines.
• Audio System – Note the in-game audio components (src/in_game_audio) that control music and sound effects through their own scenes and logic.
• Visual & Asset Management – Indicate the multiple scene files (.tscn) and visual assets for the player, coins, map, and other game objects.
• Utility & External Services – Include components for dependency injection (AutoInject), reactive utilities (Collections), node mixins (Introspection), and testing (via the GoDotTest framework, along with the separate “test” folder).
• Demonstrate how domain-driven updates (using observable objects from the Collections package) propagate changes from business logic (domain repositories) to multiple logic blocks (such as those managing game and app states).
Architectural Patterns & Technologies
• Dependency Injection – Visually indicate that components receive their dependencies through AutoInject, ensuring that higher-level nodes provide services or objects to their children.
Elements
• Clear labels for each component (e.g., “Game Core”, “Player Controller”, “UI Manager”).
• Logic components (state management, domain logic)
• Presentation components (Godot scenes, visual assets)
• Support utilities (AutoInject, Introspection, Collections)
• Components according to modules (for example, group all player-related files under one “Player Module” and similarly for coins, map, audio, etc.).