# kirtapsz/hamika architecture

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

- Interactive diagram: https://gitdiagram.com/kirtapsz/hamika
- Repository: https://github.com/kirtapsz/hamika

## Overview

Hamika is an Allegro-based Supaplex-inspired game with a level editor. The likely player workflow is to choose a world and blueprint, start a game, control Murphy through a simulated object-filled level, and view the rendered scene. The tree also shows editor, account, resource, and replay/validation capabilities. The graph follows documented entry points and source-index references; several subsystem internals were not sampled, so their runtime links are omitted where evidence is insufficient.

Main entry points: [`Hamika/SceneAction.h`](https://github.com/kirtapsz/hamika/blob/master/Hamika/SceneAction.h) (Scene simulation), [`Hamika/MainEvent.cpp`](https://github.com/kirtapsz/hamika/blob/master/Hamika/MainEvent.cpp) (Game menu), [`Hamika/EditorMainEvent.h`](https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorMainEvent.h) (Editor controller), [`Hamika/EditorControlPanel.cpp`](https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorControlPanel.cpp) (Editor controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and UI"]
  node_entry["Application entry<br/>[main.cpp]"]
  node_menu["Game menu<br/>[MainEvent.cpp]"]
  node_worldlist["World selection<br/>[Worlds.h]"]
  node_blueprints["Level selection<br/>[MapList.cpp]"]
end

subgraph group_game["Gameplay"]
  node_sceneaction["Scene simulation<br/>[SceneAction.h]"]
  node_keyboard["Keyboard control"]
  node_murphy["Murphy behavior<br/>[Murphy.cpp]"]
  node_objects["Level objects<br/>[Objects.cpp]"]
  node_entities["Entity behaviors"]
  node_objectmodel["Object model<br/>[Object.h]"]
  node_world["World state<br/>[World.cpp]"]
  node_renderer["Scene renderer<br/>[SceneDrawer.hpp]"]
  node_validator["Run validation<br/>[Validator.cpp]"]
end

subgraph group_editor["Level editor"]
  node_editorentry["Editor controller<br/>[EditorMainEvent.h]"]
  node_editorscene["Editor scene<br/>[EditorScene.cpp]"]
  node_editorcontrols["Editor controls"]
  node_editorworld["Editor world<br/>[EditorWorld.cpp]"]
  node_blueprint["Blueprint data<br/>[BluePrint.h]"]
  node_savelevel["Save-level dialog"]
end

subgraph group_shared["Resources and records"]
  node_accounts["Player accounts<br/>[Account.cpp]"]
  node_resources["Resource loading<br/>[Resource.h]"]
  node_bitmaps["Bitmap resources<br/>[Bitmap.cpp]"]
  node_fonts["Font resources<br/>[Font.h]"]
  node_logger["Run records<br/>[Logger.h]"]
  node_rng["Randomness records<br/>[RngController.cpp]"]
end

node_player(("Player"))

node_player -.->|"chooses level"| node_menu
node_entry -->|"starts"| node_menu
node_entry -->|"starts"| node_editorentry
node_menu -->|"uses"| node_worldlist
node_menu -->|"uses"| node_blueprints
node_menu -.->|"uses"| node_accounts
node_menu -.->|"starts play"| node_sceneaction
node_sceneaction -->|"reads input"| node_keyboard
node_sceneaction -->|"updates"| node_murphy
node_sceneaction -->|"updates"| node_objects
node_sceneaction -->|"validates"| node_validator
node_objects -->|"uses behaviors"| node_entities
node_objects -->|"uses"| node_objectmodel
node_sceneaction -->|"uses state"| node_world
node_renderer -->|"draws"| node_objectmodel
node_renderer -->|"uses"| node_bitmaps
node_editorentry -->|"uses"| node_editorscene
node_editorentry -->|"uses"| node_editorcontrols
node_editorscene -->|"references"| node_editorentry
node_editorcontrols -->|"references"| node_editorentry
node_editorcontrols -.->|"edits"| node_editorworld
node_editorcontrols -.->|"uses"| node_blueprint
node_editorentry -->|"uses"| node_savelevel
node_resources -->|"loads"| node_bitmaps
node_resources -->|"loads"| node_fonts
node_sceneaction -->|"uses"| node_rng
node_sceneaction -.->|"records"| node_logger

click node_entry "https://github.com/kirtapsz/hamika/blob/master/Hamika/main.cpp"
click node_menu "https://github.com/kirtapsz/hamika/blob/master/Hamika/MainEvent.cpp"
click node_worldlist "https://github.com/kirtapsz/hamika/blob/master/Hamika/Worlds.h"
click node_blueprints "https://github.com/kirtapsz/hamika/blob/master/Hamika/MapList.cpp"
click node_accounts "https://github.com/kirtapsz/hamika/blob/master/Hamika/Account.cpp"
click node_sceneaction "https://github.com/kirtapsz/hamika/blob/master/Hamika/SceneAction.h"
click node_keyboard "https://github.com/kirtapsz/hamika/blob/master/Hamika/KeyboardController.cpp"
click node_murphy "https://github.com/kirtapsz/hamika/blob/master/Hamika/Murphy.cpp"
click node_objects "https://github.com/kirtapsz/hamika/blob/master/Hamika/Objects.cpp"
click node_entities "https://github.com/kirtapsz/hamika/blob/master/Hamika/OriginalEntities.cpp"
click node_objectmodel "https://github.com/kirtapsz/hamika/blob/master/Hamika/Object.h"
click node_world "https://github.com/kirtapsz/hamika/blob/master/Hamika/World.cpp"
click node_renderer "https://github.com/kirtapsz/hamika/blob/master/Hamika/SceneDrawer.hpp"
click node_validator "https://github.com/kirtapsz/hamika/blob/master/Hamika/Validator.cpp"
click node_editorentry "https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorMainEvent.h"
click node_editorscene "https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorScene.cpp"
click node_editorcontrols "https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorControlPanel.cpp"
click node_editorworld "https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorWorld.cpp"
click node_blueprint "https://github.com/kirtapsz/hamika/blob/master/Hamika/BluePrint.h"
click node_savelevel "https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorSaveWorldDialog.cpp"
click node_resources "https://github.com/kirtapsz/hamika/blob/master/Hamika/Resource.h"
click node_bitmaps "https://github.com/kirtapsz/hamika/blob/master/Hamika/Bitmap.cpp"
click node_fonts "https://github.com/kirtapsz/hamika/blob/master/Hamika/Font.h"
click node_logger "https://github.com/kirtapsz/hamika/blob/master/Hamika/Logger.h"
click node_rng "https://github.com/kirtapsz/hamika/blob/master/Hamika/RngController.cpp"

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_menu,node_worldlist,node_blueprints toneBlue
class node_sceneaction,node_keyboard,node_murphy,node_objects,node_entities,node_objectmodel,node_world,node_renderer,node_validator toneAmber
class node_editorentry,node_editorscene,node_editorcontrols,node_editorworld,node_blueprint,node_savelevel toneMint
class node_accounts,node_resources,node_bitmaps,node_fonts,node_logger,node_rng toneRose
class node_player toneIndigo
```

## Components

### Application and UI

- [Application entry](https://github.com/kirtapsz/hamika/blob/master/Hamika/main.cpp): `Hamika/main.cpp`
- [Game menu](https://github.com/kirtapsz/hamika/blob/master/Hamika/MainEvent.cpp): `Hamika/MainEvent.cpp`
- [World selection](https://github.com/kirtapsz/hamika/blob/master/Hamika/Worlds.h): `Hamika/Worlds.h`
- [Level selection](https://github.com/kirtapsz/hamika/blob/master/Hamika/MapList.cpp): `Hamika/MapList.cpp`

### Gameplay

- [Scene simulation](https://github.com/kirtapsz/hamika/blob/master/Hamika/SceneAction.h): `Hamika/SceneAction.h`
- [Keyboard control](https://github.com/kirtapsz/hamika/blob/master/Hamika/KeyboardController.cpp): `Hamika/KeyboardController.cpp`
- [Murphy behavior](https://github.com/kirtapsz/hamika/blob/master/Hamika/Murphy.cpp): `Hamika/Murphy.cpp`
- [Level objects](https://github.com/kirtapsz/hamika/blob/master/Hamika/Objects.cpp): `Hamika/Objects.cpp`
- [Entity behaviors](https://github.com/kirtapsz/hamika/blob/master/Hamika/OriginalEntities.cpp): `Hamika/OriginalEntities.cpp`
- [Object model](https://github.com/kirtapsz/hamika/blob/master/Hamika/Object.h): `Hamika/Object.h`
- [World state](https://github.com/kirtapsz/hamika/blob/master/Hamika/World.cpp): `Hamika/World.cpp`
- [Scene renderer](https://github.com/kirtapsz/hamika/blob/master/Hamika/SceneDrawer.hpp): `Hamika/SceneDrawer.hpp`
- [Run validation](https://github.com/kirtapsz/hamika/blob/master/Hamika/Validator.cpp): `Hamika/Validator.cpp`

### Level editor

- [Editor controller](https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorMainEvent.h): `Hamika/EditorMainEvent.h`
- [Editor scene](https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorScene.cpp): `Hamika/EditorScene.cpp`
- [Editor controls](https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorControlPanel.cpp): `Hamika/EditorControlPanel.cpp`
- [Editor world](https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorWorld.cpp): `Hamika/EditorWorld.cpp`
- [Blueprint data](https://github.com/kirtapsz/hamika/blob/master/Hamika/BluePrint.h): `Hamika/BluePrint.h`
- [Save-level dialog](https://github.com/kirtapsz/hamika/blob/master/Hamika/EditorSaveWorldDialog.cpp): `Hamika/EditorSaveWorldDialog.cpp`

### Resources and records

- [Player accounts](https://github.com/kirtapsz/hamika/blob/master/Hamika/Account.cpp): `Hamika/Account.cpp`
- [Resource loading](https://github.com/kirtapsz/hamika/blob/master/Hamika/Resource.h): `Hamika/Resource.h`
- [Bitmap resources](https://github.com/kirtapsz/hamika/blob/master/Hamika/Bitmap.cpp): `Hamika/Bitmap.cpp`
- [Font resources](https://github.com/kirtapsz/hamika/blob/master/Hamika/Font.h): `Hamika/Font.h`
- [Run records](https://github.com/kirtapsz/hamika/blob/master/Hamika/Logger.h): `Hamika/Logger.h`
- [Randomness records](https://github.com/kirtapsz/hamika/blob/master/Hamika/RngController.cpp): `Hamika/RngController.cpp`

### Other components

- **Player**

## Connections

- Player → Game menu: chooses level
- Application entry → Game menu: starts (evidence: `Hamika/main.cpp`)
- Application entry → Editor controller: starts (evidence: `Hamika/main.cpp`)
- Game menu → World selection: uses (evidence: `Hamika/MainEvent.cpp`)
- Game menu → Level selection: uses
- Game menu → Player accounts: uses
- Game menu → Scene simulation: starts play
- Scene simulation → Keyboard control: reads input (evidence: `Hamika/SceneAction.h`)
- Scene simulation → Murphy behavior: updates (evidence: `Hamika/SceneAction.h`)
- Scene simulation → Level objects: updates (evidence: `Hamika/SceneAction.h`)
- Scene simulation → Run validation: validates (evidence: `Hamika/SceneAction.h`)
- Level objects → Entity behaviors: uses behaviors (evidence: `Hamika/Objects.cpp`)
- Level objects → Object model: uses
- Scene simulation → World state: uses state (evidence: `Hamika/SceneAction.h`)
- Scene renderer → Object model: draws (evidence: `Hamika/SceneDrawer.h`)
- Scene renderer → Bitmap resources: uses
- Editor controller → Editor scene: uses (evidence: `Hamika/EditorMainEvent.h`)
- Editor controller → Editor controls: uses (evidence: `Hamika/EditorMainEvent.h`)
- Editor scene → Editor controller: references (evidence: `Hamika/EditorScene.cpp`)
- Editor controls → Editor controller: references (evidence: `Hamika/EditorControlPanel.cpp`)
- Editor controls → Editor world: edits
- Editor controls → Blueprint data: uses
- Editor controller → Save-level dialog: uses (evidence: `Hamika/EditorMainEvent.h`)
- Resource loading → Bitmap resources: loads
- Resource loading → Font resources: loads (evidence: `Hamika/Font.h`)
- Scene simulation → Randomness records: uses (evidence: `Hamika/SceneAction.h`)
- Scene simulation → Run records: records
