# jung-ji-min/basegames architecture

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

- Interactive diagram: https://gitdiagram.com/jung-ji-min/basegames
- Repository: https://github.com/jung-ji-min/basegames

## Overview

BaseGames is a single-player 2D survival-and-choice game prototype. The player moves through deterministic terrain, finds objects, chooses actions that change resources and personal attributes, and reviews a journal of recorded events. The main loop handles input and timing; World owns simulation, interaction, and drawing, while Renderer batches the graphics. Persistence, combat, and AI dialogue are explicitly not implemented. The map follows the shown calls; terrain generation and drawing are grouped from World.cpp, and no unsampled shader-loading links are asserted.

Main entry points: [`SimpleGame/SimpleGame.cpp`](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/SimpleGame.cpp) (Game Loop), [`SimpleGame/Renderer.cpp`](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/Renderer.cpp) (Renderer), [`SimpleGame/World.cpp`](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/World.cpp) (Movement & Camera), [`SimpleGame/WorldInteraction.cpp`](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/WorldInteraction.cpp) (Object Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_app["Game Loop<br/>[SimpleGame.cpp]"]
  node_framework["Window Framework<br/>[freeglut.h]"]
end

subgraph group_world["World Simulation"]
  node_terrain["Terrain &amp; Chunks<br/>[World.cpp]"]
  node_movement["Movement &amp; Camera<br/>[World.cpp]"]
end

subgraph group_play["Player Experience"]
  node_interaction["Object Actions"]
  node_state["Player State<br/>[PlayerState.h]"]
  node_journal["Life Journal"]
end

subgraph group_graphics["Graphics"]
  node_worlddraw["World Drawing<br/>[World.cpp]"]
  node_ui["Game UI"]
  node_renderer["Renderer<br/>[Renderer.cpp]"]
  node_shaders["GL Shaders"]
end

node_player(("Player"))

node_player -->|"provides input"| node_app
node_app -->|"registers callbacks"| node_framework
node_app -->|"updates"| node_movement
node_app -->|"dispatches actions"| node_interaction
node_app -->|"requests drawing"| node_worlddraw
node_app -->|"manages frames"| node_renderer
node_movement -->|"loads nearby chunks"| node_terrain
node_movement -->|"updates stamina"| node_state
node_interaction -->|"updates attributes"| node_state
node_interaction -->|"records choices"| node_journal
node_worlddraw -->|"draws world"| node_renderer
node_worlddraw -->|"draws interface"| node_ui
node_ui -->|"draws panels"| node_renderer
node_renderer -.-> node_shaders

click node_app "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/SimpleGame.cpp"
click node_framework "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/Dependencies/freeglut.h"
click node_terrain "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/World.cpp"
click node_movement "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/World.cpp"
click node_interaction "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/WorldInteraction.cpp"
click node_state "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/PlayerState.h"
click node_journal "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/WorldInteraction.cpp"
click node_worlddraw "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/World.cpp"
click node_ui "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/WorldInteraction.cpp"
click node_renderer "https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/Renderer.cpp"
click node_shaders "https://github.com/jung-ji-min/basegames/tree/main/SimpleGame/Shaders"

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_app,node_framework toneBlue
class node_terrain,node_movement toneAmber
class node_interaction,node_state,node_journal toneMint
class node_worlddraw,node_ui,node_renderer,node_shaders toneRose
class node_player toneIndigo
```

## Components

### Game Runtime

- [Game Loop](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/SimpleGame.cpp): `SimpleGame/SimpleGame.cpp`
- [Window Framework](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/Dependencies/freeglut.h): `SimpleGame/Dependencies/freeglut.h`

### World Simulation

- [Terrain & Chunks](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/World.cpp): `SimpleGame/World.cpp`
- [Movement & Camera](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/World.cpp): `SimpleGame/World.cpp`

### Player Experience

- [Object Actions](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/WorldInteraction.cpp): `SimpleGame/WorldInteraction.cpp`
- [Player State](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/PlayerState.h): `SimpleGame/PlayerState.h`
- [Life Journal](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/WorldInteraction.cpp): `SimpleGame/WorldInteraction.cpp`

### Graphics

- [World Drawing](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/World.cpp): `SimpleGame/World.cpp`
- [Game UI](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/WorldInteraction.cpp): `SimpleGame/WorldInteraction.cpp`
- [Renderer](https://github.com/jung-ji-min/basegames/blob/main/SimpleGame/Renderer.cpp): `SimpleGame/Renderer.cpp`
- [GL Shaders](https://github.com/jung-ji-min/basegames/tree/main/SimpleGame/Shaders): `SimpleGame/Shaders`

### Other components

- **Player**

## Connections

- Player → Game Loop: provides input (evidence: `SimpleGame/SimpleGame.cpp`)
- Game Loop → Window Framework: registers callbacks (evidence: `SimpleGame/SimpleGame.cpp`)
- Game Loop → Movement & Camera: updates (evidence: `SimpleGame/SimpleGame.cpp`)
- Game Loop → Object Actions: dispatches actions (evidence: `SimpleGame/SimpleGame.cpp`)
- Game Loop → World Drawing: requests drawing (evidence: `SimpleGame/SimpleGame.cpp`)
- Game Loop → Renderer: manages frames (evidence: `SimpleGame/SimpleGame.cpp`)
- Movement & Camera → Terrain & Chunks: loads nearby chunks (evidence: `SimpleGame/World.cpp`)
- Movement & Camera → Player State: updates stamina (evidence: `SimpleGame/World.cpp`)
- Object Actions → Player State: updates attributes (evidence: `SimpleGame/WorldInteraction.cpp`)
- Object Actions → Life Journal: records choices (evidence: `SimpleGame/WorldInteraction.cpp`)
- World Drawing → Renderer: draws world (evidence: `SimpleGame/World.cpp`)
- World Drawing → Game UI: draws interface (evidence: `SimpleGame/World.cpp`)
- Game UI → Renderer: draws panels (evidence: `SimpleGame/WorldInteraction.cpp`)
- Renderer → GL Shaders
