# bromscandium/astro architecture

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

- Interactive diagram: https://gitdiagram.com/bromscandium/astro
- Repository: https://github.com/bromscandium/astro

## Overview

Astro Game is a terminal-based C game. Its principal workflow starts with loading saved settings, enters the menu, and dispatches the player to gameplay, level selection, or the shop; settings are saved during these flows and at exit. Gameplay itself includes scrolling hazards, combat, and results, while the menu and level screens expose progress. The excerpts establish the calls among these components, but omit most of game.c and do not show the result implementation, so finer gameplay internals are not expanded.

Main entry points: [`menu.c`](https://github.com/bromscandium/astro/blob/main/menu.c) (Main menu), [`main.c`](https://github.com/bromscandium/astro/blob/main/main.c) (Program entry), [`levels.c`](https://github.com/bromscandium/astro/blob/main/levels.c) (Level selection), [`game.c`](https://github.com/bromscandium/astro/blob/main/game.c) (Gameplay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entry["Program entry<br/>[main.c]"]
  node_settings[("Settings file")]
  node_menu["Main menu<br/>[menu.c]"]
  node_menudisplay["Menu display<br/>[menu.c]"]
end

subgraph group_play["Play and Progress"]
  node_game["Gameplay<br/>[game.c]"]
  node_levels["Level selection<br/>[levels.c]"]
  node_levelview["Level display<br/>[levels.c]"]
end

subgraph group_customize["Customization"]
  node_shop["Shop<br/>[shop.c]"]
  node_shopview["Shop display<br/>[shop.c]"]
end

node_player(("Player"))
node_terminal{{"Terminal"}}

node_player -->|"launches"| node_entry
node_entry -->|"loads settings"| node_settings
node_entry -->|"opens"| node_menu
node_entry -->|"saves settings"| node_settings
node_entry -->|"initializes UI"| node_terminal
node_menu -->|"renders"| node_menudisplay
node_menu -->|"starts play"| node_game
node_menu -->|"opens levels"| node_levels
node_menu -->|"opens shop"| node_shop
node_levels -->|"refreshes"| node_levelview
node_levels -->|"starts level"| node_game
node_levels -->|"saves selection"| node_settings
node_shop -->|"refreshes"| node_shopview
node_shop -->|"saves purchases"| node_settings
node_game -->|"updates progress"| node_settings
node_game -->|"reads input"| node_terminal
node_menu -->|"displays stats"| node_settings

click node_entry "https://github.com/bromscandium/astro/blob/main/main.c"
click node_menu "https://github.com/bromscandium/astro/blob/main/menu.c"
click node_game "https://github.com/bromscandium/astro/blob/main/game.c"
click node_levels "https://github.com/bromscandium/astro/blob/main/levels.c"
click node_shop "https://github.com/bromscandium/astro/blob/main/shop.c"
click node_levelview "https://github.com/bromscandium/astro/blob/main/levels.c"
click node_shopview "https://github.com/bromscandium/astro/blob/main/shop.c"
click node_menudisplay "https://github.com/bromscandium/astro/blob/main/menu.c"

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_entry,node_settings,node_menu,node_menudisplay toneBlue
class node_game,node_levels,node_levelview toneAmber
class node_shop,node_shopview toneMint
class node_player,node_terminal toneIndigo
```

## Components

### Application

- [Program entry](https://github.com/bromscandium/astro/blob/main/main.c): `main.c`
- **Settings file**
- [Main menu](https://github.com/bromscandium/astro/blob/main/menu.c): `menu.c`
- [Menu display](https://github.com/bromscandium/astro/blob/main/menu.c): `menu.c`

### Play and Progress

- [Gameplay](https://github.com/bromscandium/astro/blob/main/game.c): `game.c`
- [Level selection](https://github.com/bromscandium/astro/blob/main/levels.c): `levels.c`
- [Level display](https://github.com/bromscandium/astro/blob/main/levels.c): `levels.c`

### Customization

- [Shop](https://github.com/bromscandium/astro/blob/main/shop.c): `shop.c`
- [Shop display](https://github.com/bromscandium/astro/blob/main/shop.c): `shop.c`

### Other components

- **Player**
- **Terminal**

## Connections

- Player → Program entry: launches (evidence: `README.md`)
- Program entry → Settings file: loads settings (evidence: `main.c`)
- Program entry → Main menu: opens (evidence: `main.c`)
- Program entry → Settings file: saves settings (evidence: `main.c`)
- Program entry → Terminal: initializes UI (evidence: `main.c`)
- Main menu → Menu display: renders (evidence: `menu.c`)
- Main menu → Gameplay: starts play (evidence: `menu.c`)
- Main menu → Level selection: opens levels (evidence: `menu.c`)
- Main menu → Shop: opens shop (evidence: `menu.c`)
- Level selection → Level display: refreshes (evidence: `levels.c`)
- Level selection → Gameplay: starts level (evidence: `levels.c`)
- Level selection → Settings file: saves selection (evidence: `levels.c`)
- Shop → Shop display: refreshes (evidence: `shop.c`)
- Shop → Settings file: saves purchases (evidence: `shop.c`)
- Gameplay → Settings file: updates progress (evidence: `game.c`)
- Gameplay → Terminal: reads input (evidence: `game.c`)
- Main menu → Settings file: displays stats (evidence: `menu.c`)
