# eseng-ctrlz/chromablast architecture

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

- Interactive diagram: https://gitdiagram.com/eseng-ctrlz/chromablast
- Repository: https://github.com/eseng-ctrlz/chromablast

## Overview

CHROMABLAST is a browser-based, real-time bomb arena game. The player uses keyboard or touch controls to play across arenas and modes: movement, bombs, blasts, opponents, and power-ups drive rounds or waves, while the canvas presents the game and LocalStorage preserves progression. The README documents the broader feature set; the sampled game.js excerpt confirms selected implementation details, including arena setup, bomb explosions, AI danger checks, and rendering. The game is compact and implemented primarily in one source file, so several components share its path.

Main entry points: [`game.js`](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js) (Game state and modes), [`style.css`](https://github.com/eseng-ctrlz/chromablast/blob/main/style.css) (Canvas and touch layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Arena gameplay"]
  node_game["Game state and modes<br/>[game.js]"]
  node_rounds["Rounds and waves<br/>[game.js]"]
end

subgraph group_world["World and combat"]
  node_arenas["Arena generation<br/>[game.js]"]
  node_movement["Movement and effects<br/>[game.js]"]
  node_bombs["Bomb placement<br/>[game.js]"]
  node_blasts["Explosions and chains<br/>[game.js]"]
  node_powerups["Power-ups<br/>[game.js]"]
  node_opponents["AI opponents<br/>[game.js]"]
end

subgraph group_interface["Interface and feedback"]
  node_controls["Keyboard and touch<br/>[game.js]"]
  node_render["Canvas renderer<br/>[game.js]"]
  node_palette["Palette effects<br/>[game.js]"]
  node_hud["HUD and screens<br/>[game.js]"]
  node_layout["Canvas and touch layout<br/>[style.css]"]
end

subgraph group_meta["Progression and audio"]
  node_saves[("Progress and saves<br/>[game.js]")]
  node_audio["Synthesized audio<br/>[game.js]"]
end

node_player(("Player"))
node_browser(("Browser"))

node_player -->|"provides input"| node_controls
node_controls -->|"dispatches actions"| node_game
node_game -->|"runs mode"| node_rounds
node_rounds -->|"starts round"| node_arenas
node_game -.->|"updates play"| node_movement
node_game -.->|"updates AI"| node_opponents
node_opponents -->|"places bombs"| node_bombs
node_game -.->|"places bombs"| node_bombs
node_bombs -->|"detonates"| node_blasts
node_blasts -->|"reveals drops"| node_powerups
node_game -->|"draws frame"| node_render
node_render -.->|"uses transformed sprites"| node_palette
node_render -->|"updates display"| node_hud
node_rounds -->|"records progress"| node_saves
node_game -->|"plays sounds"| node_audio
node_browser -->|"hosts runtime"| node_game
node_browser -->|"provides LocalStorage"| node_saves
node_browser -->|"provides Web Audio"| node_audio
node_browser -->|"scales display"| node_layout

click node_controls "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_game "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_rounds "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_arenas "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_movement "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_bombs "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_blasts "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_powerups "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_opponents "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_render "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_palette "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_hud "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_saves "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_audio "https://github.com/eseng-ctrlz/chromablast/blob/main/game.js"
click node_layout "https://github.com/eseng-ctrlz/chromablast/blob/main/style.css"

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_rounds,node_browser toneBlue
class node_arenas,node_movement,node_bombs,node_blasts,node_powerups,node_opponents toneAmber
class node_controls,node_render,node_palette,node_hud,node_layout toneMint
class node_saves,node_audio toneRose
class node_player toneIndigo
```

## Components

### Arena gameplay

- [Game state and modes](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Rounds and waves](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`

### World and combat

- [Arena generation](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Movement and effects](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Bomb placement](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Explosions and chains](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Power-ups](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [AI opponents](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`

### Interface and feedback

- [Keyboard and touch](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Canvas renderer](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Palette effects](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [HUD and screens](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Canvas and touch layout](https://github.com/eseng-ctrlz/chromablast/blob/main/style.css): `style.css`

### Progression and audio

- [Progress and saves](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`
- [Synthesized audio](https://github.com/eseng-ctrlz/chromablast/blob/main/game.js): `game.js`

### Other components

- **Player**
- **Browser**

## Connections

- Player → Keyboard and touch: provides input (evidence: `README.md`)
- Keyboard and touch → Game state and modes: dispatches actions (evidence: `game.js`)
- Game state and modes → Rounds and waves: runs mode (evidence: `README.md`)
- Rounds and waves → Arena generation: starts round (evidence: `game.js`)
- Game state and modes → Movement and effects: updates play (evidence: `game.js`)
- Game state and modes → AI opponents: updates AI (evidence: `game.js`)
- AI opponents → Bomb placement: places bombs (evidence: `game.js`)
- Game state and modes → Bomb placement: places bombs (evidence: `game.js`)
- Bomb placement → Explosions and chains: detonates (evidence: `game.js`)
- Explosions and chains → Power-ups: reveals drops (evidence: `README.md`)
- Game state and modes → Canvas renderer: draws frame (evidence: `game.js`)
- Canvas renderer → Palette effects: uses transformed sprites (evidence: `game.js`)
- Canvas renderer → HUD and screens: updates display (evidence: `game.js`)
- Rounds and waves → Progress and saves: records progress (evidence: `README.md`)
- Game state and modes → Synthesized audio: plays sounds (evidence: `game.js`)
- Browser → Game state and modes: hosts runtime (evidence: `README.md`)
- Browser → Progress and saves: provides LocalStorage (evidence: `README.md`)
- Browser → Synthesized audio: provides Web Audio (evidence: `README.md`)
- Browser → Canvas and touch layout: scales display (evidence: `README.md`)
