# theseusnul/galactic_standoff architecture

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

- Interactive diagram: https://gitdiagram.com/theseusnul/galactic_standoff
- Repository: https://github.com/theseusnul/galactic_standoff

## Overview

#### Purpose and Entry Point
Galactic Standoff is a native C++ ASCII/console space-combat game built as a Visual Studio solution. The executable starts in `ASCII_GAME/Main.cpp`, with project and solution definitions in `ASCII_GAME/ASCII_GAME.vcxproj` and `Galactic Standoff.sln`.

#### Game Orchestration and State Flow
`ASCII_GAME/Game/Game.cpp` and `ASCII_GAME/Game/Game.h` own the main game lifecycle: initialization, update loop, rendering, and transitions. `ASCII_GAME/Game/GameStates.h` defines the high-level modes that separate title/menu, difficulty selection, active gameplay, game-over, and winner flows. Static sprite/menu assets support those state-specific screens: `ASCII_GAME/GameTitleSprites.h`, `ASCII_GAME/DifficultySelectMenu.h`, and `ASCII_GAME/GameOverSprites.h`.

#### Core Gameplay Actors
The active combat model is centered on player, enemy, and projectile objects:
- `ASCII_GAME/Player.cpp`, `ASCII_GAME/Player.h`
- `ASCII_GAME/EnemyShip.cpp`, `ASCII_GAME/EnemyShip.h`
- `ASCII_GAME/Missile.cpp`, `ASCII_GAME/Missile.h`

Game orchestration updates actor movement/actions, resolves combat interactions, then selects sprites for the renderer. Presentation-only game objects such as score display are isolated under `ASCII_GAME/Game/GameObjects/ScoreDisplay.cpp` and `ASCII_GAME/Game/GameObjects/ScoreDisplay.h`.

#### Rendering Pipeline
The console rendering boundary is `ASCII_GAME/Core/Renderer/ASCIIRenderer.cpp` and `ASCII_GAME/Core/Renderer/ASCIIRenderer.h`. It renders text/sprite content and applies console color definitions from `ASCII_GAME/Core/Renderer/ConsoleColours.h`. Reusable visual primitives are modeled by `ASCII_GAME/Core/Renderer/Sprite.cpp` / `.h`; frame-based visual animation is handled by `ASCII_GAME/Core/Renderer/AnimatedSprite.cpp` / `.h`. Gameplay screens draw from asset headers including `ASCII_GAME/InGameSprites.h` and `ASCII_GAME/PlanetSprite.h`.

#### World and Math Foundation
Spatial state is represented by custom vector types in `ASCII_GAME/Core/Maths/Vector2.cpp` / `.h` and `ASCII_GAME/Core/Maths/Vector3.cpp` / `.h`. Background presentation is encapsulated by `ASCII_GAME/Background.cpp` and `ASCII_GAME/Background.h`. Shared low-level utilities reside in `ASCII_GAME/Core/Utils.h`.

#### Assets, Runtime, and External Boundaries
This is a Windows-oriented Visual C++ application, evidenced by the `.sln`, `.vcxproj`, and local Visual Studio metadata. Runtime output is a console/ASCII interface rather than a web service or networked system. Audio assets are external WAV files loaded or referenced by gameplay/menu behavior: `Sounds/Main_Menu_Theme.wav`, `Sounds/Player_Missile.wav`, and `Sounds/Enemy_Missile.wav`.

Main entry points: [`ASCII_GAME/Game/Game.cpp`](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Game/Game.cpp) (Game lifecycle), [`ASCII_GAME/Core/Renderer/ASCIIRenderer.cpp`](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Renderer/ASCIIRenderer.cpp) (ASCII renderer), [`ASCII_GAME/ASCII_GAME.vcxproj`](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/ASCII_GAME.vcxproj) (C++ project), [`ASCII_GAME/Main.cpp`](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Main.cpp) (Program entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build &amp; Runtime"]
  node_solution["Visual Studio solution"]
  node_project["C++ project<br/>vcxproj<br/>[ASCII_GAME.vcxproj]"]
  node_main{{"Program entry<br/>C++ entry point<br/>[Main.cpp]"}}
end

subgraph group_game["Game Control"]
  node_game["Game lifecycle<br/>orchestrator<br/>[Game.cpp]"]
  node_states["Game states<br/>state model<br/>[GameStates.h]"]
  node_screen_assets["Menu &amp; screen sprites<br/>ASCII asset headers<br/>[GameTitleSprites.h]"]
end

subgraph group_combat["Combat Model"]
  node_actors["Combat actors<br/>gameplay entities<br/>[Player.cpp]"]
  node_score["Score display<br/>presentation object<br/>[ScoreDisplay.cpp]"]
end

subgraph group_render["Console Rendering"]
  node_renderer["ASCII renderer<br/>console rendering boundary<br/>[ASCIIRenderer.cpp]"]
  node_sprites["Sprite primitives<br/>visual primitives<br/>[Sprite.cpp]"]
  node_colours["Console colours<br/>render definitions<br/>[ConsoleColours.h]"]
  node_ingame_assets["In-game sprites<br/>ASCII asset headers<br/>[InGameSprites.h]"]
end

subgraph group_foundation["World Foundation"]
  node_background["Background<br/>world presentation<br/>[Background.cpp]"]
  node_vectors["Vector math<br/>spatial primitives<br/>[Vector2.cpp]"]
end

node_audio["WAV audio assets<br/>external media"]

node_solution -->|"builds"| node_project
node_project -->|"compiles"| node_main
node_main -->|"starts"| node_game
node_game -->|"transitions through"| node_states
node_game -->|"selects screens"| node_screen_assets
node_game -->|"updates combat"| node_actors
node_game -->|"updates"| node_score
node_game -->|"updates"| node_background
node_actors -->|"uses position math"| node_vectors
node_game -->|"renders via"| node_renderer
node_renderer -->|"draws"| node_sprites
node_renderer -->|"applies"| node_colours
node_renderer -->|"draws assets"| node_ingame_assets
node_game -.->|"plays/references"| node_audio

click node_solution "https://github.com/theseusnul/galactic_standoff/blob/master/Galactic%20Standoff.sln"
click node_project "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/ASCII_GAME.vcxproj"
click node_main "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Main.cpp"
click node_game "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Game/Game.cpp"
click node_states "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Game/GameStates.h"
click node_screen_assets "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/GameTitleSprites.h"
click node_actors "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Player.cpp"
click node_score "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Game/GameObjects/ScoreDisplay.cpp"
click node_background "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Background.cpp"
click node_vectors "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Maths/Vector2.cpp"
click node_renderer "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Renderer/ASCIIRenderer.cpp"
click node_sprites "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Renderer/Sprite.cpp"
click node_colours "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Renderer/ConsoleColours.h"
click node_ingame_assets "https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/InGameSprites.h"
click node_audio "https://github.com/theseusnul/galactic_standoff/blob/master/Sounds/Main_Menu_Theme.wav"

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_solution,node_project,node_main toneBlue
class node_game,node_states,node_screen_assets toneAmber
class node_actors,node_score toneMint
class node_renderer,node_sprites,node_colours,node_ingame_assets toneRose
class node_background,node_vectors toneIndigo
class node_audio toneNeutral
```

## Components

### Build & Runtime

- [Visual Studio solution](https://github.com/theseusnul/galactic_standoff/blob/master/Galactic%20Standoff.sln): solution · Windows native C++ build entry. · `Galactic Standoff.sln`
- [C++ project](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/ASCII_GAME.vcxproj): vcxproj · `ASCII_GAME/ASCII_GAME.vcxproj`
- [Program entry](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Main.cpp): C++ entry point · `ASCII_GAME/Main.cpp`

### Game Control

- [Game lifecycle](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Game/Game.cpp): orchestrator · Initializes, updates, renders, and transitions game flow. · `ASCII_GAME/Game/Game.cpp`
- [Game states](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Game/GameStates.h): state model · Title, difficulty, gameplay, game-over, and winner modes. · `ASCII_GAME/Game/GameStates.h`
- [Menu & screen sprites](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/GameTitleSprites.h): ASCII asset headers · `ASCII_GAME/GameTitleSprites.h`

### Combat Model

- [Combat actors](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Player.cpp): gameplay entities · Player, enemy ships, and missiles. · `ASCII_GAME/Player.cpp`
- [Score display](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Game/GameObjects/ScoreDisplay.cpp): presentation object · `ASCII_GAME/Game/GameObjects/ScoreDisplay.cpp`

### Console Rendering

- [ASCII renderer](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Renderer/ASCIIRenderer.cpp): console rendering boundary · Draws text and sprites to the Windows console. · `ASCII_GAME/Core/Renderer/ASCIIRenderer.cpp`
- [Sprite primitives](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Renderer/Sprite.cpp): visual primitives · Static and frame-based animated sprites. · `ASCII_GAME/Core/Renderer/Sprite.cpp`
- [Console colours](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Renderer/ConsoleColours.h): render definitions · `ASCII_GAME/Core/Renderer/ConsoleColours.h`
- [In-game sprites](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/InGameSprites.h): ASCII asset headers · `ASCII_GAME/InGameSprites.h`

### World Foundation

- [Background](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Background.cpp): world presentation · `ASCII_GAME/Background.cpp`
- [Vector math](https://github.com/theseusnul/galactic_standoff/blob/master/ASCII_GAME/Core/Maths/Vector2.cpp): spatial primitives · Custom 2D and 3D spatial types. · `ASCII_GAME/Core/Maths/Vector2.cpp`

### Other components

- [WAV audio assets](https://github.com/theseusnul/galactic_standoff/blob/master/Sounds/Main_Menu_Theme.wav): external media · Menu and missile sound effects. · `Sounds/Main_Menu_Theme.wav`

## Connections

- Visual Studio solution → C++ project: builds
- C++ project → Program entry: compiles
- Program entry → Game lifecycle: starts
- Game lifecycle → Game states: transitions through
- Game lifecycle → Menu & screen sprites: selects screens
- Game lifecycle → Combat actors: updates combat
- Game lifecycle → Score display: updates
- Game lifecycle → Background: updates
- Combat actors → Vector math: uses position math
- Game lifecycle → ASCII renderer: renders via
- ASCII renderer → Sprite primitives: draws
- ASCII renderer → Console colours: applies
- ASCII renderer → In-game sprites: draws assets
- Game lifecycle → WAV audio assets: plays/references
