# lan2two/vampire-survivors-like architecture

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

- Interactive diagram: https://gitdiagram.com/lan2two/vampire-survivors-like
- Repository: https://github.com/lan2two/vampire-survivors-like

## Overview

Vampire-Survivors-Like is a Godot top-down survival game: the player moves, rolls, and attacks while enemy waves spawn; defeating enemies yields loot and experience, which supports weapon pickup and upgrades, and the run ends in a game-over state. The graph combines documented gameplay with relationships visible in the source index and excerpts. Several GUI and player-control scripts were not sampled, so their detailed wiring is omitted rather than inferred.

Main entry points: [`scripts/player/InventoryManager.cs`](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/InventoryManager.cs) (Inventory and weapons), [`scripts/bullet/Bullet.cs`](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/bullet/Bullet.cs) (Bullet), [`scripts/enemy/EnemyDeath.cs`](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/enemy/EnemyDeath.cs) (Enemy death), [`scripts/GUI/GameScene.cs`](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/GameScene.cs) (Game scene)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_combat["Combat and enemies"]
  node_enemy_spawn["Enemy spawning<br/>[EnemySpawner.cs]"]
  node_enemy["Enemy<br/>[Enemy.cs]"]
  node_enemy_death["Enemy death<br/>[EnemyDeath.cs]"]
  node_attack["Attack handling<br/>[AttackComponent.cs]"]
  node_bullet["Bullet<br/>[Bullet.cs]"]
  node_damage_box["Hurtbox"]
  node_health["Health<br/>[HealthComponent.cs]"]
  node_bullet_data["Bullet configuration<br/>[BulletData.cs]"]
  node_attack_data["Attack data<br/>[Attack.cs]"]
end

subgraph group_items["Items and upgrades"]
  node_inventory["Inventory and weapons"]
  node_weapon_controller["Weapon controller"]
  node_melee["Melee weapon<br/>[MeleeWeapon.cs]"]
  node_weapon_data["Weapon resources<br/>[WeaponBase.cs]"]
  node_item_data["Item resources<br/>[ItemData.cs]"]
  node_world_item["World pickups<br/>[WorldItem.cs]"]
  node_xp_orb["Experience orb<br/>[XpOrb.cs]"]
  node_upgrade_manager["Upgrade application<br/>[UpgradeManager.cs]"]
  node_upgrade_strategy["Upgrade strategies<br/>[Strategy.cs]"]
end

subgraph group_runtime["Run and player"]
  node_player["Player controls<br/>[player.cs]"]
  node_movement["Movement and roll<br/>[Move.cs]"]
  node_game_scene["Game scene<br/>[GameScene.cs]"]
  node_stats["Run statistics<br/>[Stats.cs]"]
end

subgraph group_interface["Game interface"]
  node_upgrade_ui["Upgrade choices"]
  node_xp_bar["Experience display<br/>[XpBar.cs]"]
  node_game_over["Game over<br/>[GameOverNode.cs]"]
end

node_player_actor(("Player"))

node_player_actor -.->|"moves and rolls"| node_movement
node_player_actor -.->|"holds attack"| node_melee
node_enemy_spawn -->|"spawns"| node_enemy
node_bullet -->|"applies upgrades"| node_upgrade_manager
node_bullet -->|"hits"| node_damage_box
node_bullet -->|"reads configuration"| node_bullet_data
node_bullet -->|"creates attack"| node_attack_data
node_attack -->|"damages"| node_damage_box
node_damage_box -->|"applies damage"| node_health
node_enemy_death -->|"checks health"| node_health
node_enemy_death -->|"updates kills"| node_stats
node_enemy_death -->|"uses attack"| node_attack
node_inventory -->|"equips weapon"| node_weapon_controller
node_inventory -->|"spawns drops"| node_world_item
node_inventory -->|"stores weapon"| node_weapon_data
node_inventory -->|"stores items"| node_item_data
node_world_item -->|"holds item data"| node_item_data
node_melee -->|"uses weapon data"| node_weapon_data
node_melee -->|"uses attack handling"| node_attack
node_upgrade_manager -->|"reads upgrades"| node_inventory
node_upgrade_manager -->|"applies strategies"| node_upgrade_strategy
node_upgrade_ui -->|"uses inventory"| node_inventory
node_upgrade_ui -->|"presents upgrades"| node_upgrade_strategy
node_upgrade_ui -->|"uses display"| node_xp_bar
node_xp_orb -->|"appears in run"| node_game_scene
node_game_scene -->|"uses enemies"| node_enemy
node_game_scene -->|"uses run statistics"| node_stats
node_game_scene -->|"references game over"| node_game_over
node_enemy_death -.->|"drops experience"| node_xp_orb
node_player -.->|"collects and drops items"| node_inventory
node_weapon_controller -.->|"fires automatically"| node_bullet

click node_player "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/player.cs"
click node_movement "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/Move.cs"
click node_game_scene "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/GameScene.cs"
click node_enemy_spawn "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/enemy/EnemySpawner.cs"
click node_enemy "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/enemy/Enemy.cs"
click node_enemy_death "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/enemy/EnemyDeath.cs"
click node_attack "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/components/AttackComponent.cs"
click node_bullet "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/bullet/Bullet.cs"
click node_damage_box "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/components/HurtboxComponent.cs"
click node_health "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/components/HealthComponent.cs"
click node_bullet_data "https://github.com/lan2two/vampire-survivors-like/blob/main/resources/BulletData.cs"
click node_attack_data "https://github.com/lan2two/vampire-survivors-like/blob/main/resources/Attack.cs"
click node_inventory "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/InventoryManager.cs"
click node_weapon_controller "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/WeaponController.cs"
click node_melee "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/items/MeleeWeapon.cs"
click node_weapon_data "https://github.com/lan2two/vampire-survivors-like/blob/main/resources/WeaponBase.cs"
click node_item_data "https://github.com/lan2two/vampire-survivors-like/blob/main/resources/ItemData.cs"
click node_world_item "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/items/WorldItem.cs"
click node_xp_orb "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/items/XpOrb.cs"
click node_upgrade_manager "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/UpgradeManager.cs"
click node_upgrade_strategy "https://github.com/lan2two/vampire-survivors-like/blob/main/utils/strategy/Strategy.cs"
click node_stats "https://github.com/lan2two/vampire-survivors-like/blob/main/utils/Stats.cs"
click node_upgrade_ui "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/UpgradeButtonContainer.cs"
click node_xp_bar "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/XpBar.cs"
click node_game_over "https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/GameOverNode.cs"

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_enemy_spawn,node_enemy,node_enemy_death,node_attack,node_bullet,node_damage_box,node_health,node_bullet_data,node_attack_data toneBlue
class node_inventory,node_weapon_controller,node_melee,node_weapon_data,node_item_data,node_world_item,node_xp_orb,node_upgrade_manager,node_upgrade_strategy toneAmber
class node_player,node_movement,node_game_scene,node_stats toneMint
class node_upgrade_ui,node_xp_bar,node_game_over toneRose
class node_player_actor toneIndigo
```

## Components

### Combat and enemies

- [Enemy spawning](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/enemy/EnemySpawner.cs): `scripts/enemy/EnemySpawner.cs`
- [Enemy](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/enemy/Enemy.cs): `scripts/enemy/Enemy.cs`
- [Enemy death](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/enemy/EnemyDeath.cs): `scripts/enemy/EnemyDeath.cs`
- [Attack handling](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/components/AttackComponent.cs): `scripts/components/AttackComponent.cs`
- [Bullet](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/bullet/Bullet.cs): `scripts/bullet/Bullet.cs`
- [Hurtbox](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/components/HurtboxComponent.cs): `scripts/components/HurtboxComponent.cs`
- [Health](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/components/HealthComponent.cs): `scripts/components/HealthComponent.cs`
- [Bullet configuration](https://github.com/lan2two/vampire-survivors-like/blob/main/resources/BulletData.cs): `resources/BulletData.cs`
- [Attack data](https://github.com/lan2two/vampire-survivors-like/blob/main/resources/Attack.cs): `resources/Attack.cs`

### Items and upgrades

- [Inventory and weapons](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/InventoryManager.cs): `scripts/player/InventoryManager.cs`
- [Weapon controller](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/WeaponController.cs): `scripts/player/WeaponController.cs`
- [Melee weapon](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/items/MeleeWeapon.cs): `scripts/items/MeleeWeapon.cs`
- [Weapon resources](https://github.com/lan2two/vampire-survivors-like/blob/main/resources/WeaponBase.cs): `resources/WeaponBase.cs`
- [Item resources](https://github.com/lan2two/vampire-survivors-like/blob/main/resources/ItemData.cs): `resources/ItemData.cs`
- [World pickups](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/items/WorldItem.cs): `scripts/items/WorldItem.cs`
- [Experience orb](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/items/XpOrb.cs): `scripts/items/XpOrb.cs`
- [Upgrade application](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/UpgradeManager.cs): `scripts/player/UpgradeManager.cs`
- [Upgrade strategies](https://github.com/lan2two/vampire-survivors-like/blob/main/utils/strategy/Strategy.cs): `utils/strategy/Strategy.cs`

### Run and player

- [Player controls](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/player.cs): `scripts/player/player.cs`
- [Movement and roll](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/player/Move.cs): `scripts/player/Move.cs`
- [Game scene](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/GameScene.cs): `scripts/GUI/GameScene.cs`
- [Run statistics](https://github.com/lan2two/vampire-survivors-like/blob/main/utils/Stats.cs): `utils/Stats.cs`

### Game interface

- [Upgrade choices](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/UpgradeButtonContainer.cs): `scripts/GUI/UpgradeButtonContainer.cs`
- [Experience display](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/XpBar.cs): `scripts/GUI/XpBar.cs`
- [Game over](https://github.com/lan2two/vampire-survivors-like/blob/main/scripts/GUI/GameOverNode.cs): `scripts/GUI/GameOverNode.cs`

### Other components

- **Player**

## Connections

- Player → Movement and roll: moves and rolls
- Player → Melee weapon: holds attack
- Enemy spawning → Enemy: spawns (evidence: `scripts/enemy/EnemySpawner.cs`)
- Bullet → Upgrade application: applies upgrades (evidence: `scripts/bullet/Bullet.cs`)
- Bullet → Hurtbox: hits (evidence: `scripts/bullet/Bullet.cs`)
- Bullet → Bullet configuration: reads configuration (evidence: `scripts/bullet/Bullet.cs`)
- Bullet → Attack data: creates attack (evidence: `scripts/bullet/Bullet.cs`)
- Attack handling → Hurtbox: damages (evidence: `scripts/components/AttackComponent.cs`)
- Hurtbox → Health: applies damage (evidence: `scripts/components/HurtboxComponent.cs`)
- Enemy death → Health: checks health (evidence: `scripts/enemy/EnemyDeath.cs`)
- Enemy death → Run statistics: updates kills (evidence: `scripts/enemy/EnemyDeath.cs`)
- Enemy death → Attack handling: uses attack (evidence: `scripts/enemy/EnemyDeath.cs`)
- Inventory and weapons → Weapon controller: equips weapon (evidence: `scripts/player/InventoryManager.cs`)
- Inventory and weapons → World pickups: spawns drops (evidence: `scripts/player/InventoryManager.cs`)
- Inventory and weapons → Weapon resources: stores weapon (evidence: `scripts/player/InventoryManager.cs`)
- Inventory and weapons → Item resources: stores items (evidence: `scripts/player/InventoryManager.cs`)
- World pickups → Item resources: holds item data (evidence: `scripts/items/WorldItem.cs`)
- Melee weapon → Weapon resources: uses weapon data (evidence: `scripts/items/MeleeWeapon.cs`)
- Melee weapon → Attack handling: uses attack handling (evidence: `scripts/items/MeleeWeapon.cs`)
- Upgrade application → Inventory and weapons: reads upgrades (evidence: `scripts/player/UpgradeManager.cs`)
- Upgrade application → Upgrade strategies: applies strategies (evidence: `scripts/player/UpgradeManager.cs`)
- Upgrade choices → Inventory and weapons: uses inventory (evidence: `scripts/GUI/UpgradeButtonContainer.cs`)
- Upgrade choices → Upgrade strategies: presents upgrades (evidence: `scripts/GUI/UpgradeButtonContainer.cs`)
- Upgrade choices → Experience display: uses display (evidence: `scripts/GUI/UpgradeButtonContainer.cs`)
- Experience orb → Game scene: appears in run (evidence: `scripts/GUI/GameScene.cs`)
- Game scene → Enemy: uses enemies (evidence: `scripts/GUI/GameScene.cs`)
- Game scene → Run statistics: uses run statistics (evidence: `scripts/GUI/GameScene.cs`)
- Game scene → Game over: references game over (evidence: `scripts/GUI/GameScene.cs`)
- Enemy death → Experience orb: drops experience
- Player controls → Inventory and weapons: collects and drops items
- Weapon controller → Bullet: fires automatically
