# bjornbasar/chidole architecture

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

- Interactive diagram: https://gitdiagram.com/bjornbasar/chidole
- Repository: https://github.com/bjornbasar/chidole

## Overview

chidole is a browser-based pixel-art shoot-’em-up. The player starts a run and steers with keyboard or mouse; the game spawns enemies, aims and fires equipped weapons, handles hits and pickups, advances XP and levels, and renders the run or game-over state. `game.js` coordinates the runtime and delegates reusable calculations to `logic.js`. The README documents the Canvas/static-site experience; sampled excerpts do not show every game-over or rendering detail.

Main entry points: [`game.js`](https://github.com/bjornbasar/chidole/blob/main/game.js) (Game runtime), [`index.html`](https://github.com/bjornbasar/chidole/blob/main/index.html) (Game page), [`assets`](https://github.com/bjornbasar/chidole/tree/main/assets) (Game assets), [`logic.js`](https://github.com/bjornbasar/chidole/blob/main/logic.js) (Game logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Browser presentation"]
  node_page["Game page<br/>[index.html]"]
  node_art["Game assets"]
end

subgraph group_gameplay["Gameplay runtime"]
  node_runtime["Game runtime<br/>[game.js]"]
end

subgraph group_rules["Game rules"]
  node_logic["Game logic<br/>[logic.js]"]
end

node_player(("Player"))

node_player -->|"controls"| node_runtime
node_runtime -->|"updates display"| node_page
node_runtime -->|"loads sprites"| node_art
node_runtime -->|"calls calculations"| node_logic

click node_page "https://github.com/bjornbasar/chidole/blob/main/index.html"
click node_art "https://github.com/bjornbasar/chidole/tree/main/assets"
click node_runtime "https://github.com/bjornbasar/chidole/blob/main/game.js"
click node_logic "https://github.com/bjornbasar/chidole/blob/main/logic.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_page,node_art toneBlue
class node_runtime toneAmber
class node_logic toneMint
class node_player toneIndigo
```

## Components

### Browser presentation

- [Game page](https://github.com/bjornbasar/chidole/blob/main/index.html): `index.html`
- [Game assets](https://github.com/bjornbasar/chidole/tree/main/assets): `assets`

### Gameplay runtime

- [Game runtime](https://github.com/bjornbasar/chidole/blob/main/game.js): `game.js`

### Game rules

- [Game logic](https://github.com/bjornbasar/chidole/blob/main/logic.js): `logic.js`

### Other components

- **Player**

## Connections

- Player → Game runtime: controls
- Game runtime → Game page: updates display
- Game runtime → Game assets: loads sprites
- Game runtime → Game logic: calls calculations
