# sogful/candies.monster architecture

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

- Interactive diagram: https://gitdiagram.com/sogful/candies.monster
- Repository: https://github.com/sogful/candies.monster

## Overview

#### Purpose and Delivery Model
Candies.monster is a static Cut the Rope/Om Nom resource site: reference pages, media archives, conversion tools, game-version cataloging, and browser-playable previews. It is deployable without a server; root hosting markers include `CNAME`, `.nojekyll`, and `manifest.json`.

#### Site Entry Points and Navigation
The site front page is `index.html`; standalone resource sections are implemented as independently deployable HTML pages/directories, including `convert/index.html`, `versions/index.html`, `music/index.html`, `levels/index.html`, and `preview/index.html`. This is a multipage static site rather than a single application shell.

#### Shared Presentation and Browser Utilities
Shared client-side behavior and common media live under `assets/`: `assets/static/global.js`, `assets/static/conversion.js`, and `assets/images/candies/candies.json`. Root pages consume these browser-side resources directly. The site also packages syntax highlighting, font assets, custom cursors, and audio locally; no CDN dependency is evident from the tree.

#### Conversion Tools
The converter surface at `convert/index.html` is backed by local Python conversion variants—`convert/assets/static/old.py`, `convert/assets/static/ysnew.py`—suggesting in-browser Python execution via the bundled `assets/static/pyodide.js`. A separate downloadable/native converter is retained at `assets/static/XNBSoundConverter.exe`. Conversion is therefore client-side/download-based, not an API service.

#### Resource Catalogs
Distinct static catalogs organize assets and metadata by topic. Music is metadata-driven through `music/music.json` and local audio under `music/assets/audio/`; the versions archive uses `versions/index.js`, `versions/load.js`, plus Android/iOS CSV datasets. Level-related resources reside in `levels/index.html` and `levels/assets/static/1_1.xml`. These sections read static files and render them in the browser.

#### Preview Hub and Game Runtimes
`preview/index.html` and `preview/index.js` present several embedded/playable game implementations. Three materially different runtimes are preserved:
- Source-oriented JavaScript/WebGL Famobi game: `preview/famobi/index.js`, `preview/famobi/src/game/app/loop.js`, `preview/famobi/src/engine/physics/candy.js`.
- Prebuilt H5DX web game: `preview/h5dx/dist/index.html`, `preview/h5dx/dist/assets/app-0BteyeId.js`, `preview/h5dx/dist/sw.js`.
- Published .NET WebAssembly game: `preview/dx/dist/wwwroot/index.html`, `preview/dx/dist/wwwroot/_framework/dotnet.js`, `preview/dx/dist/wwwroot/_framework/CutTheRopeDX.Browser.b67zkuaf2s.wasm`.

#### Famobi Game Architecture and Flow
The Famobi preview is the clearest editable game stack. Browser bootstrap (`preview/famobi/index.html` → `preview/famobi/index.js`) initializes lifecycle, viewport, input, persistence, and SDK boundaries under `preview/famobi/src/game/app/`. It loads fonts, sprite sheets, strings, audio, and level JSON via `preview/famobi/src/game/assets/loader.js`; scene direction selects loading/menu/level flows via `preview/famobi/src/engine/scene/director.js` and `preview/famobi/src/game/scenes/level.js`. Physics entities and ropes drive gameplay, rendering draws scene state, and audio maps game events to Web Audio assets. Level content is data-separated in `preview/famobi/assets/static/boxes/`.

#### Runtime Boundaries and Offline Behavior
All gameplay assets—levels, atlases, audio, localization, and videos—are static files fetched by the client. H5DX and DX include service-worker/PWA artifacts (`preview/h5dx/dist/sw.js`, `preview/dx/dist/wwwroot/service-worker.js`) for caching/offline behavior. The tree provides no evidence of backend APIs, databases, authentication, analytics, or third-party hosted services; browser storage and optional game SDK integration are the key client-side boundaries.

Main entry points: [`index.html`](https://github.com/sogful/candies.monster/blob/main/index.html) (Site front page), [`preview/index.html`](https://github.com/sogful/candies.monster/blob/main/preview/index.html) (Preview hub), [`convert/index.html`](https://github.com/sogful/candies.monster/blob/main/convert/index.html) (Conversion tools), [`preview/famobi/index.js`](https://github.com/sogful/candies.monster/blob/main/preview/famobi/index.js) (Famobi bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Static Site"]
  node_hosting{{"Static hosting<br/>deployment"}}
  node_home["Site front page<br/>HTML page<br/>[index.html]"]
  node_shared["Shared browser utilities<br/>JavaScript<br/>[global.js]"]
  node_candy_data[("Candy metadata<br/>JSON catalog<br/>[candies.json]")]
end

subgraph group_catalogs["Resource Catalogs"]
  node_converter["Conversion tools<br/>HTML page<br/>[index.html]"]
  node_pyodide["In-browser Python<br/>runtime bundle<br/>[pyodide.js]"]
  node_conversion_scripts["Python converters<br/>Python scripts<br/>[old.py]"]
  node_native_converter["Native converter download<br/>executable"]
  node_music["Music catalog<br/>HTML page<br/>[index.html]"]
  node_music_data[("Music metadata and audio<br/>static catalog<br/>[music.json]")]
  node_versions["Version archive<br/>HTML page<br/>[index.html]"]
  node_version_loader["Version data loader<br/>JavaScript<br/>[load.js]"]
  node_levels["Level resources<br/>HTML page<br/>[index.html]"]
end

subgraph group_preview["Preview Hub"]
  node_preview_hub["Preview hub<br/>HTML page<br/>[index.html]"]
  node_famobi_bootstrap["Famobi bootstrap<br/>JavaScript<br/>[index.js]"]
  node_famobi_assets["Famobi asset loader<br/>JavaScript<br/>[loader.js]"]
  node_famobi_flow["Famobi scene flow<br/>scene director<br/>[director.js]"]
  node_famobi_gameplay["Famobi level gameplay<br/>game scene<br/>[level.js]"]
  node_famobi_levels[("Famobi level data<br/>static assets")]
  node_h5dx["H5DX web game<br/>prebuilt web runtime<br/>[index.html]"]
  node_dx[".NET WASM game<br/>WebAssembly runtime<br/>[index.html]"]
end

node_hosting -->|"serves"| node_home
node_home -->|"loads"| node_shared
node_home -->|"uses"| node_candy_data
node_home -->|"links to"| node_converter
node_home -->|"links to"| node_music
node_home -->|"links to"| node_versions
node_home -->|"links to"| node_levels
node_home -->|"links to"| node_preview_hub
node_converter -->|"runs with"| node_pyodide
node_pyodide -->|"executes"| node_conversion_scripts
node_converter -->|"offers download"| node_native_converter
node_music -->|"reads"| node_music_data
node_versions -->|"loads"| node_version_loader
node_preview_hub -->|"launches"| node_famobi_bootstrap
node_preview_hub -->|"launches"| node_h5dx
node_preview_hub -->|"launches"| node_dx
node_famobi_bootstrap -->|"initializes"| node_famobi_assets
node_famobi_bootstrap -->|"starts"| node_famobi_flow
node_famobi_flow -->|"enters level scene"| node_famobi_gameplay
node_famobi_assets -->|"fetches"| node_famobi_levels

click node_home "https://github.com/sogful/candies.monster/blob/main/index.html"
click node_shared "https://github.com/sogful/candies.monster/blob/main/assets/static/global.js"
click node_candy_data "https://github.com/sogful/candies.monster/blob/main/assets/images/candies/candies.json"
click node_converter "https://github.com/sogful/candies.monster/blob/main/convert/index.html"
click node_pyodide "https://github.com/sogful/candies.monster/blob/main/assets/static/pyodide.js"
click node_conversion_scripts "https://github.com/sogful/candies.monster/blob/main/convert/assets/static/old.py"
click node_native_converter "https://github.com/sogful/candies.monster/blob/main/assets/static/XNBSoundConverter.exe"
click node_music "https://github.com/sogful/candies.monster/blob/main/music/index.html"
click node_music_data "https://github.com/sogful/candies.monster/blob/main/music/music.json"
click node_versions "https://github.com/sogful/candies.monster/blob/main/versions/index.html"
click node_version_loader "https://github.com/sogful/candies.monster/blob/main/versions/load.js"
click node_levels "https://github.com/sogful/candies.monster/blob/main/levels/index.html"
click node_preview_hub "https://github.com/sogful/candies.monster/blob/main/preview/index.html"
click node_famobi_bootstrap "https://github.com/sogful/candies.monster/blob/main/preview/famobi/index.js"
click node_famobi_assets "https://github.com/sogful/candies.monster/blob/main/preview/famobi/src/game/assets/loader.js"
click node_famobi_flow "https://github.com/sogful/candies.monster/blob/main/preview/famobi/src/engine/scene/director.js"
click node_famobi_gameplay "https://github.com/sogful/candies.monster/blob/main/preview/famobi/src/game/scenes/level.js"
click node_h5dx "https://github.com/sogful/candies.monster/blob/main/preview/h5dx/dist/index.html"
click node_dx "https://github.com/sogful/candies.monster/blob/main/preview/dx/dist/wwwroot/index.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_hosting,node_home,node_shared,node_candy_data toneBlue
class node_converter,node_pyodide,node_conversion_scripts,node_native_converter,node_music,node_music_data,node_versions,node_version_loader,node_levels toneAmber
class node_preview_hub,node_famobi_bootstrap,node_famobi_assets,node_famobi_flow,node_famobi_gameplay,node_famobi_levels,node_h5dx,node_dx toneMint
```

## Components

### Static Site

Multipage static hosting.

- **Static hosting**: deployment · Hosts files without a server.
- [Site front page](https://github.com/sogful/candies.monster/blob/main/index.html): HTML page · `index.html`
- [Shared browser utilities](https://github.com/sogful/candies.monster/blob/main/assets/static/global.js): JavaScript · Common browser behavior and conversion support. · `assets/static/global.js`
- [Candy metadata](https://github.com/sogful/candies.monster/blob/main/assets/images/candies/candies.json): JSON catalog · `assets/images/candies/candies.json`

### Resource Catalogs

Browser-rendered static resource sections.

- [Conversion tools](https://github.com/sogful/candies.monster/blob/main/convert/index.html): HTML page · Client-side and downloadable conversion surface. · `convert/index.html`
- [In-browser Python](https://github.com/sogful/candies.monster/blob/main/assets/static/pyodide.js): runtime bundle · `assets/static/pyodide.js`
- [Python converters](https://github.com/sogful/candies.monster/blob/main/convert/assets/static/old.py): Python scripts · `convert/assets/static/old.py`
- [Native converter download](https://github.com/sogful/candies.monster/blob/main/assets/static/XNBSoundConverter.exe): executable · `assets/static/XNBSoundConverter.exe`
- [Music catalog](https://github.com/sogful/candies.monster/blob/main/music/index.html): HTML page · `music/index.html`
- [Music metadata and audio](https://github.com/sogful/candies.monster/blob/main/music/music.json): static catalog · `music/music.json`
- [Version archive](https://github.com/sogful/candies.monster/blob/main/versions/index.html): HTML page · `versions/index.html`
- [Version data loader](https://github.com/sogful/candies.monster/blob/main/versions/load.js): JavaScript · Loads Android and iOS CSV datasets. · `versions/load.js`
- [Level resources](https://github.com/sogful/candies.monster/blob/main/levels/index.html): HTML page · `levels/index.html`

### Preview Hub

Playable game runtimes and their assets.

- [Preview hub](https://github.com/sogful/candies.monster/blob/main/preview/index.html): HTML page · Selects embedded playable implementations. · `preview/index.html`
- [Famobi bootstrap](https://github.com/sogful/candies.monster/blob/main/preview/famobi/index.js): JavaScript · Initializes the editable JavaScript/WebGL game. · `preview/famobi/index.js`
- [Famobi asset loader](https://github.com/sogful/candies.monster/blob/main/preview/famobi/src/game/assets/loader.js): JavaScript · Fetches fonts, sprites, strings, audio, and levels. · `preview/famobi/src/game/assets/loader.js`
- [Famobi scene flow](https://github.com/sogful/candies.monster/blob/main/preview/famobi/src/engine/scene/director.js): scene director · Routes loading, menu, and level scenes. · `preview/famobi/src/engine/scene/director.js`
- [Famobi level gameplay](https://github.com/sogful/candies.monster/blob/main/preview/famobi/src/game/scenes/level.js): game scene · Uses physics entities and ropes during play. · `preview/famobi/src/game/scenes/level.js`
- **Famobi level data**: static assets
- [H5DX web game](https://github.com/sogful/candies.monster/blob/main/preview/h5dx/dist/index.html): prebuilt web runtime · Bundled game with service-worker caching. · `preview/h5dx/dist/index.html`
- [.NET WASM game](https://github.com/sogful/candies.monster/blob/main/preview/dx/dist/wwwroot/index.html): WebAssembly runtime · Published browser game with offline support. · `preview/dx/dist/wwwroot/index.html`

## Connections

- Static hosting → Site front page: serves
- Site front page → Shared browser utilities: loads
- Site front page → Candy metadata: uses
- Site front page → Conversion tools: links to
- Site front page → Music catalog: links to
- Site front page → Version archive: links to
- Site front page → Level resources: links to
- Site front page → Preview hub: links to
- Conversion tools → In-browser Python: runs with
- In-browser Python → Python converters: executes
- Conversion tools → Native converter download: offers download
- Music catalog → Music metadata and audio: reads
- Version archive → Version data loader: loads
- Preview hub → Famobi bootstrap: launches
- Preview hub → H5DX web game: launches
- Preview hub → .NET WASM game: launches
- Famobi bootstrap → Famobi asset loader: initializes
- Famobi bootstrap → Famobi scene flow: starts
- Famobi scene flow → Famobi level gameplay: enters level scene
- Famobi asset loader → Famobi level data: fetches
