# run2go/blockjump architecture

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

- Interactive diagram: https://gitdiagram.com/run2go/blockjump
- Repository: https://github.com/run2go/blockjump

## Overview

Block Jump is a small Rust/SDL2 platform-jumping game. Its single-file runtime initializes a window and game state, processes input, updates physics and platforms, then draws the player, platforms, and score. The README describes it as work in progress and documents no additional capabilities. All implementation evidence comes from the excerpted main file; the graph separates its meaningful runtime responsibilities without implying independent modules.

Main entry points: [`src/main.rs`](https://github.com/run2go/blockjump/blob/main/src/main.rs) (Game loop and state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_game_loop["Game loop and state<br/>[main.rs]"]
end

subgraph group_gameplay["Gameplay logic"]
  node_player["Player input and physics<br/>[main.rs]"]
  node_platforms["Platform generation<br/>[main.rs]"]
  node_scoring["Score and reset<br/>[main.rs]"]
end

subgraph group_presentation["Rendering"]
  node_renderer["Game renderer<br/>[main.rs]"]
end

node_player_actor(("Player"))
node_sdl["SDL window and input"]

node_player_actor -->|"provides input"| node_game_loop
node_game_loop -->|"polls events"| node_sdl
node_game_loop -->|"updates state"| node_player
node_game_loop -->|"initializes platforms"| node_platforms
node_player -->|"checks collisions"| node_platforms
node_player -->|"updates score"| node_scoring
node_game_loop -->|"resets on fall"| node_scoring
node_game_loop -->|"renders state"| node_renderer
node_renderer -->|"draws frame"| node_sdl

click node_player "https://github.com/run2go/blockjump/blob/main/src/main.rs"
click node_platforms "https://github.com/run2go/blockjump/blob/main/src/main.rs"
click node_scoring "https://github.com/run2go/blockjump/blob/main/src/main.rs"
click node_renderer "https://github.com/run2go/blockjump/blob/main/src/main.rs"
click node_game_loop "https://github.com/run2go/blockjump/blob/main/src/main.rs"

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_loop toneBlue
class node_player,node_platforms,node_scoring toneAmber
class node_renderer toneMint
class node_player_actor,node_sdl toneIndigo
```

## Components

### Game runtime

- [Game loop and state](https://github.com/run2go/blockjump/blob/main/src/main.rs): `src/main.rs`

### Gameplay logic

- [Player input and physics](https://github.com/run2go/blockjump/blob/main/src/main.rs): `src/main.rs`
- [Platform generation](https://github.com/run2go/blockjump/blob/main/src/main.rs): `src/main.rs`
- [Score and reset](https://github.com/run2go/blockjump/blob/main/src/main.rs): `src/main.rs`

### Rendering

- [Game renderer](https://github.com/run2go/blockjump/blob/main/src/main.rs): `src/main.rs`

### Other components

- **Player**
- **SDL window and input**

## Connections

- Player → Game loop and state: provides input (evidence: `src/main.rs`)
- Game loop and state → SDL window and input: polls events (evidence: `src/main.rs`)
- Game loop and state → Player input and physics: updates state (evidence: `src/main.rs`)
- Game loop and state → Platform generation: initializes platforms (evidence: `src/main.rs`)
- Player input and physics → Platform generation: checks collisions (evidence: `src/main.rs`)
- Player input and physics → Score and reset: updates score (evidence: `src/main.rs`)
- Game loop and state → Score and reset: resets on fall (evidence: `src/main.rs`)
- Game loop and state → Game renderer: renders state (evidence: `src/main.rs`)
- Game renderer → SDL window and input: draws frame (evidence: `src/main.rs`)
