# jaimeugr/escapethelightrooms architecture

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

- Interactive diagram: https://gitdiagram.com/jaimeugr/escapethelightrooms
- Repository: https://github.com/jaimeugr/escapethelightrooms

## Overview

Escape The Lightrooms is a browser-based WebGL escape-room game. The player explores connected rooms, collects items and solves shape, laser and Simon puzzles to unlock the exit. The main game class initializes shared state and runtime systems, creates the rooms and runs the game. The README documents the collision, interaction, camera, sound and message systems; source excerpts and the index support several, but not every, runtime connection. Room and model internals are grouped where their individual wiring is not shown.

Main entry points: [`src/EscapeTheLightrooms.js`](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/EscapeTheLightrooms.js) (Game runtime), [`src/rooms/Sala.js`](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/rooms/Sala.js) (Room network), [`src/systems/SistemaColisiones.js`](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaColisiones.js) (Collision system), [`src/GameState.js`](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/GameState.js) (Game state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game runtime"]
  node_game["Game runtime"]
  node_state["Game state<br/>[GameState.js]"]
end

subgraph group_world["Rooms and puzzles"]
  node_rooms["Room network<br/>[Sala.js]"]
  node_room_variants["Room variants"]
  node_end["End location<br/>[EndLocation.js]"]
  node_puzzle_shapes["Shape puzzle<br/>[PuzleFormas.js]"]
  node_puzzle_laser["Laser puzzle<br/>[PuzleLaser.js]"]
  node_puzzle_simon["Simon puzzle<br/>[PuzleSimon.js]"]
  node_models["Room objects"]
  node_items["Inventory items"]
end

subgraph group_systems["Player systems"]
  node_cameras["Camera system<br/>[GestorCamaras.js]"]
  node_collision["Collision system"]
  node_interaction["Interaction system"]
  node_messages["Message system<br/>[SistemaMensajes.js]"]
  node_sound["Sound system<br/>[SistemaSonidos.js]"]
end

subgraph group_internals["Shared state and geometry"]
  node_quadtree["Collider index<br/>[QuadTree.js]"]
  node_rect["Collision bounds<br/>[Rect.js]"]
  node_config["Game configuration<br/>[Config.js]"]
  node_utils["Shared utilities<br/>[Utils.js]"]
end

node_player(("Player"))

node_player -->|"plays"| node_game
node_game -->|"initializes"| node_state
node_game -->|"creates"| node_collision
node_game -->|"creates"| node_interaction
node_game -->|"creates"| node_cameras
node_game -->|"creates"| node_messages
node_game -->|"creates"| node_sound
node_game -->|"adds"| node_rooms
node_game -->|"creates"| node_room_variants
node_game -->|"reads"| node_config
node_rooms -->|"places"| node_models
node_rooms -->|"includes"| node_puzzle_laser
node_puzzle_shapes -->|"uses"| node_models
node_puzzle_laser -->|"uses"| node_models
node_puzzle_simon -->|"uses"| node_models
node_state -->|"initializes"| node_items
node_collision -->|"indexes colliders"| node_quadtree
node_collision -->|"builds bounds"| node_rect
node_quadtree -->|"indexes bounds"| node_rect
node_rooms -->|"registers colliders"| node_collision
node_cameras -->|"reads"| node_state
node_puzzle_laser -->|"uses messages"| node_messages
node_end -->|"reads"| node_state
node_end -->|"uses"| node_utils

click node_game "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/EscapeTheLightrooms.js"
click node_state "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/GameState.js"
click node_rooms "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/rooms/Sala.js"
click node_room_variants "https://github.com/jaimeugr/escapethelightrooms/tree/main/src/rooms"
click node_end "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/locations/EndLocation.js"
click node_puzzle_shapes "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/puzles/PuzleFormas.js"
click node_puzzle_laser "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/puzles/PuzleLaser.js"
click node_puzzle_simon "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/puzles/PuzleSimon.js"
click node_models "https://github.com/jaimeugr/escapethelightrooms/tree/main/src/models"
click node_items "https://github.com/jaimeugr/escapethelightrooms/tree/main/src/models/items"
click node_cameras "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/cameras/GestorCamaras.js"
click node_collision "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaColisiones.js"
click node_interaction "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaInteraccion.js"
click node_messages "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaMensajes.js"
click node_sound "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaSonidos.js"
click node_quadtree "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/structures/QuadTree.js"
click node_rect "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/structures/Rect.js"
click node_config "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/Config.js"
click node_utils "https://github.com/jaimeugr/escapethelightrooms/blob/main/src/Utils.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_state toneBlue
class node_rooms,node_room_variants,node_end,node_puzzle_shapes,node_puzzle_laser,node_puzzle_simon,node_models,node_items toneAmber
class node_cameras,node_collision,node_interaction,node_messages,node_sound toneMint
class node_quadtree,node_rect,node_config,node_utils toneRose
class node_player toneIndigo
```

## Components

### Game runtime

- [Game runtime](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/EscapeTheLightrooms.js): `src/EscapeTheLightrooms.js`
- [Game state](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/GameState.js): `src/GameState.js`

### Rooms and puzzles

- [Room network](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/rooms/Sala.js): `src/rooms/Sala.js`
- [Room variants](https://github.com/jaimeugr/escapethelightrooms/tree/main/src/rooms): `src/rooms`
- [End location](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/locations/EndLocation.js): `src/locations/EndLocation.js`
- [Shape puzzle](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/puzles/PuzleFormas.js): `src/puzles/PuzleFormas.js`
- [Laser puzzle](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/puzles/PuzleLaser.js): `src/puzles/PuzleLaser.js`
- [Simon puzzle](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/puzles/PuzleSimon.js): `src/puzles/PuzleSimon.js`
- [Room objects](https://github.com/jaimeugr/escapethelightrooms/tree/main/src/models): `src/models`
- [Inventory items](https://github.com/jaimeugr/escapethelightrooms/tree/main/src/models/items): `src/models/items`

### Player systems

- [Camera system](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/cameras/GestorCamaras.js): `src/cameras/GestorCamaras.js`
- [Collision system](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaColisiones.js): `src/systems/SistemaColisiones.js`
- [Interaction system](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaInteraccion.js): `src/systems/SistemaInteraccion.js`
- [Message system](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaMensajes.js): `src/systems/SistemaMensajes.js`
- [Sound system](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/systems/SistemaSonidos.js): `src/systems/SistemaSonidos.js`

### Shared state and geometry

- [Collider index](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/structures/QuadTree.js): `src/structures/QuadTree.js`
- [Collision bounds](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/structures/Rect.js): `src/structures/Rect.js`
- [Game configuration](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/Config.js): `src/Config.js`
- [Shared utilities](https://github.com/jaimeugr/escapethelightrooms/blob/main/src/Utils.js): `src/Utils.js`

### Other components

- **Player**

## Connections

- Player → Game runtime: plays
- Game runtime → Game state: initializes (evidence: `src/EscapeTheLightrooms.js`)
- Game runtime → Collision system: creates (evidence: `src/EscapeTheLightrooms.js`)
- Game runtime → Interaction system: creates (evidence: `src/EscapeTheLightrooms.js`)
- Game runtime → Camera system: creates (evidence: `src/EscapeTheLightrooms.js`)
- Game runtime → Message system: creates (evidence: `src/EscapeTheLightrooms.js`)
- Game runtime → Sound system: creates (evidence: `src/EscapeTheLightrooms.js`)
- Game runtime → Room network: adds (evidence: `src/EscapeTheLightrooms.js`)
- Game runtime → Room variants: creates (evidence: `src/EscapeTheLightrooms.js`)
- Game runtime → Game configuration: reads (evidence: `src/EscapeTheLightrooms.js`)
- Room network → Room objects: places (evidence: `src/rooms/SalaPrincipal.js`)
- Room network → Laser puzzle: includes (evidence: `src/rooms/SalaPrincipal.js`)
- Shape puzzle → Room objects: uses (evidence: `src/puzles/PuzleFormas.js`)
- Laser puzzle → Room objects: uses (evidence: `src/puzles/PuzleLaser.js`)
- Simon puzzle → Room objects: uses (evidence: `src/puzles/PuzleSimon.js`)
- Game state → Inventory items: initializes (evidence: `src/GameState.js`)
- Collision system → Collider index: indexes colliders (evidence: `src/systems/SistemaColisiones.js`)
- Collision system → Collision bounds: builds bounds (evidence: `src/systems/SistemaColisiones.js`)
- Collider index → Collision bounds: indexes bounds (evidence: `src/structures/QuadTree.js`)
- Room network → Collision system: registers colliders (evidence: `src/rooms/Sala.js`)
- Camera system → Game state: reads (evidence: `src/cameras/GestorCamaras.js`)
- Laser puzzle → Message system: uses messages (evidence: `src/puzles/PuzleLaser.js`)
- End location → Game state: reads (evidence: `src/locations/EndLocation.js`)
- End location → Shared utilities: uses (evidence: `src/locations/EndLocation.js`)
