# arkeus/axel architecture

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

- Interactive diagram: https://gitdiagram.com/arkeus/axel
- Repository: https://github.com/arkeus/axel

## Overview

##### Main Components

a. Core Engine Layer
- Center the `Ax` class as the main entry point
- `AxState` for game state management
- `AxEntity` as the base game object class

b. Rendering System
- `render` package components
- `AxShader`, `AxTexture`, and `AxQuad` interaction
- `AxBlendMode` for rendering options

c. Game Object Hierarchy
- Branch to specialized types (`AxSprite`, `AxGroup`, `AxModel`)
- Particle system integration

d. Input Management
- Input handlers (`AxKeyboard`, `AxMouse`, `AxTouchEvent`)
- Connection to core engine

e. Support Systems
- Camera system with effects
- Sound management (`AxMusic`, `AxSound`)
- Resource management
- Collision system

**Game Implementation Layer**

**Core Engine Layer (Ax, AxState)**

- Rendering System
- Input System
- Physics/Collision
- Resource Management

##### Implementation Details

- Component name
- Key methods/properties
- Relationships to other components

Example component detail:
**┌─────────────────────┐**
- AxSprite           │
- ┤
- position         │
- scale            │
- rotation         │
- render()         │
- update()         │
- ┘

##### Technical Notes

Specific technical aspects:
- Stage3D rendering pipeline
- Particle system flow
- Camera effects system
- Collision detection system
- Resource loading and management

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Core Engine Layer
    subgraph CoreEngine["Core Engine Layer"]
        Ax["Ax (Main Entry)"]:::core
        AxState["AxState"]:::core
        AxEntity["AxEntity"]:::core
    end

    %% Rendering System
    subgraph RenderSystem["Rendering System"]
        AxShader["AxShader"]:::render
        AxTexture["AxTexture"]:::render
        AxQuad["AxQuad"]:::render
        AxBlendMode["AxBlendMode"]:::render
    end

    %% Game Objects
    subgraph GameObjects["Game Object Hierarchy"]
        AxSprite["AxSprite"]:::gameobj
        AxGroup["AxGroup"]:::gameobj
        AxModel["AxModel"]:::gameobj
    end

    %% Input Management
    subgraph InputSystem["Input System"]
        AxInput["AxInput"]:::input
        AxKeyboard["AxKeyboard"]:::input
        AxMouse["AxMouse"]:::input
        AxTouchEvent["AxTouchEvent"]:::input
    end

    %% Support Systems
    subgraph SupportSystems["Support Systems"]
        %% Camera
        AxCamera["AxCamera"]:::support

        %% Sound
        subgraph Sound["Sound Management"]
            AxMusic["AxMusic"]:::audio
            AxSound["AxSound"]:::audio
        end

        %% Resource
        AxResource["AxResource"]:::resource

        %% Collision
        subgraph Collision["Collision System"]
            AxCollider["AxCollider"]:::collision
            AxCollisionGroup["AxCollisionGroup"]:::collision
        end
    end

    %% Particle System
    subgraph ParticleSystem["Particle System"]
        AxParticleSystem["AxParticleSystem"]:::particle
        AxParticleEffect["AxParticleEffect"]:::particle
        AxParticleCloud["AxParticleCloud"]:::particle
    end

    %% Relationships
    Ax --> AxState
    Ax --> AxEntity
    AxEntity --> AxSprite
    AxEntity --> AxGroup
    AxEntity --> AxModel
    AxEntity --> RenderSystem
    AxInput --> AxKeyboard
    AxInput --> AxMouse
    AxInput --> AxTouchEvent
    Ax --> InputSystem
    Ax --> SupportSystems
    AxEntity --> ParticleSystem

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef render fill:#2ecc71,stroke:#27ae60,color:white
    classDef gameobj fill:#e74c3c,stroke:#c0392b,color:white
    classDef input fill:#f1c40f,stroke:#f39c12,color:white
    classDef support fill:#9b59b6,stroke:#8e44ad,color:white
    classDef audio fill:#e67e22,stroke:#d35400,color:white
    classDef resource fill:#1abc9c,stroke:#16a085,color:white
    classDef collision fill:#e74c3c,stroke:#c0392b,color:white
    classDef particle fill:#34495e,stroke:#2c3e50,color:white

    %% Click Events
    click Ax "https://github.com/arkeus/Axel/blob/master/src/org/axgl/Ax.as"
    click AxState "https://github.com/arkeus/Axel/blob/master/src/org/axgl/AxState.as"
    click AxEntity "https://github.com/arkeus/Axel/blob/master/src/org/axgl/AxEntity.as"
    click AxShader "https://github.com/arkeus/Axel/blob/master/src/org/axgl/render/AxShader.as"
    click AxTexture "https://github.com/arkeus/Axel/blob/master/src/org/axgl/render/AxTexture.as"
    click AxQuad "https://github.com/arkeus/Axel/blob/master/src/org/axgl/render/AxQuad.as"
    click AxBlendMode "https://github.com/arkeus/Axel/blob/master/src/org/axgl/render/AxBlendMode.as"
    click AxSprite "https://github.com/arkeus/Axel/blob/master/src/org/axgl/AxSprite.as"
    click AxGroup "https://github.com/arkeus/Axel/blob/master/src/org/axgl/AxGroup.as"
    click AxModel "https://github.com/arkeus/Axel/blob/master/src/org/axgl/AxModel.as"
    click AxInput "https://github.com/arkeus/Axel/blob/master/src/org/axgl/input/AxInput.as"
    click AxKeyboard "https://github.com/arkeus/Axel/blob/master/src/org/axgl/input/AxKeyboard.as"
    click AxMouse "https://github.com/arkeus/Axel/blob/master/src/org/axgl/input/AxMouse.as"
    click AxTouchEvent "https://github.com/arkeus/Axel/blob/master/src/org/axgl/input/AxTouchEvent.as"
    click AxCamera "https://github.com/arkeus/Axel/blob/master/src/org/axgl/camera/AxCamera.as"
    click AxMusic "https://github.com/arkeus/Axel/blob/master/src/org/axgl/sound/AxMusic.as"
    click AxSound "https://github.com/arkeus/Axel/blob/master/src/org/axgl/sound/AxSound.as"
    click AxResource "https://github.com/arkeus/Axel/blob/master/src/org/axgl/resource/AxResource.as"
    click AxCollider "https://github.com/arkeus/Axel/blob/master/src/org/axgl/collision/AxCollider.as"
    click AxCollisionGroup "https://github.com/arkeus/Axel/blob/master/src/org/axgl/collision/AxCollisionGroup.as"
    click AxParticleSystem "https://github.com/arkeus/Axel/blob/master/src/org/axgl/particle/AxParticleSystem.as"
    click AxParticleEffect "https://github.com/arkeus/Axel/blob/master/src/org/axgl/particle/AxParticleEffect.as"
    click AxParticleCloud "https://github.com/arkeus/Axel/blob/master/src/org/axgl/particle/AxParticleCloud.as"
```
