# zzzsleepyy/lightmaze architecture

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

- Interactive diagram: https://gitdiagram.com/zzzsleepyy/lightmaze
- Repository: https://github.com/zzzsleepyy/lightmaze

## Overview

LightMaze is a browser-based maze puzzle game with a web interface for browsing levels, tracking progress, and customizing the experience, alongside a Godot Web export for gameplay. The visible JavaScript handles navigation, level filtering, settings, progress resets, notifications, sound effects, and a game timer; the Godot files provide the exported runtime and audio worklets. The README describes light-based maze challenges, but sampled source does not expose maze mechanics or confirm how the root page launches the Godot export, so those connections are left conservative.

Main entry points: [`script.js`](https://github.com/zzzsleepyy/lightmaze/blob/main/script.js) (UI Behavior), [`godot/index.js`](https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.js) (Godot Engine Loader), [`index.html`](https://github.com/zzzsleepyy/lightmaze/blob/main/index.html) (LightMaze Site), [`godot/index.html`](https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.html) (Godot Web Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Interface"]
  node_site["LightMaze Site<br/>[index.html]"]
  node_interface["UI Behavior<br/>[script.js]"]
  node_levelprogress["Levels &amp; Progress<br/>[script.js]"]
  node_preferences["Themes &amp; Settings<br/>[script.js]"]
  node_timer["Game Timer<br/>[script.js]"]
  node_browserstorage[("Browser Storage")]
end

subgraph group_game["Game Runtime"]
  node_godotpage["Godot Web Page<br/>[index.html]"]
  node_engine["Godot Engine Loader<br/>[index.js]"]
  node_gamepack["Exported Game<br/>[index.pck]"]
  node_wasm["WebAssembly Engine<br/>[index.wasm]"]
end

subgraph group_media["Audio"]
  node_audioworklet["Audio Worklet"]
  node_positionworklet["Position Worklet"]
  node_clicksound["Button Click Sound"]
end

node_player(("Player"))

node_player -->|"opens"| node_site
node_site -->|"hosts UI"| node_interface
node_player -->|"interacts"| node_interface
node_interface -->|"filters levels"| node_levelprogress
node_interface -->|"changes settings"| node_preferences
node_interface -->|"starts timer"| node_timer
node_levelprogress -->|"stores progress"| node_browserstorage
node_preferences -->|"stores settings"| node_browserstorage
node_interface -->|"plays sound"| node_clicksound
node_godotpage -->|"loads runtime"| node_engine
node_engine -->|"loads engine"| node_wasm
node_engine -->|"loads game data"| node_gamepack
node_engine -.->|"loads audio processor"| node_audioworklet
node_engine -.->|"loads position processor"| node_positionworklet

click node_site "https://github.com/zzzsleepyy/lightmaze/blob/main/index.html"
click node_interface "https://github.com/zzzsleepyy/lightmaze/blob/main/script.js"
click node_levelprogress "https://github.com/zzzsleepyy/lightmaze/blob/main/script.js"
click node_preferences "https://github.com/zzzsleepyy/lightmaze/blob/main/script.js"
click node_timer "https://github.com/zzzsleepyy/lightmaze/blob/main/script.js"
click node_godotpage "https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.html"
click node_engine "https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.js"
click node_gamepack "https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.pck"
click node_wasm "https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.wasm"
click node_audioworklet "https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.audio.worklet.js"
click node_positionworklet "https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.audio.position.worklet.js"
click node_clicksound "https://github.com/zzzsleepyy/lightmaze/blob/main/assets/buttonclickSound.MP3"

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_site,node_interface,node_levelprogress,node_preferences,node_timer,node_browserstorage toneBlue
class node_godotpage,node_engine,node_gamepack,node_wasm toneAmber
class node_audioworklet,node_positionworklet,node_clicksound toneMint
class node_player toneIndigo
```

## Components

### Web Interface

- [LightMaze Site](https://github.com/zzzsleepyy/lightmaze/blob/main/index.html): `index.html`
- [UI Behavior](https://github.com/zzzsleepyy/lightmaze/blob/main/script.js): `script.js`
- [Levels & Progress](https://github.com/zzzsleepyy/lightmaze/blob/main/script.js): `script.js`
- [Themes & Settings](https://github.com/zzzsleepyy/lightmaze/blob/main/script.js): `script.js`
- [Game Timer](https://github.com/zzzsleepyy/lightmaze/blob/main/script.js): `script.js`
- **Browser Storage**

### Game Runtime

- [Godot Web Page](https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.html): `godot/index.html`
- [Godot Engine Loader](https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.js): `godot/index.js`
- [Exported Game](https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.pck): `godot/index.pck`
- [WebAssembly Engine](https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.wasm): `godot/index.wasm`

### Audio

- [Audio Worklet](https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.audio.worklet.js): `godot/index.audio.worklet.js`
- [Position Worklet](https://github.com/zzzsleepyy/lightmaze/blob/main/godot/index.audio.position.worklet.js): `godot/index.audio.position.worklet.js`
- [Button Click Sound](https://github.com/zzzsleepyy/lightmaze/blob/main/assets/buttonclickSound.MP3): `assets/buttonclickSound.MP3`

### Other components

- **Player**

## Connections

- Player → LightMaze Site: opens
- LightMaze Site → UI Behavior: hosts UI
- Player → UI Behavior: interacts
- UI Behavior → Levels & Progress: filters levels
- UI Behavior → Themes & Settings: changes settings
- UI Behavior → Game Timer: starts timer
- Levels & Progress → Browser Storage: stores progress
- Themes & Settings → Browser Storage: stores settings
- UI Behavior → Button Click Sound: plays sound
- Godot Web Page → Godot Engine Loader: loads runtime
- Godot Engine Loader → WebAssembly Engine: loads engine
- Godot Engine Loader → Exported Game: loads game data
- Godot Engine Loader → Audio Worklet: loads audio processor
- Godot Engine Loader → Position Worklet: loads position processor
