# kaguyo/blitz architecture

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

- Interactive diagram: https://gitdiagram.com/kaguyo/blitz
- Repository: https://github.com/kaguyo/blitz

## Overview

Blitz appears to be a canvas-based action game wrapped as a Wails desktop application. Its visible runtime loop initializes a player and character, loads default scenery, then repeatedly handles input, generates the stage, updates and draws the character, and renders the HUD. The tree suggests separate character movesets, animations, attributes, and HUD widgets, but their detailed wiring is not fully sampled. The README describes the Wails template rather than game features, so the game map is based on the sampled entry point and source names.

Main entry points: [`frontend/src/main.ts`](https://github.com/kaguyo/blitz/blob/master/frontend/src/main.ts) (Game Loop), [`frontend/src/scripts/players/player.ts`](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/players/player.ts) (Player), [`frontend/src/scripts/characters/character.ts`](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/characters/character.ts) (Character), [`frontend/src/scripts/listeners/listeners.ts`](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/listeners/listeners.ts) (Input Listeners)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Gameplay"]
  node_player["Player<br/>[player.ts]"]
  node_input["Input Listeners<br/>[listeners.ts]"]
  node_gameproperties["Game Properties<br/>[gameProperties.ts]"]
  node_loop["Game Loop<br/>[main.ts]"]
end

subgraph group_characters["Character System"]
  node_character["Character<br/>[character.ts]"]
  node_movesets["Character Movesets"]
  node_animations["Character Animations"]
  node_attributes["Character Attributes<br/>[attributes.ts]"]
end

subgraph group_presentation["Presentation"]
  node_stage["Stage 1<br/>[stage1.ts]"]
  node_hud["HUD Renderer<br/>[hud.ts]"]
  node_hudwidgets["Character HUD Widgets"]
end

subgraph group_desktop["Desktop Shell"]
  node_wails["Wails App<br/>[main.go]"]
  node_app["Go App Binding<br/>[app.go]"]
end

node_user(("Player"))

node_loop -->|"creates and updates"| node_player
node_loop -->|"loads defaults"| node_input
node_loop -->|"generates stage"| node_stage
node_loop -->|"draws player"| node_player
node_loop -->|"generates HUD"| node_hud
node_loop -->|"sets contexts"| node_gameproperties
node_player -->|"uses active character"| node_character
node_character --> node_attributes
node_user -->|"provides input"| node_input
node_wails -->|"starts and binds"| node_app

click node_player "https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/players/player.ts"
click node_input "https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/listeners/listeners.ts"
click node_stage "https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/scenery/stage1.ts"
click node_character "https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/characters/character.ts"
click node_movesets "https://github.com/kaguyo/blitz/tree/master/frontend/src/scripts/characters/movesets"
click node_animations "https://github.com/kaguyo/blitz/tree/master/frontend/src/scripts/characters/animations"
click node_attributes "https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/characters/properties/attributes.ts"
click node_hud "https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/hud/hud.ts"
click node_hudwidgets "https://github.com/kaguyo/blitz/tree/master/frontend/src/scripts/hud/characterHud"
click node_gameproperties "https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/options/gameProperties.ts"
click node_loop "https://github.com/kaguyo/blitz/blob/master/frontend/src/main.ts"
click node_wails "https://github.com/kaguyo/blitz/blob/master/main.go"
click node_app "https://github.com/kaguyo/blitz/blob/master/app.go"

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_player,node_input,node_gameproperties,node_loop toneBlue
class node_character,node_movesets,node_animations,node_attributes toneAmber
class node_stage,node_hud,node_hudwidgets toneMint
class node_wails,node_app toneRose
class node_user toneIndigo
```

## Components

### Gameplay

- [Player](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/players/player.ts): `frontend/src/scripts/players/player.ts`
- [Input Listeners](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/listeners/listeners.ts): `frontend/src/scripts/listeners/listeners.ts`
- [Game Properties](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/options/gameProperties.ts): `frontend/src/scripts/options/gameProperties.ts`
- [Game Loop](https://github.com/kaguyo/blitz/blob/master/frontend/src/main.ts): `frontend/src/main.ts`

### Character System

- [Character](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/characters/character.ts): `frontend/src/scripts/characters/character.ts`
- [Character Movesets](https://github.com/kaguyo/blitz/tree/master/frontend/src/scripts/characters/movesets): `frontend/src/scripts/characters/movesets`
- [Character Animations](https://github.com/kaguyo/blitz/tree/master/frontend/src/scripts/characters/animations): `frontend/src/scripts/characters/animations`
- [Character Attributes](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/characters/properties/attributes.ts): `frontend/src/scripts/characters/properties/attributes.ts`

### Presentation

- [Stage 1](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/scenery/stage1.ts): `frontend/src/scripts/scenery/stage1.ts`
- [HUD Renderer](https://github.com/kaguyo/blitz/blob/master/frontend/src/scripts/hud/hud.ts): `frontend/src/scripts/hud/hud.ts`
- [Character HUD Widgets](https://github.com/kaguyo/blitz/tree/master/frontend/src/scripts/hud/characterHud): `frontend/src/scripts/hud/characterHud`

### Desktop Shell

- [Wails App](https://github.com/kaguyo/blitz/blob/master/main.go): `main.go`
- [Go App Binding](https://github.com/kaguyo/blitz/blob/master/app.go): `app.go`

### Other components

- **Player**

## Connections

- Game Loop → Player: creates and updates
- Game Loop → Input Listeners: loads defaults
- Game Loop → Stage 1: generates stage
- Game Loop → Player: draws player
- Game Loop → HUD Renderer: generates HUD
- Game Loop → Game Properties: sets contexts
- Player → Character: uses active character
- Character → Character Attributes
- Player → Input Listeners: provides input
- Wails App → Go App Binding: starts and binds
