# kolasak/jakir architecture

> Architecture diagram of the GitHub repository kolasak/jakir, 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/kolasak/jakir
- Repository: https://github.com/kolasak/jakir

## Overview

JAKIR is a pygame roguelike. Its visible runtime starts by loading a map and questions, then displays the world and accepts keyboard movement; movement can trigger field or token interactions, including battles, chests, and dialogue. The graph includes the documented-by-code game domains and UI layers. The README provides no feature details, and unsampled modules are represented only where the tree or SOURCE INDEX supports them; some subsystem links are therefore omitted.

Main entry points: [`fields/Field.py`](https://github.com/kolasak/jakir/blob/master/fields/Field.py) (Map fields), [`configuration.py`](https://github.com/kolasak/jakir/blob/master/configuration.py) (Game configuration), [`tokens/Token.py`](https://github.com/kolasak/jakir/blob/master/tokens/Token.py) (World tokens), [`character/CharacterController.py`](https://github.com/kolasak/jakir/blob/master/character/CharacterController.py) (Movement and inventory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_world["World and map"]
  node_configuration["Game configuration<br/>[configuration.py]"]
  node_map_generation["Map generation<br/>[MapGenerator.py]"]
  node_fields["Map fields<br/>[Field.py]"]
  node_terrain_fields["Terrain types"]
  node_tokens["World tokens<br/>[Token.py]"]
end

subgraph group_player["Player and items"]
  node_character["Character state<br/>[CharacterInfo.py]"]
  node_movement["Movement and inventory"]
  node_items["Items and keys"]
end

subgraph group_encounters["Encounters and questions"]
  node_monsters["Monster encounters<br/>[MonsterToken.py]"]
  node_chests["Chest encounters<br/>[ChestToken.py]"]
  node_npcs["NPC dialogue<br/>[NpcToken.py]"]
  node_battle["Battle controller"]
  node_chest_controller["Chest controller<br/>[ChestController.py]"]
  node_dialog_controller["Dialogue controller"]
  node_questions["Question data<br/>[Question.py]"]
  node_question_bank["Question collection"]
end

subgraph group_presentation["Rendering and input"]
  node_game_entry["Game entry<br/>[main.py]"]
  node_screen["Game screen<br/>[Screen.py]"]
  node_character_view["Character view"]
  node_battle_view["Battle view<br/>[BattleView.py]"]
  node_chest_view["Chest view<br/>[ChestView.py]"]
  node_dialog_view["Dialogue view<br/>[DialogView.py]"]
  node_question_view["Question view<br/>[QuestionView.py]"]
  node_text_rendering["Text rendering<br/>[TextUtil.py]"]
end

node_player_actor(("Player"))

node_player_actor -->|"starts game"| node_game_entry
node_game_entry -->|"loads map and questions"| node_configuration
node_game_entry -->|"creates screen"| node_screen
node_game_entry -->|"creates character"| node_character
node_configuration -->|"configures fields"| node_fields
node_configuration -->|"loads questions"| node_questions
node_configuration -->|"loads question collection"| node_question_bank
node_configuration -->|"configures tokens"| node_tokens
node_map_generation -->|"creates fields"| node_fields
node_terrain_fields -->|"extends field"| node_fields
node_screen -->|"dispatches key input"| node_movement
node_movement -->|"checks and interacts"| node_fields
node_movement -->|"updates display"| node_character_view
node_movement -->|"manages inventory"| node_items
node_fields -->|"invokes interaction"| node_tokens
node_tokens -->|"specializes token"| node_monsters
node_tokens -->|"specializes token"| node_chests
node_tokens -->|"specializes token"| node_npcs
node_monsters -->|"starts battle"| node_battle
node_chests -->|"starts chest interaction"| node_chest_controller
node_npcs -->|"starts dialogue"| node_dialog_controller
node_battle -->|"displays battle"| node_battle_view
node_battle -->|"creates question view"| node_question_view
node_chest_controller -->|"displays chest"| node_chest_view
node_chest_controller -->|"asks question"| node_question_view
node_dialog_controller -->|"uses dialogue view"| node_dialog_view
node_question_view -->|"displays question data"| node_questions
node_question_view -->|"renders text"| node_text_rendering
node_screen -->|"draws map"| node_fields

click node_game_entry "https://github.com/kolasak/jakir/blob/master/main.py"
click node_configuration "https://github.com/kolasak/jakir/blob/master/configuration.py"
click node_map_generation "https://github.com/kolasak/jakir/blob/master/map_generator/MapGenerator.py"
click node_fields "https://github.com/kolasak/jakir/blob/master/fields/Field.py"
click node_terrain_fields "https://github.com/kolasak/jakir/tree/master/fields"
click node_character "https://github.com/kolasak/jakir/blob/master/character/CharacterInfo.py"
click node_movement "https://github.com/kolasak/jakir/blob/master/character/CharacterController.py"
click node_items "https://github.com/kolasak/jakir/tree/master/character/items"
click node_tokens "https://github.com/kolasak/jakir/blob/master/tokens/Token.py"
click node_monsters "https://github.com/kolasak/jakir/blob/master/tokens/MonsterToken.py"
click node_chests "https://github.com/kolasak/jakir/blob/master/tokens/ChestToken.py"
click node_npcs "https://github.com/kolasak/jakir/blob/master/tokens/NpcToken.py"
click node_battle "https://github.com/kolasak/jakir/blob/master/controllers/BattleController.py"
click node_chest_controller "https://github.com/kolasak/jakir/blob/master/controllers/ChestController.py"
click node_dialog_controller "https://github.com/kolasak/jakir/blob/master/controllers/DialogController.py"
click node_questions "https://github.com/kolasak/jakir/blob/master/gameplay/Question.py"
click node_question_bank "https://github.com/kolasak/jakir/blob/master/gameplay/QuestionContainer.py"
click node_screen "https://github.com/kolasak/jakir/blob/master/graphics/Screen.py"
click node_character_view "https://github.com/kolasak/jakir/blob/master/graphics/views/CharacterInfoView.py"
click node_battle_view "https://github.com/kolasak/jakir/blob/master/graphics/views/BattleView.py"
click node_chest_view "https://github.com/kolasak/jakir/blob/master/graphics/views/ChestView.py"
click node_dialog_view "https://github.com/kolasak/jakir/blob/master/graphics/views/DialogView.py"
click node_question_view "https://github.com/kolasak/jakir/blob/master/graphics/views/QuestionView.py"
click node_text_rendering "https://github.com/kolasak/jakir/blob/master/graphics/TextUtil.py"

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_configuration,node_map_generation,node_fields,node_terrain_fields,node_tokens toneBlue
class node_character,node_movement,node_items toneAmber
class node_monsters,node_chests,node_npcs,node_battle,node_chest_controller,node_dialog_controller,node_questions,node_question_bank toneMint
class node_game_entry,node_screen,node_character_view,node_battle_view,node_chest_view,node_dialog_view,node_question_view,node_text_rendering toneRose
class node_player_actor toneIndigo
```

## Components

### World and map

- [Game configuration](https://github.com/kolasak/jakir/blob/master/configuration.py): `configuration.py`
- [Map generation](https://github.com/kolasak/jakir/blob/master/map_generator/MapGenerator.py): `map_generator/MapGenerator.py`
- [Map fields](https://github.com/kolasak/jakir/blob/master/fields/Field.py): `fields/Field.py`
- [Terrain types](https://github.com/kolasak/jakir/tree/master/fields): `fields`
- [World tokens](https://github.com/kolasak/jakir/blob/master/tokens/Token.py): `tokens/Token.py`

### Player and items

- [Character state](https://github.com/kolasak/jakir/blob/master/character/CharacterInfo.py): `character/CharacterInfo.py`
- [Movement and inventory](https://github.com/kolasak/jakir/blob/master/character/CharacterController.py): `character/CharacterController.py`
- [Items and keys](https://github.com/kolasak/jakir/tree/master/character/items): `character/items`

### Encounters and questions

- [Monster encounters](https://github.com/kolasak/jakir/blob/master/tokens/MonsterToken.py): `tokens/MonsterToken.py`
- [Chest encounters](https://github.com/kolasak/jakir/blob/master/tokens/ChestToken.py): `tokens/ChestToken.py`
- [NPC dialogue](https://github.com/kolasak/jakir/blob/master/tokens/NpcToken.py): `tokens/NpcToken.py`
- [Battle controller](https://github.com/kolasak/jakir/blob/master/controllers/BattleController.py): `controllers/BattleController.py`
- [Chest controller](https://github.com/kolasak/jakir/blob/master/controllers/ChestController.py): `controllers/ChestController.py`
- [Dialogue controller](https://github.com/kolasak/jakir/blob/master/controllers/DialogController.py): `controllers/DialogController.py`
- [Question data](https://github.com/kolasak/jakir/blob/master/gameplay/Question.py): `gameplay/Question.py`
- [Question collection](https://github.com/kolasak/jakir/blob/master/gameplay/QuestionContainer.py): `gameplay/QuestionContainer.py`

### Rendering and input

- [Game entry](https://github.com/kolasak/jakir/blob/master/main.py): `main.py`
- [Game screen](https://github.com/kolasak/jakir/blob/master/graphics/Screen.py): `graphics/Screen.py`
- [Character view](https://github.com/kolasak/jakir/blob/master/graphics/views/CharacterInfoView.py): `graphics/views/CharacterInfoView.py`
- [Battle view](https://github.com/kolasak/jakir/blob/master/graphics/views/BattleView.py): `graphics/views/BattleView.py`
- [Chest view](https://github.com/kolasak/jakir/blob/master/graphics/views/ChestView.py): `graphics/views/ChestView.py`
- [Dialogue view](https://github.com/kolasak/jakir/blob/master/graphics/views/DialogView.py): `graphics/views/DialogView.py`
- [Question view](https://github.com/kolasak/jakir/blob/master/graphics/views/QuestionView.py): `graphics/views/QuestionView.py`
- [Text rendering](https://github.com/kolasak/jakir/blob/master/graphics/TextUtil.py): `graphics/TextUtil.py`

### Other components

- **Player**

## Connections

- Player → Game entry: starts game
- Game entry → Game configuration: loads map and questions (evidence: `main.py`)
- Game entry → Game screen: creates screen (evidence: `main.py`)
- Game entry → Character state: creates character (evidence: `main.py`)
- Game configuration → Map fields: configures fields (evidence: `configuration.py`)
- Game configuration → Question data: loads questions (evidence: `configuration.py`)
- Game configuration → Question collection: loads question collection (evidence: `configuration.py`)
- Game configuration → World tokens: configures tokens (evidence: `configuration.py`)
- Map generation → Map fields: creates fields (evidence: `map_generator/MapGenerator.py`)
- Terrain types → Map fields: extends field (evidence: `fields/GateField.py`)
- Game screen → Movement and inventory: dispatches key input (evidence: `graphics/Screen.py`)
- Movement and inventory → Map fields: checks and interacts (evidence: `character/CharacterController.py`)
- Movement and inventory → Character view: updates display (evidence: `character/CharacterController.py`)
- Movement and inventory → Items and keys: manages inventory (evidence: `character/CharacterController.py`)
- Map fields → World tokens: invokes interaction (evidence: `fields/Field.py`)
- World tokens → Monster encounters: specializes token (evidence: `tokens/MonsterToken.py`)
- World tokens → Chest encounters: specializes token (evidence: `tokens/ChestToken.py`)
- World tokens → NPC dialogue: specializes token (evidence: `tokens/NpcToken.py`)
- Monster encounters → Battle controller: starts battle (evidence: `tokens/MonsterToken.py`)
- Chest encounters → Chest controller: starts chest interaction (evidence: `tokens/ChestToken.py`)
- NPC dialogue → Dialogue controller: starts dialogue (evidence: `tokens/NpcToken.py`)
- Battle controller → Battle view: displays battle (evidence: `controllers/BattleController.py`)
- Battle controller → Question view: creates question view (evidence: `controllers/BattleController.py`)
- Chest controller → Chest view: displays chest (evidence: `controllers/ChestController.py`)
- Chest controller → Question view: asks question (evidence: `controllers/ChestController.py`)
- Dialogue controller → Dialogue view: uses dialogue view (evidence: `controllers/DialogController.py`)
- Question view → Question data: displays question data (evidence: `graphics/views/QuestionView.py`)
- Question view → Text rendering: renders text (evidence: `graphics/views/QuestionView.py`)
- Game screen → Map fields: draws map (evidence: `graphics/Screen.py`)
