# pi-bouf/experimental-game-engine architecture

> Architecture diagram of the GitHub repository pi-bouf/experimental-game-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pi-bouf/experimental-game-engine
- Repository: https://github.com/pi-bouf/experimental-game-engine

## Overview

##### Main Components Organization

a) Core Engine Layer
- It to all major subsystems

b) Subsystems (arrange these around the core):
- Assets Management System (yellow)
- Event System (green)
- Geometry System (purple)
- Sprite System (orange)
- Debug System (red)
- Ticker System (blue)

##### Component Relationships

a) Engine Core → Subsystems

b) Inter-system Communications
- Assets → Sprite (texture loading)
- Events → Sprite (input handling)
- Geometry → Sprite (positioning and transformation)
- Ticker → All Systems (update cycle)

##### Detailed Subsystem Breakdown

a) Sprite System
- Base Components: PSprite, PTexture, PBaseTexture
- Graphics: Graphic
- Tween System: TranslateTween, Tween

b) Geometry System
- Stage
- Position3D
- PRectangle
- GeometryManager as coordinator

c) Events System
- InputManager
- Connection to ICurrentInputs interface

d) Assets System
- AssetsManager
- Asset Types
- Loading flow

##### Interface Implementation

- IFlushable
- IResetable
- IEngineOption

##### Additional Elements

Include:
- Version information
- Technology stack indicators (TypeScript, PixiJS)
- System requirements or dependencies
- Scale indicator for size reference

##### Notes Section

A notes section explaining:
- Update cycle flow
- Asset loading pipeline
- Event propagation
- Debug mode activation
- Tween system operation

- Multiple layers
- Exportable formats
- Zoomable interface
- Component reuse

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        Engine["Engine"]:::core
        IEngineOption["IEngineOption"]:::interface
        Engine --> IEngineOption
    end

    subgraph Assets
        AssetsManager["AssetsManager"]:::assets
        IAssetsManager["IAssetsManager"]:::interface
        Asset["Asset Types"]:::assets
        AssetsManager --> IAssetsManager
        AssetsManager --> Asset
    end

    subgraph Events
        InputManager["InputManager"]:::events
        ICurrentInputs["ICurrentInputs"]:::interface
        InputManager --> ICurrentInputs
    end

    subgraph Geometry
        GeometryManager["GeometryManager"]:::geometry
        Position3D["Position3D"]:::geometry
        PRectangle["PRectangle"]:::geometry
        Stage["Stage"]:::geometry
        IPosition3D["IPosition3D"]:::interface
        GeometryManager --> Position3D
        GeometryManager --> PRectangle
        GeometryManager --> Stage
        Position3D --> IPosition3D
    end

    subgraph Sprites
        PSprite["PSprite"]:::sprites
        PTexture["PTexture"]:::sprites
        PBaseTexture["PBaseTexture"]:::sprites
        Graphic["Graphic"]:::sprites
        IGraphic["IGraphic"]:::interface
        PSprite --> PTexture
        PTexture --> PBaseTexture
        Graphic --> IGraphic
    end

    subgraph Tweens
        TranslateTween["TranslateTween"]:::tweens
        Tween["Tween"]:::tweens
        ITween["ITween"]:::interface
        ITweenVars["ITweenVars"]:::interface
        TranslateTween --> Tween
        Tween --> ITween
        Tween --> ITweenVars
    end

    subgraph Debug
        DebugFilter["DebugFilter"]:::debug
        PixiInspector["PixiInspector"]:::debug
    end

    subgraph Ticker
        DoubleTicker["DoubleTicker"]:::ticker
        IntervalWorker["IntervalWorker"]:::ticker
        DoubleTicker --> IntervalWorker
    end

    subgraph Common
        IFlushable["IFlushable"]:::interface
        IResetable["IResetable"]:::interface
    end

    Engine --> AssetsManager
    Engine --> InputManager
    Engine --> GeometryManager
    Engine --> PSprite
    Engine --> DoubleTicker
    Engine --> DebugFilter
    Engine --> PixiInspector

    AssetsManager --> PSprite
    InputManager --> PSprite
    GeometryManager --> PSprite
    DoubleTicker --> Engine

    classDef core fill:#2b4b6b,stroke:#1a3d5c,color:#fff
    classDef assets fill:#ffd700,stroke:#b39700,color:#000
    classDef events fill:#32cd32,stroke:#228b22,color:#000
    classDef geometry fill:#9370db,stroke:#6a5acd,color:#fff
    classDef sprites fill:#ff8c00,stroke:#d2691e,color:#000
    classDef tweens fill:#ff69b4,stroke:#ff1493,color:#000
    classDef debug fill:#ff4444,stroke:#cc0000,color:#fff
    classDef ticker fill:#4169e1,stroke:#0000cd,color:#fff
    classDef interface fill:#dcdcdc,stroke:#a9a9a9,color:#000

    click Engine "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/Engine.ts"
    click IEngineOption "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/interfaces/IEngineOption.ts"
    click AssetsManager "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/assets/AssetsManager.ts"
    click IAssetsManager "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/assets/interfaces/IAssetsManager.ts"
    click Asset "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/assets/types/Asset.ts"
    click InputManager "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/events/InputManager.ts"
    click ICurrentInputs "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/events/interface/ICurrentInputs.ts"
    click GeometryManager "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/geometry/GeometryManager.ts"
    click Position3D "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/geometry/Position3D.ts"
    click PRectangle "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/geometry/PRectangle.ts"
    click Stage "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/geometry/Stage.ts"
    click IPosition3D "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/geometry/interfaces/IPosition3D.ts"
    click PSprite "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/PSprite.ts"
    click PTexture "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/PTexture.ts"
    click PBaseTexture "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/PBaseTexture.ts"
    click Graphic "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/Graphic.ts"
    click IGraphic "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/interface/IGraphic.ts"
    click TranslateTween "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/tween/TranslateTween.ts"
    click Tween "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/tween/Tween.ts"
    click ITween "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/tween/interface/ITween.ts"
    click ITweenVars "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/sprite/tween/interface/ITweenVars.ts"
    click DebugFilter "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/debug/filters/DebugFilter.ts"
    click PixiInspector "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/debug/inspector/PixiInspector.ts"
    click DoubleTicker "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/ticker/DoubleTicker.ts"
    click IntervalWorker "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/ticker/IntervalWorker.js"
    click IFlushable "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/interfaces/IFlushable.ts"
    click IResetable "https://github.com/pi-bouf/experimental-game-engine/blob/main/src/interfaces/IResetable.ts"
```
