# kevintngo/voidlight architecture

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

- Interactive diagram: https://gitdiagram.com/kevintngo/voidlight
- Repository: https://github.com/kevintngo/voidlight

## Overview

VOIDLIGHT DEPTHS is a browser-based 3D action game. The principal workflow is gameplay input and frame updates, with the game operating on a generated deck populated by the hero, enemies, bosses, and world objects; rendering, effects, and synthesized audio support the experience. The source is a set of globally shared JavaScript modules rather than an import graph. The map preserves the major systems named by the source index, but several links remain unshown because the excerpts do not expose their callers.

Main entry points: [`src/09_build.js`](https://github.com/kevintngo/voidlight/blob/main/src/09_build.js) (Deck Builder), [`src/13_world.js`](https://github.com/kevintngo/voidlight/blob/main/src/13_world.js) (World Objects), [`src/12_boss.js`](https://github.com/kevintngo/voidlight/blob/main/src/12_boss.js) (Boss Fights), [`src/15_audio.js`](https://github.com/kevintngo/voidlight/blob/main/src/15_audio.js) (Synthesized Audio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and Rendering"]
  node_game["Game Loop<br/>[16_game.js]"]
  node_mobile["Mobile Controls<br/>[17_mobile.js]"]
  node_core["Core Utilities<br/>[01_core.js]"]
  node_engine["WebGL Engine<br/>[01b_engine.js]"]
  node_geometry["Geometry<br/>[03_geom.js]"]
  node_graphics["Camera and Post<br/>[04_gx.js]"]
  node_textures["Procedural Textures<br/>[02_tex.js]"]
end

subgraph group_content["Deck and Content"]
  node_deckgen["Deck Layout<br/>[06_deckgen.js]"]
  node_themes["Themes<br/>[08_themes.js]"]
  node_themeextras["Theme Content<br/>[08b_themes2.js]"]
  node_props["Prop Library<br/>[07_props.js]"]
  node_props2["Prop Extensions<br/>[07b_props2.js]"]
  node_deck["Deck Builder<br/>[09_build.js]"]
end

subgraph group_actors["Combatants and World"]
  node_hero["Star Knight<br/>[10_hero.js]"]
  node_monsters["Monsters<br/>[11_monsters.js]"]
  node_monsters2["Monster Content<br/>[11b_monsters2.js]"]
  node_boss["Boss Fights<br/>[12_boss.js]"]
  node_boss2["Boss Content<br/>[12b_boss2.js]"]
  node_world["World Objects<br/>[13_world.js]"]
  node_brain["Game AI<br/>[14_brain.js]"]
end

subgraph group_feedback["Effects and Audio"]
  node_fx["Visual Effects<br/>[05_fx.js]"]
  node_audio["Synthesized Audio<br/>[15_audio.js]"]
end

node_player(("Player"))
node_browseraudio(("Web Audio API"))

node_player -.->|"plays"| node_game
node_mobile -.->|"provides controls"| node_game
node_textures -->|"constructs textures"| node_engine
node_graphics -->|"initializes GX"| node_engine
node_deck -->|"generates layout"| node_deckgen
node_deck -->|"builds batches"| node_props
node_deck -->|"creates objects"| node_world
node_deck -->|"activates lights"| node_graphics
node_deck -->|"registers emitters"| node_fx
node_monsters -->|"uses dangers"| node_world
node_boss -->|"triggers effects"| node_fx
node_boss -->|"plays sounds"| node_audio
node_boss -->|"drops loot"| node_world
node_world -->|"triggers effects"| node_fx
node_world -->|"plays sounds"| node_audio
node_audio -.->|"synthesizes audio"| node_browseraudio

click node_game "https://github.com/kevintngo/voidlight/blob/main/src/16_game.js"
click node_mobile "https://github.com/kevintngo/voidlight/blob/main/src/17_mobile.js"
click node_core "https://github.com/kevintngo/voidlight/blob/main/src/01_core.js"
click node_engine "https://github.com/kevintngo/voidlight/blob/main/src/01b_engine.js"
click node_geometry "https://github.com/kevintngo/voidlight/blob/main/src/03_geom.js"
click node_graphics "https://github.com/kevintngo/voidlight/blob/main/src/04_gx.js"
click node_textures "https://github.com/kevintngo/voidlight/blob/main/src/02_tex.js"
click node_deckgen "https://github.com/kevintngo/voidlight/blob/main/src/06_deckgen.js"
click node_themes "https://github.com/kevintngo/voidlight/blob/main/src/08_themes.js"
click node_themeextras "https://github.com/kevintngo/voidlight/blob/main/src/08b_themes2.js"
click node_props "https://github.com/kevintngo/voidlight/blob/main/src/07_props.js"
click node_props2 "https://github.com/kevintngo/voidlight/blob/main/src/07b_props2.js"
click node_deck "https://github.com/kevintngo/voidlight/blob/main/src/09_build.js"
click node_hero "https://github.com/kevintngo/voidlight/blob/main/src/10_hero.js"
click node_monsters "https://github.com/kevintngo/voidlight/blob/main/src/11_monsters.js"
click node_monsters2 "https://github.com/kevintngo/voidlight/blob/main/src/11b_monsters2.js"
click node_boss "https://github.com/kevintngo/voidlight/blob/main/src/12_boss.js"
click node_boss2 "https://github.com/kevintngo/voidlight/blob/main/src/12b_boss2.js"
click node_world "https://github.com/kevintngo/voidlight/blob/main/src/13_world.js"
click node_brain "https://github.com/kevintngo/voidlight/blob/main/src/14_brain.js"
click node_fx "https://github.com/kevintngo/voidlight/blob/main/src/05_fx.js"
click node_audio "https://github.com/kevintngo/voidlight/blob/main/src/15_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_game,node_mobile,node_core,node_engine,node_geometry,node_graphics,node_textures toneBlue
class node_deckgen,node_themes,node_themeextras,node_props,node_props2,node_deck toneAmber
class node_hero,node_monsters,node_monsters2,node_boss,node_boss2,node_world,node_brain,node_browseraudio toneMint
class node_fx,node_audio toneRose
class node_player toneIndigo
```

## Components

### Runtime and Rendering

- [Game Loop](https://github.com/kevintngo/voidlight/blob/main/src/16_game.js): `src/16_game.js`
- [Mobile Controls](https://github.com/kevintngo/voidlight/blob/main/src/17_mobile.js): `src/17_mobile.js`
- [Core Utilities](https://github.com/kevintngo/voidlight/blob/main/src/01_core.js): `src/01_core.js`
- [WebGL Engine](https://github.com/kevintngo/voidlight/blob/main/src/01b_engine.js): `src/01b_engine.js`
- [Geometry](https://github.com/kevintngo/voidlight/blob/main/src/03_geom.js): `src/03_geom.js`
- [Camera and Post](https://github.com/kevintngo/voidlight/blob/main/src/04_gx.js): `src/04_gx.js`
- [Procedural Textures](https://github.com/kevintngo/voidlight/blob/main/src/02_tex.js): `src/02_tex.js`

### Deck and Content

- [Deck Layout](https://github.com/kevintngo/voidlight/blob/main/src/06_deckgen.js): `src/06_deckgen.js`
- [Themes](https://github.com/kevintngo/voidlight/blob/main/src/08_themes.js): `src/08_themes.js`
- [Theme Content](https://github.com/kevintngo/voidlight/blob/main/src/08b_themes2.js): `src/08b_themes2.js`
- [Prop Library](https://github.com/kevintngo/voidlight/blob/main/src/07_props.js): `src/07_props.js`
- [Prop Extensions](https://github.com/kevintngo/voidlight/blob/main/src/07b_props2.js): `src/07b_props2.js`
- [Deck Builder](https://github.com/kevintngo/voidlight/blob/main/src/09_build.js): `src/09_build.js`

### Combatants and World

- [Star Knight](https://github.com/kevintngo/voidlight/blob/main/src/10_hero.js): `src/10_hero.js`
- [Monsters](https://github.com/kevintngo/voidlight/blob/main/src/11_monsters.js): `src/11_monsters.js`
- [Monster Content](https://github.com/kevintngo/voidlight/blob/main/src/11b_monsters2.js): `src/11b_monsters2.js`
- [Boss Fights](https://github.com/kevintngo/voidlight/blob/main/src/12_boss.js): `src/12_boss.js`
- [Boss Content](https://github.com/kevintngo/voidlight/blob/main/src/12b_boss2.js): `src/12b_boss2.js`
- [World Objects](https://github.com/kevintngo/voidlight/blob/main/src/13_world.js): `src/13_world.js`
- [Game AI](https://github.com/kevintngo/voidlight/blob/main/src/14_brain.js): `src/14_brain.js`

### Effects and Audio

- [Visual Effects](https://github.com/kevintngo/voidlight/blob/main/src/05_fx.js): `src/05_fx.js`
- [Synthesized Audio](https://github.com/kevintngo/voidlight/blob/main/src/15_audio.js): `src/15_audio.js`

### Other components

- **Player**
- **Web Audio API**

## Connections

- Player → Game Loop: plays
- Mobile Controls → Game Loop: provides controls
- Procedural Textures → WebGL Engine: constructs textures (evidence: `src/02_tex.js`)
- Camera and Post → WebGL Engine: initializes GX (evidence: `src/04_gx.js`)
- Deck Builder → Deck Layout: generates layout (evidence: `src/09_build.js`)
- Deck Builder → Prop Library: builds batches (evidence: `src/09_build.js`)
- Deck Builder → World Objects: creates objects (evidence: `src/09_build.js`)
- Deck Builder → Camera and Post: activates lights (evidence: `src/09_build.js`)
- Deck Builder → Visual Effects: registers emitters (evidence: `src/09_build.js`)
- Monsters → World Objects: uses dangers (evidence: `src/11_monsters.js`)
- Boss Fights → Visual Effects: triggers effects (evidence: `src/12_boss.js`)
- Boss Fights → Synthesized Audio: plays sounds (evidence: `src/12_boss.js`)
- Boss Fights → World Objects: drops loot (evidence: `src/12_boss.js`)
- World Objects → Visual Effects: triggers effects (evidence: `src/13_world.js`)
- World Objects → Synthesized Audio: plays sounds (evidence: `src/13_world.js`)
- Synthesized Audio → Web Audio API: synthesizes audio
