# sparrowworks/vanguard architecture

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

- Interactive diagram: https://gitdiagram.com/sparrowworks/vanguard
- Repository: https://github.com/sparrowworks/vanguard

## Overview

Vanguard is a Godot library for building and customizing 2D weapons. A user starts from a blueprint scene, inherits it into a game-specific scene, and can build ranged weapons, projectiles, fields, melee weapons, hitboxes, and hurtboxes. Weapon kits provide modification capabilities, while the core Weapon class is the documented base for custom weapon types. The README describes these capabilities but no source excerpts were provided, so internal runtime calls and interactions between blueprints are not asserted.

Main entry points: [`addons/vanguard/blueprints/weapon/weapon.gd`](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/weapon/weapon.gd) (Weapon base), [`addons/vanguard/blueprints/ranged/ranged.gd`](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/ranged/ranged.gd) (Ranged weapon), [`addons/vanguard/kits`](https://github.com/sparrowworks/vanguard/tree/main/addons/vanguard/kits) (Weapon kits), [`addons/vanguard/blueprints/projectile/projectile.gd`](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/projectile/projectile.gd) (Projectile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_weapon_core["Weapon foundations"]
  node_weapon["Weapon base<br/>[weapon.gd]"]
  node_ranged["Ranged weapon<br/>[ranged.gd]"]
end

subgraph group_combat_blueprints["Combat blueprints"]
  node_projectile["Projectile<br/>[projectile.gd]"]
  node_field["Effect field<br/>[field.gd]"]
  node_melee["Melee weapon<br/>[melee.tscn]"]
  node_hitbox["Hitbox<br/>[hitbox.gd]"]
  node_hurtbox["Hurtbox<br/>[hurtbox.gd]"]
end

subgraph group_modifications["Weapon modifications"]
  node_kits["Weapon kits"]
end

subgraph group_examples["Example weapons"]
  node_pistol["Pistol example<br/>[pistol.gd]"]
  node_sword["Sword example<br/>[sword.gd]"]
end

node_user(("Godot user"))

node_user -->|"inherits scene"| node_weapon
node_user -->|"inherits scene"| node_ranged
node_user -->|"inherits scene"| node_projectile
node_user -->|"inherits scene"| node_field
node_user -->|"inherits scene"| node_melee
node_user -->|"inherits scene"| node_hitbox
node_user -->|"inherits scene"| node_hurtbox
node_weapon -->|"base for"| node_ranged
node_kits -->|"modifies"| node_weapon

click node_weapon "https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/weapon/weapon.gd"
click node_ranged "https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/ranged/ranged.gd"
click node_projectile "https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/projectile/projectile.gd"
click node_field "https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/field/field.gd"
click node_melee "https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/melee/melee.tscn"
click node_hitbox "https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/hitbox/hitbox.gd"
click node_hurtbox "https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/hurtbox/hurtbox.gd"
click node_kits "https://github.com/sparrowworks/vanguard/tree/main/addons/vanguard/kits"
click node_pistol "https://github.com/sparrowworks/vanguard/blob/main/src/weapons/pistol/pistol.gd"
click node_sword "https://github.com/sparrowworks/vanguard/blob/main/src/weapons/sword/sword.gd"

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_weapon,node_ranged,node_user toneBlue
class node_projectile,node_field,node_melee,node_hitbox,node_hurtbox toneAmber
class node_kits toneMint
class node_pistol,node_sword toneRose
```

## Components

### Weapon foundations

- [Weapon base](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/weapon/weapon.gd): `addons/vanguard/blueprints/weapon/weapon.gd`
- [Ranged weapon](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/ranged/ranged.gd): `addons/vanguard/blueprints/ranged/ranged.gd`

### Combat blueprints

- [Projectile](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/projectile/projectile.gd): `addons/vanguard/blueprints/projectile/projectile.gd`
- [Effect field](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/field/field.gd): `addons/vanguard/blueprints/field/field.gd`
- [Melee weapon](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/melee/melee.tscn): `addons/vanguard/blueprints/melee/melee.tscn`
- [Hitbox](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/hitbox/hitbox.gd): `addons/vanguard/blueprints/hitbox/hitbox.gd`
- [Hurtbox](https://github.com/sparrowworks/vanguard/blob/main/addons/vanguard/blueprints/hurtbox/hurtbox.gd): `addons/vanguard/blueprints/hurtbox/hurtbox.gd`

### Weapon modifications

- [Weapon kits](https://github.com/sparrowworks/vanguard/tree/main/addons/vanguard/kits): `addons/vanguard/kits`

### Example weapons

- [Pistol example](https://github.com/sparrowworks/vanguard/blob/main/src/weapons/pistol/pistol.gd): `src/weapons/pistol/pistol.gd`
- [Sword example](https://github.com/sparrowworks/vanguard/blob/main/src/weapons/sword/sword.gd): `src/weapons/sword/sword.gd`

### Other components

- **Godot user**

## Connections

- Godot user → Weapon base: inherits scene (evidence: `README.md`)
- Godot user → Ranged weapon: inherits scene (evidence: `README.md`)
- Godot user → Projectile: inherits scene (evidence: `README.md`)
- Godot user → Effect field: inherits scene (evidence: `README.md`)
- Godot user → Melee weapon: inherits scene (evidence: `README.md`)
- Godot user → Hitbox: inherits scene (evidence: `README.md`)
- Godot user → Hurtbox: inherits scene (evidence: `README.md`)
- Weapon base → Ranged weapon: base for (evidence: `README.md`)
- Weapon kits → Weapon base: modifies (evidence: `README.md`)
