# glenicko/stickman-fighter-keyboard architecture

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

- Interactive diagram: https://gitdiagram.com/glenicko/stickman-fighter-keyboard
- Repository: https://github.com/glenicko/stickman-fighter-keyboard

## Overview

This is a browser-based keyboard fighting game: the player starts or resumes from the menu, types generated combat prompts, and the resulting moves affect fighter state and lead to a win/loss outcome. The single JavaScript file also handles difficulty, enemy attacks, HUD updates, animation, and canvas effects. The README is only a brief description, and the excerpts omit parts of the runtime, so edges below are limited to relationships directly shown in the excerpts or documented capabilities.

Main entry points: [`script.js`](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js) (Typing combat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Combat gameplay"]
  node_script["Game runtime<br/>[script.js]"]
  node_combat["Typing combat<br/>[script.js]"]
  node_difficulty["Difficulty settings<br/>[script.js]"]
  node_enemy["Enemy fighter<br/>[script.js]"]
  node_gameflow["Game flow<br/>[script.js]"]
end

subgraph group_interface["Game interface"]
  node_hud["HUD updates<br/>[script.js]"]
  node_menu["Menu controls<br/>[script.js]"]
end

subgraph group_rendering["Rendering and effects"]
  node_fighterdrawing["Fighter drawing<br/>[script.js]"]
  node_effects["Canvas effects<br/>[script.js]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_menu
node_player -->|"types prompts"| node_combat
node_menu -->|"starts or returns"| node_gameflow
node_difficulty -->|"sets difficulty"| node_script
node_combat -->|"applies attacks"| node_enemy
node_combat -->|"updates status"| node_hud
node_combat -->|"checks game over"| node_gameflow
node_script -->|"draws fighters"| node_fighterdrawing
node_script -->|"draws effects"| node_effects
node_enemy -->|"attacks on timer"| node_script

click node_script "https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js"
click node_combat "https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js"
click node_difficulty "https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js"
click node_enemy "https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js"
click node_gameflow "https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js"
click node_hud "https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js"
click node_menu "https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js"
click node_fighterdrawing "https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js"
click node_effects "https://github.com/glenicko/stickman-fighter-keyboard/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_script,node_combat,node_difficulty,node_enemy,node_gameflow toneBlue
class node_hud,node_menu toneAmber
class node_fighterdrawing,node_effects toneMint
class node_player toneIndigo
```

## Components

### Combat gameplay

- [Game runtime](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`
- [Typing combat](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`
- [Difficulty settings](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`
- [Enemy fighter](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`
- [Game flow](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`

### Game interface

- [HUD updates](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`
- [Menu controls](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`

### Rendering and effects

- [Fighter drawing](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`
- [Canvas effects](https://github.com/glenicko/stickman-fighter-keyboard/blob/main/script.js): `script.js`

### Other components

- **Player**

## Connections

- Player → Menu controls: starts game (evidence: `script.js`)
- Player → Typing combat: types prompts (evidence: `script.js`)
- Menu controls → Game flow: starts or returns (evidence: `script.js`)
- Difficulty settings → Game runtime: sets difficulty (evidence: `script.js`)
- Typing combat → Enemy fighter: applies attacks (evidence: `script.js`)
- Typing combat → HUD updates: updates status (evidence: `script.js`)
- Typing combat → Game flow: checks game over (evidence: `script.js`)
- Game runtime → Fighter drawing: draws fighters (evidence: `script.js`)
- Game runtime → Canvas effects: draws effects (evidence: `script.js`)
- Enemy fighter → Game runtime: attacks on timer (evidence: `script.js`)
