# parthubhe/javaendsemproject_game architecture

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

- Interactive diagram: https://gitdiagram.com/parthubhe/javaendsemproject_game
- Repository: https://github.com/parthubhe/javaendsemproject_game

## Overview

##### Project Type and Purpose
- This is a game project built with libGDX. Its purpose is to implement the core game logic (found in the core module) and to provide platform‐specific launchers for both desktop (LWJGL3) and web (HTML using GWT and WebGL).
- Avoid expanding on the extensive asset folders—only note that game assets exist as external resources without detailing every subdirectory.

##### Main Components
- Core Module:
– Contains the shared game logic and core classes (e.g., HackAndSlash, Animator.java, Background.java, Enemy.java, etc.).
– Acts as the backbone for game mechanics, state management, and the ApplicationAdapter extension.
- Platform-Specific Modules:
– LWJGL3 Module: Holds the desktop-specific launcher (Lwjgl3Launcher.java) and support classes (like StartupHelper) that integrate libGDX with the LWJGL3 framework.
– HTML Module: Contains the GWT setup (GwtLauncher.java, GdxDefinition.gwt.xml files) to run the game in a web browser.
- Gradle Build System:
– Represent the overall build infrastructure that manages project dependencies, cross-platform builds, and tasks for each module.
- External Dependencies:
– Highlight libGDX as the primary framework and any relevant libraries (e.g., GWT for web, LWJGL3 for desktop rendering).

##### Relationships and Interactions
- That the application launchers in LWJGL3 and HTML delegate to the Core (game logic) at startup.
- Gradle build process as an external system that compiles, tests, and packages all modules.
- (Optional) Represent a simplified “Asset Manager” or an external assets resource node if needed—but keep this high-level since detailed asset organization is unnecessary.

##### Architectural Patterns and Design Principles
- Modularity by depicting a clear separation between shared code (Core) and platform-specific code (LWJGL3 and HTML).
- That the project leverages Gradle for dependency management and builds, which supports a multi-module architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Gradle Build System (Root)
    gradleRoot("Gradle Build System (Root)"):::build

    %% External Dependency
    libGDX("libGDX Framework"):::external

    %% Core Module
    subgraph "Core Module"
        coreGame("Core Game Logic"):::core
        coreGradle("Core Gradle (core/build.gradle)"):::build
    end

    %% Desktop Module (LWJGL3)
    subgraph "Desktop Module (LWJGL3)"
        desktopLauncher("Desktop (LWJGL3) Launcher"):::desktop
        desktopSupport("Desktop (LWJGL3) Support"):::desktop
        lwjglGradle("LWJGL3 Gradle (lwjgl3/build.gradle)"):::build
    end

    %% Web Module (HTML - GWT)
    subgraph "Web Module (HTML - GWT)"
        webLauncher("Web (HTML - GWT) Launcher"):::html
        gwtConfig("GWT Config (GdxDefinition.gwt.xml)"):::html
        gwtSuper("GWT Superdev Config (GdxDefinitionSuperdev.gwt.xml)"):::html
        htmlGradle("HTML Gradle (html/build.gradle)"):::build
    end

    %% Relationships: Gradle orchestration
    gradleRoot --> coreGradle
    gradleRoot --> lwjglGradle
    gradleRoot --> htmlGradle

    %% Launcher dependencies to Core Game Logic
    desktopLauncher -->|"delegatesTo"| coreGame
    webLauncher -->|"delegatesTo"| coreGame

    %% Desktop Module internal dependency
    desktopLauncher -->|"uses"| desktopSupport

    %% External Framework dependency for Core
    libGDX -->|"provides"| coreGame

    %% Gradle Build orchestration connections
    gradleRoot -->|"orchestrates"| coreGame
    gradleRoot -->|"orchestrates"| desktopLauncher
    gradleRoot -->|"orchestrates"| webLauncher

    %% Click Events
    click coreGame "https://github.com/parthubhe/javaendsemproject_game/tree/master/core/src/main/java/com/has/mt"
    click desktopLauncher "https://github.com/parthubhe/javaendsemproject_game/blob/master/lwjgl3/src/main/java/com/has/mt/lwjgl3/Lwjgl3Launcher.java"
    click desktopSupport "https://github.com/parthubhe/javaendsemproject_game/blob/master/lwjgl3/src/main/java/com/has/mt/lwjgl3/StartupHelper.java"
    click webLauncher "https://github.com/parthubhe/javaendsemproject_game/blob/master/html/src/main/java/com/has/mt/gwt/GwtLauncher.java"
    click gwtConfig "https://github.com/parthubhe/javaendsemproject_game/blob/master/html/src/main/java/com/has/mt/GdxDefinition.gwt.xml"
    click gwtSuper "https://github.com/parthubhe/javaendsemproject_game/blob/master/html/src/main/java/com/has/mt/GdxDefinitionSuperdev.gwt.xml"
    click gradleRoot "https://github.com/parthubhe/javaendsemproject_game/blob/master/build.gradle"
    click coreGradle "https://github.com/parthubhe/javaendsemproject_game/blob/master/core/build.gradle"
    click lwjglGradle "https://github.com/parthubhe/javaendsemproject_game/blob/master/lwjgl3/build.gradle"
    click htmlGradle "https://github.com/parthubhe/javaendsemproject_game/blob/master/html/build.gradle"

    %% Styles
    classDef core fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef desktop fill:#C1E1C1,stroke:#333,stroke-width:2px;
    classDef html fill:#F7E1A5,stroke:#333,stroke-width:2px;
    classDef build fill:#FADADD,stroke:#333,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#333,stroke-width:2px;
```
