# emnlfrnds/mar-abaixo-quest architecture

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

- Interactive diagram: https://gitdiagram.com/emnlfrnds/mar-abaixo-quest
- Repository: https://github.com/emnlfrnds/mar-abaixo-quest

## Overview

Mar Abaixo Quest is a terminal-based Seaquest-style game written in C. The user starts the game, steers a submarine, and fires; the main loop updates play and the game presents ASCII graphics, rescue and survival gameplay, and sound effects. The sampled source is partial and the game is concentrated in one file, so components represent responsibilities within that file rather than separate modules. The README documents Windows terminal support and controls; unsampled gameplay wiring is not inferred.

Main entry points: [`main.c`](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c) (World simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_player["Player controls<br/>[main.c]"]
  node_loop["Game loop<br/>[main.c]"]
  node_world["World simulation<br/>[main.c]"]
  node_entities["Entities and spawns<br/>[main.c]"]
  node_rescue["Rescue and collisions<br/>[main.c]"]
  node_game_states["Game states<br/>[main.c]"]
end

subgraph group_presentation["Game presentation"]
  node_screen["ASCII rendering<br/>[main.c]"]
  node_sound["Sound effects<br/>[main.c]"]
end

subgraph group_platform["Platform services"]
  node_console["Windows console"]
  node_audio_service["Windows audio"]
end

node_user(("Player"))

node_user -->|"controls"| node_player
node_loop -->|"updates"| node_world
node_loop -.->|"renders"| node_screen
node_world -.->|"moves"| node_player
node_world -.->|"updates"| node_entities
node_world -.->|"checks"| node_rescue
node_world -.->|"changes"| node_game_states
node_screen -->|"writes"| node_console
node_sound -->|"plays"| node_audio_service

click node_player "https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c"
click node_loop "https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c"
click node_world "https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c"
click node_entities "https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c"
click node_rescue "https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c"
click node_game_states "https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c"
click node_screen "https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c"
click node_sound "https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.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_player,node_loop,node_world,node_entities,node_rescue,node_game_states toneBlue
class node_screen,node_sound toneAmber
class node_console,node_audio_service toneMint
class node_user toneIndigo
```

## Components

### Game runtime

- [Player controls](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c): `main.c`
- [Game loop](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c): `main.c`
- [World simulation](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c): `main.c`
- [Entities and spawns](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c): `main.c`
- [Rescue and collisions](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c): `main.c`
- [Game states](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c): `main.c`

### Game presentation

- [ASCII rendering](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c): `main.c`
- [Sound effects](https://github.com/emnlfrnds/mar-abaixo-quest/blob/main/main.c): `main.c`

### Platform services

- **Windows console**
- **Windows audio**

### Other components

- **Player**

## Connections

- Player → Player controls: controls (evidence: `README.md`)
- Game loop → World simulation: updates (evidence: `main.c`)
- Game loop → ASCII rendering: renders (evidence: `main.c`)
- World simulation → Player controls: moves (evidence: `main.c`)
- World simulation → Entities and spawns: updates (evidence: `main.c`)
- World simulation → Rescue and collisions: checks (evidence: `main.c`)
- World simulation → Game states: changes (evidence: `main.c`)
- ASCII rendering → Windows console: writes (evidence: `main.c`)
- Sound effects → Windows audio: plays (evidence: `main.c`)
