# ncase/wbwwb architecture

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

- Interactive diagram: https://gitdiagram.com/ncase/wbwwb
- Repository: https://github.com/ncase/wbwwb

## Overview

This repository implements a browser game about news cycles, social escalation, and violence. The principal workflow is: initialize and load assets, enter a scene, explore a world, and use the camera to photograph events that advance the story. The scene scripts preserve distinct acts and post-game content; character behaviors and world effects form the simulation layer. Evidence is limited to the supplied excerpts and README, so unsampled scene transitions and implementation details are not inferred.

Main entry points: [`js/core/SceneManager.js`](https://github.com/ncase/wbwwb/blob/master/js/core/SceneManager.js) (Scene manager), [`js/core/Game.js`](https://github.com/ncase/wbwwb/blob/master/js/core/Game.js) (Game loop and assets), [`js/scenes/Act_II.js`](https://github.com/ncase/wbwwb/blob/master/js/scenes/Act_II.js) (Act II escalation), [`js/scenes/Act_III.js`](https://github.com/ncase/wbwwb/blob/master/js/scenes/Act_III.js) (Act III murders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_game["Game loop and assets<br/>[Game.js]"]
  node_scene_manager["Scene manager<br/>[SceneManager.js]"]
  node_scene_base["Scene lifecycle<br/>[Scene.js]"]
  node_howler["Howler audio<br/>[howler.js]"]
end

subgraph group_story["Story scenes"]
  node_preloader["Preloader<br/>[Scene_Preloader.js]"]
  node_act_one["Act I<br/>[Act_I.js]"]
  node_act_two["Act II escalation<br/>[Act_II.js]"]
  node_act_three["Act III murders<br/>[Act_III.js]"]
  node_game_scene["Game scene<br/>[Scene_Game.js]"]
  node_meta_scene["Meta scene<br/>[Scene_Meta.js]"]
  node_credits["Credits and endings<br/>[Scene_Credits.js]"]
  node_text["Localized text<br/>[textStrings.js]"]
  node_post_credits["Post-credits scenes"]
  node_post_post_credits["Further post-credits"]
  node_quote["Quote scene<br/>[Scene_Quote.js]"]
  node_end_prototype["Prototype ending"]
end

subgraph group_simulation["World simulation"]
  node_director["Photo director<br/>[Director.js]"]
  node_world["World and props<br/>[World.js]"]
  node_camera["Camera<br/>[Camera.js]"]
  node_cricket["Cricket prop<br/>[Cricket.js]"]
end

subgraph group_characters["Characters and audio"]
  node_normal_peep["Everyday characters<br/>[NormalPeep.js]"]
  node_peep_base["Character behavior<br/>[Peep.js]"]
  node_murder_peep["Murderers<br/>[MurderPeep.js]"]
end

node_player(("Player"))

node_player -.->|"plays"| node_game
node_game -->|"updates"| node_scene_manager
node_game -->|"loads and mutes"| node_howler
node_scene_manager -->|"updates and kills"| node_scene_base
node_scene_manager -->|"dispatches scenes"| node_preloader
node_scene_manager -.->|"dispatches scenes"| node_game_scene
node_scene_manager -.->|"dispatches scenes"| node_act_one
node_scene_manager -.->|"dispatches scenes"| node_act_two
node_scene_manager -.->|"dispatches scenes"| node_act_three
node_scene_manager -.->|"dispatches scenes"| node_meta_scene
node_scene_manager -.->|"dispatches scenes"| node_credits
node_scene_manager -.->|"dispatches scenes"| node_post_credits
node_scene_manager -.->|"dispatches scenes"| node_post_post_credits
node_scene_manager -.->|"dispatches scenes"| node_quote
node_scene_manager -.->|"dispatches scenes"| node_end_prototype
node_act_two -->|"reads captions"| node_text
node_act_two -->|"replaces characters"| node_world
node_act_three -->|"creates murderers"| node_murder_peep
node_director -->|"adds prop"| node_cricket
node_game -.->|"registers audio assets"| node_director

click node_game "https://github.com/ncase/wbwwb/blob/master/js/core/Game.js"
click node_scene_manager "https://github.com/ncase/wbwwb/blob/master/js/core/SceneManager.js"
click node_scene_base "https://github.com/ncase/wbwwb/blob/master/js/core/Scene.js"
click node_preloader "https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Preloader.js"
click node_act_one "https://github.com/ncase/wbwwb/blob/master/js/scenes/Act_I.js"
click node_act_two "https://github.com/ncase/wbwwb/blob/master/js/scenes/Act_II.js"
click node_act_three "https://github.com/ncase/wbwwb/blob/master/js/scenes/Act_III.js"
click node_game_scene "https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Game.js"
click node_meta_scene "https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Meta.js"
click node_credits "https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Credits.js"
click node_director "https://github.com/ncase/wbwwb/blob/master/js/game/Director.js"
click node_world "https://github.com/ncase/wbwwb/blob/master/js/game/World.js"
click node_camera "https://github.com/ncase/wbwwb/blob/master/js/game/Camera.js"
click node_normal_peep "https://github.com/ncase/wbwwb/blob/master/js/peeps/NormalPeep.js"
click node_peep_base "https://github.com/ncase/wbwwb/blob/master/js/game/Peep.js"
click node_murder_peep "https://github.com/ncase/wbwwb/blob/master/js/peeps/MurderPeep.js"
click node_text "https://github.com/ncase/wbwwb/blob/master/js/textStrings.js"
click node_cricket "https://github.com/ncase/wbwwb/blob/master/js/misc/Cricket.js"
click node_howler "https://github.com/ncase/wbwwb/blob/master/js/lib/howler.js"
click node_post_credits "https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Post_Credits.js"
click node_post_post_credits "https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Post_Post_Credits.js"
click node_quote "https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Quote.js"
click node_end_prototype "https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_EndPrototype.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_scene_manager,node_scene_base,node_howler toneBlue
class node_preloader,node_act_one,node_act_two,node_act_three,node_game_scene,node_meta_scene,node_credits,node_text,node_post_credits,node_post_post_credits,node_quote,node_end_prototype toneAmber
class node_director,node_world,node_camera,node_cricket toneMint
class node_normal_peep,node_peep_base,node_murder_peep toneRose
class node_player toneIndigo
```

## Components

### Game runtime

- [Game loop and assets](https://github.com/ncase/wbwwb/blob/master/js/core/Game.js): `js/core/Game.js`
- [Scene manager](https://github.com/ncase/wbwwb/blob/master/js/core/SceneManager.js): `js/core/SceneManager.js`
- [Scene lifecycle](https://github.com/ncase/wbwwb/blob/master/js/core/Scene.js): `js/core/Scene.js`
- [Howler audio](https://github.com/ncase/wbwwb/blob/master/js/lib/howler.js): `js/lib/howler.js`

### Story scenes

- [Preloader](https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Preloader.js): `js/scenes/Scene_Preloader.js`
- [Act I](https://github.com/ncase/wbwwb/blob/master/js/scenes/Act_I.js): `js/scenes/Act_I.js`
- [Act II escalation](https://github.com/ncase/wbwwb/blob/master/js/scenes/Act_II.js): `js/scenes/Act_II.js`
- [Act III murders](https://github.com/ncase/wbwwb/blob/master/js/scenes/Act_III.js): `js/scenes/Act_III.js`
- [Game scene](https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Game.js): `js/scenes/Scene_Game.js`
- [Meta scene](https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Meta.js): `js/scenes/Scene_Meta.js`
- [Credits and endings](https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Credits.js): `js/scenes/Scene_Credits.js`
- [Localized text](https://github.com/ncase/wbwwb/blob/master/js/textStrings.js): `js/textStrings.js`
- [Post-credits scenes](https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Post_Credits.js): `js/scenes/Scene_Post_Credits.js`
- [Further post-credits](https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Post_Post_Credits.js): `js/scenes/Scene_Post_Post_Credits.js`
- [Quote scene](https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_Quote.js): `js/scenes/Scene_Quote.js`
- [Prototype ending](https://github.com/ncase/wbwwb/blob/master/js/scenes/Scene_EndPrototype.js): `js/scenes/Scene_EndPrototype.js`

### World simulation

- [Photo director](https://github.com/ncase/wbwwb/blob/master/js/game/Director.js): `js/game/Director.js`
- [World and props](https://github.com/ncase/wbwwb/blob/master/js/game/World.js): `js/game/World.js`
- [Camera](https://github.com/ncase/wbwwb/blob/master/js/game/Camera.js): `js/game/Camera.js`
- [Cricket prop](https://github.com/ncase/wbwwb/blob/master/js/misc/Cricket.js): `js/misc/Cricket.js`

### Characters and audio

- [Everyday characters](https://github.com/ncase/wbwwb/blob/master/js/peeps/NormalPeep.js): `js/peeps/NormalPeep.js`
- [Character behavior](https://github.com/ncase/wbwwb/blob/master/js/game/Peep.js): `js/game/Peep.js`
- [Murderers](https://github.com/ncase/wbwwb/blob/master/js/peeps/MurderPeep.js): `js/peeps/MurderPeep.js`

### Other components

- **Player**

## Connections

- Player → Game loop and assets: plays (evidence: `README.md`)
- Game loop and assets → Scene manager: updates (evidence: `js/core/Game.js`)
- Game loop and assets → Howler audio: loads and mutes (evidence: `js/core/Game.js`)
- Scene manager → Scene lifecycle: updates and kills (evidence: `js/core/SceneManager.js`)
- Scene manager → Preloader: dispatches scenes (evidence: `js/core/SceneManager.js`)
- Scene manager → Game scene: dispatches scenes
- Scene manager → Act I: dispatches scenes
- Scene manager → Act II escalation: dispatches scenes
- Scene manager → Act III murders: dispatches scenes
- Scene manager → Meta scene: dispatches scenes
- Scene manager → Credits and endings: dispatches scenes
- Scene manager → Post-credits scenes: dispatches scenes
- Scene manager → Further post-credits: dispatches scenes
- Scene manager → Quote scene: dispatches scenes
- Scene manager → Prototype ending: dispatches scenes
- Act II escalation → Localized text: reads captions (evidence: `js/scenes/Act_II.js`)
- Act II escalation → World and props: replaces characters (evidence: `js/scenes/Act_II.js`)
- Act III murders → Murderers: creates murderers (evidence: `js/scenes/Act_III.js`)
- Photo director → Cricket prop: adds prop (evidence: `js/game/Director.js`)
- Game loop and assets → Photo director: registers audio assets
