# tolstiy83/alpha-strike architecture

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

- Interactive diagram: https://gitdiagram.com/tolstiy83/alpha-strike
- Repository: https://github.com/tolstiy83/alpha-strike

## Overview

Alpha Strike is a browser-based squad shooter. The player chooses a difficulty and campaign or unlocked endless mode, fights scheduled enemy formations and bosses, collects weapon or troop rewards, and carries run progress into later stages or survival. The Phaser scene in `src/main.ts` orchestrates gameplay, using data modules for campaign, combat balance, weapons, and survival, plus entity, squad, audio, and visual modules. The README documents several menu and progression capabilities; some corresponding implementation details were not sampled, so those links are documented rather than inferred from unsampled code.

Main entry points: [`src/main.ts`](https://github.com/tolstiy83/alpha-strike/blob/main/src/main.ts) (Game scene), [`src/entities/Enemy.ts`](https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Enemy.ts) (Horde enemies), [`src/entities/Boss.ts`](https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Boss.ts) (Stage bosses), [`src/visuals/characters.ts`](https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/characters.ts) (Character rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Run orchestration"]
  node_scene["Game scene<br/>[main.ts]"]
  node_runmenu["Menus and results<br/>[main.ts]"]
end

subgraph group_rules["Run rules"]
  node_campaign["Campaign stages<br/>[campaign.ts]"]
  node_difficulty["Encounter balance<br/>[difficulty.ts]"]
  node_enemydata["Enemy definitions<br/>[enemies.ts]"]
  node_runstate["Run setup<br/>[run.ts]"]
end

subgraph group_combat["Combat entities"]
  node_playerentity["Player entity<br/>[Player.ts]"]
  node_enemies["Horde enemies<br/>[Enemy.ts]"]
  node_boss["Stage bosses<br/>[Boss.ts]"]
  node_projectile["Projectiles<br/>[Projectile.ts]"]
  node_squad["Troop formation<br/>[TroopSystems.ts]"]
end

subgraph group_presentation["Presentation systems"]
  node_audio["Combat audio<br/>[CombatAudio.ts]"]
  node_battlefield["Battlefield art<br/>[battlefield.ts]"]
  node_characterart["Character rendering<br/>[characters.ts]"]
  node_weaponart["Weapon rendering<br/>[weapons.ts]"]
  node_effects["Combat effects<br/>[combat.ts]"]
end

subgraph group_progress["Rewards and records"]
  node_weapons["Weapon rules<br/>[weapons.ts]"]
  node_upgrades["Upgrade rewards<br/>[UpgradeCard.ts]"]
  node_survival[("Endless records<br/>[survival.ts]")]
end

node_player(("Player"))
node_storage[("Browser storage")]

node_player -->|"chooses mode"| node_runmenu
node_runmenu -->|"starts run"| node_scene
node_scene -->|"shows results"| node_runmenu
node_scene -->|"reads stages"| node_campaign
node_scene -->|"builds formations"| node_difficulty
node_scene -->|"creates run"| node_runstate
node_scene -->|"loads records"| node_survival
node_scene -->|"creates player"| node_playerentity
node_scene -->|"spawns enemies"| node_enemies
node_scene -->|"spawns boss"| node_boss
node_scene -->|"fires projectiles"| node_projectile
node_scene -->|"uses formation"| node_squad
node_scene -->|"reads weapon stats"| node_weapons
node_scene -->|"offers rewards"| node_upgrades
node_scene -->|"plays combat sounds"| node_audio
node_scene -->|"draws battlefield"| node_battlefield
node_scene -->|"installs character art"| node_characterart
node_scene -->|"creates weapon art"| node_weaponart
node_scene -->|"triggers effects"| node_effects
node_enemies -->|"reads definitions"| node_enemydata
node_enemies -->|"scales health"| node_difficulty
node_boss -->|"reads boss balance"| node_difficulty
node_boss -->|"maps attack lanes"| node_campaign
node_characterart -->|"renders enemy types"| node_enemies
node_characterart -->|"uses weapon assets"| node_weaponart
node_scene -->|"reads and writes records"| node_storage
node_runstate -->|"checks unlock"| node_storage
node_scene -->|"accepts controls"| node_player

click node_scene "https://github.com/tolstiy83/alpha-strike/blob/main/src/main.ts"
click node_runmenu "https://github.com/tolstiy83/alpha-strike/blob/main/src/main.ts"
click node_campaign "https://github.com/tolstiy83/alpha-strike/blob/main/src/data/campaign.ts"
click node_difficulty "https://github.com/tolstiy83/alpha-strike/blob/main/src/data/difficulty.ts"
click node_enemydata "https://github.com/tolstiy83/alpha-strike/blob/main/src/data/enemies.ts"
click node_runstate "https://github.com/tolstiy83/alpha-strike/blob/main/src/data/run.ts"
click node_playerentity "https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Player.ts"
click node_enemies "https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Enemy.ts"
click node_boss "https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Boss.ts"
click node_projectile "https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Projectile.ts"
click node_squad "https://github.com/tolstiy83/alpha-strike/blob/main/src/systems/TroopSystems.ts"
click node_weapons "https://github.com/tolstiy83/alpha-strike/blob/main/src/data/weapons.ts"
click node_upgrades "https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/UpgradeCard.ts"
click node_survival "https://github.com/tolstiy83/alpha-strike/blob/main/src/data/survival.ts"
click node_audio "https://github.com/tolstiy83/alpha-strike/blob/main/src/systems/CombatAudio.ts"
click node_battlefield "https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/battlefield.ts"
click node_characterart "https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/characters.ts"
click node_weaponart "https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/weapons.ts"
click node_effects "https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/combat.ts"

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_scene,node_runmenu toneBlue
class node_campaign,node_difficulty,node_enemydata,node_runstate,node_storage toneAmber
class node_playerentity,node_enemies,node_boss,node_projectile,node_squad toneMint
class node_audio,node_battlefield,node_characterart,node_weaponart,node_effects toneRose
class node_weapons,node_upgrades,node_survival,node_player toneIndigo
```

## Components

### Run orchestration

- [Game scene](https://github.com/tolstiy83/alpha-strike/blob/main/src/main.ts): `src/main.ts`
- [Menus and results](https://github.com/tolstiy83/alpha-strike/blob/main/src/main.ts): `src/main.ts`

### Run rules

- [Campaign stages](https://github.com/tolstiy83/alpha-strike/blob/main/src/data/campaign.ts): `src/data/campaign.ts`
- [Encounter balance](https://github.com/tolstiy83/alpha-strike/blob/main/src/data/difficulty.ts): `src/data/difficulty.ts`
- [Enemy definitions](https://github.com/tolstiy83/alpha-strike/blob/main/src/data/enemies.ts): `src/data/enemies.ts`
- [Run setup](https://github.com/tolstiy83/alpha-strike/blob/main/src/data/run.ts): `src/data/run.ts`

### Combat entities

- [Player entity](https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Player.ts): `src/entities/Player.ts`
- [Horde enemies](https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Enemy.ts): `src/entities/Enemy.ts`
- [Stage bosses](https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Boss.ts): `src/entities/Boss.ts`
- [Projectiles](https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/Projectile.ts): `src/entities/Projectile.ts`
- [Troop formation](https://github.com/tolstiy83/alpha-strike/blob/main/src/systems/TroopSystems.ts): `src/systems/TroopSystems.ts`

### Presentation systems

- [Combat audio](https://github.com/tolstiy83/alpha-strike/blob/main/src/systems/CombatAudio.ts): `src/systems/CombatAudio.ts`
- [Battlefield art](https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/battlefield.ts): `src/visuals/battlefield.ts`
- [Character rendering](https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/characters.ts): `src/visuals/characters.ts`
- [Weapon rendering](https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/weapons.ts): `src/visuals/weapons.ts`
- [Combat effects](https://github.com/tolstiy83/alpha-strike/blob/main/src/visuals/combat.ts): `src/visuals/combat.ts`

### Rewards and records

- [Weapon rules](https://github.com/tolstiy83/alpha-strike/blob/main/src/data/weapons.ts): `src/data/weapons.ts`
- [Upgrade rewards](https://github.com/tolstiy83/alpha-strike/blob/main/src/entities/UpgradeCard.ts): `src/entities/UpgradeCard.ts`
- [Endless records](https://github.com/tolstiy83/alpha-strike/blob/main/src/data/survival.ts): `src/data/survival.ts`

### Other components

- **Player**
- **Browser storage**

## Connections

- Player → Menus and results: chooses mode (evidence: `README.md`)
- Menus and results → Game scene: starts run (evidence: `src/main.ts`)
- Game scene → Menus and results: shows results (evidence: `README.md`)
- Game scene → Campaign stages: reads stages (evidence: `src/main.ts`)
- Game scene → Encounter balance: builds formations (evidence: `src/main.ts`)
- Game scene → Run setup: creates run (evidence: `src/main.ts`)
- Game scene → Endless records: loads records (evidence: `src/main.ts`)
- Game scene → Player entity: creates player (evidence: `src/main.ts`)
- Game scene → Horde enemies: spawns enemies (evidence: `src/main.ts`)
- Game scene → Stage bosses: spawns boss (evidence: `src/main.ts`)
- Game scene → Projectiles: fires projectiles (evidence: `src/main.ts`)
- Game scene → Troop formation: uses formation (evidence: `src/main.ts`)
- Game scene → Weapon rules: reads weapon stats (evidence: `src/main.ts`)
- Game scene → Upgrade rewards: offers rewards (evidence: `README.md`)
- Game scene → Combat audio: plays combat sounds (evidence: `src/main.ts`)
- Game scene → Battlefield art: draws battlefield (evidence: `src/main.ts`)
- Game scene → Character rendering: installs character art (evidence: `src/main.ts`)
- Game scene → Weapon rendering: creates weapon art (evidence: `src/main.ts`)
- Game scene → Combat effects: triggers effects (evidence: `src/main.ts`)
- Horde enemies → Enemy definitions: reads definitions (evidence: `src/entities/Enemy.ts`)
- Horde enemies → Encounter balance: scales health (evidence: `src/entities/Enemy.ts`)
- Stage bosses → Encounter balance: reads boss balance (evidence: `src/entities/Boss.ts`)
- Stage bosses → Campaign stages: maps attack lanes (evidence: `src/entities/Boss.ts`)
- Character rendering → Horde enemies: renders enemy types (evidence: `src/visuals/characters.ts`)
- Character rendering → Weapon rendering: uses weapon assets (evidence: `src/visuals/characters.ts`)
- Game scene → Browser storage: reads and writes records
- Run setup → Browser storage: checks unlock (evidence: `src/data/run.ts`)
- Game scene → Player: accepts controls (evidence: `README.md`)
