# trewrightserves/cube-basher architecture

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

- Interactive diagram: https://gitdiagram.com/trewrightserves/cube-basher
- Repository: https://github.com/trewrightserves/cube-basher

## Overview

Cube Basher is a browser-based, single-file 3D survivors-like game. The main workflow is to launch a run, move and survive while weapons fire automatically, choose in-run upgrades, and earn gold for permanent purchases between runs. The map separates run gameplay, metaprogression, and presentation/runtime concerns; these are documented capabilities, not inspected implementation modules. The README identifies index.html as the whole game and documents browser storage and CDN dependencies, but source excerpts were unavailable, so internal call relationships are omitted where wiring is uncertain.

Main entry points: [`index.html`](https://github.com/trewrightserves/cube-basher/blob/main/index.html) (Game Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run Gameplay"]
  node_world["World and Movement<br/>[index.html]"]
  node_characters["Playable Characters<br/>[index.html]"]
  node_combat["Auto-Firing Weapons<br/>[index.html]"]
  node_enemies["Enemies and Bosses<br/>[index.html]"]
  node_runupgrades["Run Upgrades<br/>[index.html]"]
end

subgraph group_meta["Metaprogression"]
  node_runrewards["Run Gold<br/>[index.html]"]
  node_lab["Upgrade Lab<br/>[index.html]"]
  node_savedata[("Browser Save Data<br/>[index.html]")]
end

subgraph group_runtime["Presentation Runtime"]
  node_game["Game Entry<br/>[index.html]"]
  node_graphics["3D Rendering<br/>[index.html]"]
  node_audio["Procedural Audio<br/>[index.html]"]
end

node_player(("Player"))
node_browser["Web Browser"]
node_threejs["three.js CDN"]
node_fonts["Fonts CDN"]

node_player -->|"launches"| node_game
node_game -->|"runs"| node_world
node_game -->|"offers selection"| node_characters
node_game -->|"runs combat"| node_combat
node_game -->|"runs encounters"| node_enemies
node_player -->|"moves and dodges"| node_world
node_player -->|"chooses upgrades"| node_runupgrades
node_runrewards -->|"banks gold"| node_lab
node_lab -->|"saves purchases"| node_savedata
node_game -->|"runs in"| node_browser
node_game -.->|"loads engine"| node_threejs
node_game -.->|"loads fonts"| node_fonts
node_game -->|"renders"| node_graphics
node_game -->|"synthesizes sound"| node_audio
node_browser -->|"stores locally"| node_savedata

click node_game "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_world "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_characters "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_combat "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_enemies "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_runupgrades "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_runrewards "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_lab "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_savedata "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_graphics "https://github.com/trewrightserves/cube-basher/blob/main/index.html"
click node_audio "https://github.com/trewrightserves/cube-basher/blob/main/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_world,node_characters,node_combat,node_enemies,node_runupgrades,node_browser toneBlue
class node_runrewards,node_lab,node_savedata toneAmber
class node_game,node_graphics,node_audio toneMint
class node_player,node_threejs,node_fonts toneIndigo
```

## Components

### Run Gameplay

- [World and Movement](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`
- [Playable Characters](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`
- [Auto-Firing Weapons](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`
- [Enemies and Bosses](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`
- [Run Upgrades](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`

### Metaprogression

- [Run Gold](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`
- [Upgrade Lab](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`
- [Browser Save Data](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`

### Presentation Runtime

- [Game Entry](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`
- [3D Rendering](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`
- [Procedural Audio](https://github.com/trewrightserves/cube-basher/blob/main/index.html): `index.html`

### Other components

- **Player**
- **Web Browser**
- **three.js CDN**
- **Fonts CDN**

## Connections

- Player → Game Entry: launches
- Game Entry → World and Movement: runs
- Game Entry → Playable Characters: offers selection
- Game Entry → Auto-Firing Weapons: runs combat
- Game Entry → Enemies and Bosses: runs encounters
- Player → World and Movement: moves and dodges
- Player → Run Upgrades: chooses upgrades
- Run Gold → Upgrade Lab: banks gold
- Upgrade Lab → Browser Save Data: saves purchases
- Game Entry → Web Browser: runs in
- Game Entry → three.js CDN: loads engine
- Game Entry → Fonts CDN: loads fonts
- Game Entry → 3D Rendering: renders
- Game Entry → Procedural Audio: synthesizes sound
- Web Browser → Browser Save Data: stores locally
