# kyungjunn/pain_and_gain architecture

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

- Interactive diagram: https://gitdiagram.com/kyungjunn/pain_and_gain
- Repository: https://github.com/kyungjunn/pain_and_gain

## Overview

Pain & Gain is documented as a Unity 3D roguelike action-defense game. Its main loop is direct character control and combat, defeating enemies for experience, choosing an augment on level-up, and taking on random risk-based quests whose outcomes affect abilities and rewards. Death resets abilities, and repeated runs enable new builds. The README describes these product stages, but no gameplay source excerpts were provided, so implementation paths and internal call relationships cannot be verified; those nodes use null paths.

Main entry points: [`Assets/Input`](https://github.com/kyungjunn/pain_and_gain/tree/main/Assets/Input) (Character Control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_combat["Combat"]
  node_game["Game Session"]
  node_controls["Character Control"]
  node_combatplay["3D Combat"]
  node_enemies["Enemies"]
end

subgraph group_progression["Progression"]
  node_experience["Experience"]
  node_levelup["Level Up"]
  node_augments["Augment Choice"]
  node_build["Player Build"]
end

subgraph group_run["Run Cycle"]
  node_quests["Random Quests"]
  node_questoutcome["Quest Outcome"]
  node_abilityloss["Ability Loss"]
  node_rewards["Quest Rewards"]
  node_death["Character Death"]
  node_reset["Ability Reset"]
  node_replay["Next Run"]
end

node_player(("Player"))

node_player -->|"starts"| node_game
node_game -->|"uses WASD"| node_controls
node_game -->|"runs"| node_combatplay
node_combatplay -->|"fights"| node_enemies
node_enemies -->|"grant experience"| node_experience
node_experience -->|"enables"| node_levelup
node_levelup -->|"prompts choice"| node_augments
node_augments -->|"changes"| node_build
node_game -->|"triggers randomly"| node_quests
node_quests -->|"resolves"| node_questoutcome
node_questoutcome -->|"failure removes"| node_abilityloss
node_questoutcome -->|"success grants"| node_rewards
node_game -->|"can end in"| node_death
node_death -->|"resets abilities"| node_reset
node_reset -->|"leads to"| node_replay
node_replay -->|"repeats play"| node_game

click node_controls "https://github.com/kyungjunn/pain_and_gain/tree/main/Assets/Input"

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_game,node_controls,node_combatplay,node_enemies toneBlue
class node_experience,node_levelup,node_augments,node_build toneAmber
class node_quests,node_questoutcome,node_abilityloss,node_rewards,node_death,node_reset,node_replay toneMint
class node_player toneIndigo
```

## Components

### Combat

- **Game Session**
- [Character Control](https://github.com/kyungjunn/pain_and_gain/tree/main/Assets/Input): `Assets/Input`
- **3D Combat**
- **Enemies**

### Progression

- **Experience**
- **Level Up**
- **Augment Choice**
- **Player Build**

### Run Cycle

- **Random Quests**
- **Quest Outcome**
- **Ability Loss**
- **Quest Rewards**
- **Character Death**
- **Ability Reset**
- **Next Run**

### Other components

- **Player**

## Connections

- Player → Game Session: starts (evidence: `README.md`)
- Game Session → Character Control: uses WASD (evidence: `README.md`)
- Game Session → 3D Combat: runs (evidence: `README.md`)
- 3D Combat → Enemies: fights (evidence: `README.md`)
- Enemies → Experience: grant experience (evidence: `README.md`)
- Experience → Level Up: enables (evidence: `README.md`)
- Level Up → Augment Choice: prompts choice (evidence: `README.md`)
- Augment Choice → Player Build: changes (evidence: `README.md`)
- Game Session → Random Quests: triggers randomly (evidence: `README.md`)
- Random Quests → Quest Outcome: resolves (evidence: `README.md`)
- Quest Outcome → Ability Loss: failure removes (evidence: `README.md`)
- Quest Outcome → Quest Rewards: success grants (evidence: `README.md`)
- Game Session → Character Death: can end in (evidence: `README.md`)
- Character Death → Ability Reset: resets abilities (evidence: `README.md`)
- Ability Reset → Next Run: leads to (evidence: `README.md`)
- Next Run → Game Session: repeats play (evidence: `README.md`)
