# maith-dulsara/nebula-2d-shooter-game- architecture

> Architecture diagram of the GitHub repository maith-dulsara/nebula-2d-shooter-game-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maith-dulsara/nebula-2d-shooter-game-
- Repository: https://github.com/maith-dulsara/nebula-2d-shooter-game-

## Overview

##### Project type and purpose
- This is a browser-based, single-page HTML5 game (“Nebula Shooter”) packaged entirely in nebula_shooter.html plus its README.
- It uses JavaScript and the Canvas API (or DOM) to implement a top-down shooter with AI enemies, particle effects, score tracking, and level progression—all running client-side.

##### File structure
- Only two top-level files:
- README.md (project description, features, controls)
- nebula_shooter.html (all game code, assets references, styles, and markup)
- No backend services, databases, or external dependencies beyond standard browser APIs.

##### Key insights from README
- Core gameplay loop: input → update (AI, physics) → render (player, enemies, particles, UI).
- Systems: Input handling, AI movement, collisions/health, particle effects, scoring/levels.
- Runs purely in the browser—no network calls or server logic.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Documentation
    RD["Project Documentation\nREADME.md"]:::doc
    click RD "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/README.md"

    subgraph "Browser Client"
        direction TB
        AL["Asset Loader"]:::asset
        IH["Input Handler"]:::core
        GL["Game Loop / Engine Core"]:::core
        AI["AI Module\n(difficulty scaling)"]:::ai
        PC["Physics / Collision System"]:::physics
        EM["Entity Manager"]:::core
        PS["Particle System"]:::particle
        RE["Rendering Engine"]:::render
        UI["UI Manager"]:::ui
    end

    %% Relationships
    RD -->|"bootstrap"| AL
    AL -->|"sprite/audio data"| GL
    IH -->|"player commands (key/mouse)"| GL
    GL -->|"update positions"| AI
    GL -->|"resolve hits"| PC
    GL -->|"spawn/remove entities"| EM
    GL -->|"trigger effects"| PS
    GL -->|"draw calls"| RE
    GL -->|"update overlays"| UI

    %% Click Events for Modules
    click AL "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"
    click IH "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"
    click GL "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"
    click AI "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"
    click PC "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"
    click EM "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"
    click PS "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"
    click RE "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"
    click UI "https://github.com/maith-dulsara/nebula-2d-shooter-game-/blob/main/nebula_shooter.html"

    %% Styles
    classDef doc fill:#dddddd,stroke:#888888,color:#000000
    classDef asset fill:#d0c4f2,stroke:#9b8de3,color:#000000
    classDef core fill:#c4e1f2,stroke:#67aadd,color:#000000
    classDef ai fill:#f2d1c4,stroke:#e38f67,color:#000000
    classDef physics fill:#f2e0c4,stroke:#e3c167,color:#000000
    classDef particle fill:#e8c4f2,stroke:#c567e3,color:#000000
    classDef render fill:#c4f2d2,stroke:#67dda3,color:#000000
    classDef ui fill:#c4f2e8,stroke:#67add2,color:#000000
```
