# rhineland905/ghostengine architecture

> Architecture diagram of the GitHub repository rhineland905/ghostengine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rhineland905/ghostengine
- Repository: https://github.com/rhineland905/ghostengine

## Overview

GhostEngine is a side-scrolling game with a separate DesktopGL level editor. The player-facing workflow starts at the main menu, enters gameplay, and runs a level in which the player navigates tiles, enemies, and gems; completion and leaderboard handling are part of the game domain. The Core project also provides screens, settings, localization, and particle effects. The editor has its own UI and level-editing workflow. README is empty, so capability details and relationships are limited to the source index and excerpts; unsampled links are omitted where their direction is unclear.

Main entry points: [`GhostEngine.Core/Game/Level.cs`](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Level.cs) (Level), [`GhostEngine.Core/GhostEngineGame.cs`](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/GhostEngineGame.cs) (Game bootstrap), [`GhostEngine.Core/Screens/GameplayScreen.cs`](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/GameplayScreen.cs) (Gameplay screen), [`GhostEngine.Core/Screens/MainMenuScreen.cs`](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/MainMenuScreen.cs) (Main menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_screens["Screen manager<br/>[ScreenManager.cs]"]
  node_game_screen["Screen lifecycle<br/>[GameScreen.cs]"]
  node_main_menu["Main menu<br/>[MainMenuScreen.cs]"]
  node_gameplay["Gameplay screen<br/>[GameplayScreen.cs]"]
  node_settings_screen["Settings screen<br/>[SettingsScreen.cs]"]
  node_pause_screen["Pause screen<br/>[PauseScreen.cs]"]
  node_input["Input state<br/>[InputState.cs]"]
  node_game["Game bootstrap<br/>[GhostEngineGame.cs]"]
end

subgraph group_world["Game world"]
  node_player["Player<br/>[Player.cs]"]
  node_level["Level<br/>[Level.cs]"]
  node_tiles["Tiles and collisions<br/>[Tile.cs]"]
  node_enemy["Enemies<br/>[Enemy.cs]"]
  node_gems["Gems<br/>[Gem.cs]"]
end

subgraph group_services["Game services"]
  node_particles["Particle effects<br/>[ParticleManager.cs]"]
  node_settings["Settings manager<br/>[SettingsManager.cs]"]
  node_settings_data["Game settings"]
  node_storage[("JSON settings storage")]
  node_leaderboard["Leaderboard"]
  node_localization["Localization"]
end

subgraph group_editor["Desktop editor"]
  node_editor_entry["Editor<br/>[LevelEditor.cs]"]
  node_editor_ui["Editor UI<br/>[UIManager.cs]"]
  node_editor_events["Editor settings and events"]
  node_editor_palette["Tile palette<br/>[PaletteList.cs]"]
  node_editor_save["Level save/load<br/>[SaveLoadConfig.cs]"]
end

node_user(("Player"))

node_user -->|"starts at"| node_main_menu
node_game -->|"creates"| node_screens
node_game -->|"adds initial screen"| node_main_menu
node_screens -->|"updates"| node_input
node_screens -->|"manages screens"| node_game_screen
node_main_menu -->|"starts gameplay"| node_gameplay
node_main_menu -->|"opens settings"| node_settings_screen
node_gameplay -->|"creates and updates"| node_level
node_gameplay -->|"opens pause"| node_pause_screen
node_gameplay -->|"updates results"| node_leaderboard
node_level -->|"owns world player"| node_player
node_level -->|"loads and checks"| node_tiles
node_level -->|"updates enemies"| node_enemy
node_level -->|"updates gems"| node_gems
node_level -->|"emits effects"| node_particles
node_game -->|"initializes"| node_settings
node_game -->|"initializes"| node_particles
node_game -->|"sets culture"| node_localization
node_settings -->|"loads and saves"| node_storage
node_settings -.->|"manages"| node_settings_data
node_editor_entry -->|"creates"| node_editor_ui
node_editor_entry -->|"uses"| node_editor_events
node_editor_entry -->|"uses"| node_editor_save
node_editor_events -->|"rebuilds UI"| node_editor_ui
node_editor_ui -.->|"composes editor UI"| node_editor_palette

click node_player "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Player.cs"
click node_level "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Level.cs"
click node_tiles "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Tile.cs"
click node_enemy "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Enemy.cs"
click node_gems "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Gem.cs"
click node_screens "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/ScreenManagers/ScreenManager.cs"
click node_game_screen "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/GameScreen.cs"
click node_main_menu "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/MainMenuScreen.cs"
click node_gameplay "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/GameplayScreen.cs"
click node_settings_screen "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/SettingsScreen.cs"
click node_pause_screen "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/PauseScreen.cs"
click node_input "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Inputs/InputState.cs"
click node_game "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/GhostEngineGame.cs"
click node_particles "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Effects/ParticleManager.cs"
click node_settings "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Settings/SettingsManager.cs"
click node_settings_data "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Settings/GhostEngineSettings.cs"
click node_storage "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Settings/BaseSettingsStorage.cs"
click node_leaderboard "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Settings/GhostEngineLeaderboard.cs"
click node_localization "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Localization/LocalizationManager.cs"
click node_editor_entry "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/LevelEditor.cs"
click node_editor_ui "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/UIManager.cs"
click node_editor_events "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/Settings/ButtonsEventsSettings.cs"
click node_editor_palette "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/UI/PaletteList.cs"
click node_editor_save "https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/Config/SaveLoadConfig.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_screens,node_game_screen,node_main_menu,node_gameplay,node_settings_screen,node_pause_screen,node_input,node_game toneBlue
class node_player,node_level,node_tiles,node_enemy,node_gems toneAmber
class node_particles,node_settings,node_settings_data,node_storage,node_leaderboard,node_localization toneMint
class node_editor_entry,node_editor_ui,node_editor_events,node_editor_palette,node_editor_save toneRose
class node_user toneIndigo
```

## Components

### Game runtime

- [Screen manager](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/ScreenManagers/ScreenManager.cs): `GhostEngine.Core/ScreenManagers/ScreenManager.cs`
- [Screen lifecycle](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/GameScreen.cs): `GhostEngine.Core/Screens/GameScreen.cs`
- [Main menu](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/MainMenuScreen.cs): `GhostEngine.Core/Screens/MainMenuScreen.cs`
- [Gameplay screen](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/GameplayScreen.cs): `GhostEngine.Core/Screens/GameplayScreen.cs`
- [Settings screen](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/SettingsScreen.cs): `GhostEngine.Core/Screens/SettingsScreen.cs`
- [Pause screen](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Screens/PauseScreen.cs): `GhostEngine.Core/Screens/PauseScreen.cs`
- [Input state](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Inputs/InputState.cs): `GhostEngine.Core/Inputs/InputState.cs`
- [Game bootstrap](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/GhostEngineGame.cs): `GhostEngine.Core/GhostEngineGame.cs`

### Game world

- [Player](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Player.cs): `GhostEngine.Core/Game/Player.cs`
- [Level](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Level.cs): `GhostEngine.Core/Game/Level.cs`
- [Tiles and collisions](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Tile.cs): `GhostEngine.Core/Game/Tile.cs`
- [Enemies](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Enemy.cs): `GhostEngine.Core/Game/Enemy.cs`
- [Gems](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Game/Gem.cs): `GhostEngine.Core/Game/Gem.cs`

### Game services

- [Particle effects](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Effects/ParticleManager.cs): `GhostEngine.Core/Effects/ParticleManager.cs`
- [Settings manager](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Settings/SettingsManager.cs): `GhostEngine.Core/Settings/SettingsManager.cs`
- [Game settings](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Settings/GhostEngineSettings.cs): `GhostEngine.Core/Settings/GhostEngineSettings.cs`
- [JSON settings storage](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Settings/BaseSettingsStorage.cs): `GhostEngine.Core/Settings/BaseSettingsStorage.cs`
- [Leaderboard](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Settings/GhostEngineLeaderboard.cs): `GhostEngine.Core/Settings/GhostEngineLeaderboard.cs`
- [Localization](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.Core/Localization/LocalizationManager.cs): `GhostEngine.Core/Localization/LocalizationManager.cs`

### Desktop editor

- [Editor](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/LevelEditor.cs): `GhostEngine.DesktopGL/Editor/LevelEditor.cs`
- [Editor UI](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/UIManager.cs): `GhostEngine.DesktopGL/Editor/UIManager.cs`
- [Editor settings and events](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/Settings/ButtonsEventsSettings.cs): `GhostEngine.DesktopGL/Editor/Settings/ButtonsEventsSettings.cs`
- [Tile palette](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/UI/PaletteList.cs): `GhostEngine.DesktopGL/Editor/UI/PaletteList.cs`
- [Level save/load](https://github.com/rhineland905/ghostengine/blob/main/GhostEngine.DesktopGL/Editor/Config/SaveLoadConfig.cs): `GhostEngine.DesktopGL/Editor/Config/SaveLoadConfig.cs`

### Other components

- **Player**

## Connections

- Player → Main menu: starts at
- Game bootstrap → Screen manager: creates (evidence: `GhostEngine.Core/GhostEngineGame.cs`)
- Game bootstrap → Main menu: adds initial screen (evidence: `GhostEngine.Core/GhostEngineGame.cs`)
- Screen manager → Input state: updates (evidence: `GhostEngine.Core/ScreenManagers/ScreenManager.cs`)
- Screen manager → Screen lifecycle: manages screens (evidence: `GhostEngine.Core/ScreenManagers/ScreenManager.cs`)
- Main menu → Gameplay screen: starts gameplay (evidence: `GhostEngine.Core/Screens/MainMenuScreen.cs`)
- Main menu → Settings screen: opens settings (evidence: `GhostEngine.Core/Screens/MainMenuScreen.cs`)
- Gameplay screen → Level: creates and updates (evidence: `GhostEngine.Core/Screens/GameplayScreen.cs`)
- Gameplay screen → Pause screen: opens pause (evidence: `GhostEngine.Core/Screens/GameplayScreen.cs`)
- Gameplay screen → Leaderboard: updates results (evidence: `GhostEngine.Core/Screens/GameplayScreen.cs`)
- Level → Player: owns world player (evidence: `GhostEngine.Core/Game/Level.cs`)
- Level → Tiles and collisions: loads and checks (evidence: `GhostEngine.Core/Game/Level.cs`)
- Level → Enemies: updates enemies (evidence: `GhostEngine.Core/Game/Level.cs`)
- Level → Gems: updates gems (evidence: `GhostEngine.Core/Game/Level.cs`)
- Level → Particle effects: emits effects (evidence: `GhostEngine.Core/Game/Level.cs`)
- Game bootstrap → Settings manager: initializes (evidence: `GhostEngine.Core/GhostEngineGame.cs`)
- Game bootstrap → Particle effects: initializes (evidence: `GhostEngine.Core/GhostEngineGame.cs`)
- Game bootstrap → Localization: sets culture (evidence: `GhostEngine.Core/GhostEngineGame.cs`)
- Settings manager → JSON settings storage: loads and saves (evidence: `GhostEngine.Core/Settings/SettingsManager.cs`)
- Settings manager → Game settings: manages
- Editor → Editor UI: creates (evidence: `GhostEngine.DesktopGL/Editor/LevelEditor.cs`)
- Editor → Editor settings and events: uses (evidence: `GhostEngine.DesktopGL/Editor/LevelEditor.cs`)
- Editor → Level save/load: uses (evidence: `GhostEngine.DesktopGL/Editor/LevelEditor.cs`)
- Editor settings and events → Editor UI: rebuilds UI (evidence: `GhostEngine.DesktopGL/Editor/Settings/ButtonsEventsSettings.cs`)
- Editor UI → Tile palette: composes editor UI
