# zulfiqarrrr/the-last-exit-master architecture

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

- Interactive diagram: https://gitdiagram.com/zulfiqarrrr/the-last-exit-master
- Repository: https://github.com/zulfiqarrrr/the-last-exit-master

## Overview

THE LAST EXIT is a browser-based first-person survival-horror game. The player starts from the site’s Play action, enters the game controller, explores a selected environment, evades a stalking creature, finds keys, and uses the exit; HUD, map, CCTV, audio, and touch controls support that loop. The graph also preserves the documented alternate environments and monster viewer. Sampled excerpts and the source index support the main wiring; unsampled subsystems are included where documented, with uncertain links omitted.

Main entry points: [`src/game/game.js`](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/game.js) (Game Controller), [`src/main.js`](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/main.js) (App Bootstrap), [`src/game/level.js`](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/level.js) (Level Builder), [`src/game/creatures/factory.js`](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/creatures/factory.js) (Creature Factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and Controls"]
  node_input["Input Binding<br/>[input.js]"]
  node_touch["Touch Controls<br/>[touch.js]"]
  node_site["Site Play UI<br/>[site.js]"]
  node_bootstrap["App Bootstrap<br/>[main.js]"]
  node_game["Game Controller<br/>[game.js]"]
end

subgraph group_world["World and Navigation"]
  node_level["Level Builder<br/>[level.js]"]
  node_maps["Environment Maps"]
  node_props["World Props<br/>[props.js]"]
end

subgraph group_survival["Survival Systems"]
  node_player["Player<br/>[player.js]"]
  node_interactions["Interactions<br/>[interactions.js]"]
  node_lumen["Lumen System<br/>[lumen.js]"]
  node_lumenkey["Lumen Key<br/>[lumen-key.js]"]
end

subgraph group_presentation["Game Presentation"]
  node_mapview["Facility Map<br/>[map.js]"]
  node_mapselect["Map Selection<br/>[map-select-ui.js]"]
  node_cctv["CCTV Console<br/>[cctv.js]"]
  node_hud["HUD<br/>[hud.js]"]
  node_audio["Audio Engine<br/>[audio.js]"]
end

subgraph group_creatures["Creature Systems"]
  node_enemy["Creature AI<br/>[enemy.js]"]
  node_factory["Creature Factory<br/>[factory.js]"]
  node_warden["Warden Model<br/>[warden-model.js]"]
  node_crawler["Crawler Model<br/>[crawler-model.js]"]
  node_archivist["Archivist Model<br/>[archivist-model.js]"]
  node_inspector["Monster Viewer"]
end

node_visitor(("Player"))

node_visitor -->|"presses Play"| node_site
node_site -->|"starts game"| node_bootstrap
node_bootstrap -->|"creates"| node_game
node_bootstrap -->|"loads model"| node_warden
node_bootstrap -->|"loads model"| node_crawler
node_bootstrap -->|"loads model"| node_archivist
node_bootstrap -->|"imports HUD"| node_hud
node_bootstrap -->|"imports audio"| node_audio
node_bootstrap -->|"imports selector"| node_mapselect
node_bootstrap -->|"opens viewer"| node_inspector
node_game -->|"routes input"| node_input
node_game -->|"routes touch"| node_touch
node_game -->|"controls"| node_player
node_game -->|"builds level"| node_level
node_game -->|"updates creature"| node_enemy
node_game -->|"routes actions"| node_interactions
node_game -->|"updates light"| node_lumen
node_game -->|"spawns key"| node_lumenkey
node_game -->|"updates map"| node_mapview
node_game -->|"updates CCTV"| node_cctv
node_level -->|"uses layouts"| node_maps
node_level -->|"builds props"| node_props
node_enemy -->|"queries navigation"| node_level
node_enemy -->|"creates creature"| node_factory
node_factory -->|"uses model"| node_warden
node_factory -->|"uses model"| node_crawler
node_factory -->|"uses model"| node_archivist
node_cctv -->|"reads scene"| node_level
node_visitor -->|"provides controls"| node_input
node_visitor -->|"uses mobile controls"| node_touch
node_game -.->|"updates display"| node_hud
node_game -.->|"plays effects"| node_audio
node_mapselect -.->|"selects environment"| node_maps
node_inspector -->|"views model"| node_warden
node_inspector -->|"views model"| node_crawler
node_inspector -->|"views model"| node_archivist

click node_player "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/player.js"
click node_input "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/input.js"
click node_touch "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/touch.js"
click node_site "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/site/site.js"
click node_bootstrap "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/main.js"
click node_game "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/game.js"
click node_level "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/level.js"
click node_maps "https://github.com/zulfiqarrrr/the-last-exit-master/tree/main/src/game/maps"
click node_mapview "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/map.js"
click node_mapselect "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/map-select-ui.js"
click node_props "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/props.js"
click node_enemy "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/enemy.js"
click node_factory "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/creatures/factory.js"
click node_warden "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/warden-model.js"
click node_crawler "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/creatures/crawler-model.js"
click node_archivist "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/creatures/archivist-model.js"
click node_inspector "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/monster-inspector.js"
click node_cctv "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/cctv.js"
click node_interactions "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/interactions.js"
click node_lumen "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/lumen.js"
click node_lumenkey "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/lumen-key.js"
click node_hud "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/hud.js"
click node_audio "https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/audio.js"

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_input,node_touch,node_site,node_bootstrap,node_game toneBlue
class node_level,node_maps,node_props toneAmber
class node_player,node_interactions,node_lumen,node_lumenkey toneMint
class node_mapview,node_mapselect,node_cctv,node_hud,node_audio toneRose
class node_enemy,node_factory,node_warden,node_crawler,node_archivist,node_inspector,node_visitor toneIndigo
```

## Components

### Entry and Controls

- [Input Binding](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/input.js): `src/game/input.js`
- [Touch Controls](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/touch.js): `src/game/touch.js`
- [Site Play UI](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/site/site.js): `src/site/site.js`
- [App Bootstrap](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/main.js): `src/main.js`
- [Game Controller](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/game.js): `src/game/game.js`

### World and Navigation

- [Level Builder](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/level.js): `src/game/level.js`
- [Environment Maps](https://github.com/zulfiqarrrr/the-last-exit-master/tree/main/src/game/maps): `src/game/maps`
- [World Props](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/props.js): `src/game/props.js`

### Survival Systems

- [Player](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/player.js): `src/game/player.js`
- [Interactions](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/interactions.js): `src/game/interactions.js`
- [Lumen System](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/lumen.js): `src/game/lumen.js`
- [Lumen Key](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/lumen-key.js): `src/game/lumen-key.js`

### Game Presentation

- [Facility Map](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/map.js): `src/game/map.js`
- [Map Selection](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/map-select-ui.js): `src/game/map-select-ui.js`
- [CCTV Console](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/cctv.js): `src/game/cctv.js`
- [HUD](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/hud.js): `src/game/hud.js`
- [Audio Engine](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/audio.js): `src/game/audio.js`

### Creature Systems

- [Creature AI](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/enemy.js): `src/game/enemy.js`
- [Creature Factory](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/creatures/factory.js): `src/game/creatures/factory.js`
- [Warden Model](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/warden-model.js): `src/game/warden-model.js`
- [Crawler Model](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/creatures/crawler-model.js): `src/game/creatures/crawler-model.js`
- [Archivist Model](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/creatures/archivist-model.js): `src/game/creatures/archivist-model.js`
- [Monster Viewer](https://github.com/zulfiqarrrr/the-last-exit-master/blob/main/src/game/monster-inspector.js): `src/game/monster-inspector.js`

### Other components

- **Player**

## Connections

- Player → Site Play UI: presses Play (evidence: `README.md`)
- Site Play UI → App Bootstrap: starts game (evidence: `src/site/site.js`)
- App Bootstrap → Game Controller: creates (evidence: `src/main.js`)
- App Bootstrap → Warden Model: loads model (evidence: `src/main.js`)
- App Bootstrap → Crawler Model: loads model (evidence: `src/main.js`)
- App Bootstrap → Archivist Model: loads model (evidence: `src/main.js`)
- App Bootstrap → HUD: imports HUD (evidence: `src/main.js`)
- App Bootstrap → Audio Engine: imports audio (evidence: `src/main.js`)
- App Bootstrap → Map Selection: imports selector (evidence: `src/main.js`)
- App Bootstrap → Monster Viewer: opens viewer (evidence: `src/main.js`)
- Game Controller → Input Binding: routes input (evidence: `src/game/game.js`)
- Game Controller → Touch Controls: routes touch (evidence: `src/game/game.js`)
- Game Controller → Player: controls (evidence: `src/game/game.js`)
- Game Controller → Level Builder: builds level (evidence: `src/game/game.js`)
- Game Controller → Creature AI: updates creature (evidence: `src/game/game.js`)
- Game Controller → Interactions: routes actions (evidence: `src/game/game.js`)
- Game Controller → Lumen System: updates light (evidence: `src/game/game.js`)
- Game Controller → Lumen Key: spawns key (evidence: `src/game/game.js`)
- Game Controller → Facility Map: updates map (evidence: `src/game/game.js`)
- Game Controller → CCTV Console: updates CCTV (evidence: `src/game/game.js`)
- Level Builder → Environment Maps: uses layouts (evidence: `src/game/level.js`)
- Level Builder → World Props: builds props (evidence: `src/game/level.js`)
- Creature AI → Level Builder: queries navigation (evidence: `src/game/enemy.js`)
- Creature AI → Creature Factory: creates creature (evidence: `src/game/enemy.js`)
- Creature Factory → Warden Model: uses model (evidence: `src/game/creatures/factory.js`)
- Creature Factory → Crawler Model: uses model (evidence: `src/game/creatures/factory.js`)
- Creature Factory → Archivist Model: uses model (evidence: `src/game/creatures/factory.js`)
- CCTV Console → Level Builder: reads scene (evidence: `src/game/cctv.js`)
- Player → Input Binding: provides controls (evidence: `README.md`)
- Player → Touch Controls: uses mobile controls (evidence: `README.md`)
- Game Controller → HUD: updates display
- Game Controller → Audio Engine: plays effects
- Map Selection → Environment Maps: selects environment
- Monster Viewer → Warden Model: views model (evidence: `src/game/monster-inspector.js`)
- Monster Viewer → Crawler Model: views model (evidence: `src/game/monster-inspector.js`)
- Monster Viewer → Archivist Model: views model (evidence: `src/game/monster-inspector.js`)
