# vascocosta/glulander architecture

> Architecture diagram of the GitHub repository vascocosta/glulander, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vascocosta/glulander
- Repository: https://github.com/vascocosta/glulander

## Overview

##### Project Type Analysis
This is a vintage-style gaming project specifically targeting the ZX Spectrum platform. It's a lunar lander game with a historical fiction twist, implemented in ZX BASIC.

##### Main Components

A. Source Code Layer:
- ZX BASIC Source (glulander.bas)
- Game Logic Components
- Physics Engine Components
- Input Handler
- Graphics Renderer

B. Build System:
- ZX BASIC Compiler
- Build Script
- Output Binary/Tape File

C. Runtime Environment:
- ZX Spectrum Hardware/Emulator
- Memory Management
- Output
- Input Processing

**┌─────────────────────────────────────────┐**
- Runtime Environment          │
- ┌─────────────────┐ ┌───────────────┐ │
- ZX Spectrum    │ │    Memory     │ │
- Display/Input  │ │   Management  │ │
- ┘ └───────────────┘ │
- ┘
- ▲

**┌─────────────────────────────────────────┐**
- Compiled Binary              │
- ┘
- ▲

**┌─────────────────────────────────────────┐**
- Build/Compilation Layer         │
- ┌─────────────────┐ ┌───────────────┐ │
- ZX BASIC      │ │    Build      │ │
- Compiler      │ │    Script     │ │
- ┘ └───────────────┘ │
- ┘
- ▲

**┌─────────────────────────────────────────┐**
- Source Code Components          │
- ┌─────────────┐ ┌─────────┐ ┌───────┐ │
- Game Logic │ │ Physics │ │ Input │ │
- Engine   │ │ Engine  │ │Handler│ │
- ┘ └─────────┘ └───────┘ │
- ┘

##### Important Elements to Highlight
- The single source file (glulander.bas) architecture
- The compilation process using ZX BASIC Compiler
- The runtime environment requirements
- The game's core systems (physics, input, graphics)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef runtime fill:#b3d9ff,stroke:#333
    classDef build fill:#90EE90,stroke:#333
    classDef source fill:#FFB366,stroke:#333
    classDef output fill:#E6E6E6,stroke:#333

    %% Runtime Environment Layer
    subgraph Runtime
        ZXHardware["ZX Spectrum Hardware/Emulator"]:::runtime
        Memory["Memory Management"]:::runtime
        Display["Display Output"]:::runtime
        InputProc["Input Processing"]:::runtime

        ZXHardware --- Memory
        ZXHardware --- Display
        ZXHardware --- InputProc
    end

    %% Compiled Output Layer
    Binary["Compiled Binary/Tape File"]:::output

    %% Build System Layer
    subgraph BuildSystem
        Compiler["ZX BASIC Compiler"]:::build
        BuildScript["Build Script"]:::build

        Compiler --> Binary
        BuildScript --> Compiler
    end
    click BuildScript "https://github.com/vascocosta/glulander/tree/main/build/"

    %% Source Code Layer
    subgraph SourceCode
        GameLogic["Game Logic Engine"]:::source
        Physics["Physics Engine"]:::source
        InputHandler["Input Handler"]:::source
        Graphics["Graphics Renderer"]:::source

        GameLogic --- Physics
        GameLogic --- InputHandler
        GameLogic --- Graphics
    end
    click GameLogic "https://github.com/vascocosta/glulander/blob/main/src/glulander.bas"
    click Physics "https://github.com/vascocosta/glulander/blob/main/src/glulander.bas"
    click InputHandler "https://github.com/vascocosta/glulander/blob/main/src/glulander.bas"
    click Graphics "https://github.com/vascocosta/glulander/blob/main/src/glulander.bas"

    %% Connections between layers
    SourceCode --> BuildSystem
    BuildSystem --> Binary
    Binary --> Runtime

    %% Legend
    subgraph Legend
        L1["Runtime Components"]:::runtime
        L2["Build Components"]:::build
        L3["Source Components"]:::source
        L4["Output Components"]:::output
    end
```
