# sronaldooo/dodge-the-meteors architecture

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

- Interactive diagram: https://gitdiagram.com/sronaldooo/dodge-the-meteors
- Repository: https://github.com/sronaldooo/dodge-the-meteors

## Overview

Dodge the Meteors is a small browser survival game. Players start or resume a run, steer the ship with keyboard controls, avoid increasingly frequent falling meteors, and survive to build a score; collisions end the run and update the browser-stored best score. Pause and restart are additional controls. The sampled JavaScript combines game state, simulation, collision handling, drawing, and event wiring in one file, so these are shown as responsibilities within that runtime rather than separate modules. HTML and styling are present in the tree, but their implementation was not sampled.

Main entry points: [`script.js`](https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.js) (Game controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game runtime"]
  node_game["Game controller<br/>[script.js]"]
  node_simulation["Survival simulation<br/>[script.js]"]
  node_renderer["Canvas renderer<br/>[script.js]"]
end

subgraph group_progress["Scores and persistence"]
  node_score["Score state<br/>[script.js]"]
  node_storage[("Browser storage")]
end

node_player(("Player"))

node_player -->|"starts, pauses"| node_game
node_player -->|"steers ship"| node_simulation
node_game -->|"updates"| node_simulation
node_game -->|"draws frame"| node_renderer
node_simulation -->|"increments"| node_score
node_game -->|"resets, checks"| node_score
node_score -->|"reads, writes best"| node_storage

click node_game "https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.js"
click node_simulation "https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.js"
click node_renderer "https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.js"
click node_score "https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.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_simulation,node_renderer toneBlue
class node_score,node_storage toneAmber
class node_player toneIndigo
```

## Components

### Game runtime

- [Game controller](https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.js): `script.js`
- [Survival simulation](https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.js): `script.js`
- [Canvas renderer](https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.js): `script.js`

### Scores and persistence

- [Score state](https://github.com/sronaldooo/dodge-the-meteors/blob/main/script.js): `script.js`
- **Browser storage**

### Other components

- **Player**

## Connections

- Player → Game controller: starts, pauses (evidence: `script.js`)
- Player → Survival simulation: steers ship (evidence: `script.js`)
- Game controller → Survival simulation: updates (evidence: `script.js`)
- Game controller → Canvas renderer: draws frame (evidence: `script.js`)
- Survival simulation → Score state: increments (evidence: `script.js`)
- Game controller → Score state: resets, checks (evidence: `script.js`)
- Score state → Browser storage: reads, writes best (evidence: `script.js`)
