# nixondebantu/swe-224-java-team-project architecture

> Architecture diagram of the GitHub repository nixondebantu/swe-224-java-team-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nixondebantu/swe-224-java-team-project
- Repository: https://github.com/nixondebantu/swe-224-java-team-project

## Overview

##### Main Components
- Core Game Module: This is where the majority of game logic resides. Inside the “core” folder you have the source package (com.myGdx.game). Within that, separate packages exist for assets (assets files like BgAssets.java), various game screens (e.g., IntroScreen, MainMenuScreen, Level1, Level2, etc.), and other game-related resources.
- Desktop Launcher Module: Found in the “desktop” directory where DesktopLauncher.java is implemented. This module is responsible for bootstrapping the game using the libGDX framework.
- Assets: Although the digital assets (screenshots, sounds, fonts) are stored under an “assets” folder at the project root, they are integrated into the game via the core module (e.g., Assets/BgAssets.java). This should be represented as an external component that both modules rely upon.
- Gradle Build System: The Gradle configuration files (build.gradle in project root, core, and desktop folders; gradle wrapper files) indicate that the project uses Gradle for building, dependency management and possibly deployment.

##### Relationships and Interactions
- The Desktop Launcher (in the “desktop” module) initializes and calls into the Core Game Module.
- The Core Game Module manages the game state, transitions “screens” (IntroScreen, MainMenuScreen, various Level screens and others like Story, WinScreen, OverScreen, etc.), and utilizes assets.
- The assets folder serves as a repository for media files. Its resources are loaded by the game logic during runtime.
- The Gradle build system ties everything together by managing module dependencies and the build process.

##### Architectural Patterns and Technologies
- The project clearly follows a separation of concerns pattern, dividing the game logic (core) from the platform-specific launcher (desktop).
- It leverages libGDX as the game development framework, and several screen classes indicate the use of a State/Screen or MVC-like approach to manage different scenes.
- Gradle is used as the build automation tool, so the build and dependency management aspect might be highlighted as part of the overall architecture when considering deployment or continuous integration pipelines.

##### Essential Elements
- Clearly labeled nodes for: “Desktop Launcher”, “Core Game Module”, “Game Screens” (each significant screen like Intro, MainMenu, Level1, etc. can be grouped together if needed), and “Assets Repository”.
- From “Desktop Launcher” to “Core Game Module”.
- Connections from “Core Game Module” to “Assets” (showing asset loading or dependency).
- Optional: A block for the Gradle/Build System to denote how the project is built and maintained.
- Notes or annotations that mention the use of libGDX for game development, Java as the programming language, and Gradle for project management.

## Diagram (Mermaid)

```mermaid
flowchart TD

    subgraph "Build and Deployment"
        G1["Project Root Gradle"]:::build
        G2["Core Gradle"]:::build
        G3["Desktop Gradle"]:::build
        G4["Gradle Wrapper"]:::build
    end

    F["libGDX Framework"]:::framework

    subgraph "Game Modules"
        D["Desktop Launcher Module"]:::launcher
        C["Core Game Module"]:::core
        subgraph "Core Components"
            GS["Game Screens (Intro,MainMenu,Levels,etc.)"]:::screens
            AM["Asset Manager"]:::assetsManager
        end
    end

    A["Assets Repository"]:::assetRepo

    %% Build system builds modules
    G1 -->|"builds"| D
    G1 -->|"builds"| C

    %% Modules use libGDX
    D -->|"uses"| F
    C -->|"uses"| F

    %% Desktop launcher initializes core
    D -->|"initializes"| C

    %% Core game module manages screens and assets
    C -->|"manages"| GS
    C -->|"loads"| AM

    %% Asset manager references assets repository
    AM -->|"references"| A

    %% Click Events for Build System
    click G1 "https://github.com/nixondebantu/swe-224-java-team-project/blob/main/build.gradle"
    click G2 "https://github.com/nixondebantu/swe-224-java-team-project/blob/main/core/build.gradle"
    click G3 "https://github.com/nixondebantu/swe-224-java-team-project/blob/main/desktop/build.gradle"
    click G4 "https://github.com/nixondebantu/swe-224-java-team-project/tree/main/gradle/wrapper"

    %% Click Events for Game Modules and Assets
    click D "https://github.com/nixondebantu/swe-224-java-team-project/blob/main/desktop/src/com/mygdx/game/DesktopLauncher.java"
    click C "https://github.com/nixondebantu/swe-224-java-team-project/tree/main/core/src/com/mygdx/game"
    click AM "https://github.com/nixondebantu/swe-224-java-team-project/blob/main/core/src/com/mygdx/game/Assets/BgAssets.java"
    click A "https://github.com/nixondebantu/swe-224-java-team-project/tree/main/assets"

    %% Styles
    classDef build fill:#ffe0b2,stroke:#bf360c,stroke-width:2px;
    classDef launcher fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef core fill:#dcedc8,stroke:#33691e,stroke-width:2px;
    classDef screens fill:#fff9c4,stroke:#f9a825,stroke-width:2px;
    classDef assetsManager fill:#f8bbd0,stroke:#c2185b,stroke-width:2px;
    classDef assetRepo fill:#c5cae9,stroke:#1a237e,stroke-width:2px;
    classDef framework fill:#e1bee7,stroke:#6a1b9a,stroke-width:2px;
```
