# david-bouyssel/poc-fps-dark architecture

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

- Interactive diagram: https://gitdiagram.com/david-bouyssel/poc-fps-dark
- Repository: https://github.com/david-bouyssel/poc-fps-dark

## Overview

This is a browser-based dark FPS: the player configures or reopens a seeded maze, explores it in first-person, avoids a pursuing monster, and reaches the exit to win. The graph follows the main controller through maze setup and round logic, then shows rendering, map, and audio capabilities. Source excerpts establish several internal calls; other major capabilities and relationships are documented in the README, while unsampled implementation details are not assumed.

Main entry points: [`src/main.js`](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/main.js) (Game Controller), [`src/game/round.js`](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/round.js) (Round Orchestrator), [`src/game/share-link.js`](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/share-link.js) (Share Links), [`src/render/fps-renderer.js`](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/fps-renderer.js) (FPS Renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Maze Setup"]
  node_maze_gen["Maze Generator<br/>[maze.js]"]
  node_rng["Seeded Random<br/>[random.js]"]
  node_tile_grid["Tile Grid<br/>[grid.js]"]
  node_share["Share Links<br/>[share-link.js]"]
end

subgraph group_gameplay["Game Logic"]
  node_app["Game Controller<br/>[main.js]"]
  node_round["Round Orchestrator<br/>[round.js]"]
  node_input["Keyboard Input<br/>[input.js]"]
  node_touch["Touch Input<br/>[touch-input.js]"]
  node_player["Player Movement<br/>[player.js]"]
  node_movement["Movement Rules<br/>[movement.js]"]
  node_monster["Monster AI<br/>[monster.js]"]
  node_pathfinding["Pathfinding<br/>[pathfinding.js]"]
  node_exit["Exit Logic<br/>[exit.js]"]
  node_game_state["Win Loss State<br/>[game-state.js]"]
  node_difficulty["Difficulty<br/>[difficulty.js]"]
  node_stats["Round Statistics<br/>[round-stats.js]"]
end

subgraph group_presentation["Rendering"]
  node_fps_render["FPS Renderer<br/>[fps-renderer.js]"]
  node_raycaster["Raycaster<br/>[raycaster.js]"]
  node_wall_textures["Wall Textures<br/>[wall-textures.js]"]
  node_automap["Explored Map<br/>[automap.js]"]
  node_map_renderer["Map Renderer"]
  node_canvas_renderer["Maze Overview<br/>[canvas-renderer.js]"]
end

subgraph group_sound["Audio"]
  node_monster_audio["Monster Audio<br/>[monster-audio.js]"]
  node_cries["Monster Cries<br/>[monster-cries.js]"]
  node_bong["Distance Tone<br/>[bong.js]"]
  node_captions["Sound Captions<br/>[sound-captions.js]"]
end

node_player_actor(("Player"))

node_player_actor -->|"plays"| node_app
node_app -->|"generates"| node_maze_gen
node_maze_gen -->|"draws values"| node_rng
node_app -->|"converts maze"| node_tile_grid
node_app -->|"parses links"| node_share
node_share -->|"recreates seed"| node_maze_gen
node_share -->|"validates seed"| node_rng
node_app -->|"starts round"| node_round
node_app -->|"reads controls"| node_input
node_app -->|"handles touch"| node_touch
node_round -->|"creates player"| node_player
node_round -->|"steps player"| node_movement
node_round -->|"steps monster"| node_monster
node_monster -->|"finds routes"| node_pathfinding
node_round -->|"checks outcome"| node_game_state
node_round -->|"loads settings"| node_difficulty
node_round -->|"advances stats"| node_stats
node_app -->|"renders view"| node_fps_render
node_fps_render -->|"casts rays"| node_raycaster
node_fps_render -->|"draws textures"| node_wall_textures
node_app -->|"tracks exploration"| node_automap
node_app -->|"renders map"| node_map_renderer
node_app -->|"shows overview"| node_canvas_renderer
node_app -.->|"plays synthesized audio"| node_monster_audio
node_monster_audio -->|"uses cues"| node_cries
node_cries -->|"calculates gains"| node_bong
node_app -->|"shows captions"| node_captions

click node_app "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/main.js"
click node_maze_gen "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/maze/maze.js"
click node_rng "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/maze/random.js"
click node_tile_grid "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/maze/grid.js"
click node_share "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/share-link.js"
click node_round "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/round.js"
click node_input "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/input.js"
click node_touch "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/touch-input.js"
click node_player "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/player.js"
click node_movement "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/movement.js"
click node_monster "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/monster.js"
click node_pathfinding "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/pathfinding.js"
click node_exit "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/exit.js"
click node_game_state "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/game-state.js"
click node_difficulty "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/difficulty.js"
click node_stats "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/round-stats.js"
click node_fps_render "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/fps-renderer.js"
click node_raycaster "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/raycaster.js"
click node_wall_textures "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/wall-textures.js"
click node_automap "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/automap.js"
click node_map_renderer "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/automap-renderer.js"
click node_canvas_renderer "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/canvas-renderer.js"
click node_monster_audio "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/audio/monster-audio.js"
click node_cries "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/audio/monster-cries.js"
click node_bong "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/audio/bong.js"
click node_captions "https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/audio/sound-captions.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_maze_gen,node_rng,node_tile_grid,node_share toneBlue
class node_app,node_round,node_input,node_touch,node_player,node_movement,node_monster,node_pathfinding,node_exit,node_game_state,node_difficulty,node_stats toneAmber
class node_fps_render,node_raycaster,node_wall_textures,node_automap,node_map_renderer,node_canvas_renderer toneMint
class node_monster_audio,node_cries,node_bong,node_captions toneRose
class node_player_actor toneIndigo
```

## Components

### Maze Setup

- [Maze Generator](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/maze/maze.js): `src/maze/maze.js`
- [Seeded Random](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/maze/random.js): `src/maze/random.js`
- [Tile Grid](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/maze/grid.js): `src/maze/grid.js`
- [Share Links](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/share-link.js): `src/game/share-link.js`

### Game Logic

- [Game Controller](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/main.js): `src/main.js`
- [Round Orchestrator](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/round.js): `src/game/round.js`
- [Keyboard Input](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/input.js): `src/game/input.js`
- [Touch Input](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/touch-input.js): `src/game/touch-input.js`
- [Player Movement](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/player.js): `src/game/player.js`
- [Movement Rules](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/movement.js): `src/game/movement.js`
- [Monster AI](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/monster.js): `src/game/monster.js`
- [Pathfinding](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/pathfinding.js): `src/game/pathfinding.js`
- [Exit Logic](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/exit.js): `src/game/exit.js`
- [Win Loss State](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/game-state.js): `src/game/game-state.js`
- [Difficulty](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/difficulty.js): `src/game/difficulty.js`
- [Round Statistics](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/game/round-stats.js): `src/game/round-stats.js`

### Rendering

- [FPS Renderer](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/fps-renderer.js): `src/render/fps-renderer.js`
- [Raycaster](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/raycaster.js): `src/render/raycaster.js`
- [Wall Textures](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/wall-textures.js): `src/render/wall-textures.js`
- [Explored Map](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/automap.js): `src/render/automap.js`
- [Map Renderer](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/automap-renderer.js): `src/render/automap-renderer.js`
- [Maze Overview](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/render/canvas-renderer.js): `src/render/canvas-renderer.js`

### Audio

- [Monster Audio](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/audio/monster-audio.js): `src/audio/monster-audio.js`
- [Monster Cries](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/audio/monster-cries.js): `src/audio/monster-cries.js`
- [Distance Tone](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/audio/bong.js): `src/audio/bong.js`
- [Sound Captions](https://github.com/david-bouyssel/poc-fps-dark/blob/main/src/audio/sound-captions.js): `src/audio/sound-captions.js`

### Other components

- **Player**

## Connections

- Player → Game Controller: plays (evidence: `README.md`)
- Game Controller → Maze Generator: generates (evidence: `src/main.js`)
- Maze Generator → Seeded Random: draws values (evidence: `src/maze/maze.js`)
- Game Controller → Tile Grid: converts maze (evidence: `src/main.js`)
- Game Controller → Share Links: parses links (evidence: `src/main.js`)
- Share Links → Maze Generator: recreates seed (evidence: `src/game/share-link.js`)
- Share Links → Seeded Random: validates seed (evidence: `src/game/share-link.js`)
- Game Controller → Round Orchestrator: starts round (evidence: `src/main.js`)
- Game Controller → Keyboard Input: reads controls (evidence: `src/main.js`)
- Game Controller → Touch Input: handles touch (evidence: `src/main.js`)
- Round Orchestrator → Player Movement: creates player (evidence: `src/game/round.js`)
- Round Orchestrator → Movement Rules: steps player (evidence: `src/game/round.js`)
- Round Orchestrator → Monster AI: steps monster (evidence: `src/game/round.js`)
- Monster AI → Pathfinding: finds routes (evidence: `src/game/monster.js`)
- Round Orchestrator → Win Loss State: checks outcome (evidence: `src/game/round.js`)
- Round Orchestrator → Difficulty: loads settings (evidence: `src/game/round.js`)
- Round Orchestrator → Round Statistics: advances stats (evidence: `src/game/round.js`)
- Game Controller → FPS Renderer: renders view (evidence: `README.md`)
- FPS Renderer → Raycaster: casts rays (evidence: `src/render/fps-renderer.js`)
- FPS Renderer → Wall Textures: draws textures (evidence: `src/render/fps-renderer.js`)
- Game Controller → Explored Map: tracks exploration (evidence: `src/main.js`)
- Game Controller → Map Renderer: renders map (evidence: `README.md`)
- Game Controller → Maze Overview: shows overview (evidence: `README.md`)
- Game Controller → Monster Audio: plays synthesized audio (evidence: `src/main.js`)
- Monster Audio → Monster Cries: uses cues (evidence: `src/audio/monster-audio.js`)
- Monster Cries → Distance Tone: calculates gains (evidence: `src/audio/monster-cries.js`)
- Game Controller → Sound Captions: shows captions (evidence: `src/main.js`)
