# monster2z/gods-play architecture

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

- Interactive diagram: https://gitdiagram.com/monster2z/gods-play
- Repository: https://github.com/monster2z/gods-play

## Overview

This repository is a Godot Web export runtime: a browser page loads the JavaScript engine wrapper and exported project resources, then runs the game through the Godot engine. The wrapper also supports audio worklets and service-worker registration; the worker caches export files and can serve an offline fallback. The README is empty, and the HTML and binary artifacts were not excerpted, so their internal behavior and some page-to-runtime links are not confirmed.

Main entry points: [`index.service.worker.js`](https://github.com/monster2z/gods-play/blob/main/index.service.worker.js) (Service Worker), [`index.js`](https://github.com/monster2z/gods-play/blob/main/index.js) (Engine Wrapper), [`index.html`](https://github.com/monster2z/gods-play/blob/main/index.html) (Export Page), [`index.wasm`](https://github.com/monster2z/gods-play/blob/main/index.wasm) (Godot Engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web Runtime"]
  node_page["Export Page<br/>[index.html]"]
  node_wrapper["Engine Wrapper<br/>[index.js]"]
  node_engine["Godot Engine<br/>[index.wasm]"]
  node_project["Game Project<br/>[index.pck]"]
end

subgraph group_audio["Audio Processing"]
  node_audio["Audio Processor"]
  node_position["Position Reporter"]
end

subgraph group_offline["Offline Support"]
  node_worker["Service Worker"]
  node_offlinepage["Offline Page<br/>[index.offline.html]"]
end

node_user(("Player"))

node_user -.->|"opens"| node_page
node_page -.->|"loads"| node_wrapper
node_wrapper -->|"initializes"| node_engine
node_wrapper -->|"resolves worklet"| node_audio
node_wrapper -->|"resolves worklet"| node_position
node_wrapper -->|"registers"| node_worker
node_worker -->|"fallbacks to"| node_offlinepage
node_worker -->|"caches"| node_page
node_worker -->|"caches"| node_wrapper
node_worker -->|"caches"| node_engine
node_worker -->|"caches"| node_project

click node_page "https://github.com/monster2z/gods-play/blob/main/index.html"
click node_wrapper "https://github.com/monster2z/gods-play/blob/main/index.js"
click node_engine "https://github.com/monster2z/gods-play/blob/main/index.wasm"
click node_project "https://github.com/monster2z/gods-play/blob/main/index.pck"
click node_audio "https://github.com/monster2z/gods-play/blob/main/index.audio.worklet.js"
click node_position "https://github.com/monster2z/gods-play/blob/main/index.audio.position.worklet.js"
click node_worker "https://github.com/monster2z/gods-play/blob/main/index.service.worker.js"
click node_offlinepage "https://github.com/monster2z/gods-play/blob/main/index.offline.html"

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_page,node_wrapper,node_engine,node_project toneBlue
class node_audio,node_position toneAmber
class node_worker,node_offlinepage toneMint
class node_user toneIndigo
```

## Components

### Web Runtime

- [Export Page](https://github.com/monster2z/gods-play/blob/main/index.html): `index.html`
- [Engine Wrapper](https://github.com/monster2z/gods-play/blob/main/index.js): `index.js`
- [Godot Engine](https://github.com/monster2z/gods-play/blob/main/index.wasm): `index.wasm`
- [Game Project](https://github.com/monster2z/gods-play/blob/main/index.pck): `index.pck`

### Audio Processing

- [Audio Processor](https://github.com/monster2z/gods-play/blob/main/index.audio.worklet.js): `index.audio.worklet.js`
- [Position Reporter](https://github.com/monster2z/gods-play/blob/main/index.audio.position.worklet.js): `index.audio.position.worklet.js`

### Offline Support

- [Service Worker](https://github.com/monster2z/gods-play/blob/main/index.service.worker.js): `index.service.worker.js`
- [Offline Page](https://github.com/monster2z/gods-play/blob/main/index.offline.html): `index.offline.html`

### Other components

- **Player**

## Connections

- Player → Export Page: opens
- Export Page → Engine Wrapper: loads
- Engine Wrapper → Godot Engine: initializes (evidence: `index.js`)
- Engine Wrapper → Audio Processor: resolves worklet (evidence: `index.js`)
- Engine Wrapper → Position Reporter: resolves worklet (evidence: `index.js`)
- Engine Wrapper → Service Worker: registers (evidence: `index.js`)
- Service Worker → Offline Page: fallbacks to (evidence: `index.service.worker.js`)
- Service Worker → Export Page: caches (evidence: `index.service.worker.js`)
- Service Worker → Engine Wrapper: caches (evidence: `index.service.worker.js`)
- Service Worker → Godot Engine: caches (evidence: `index.service.worker.js`)
- Service Worker → Game Project: caches (evidence: `index.service.worker.js`)
