# ankhe-lioss/wanterra_base architecture

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

- Interactive diagram: https://gitdiagram.com/ankhe-lioss/wanterra_base
- Repository: https://github.com/ankhe-lioss/wanterra_base

## Overview

Warnterra is a Pygame action game. The runtime loop initializes the level and sprite groups, updates gameplay, spawns enemy waves, and draws the scene; the player’s weapon and skills drive projectile combat against enemies. Supporting systems cover entity stats, health, status effects, effects, audio, and rendering. The graph follows the shown main loop and sampled combat code; some subsystem links rely on SOURCE INDEX references, and unsampled level-loading details are omitted.

Main entry points: [`Code/main.py`](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/main.py) (Game Loop), [`Code/skill.py`](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/skill.py) (Skills), [`Code/enemies.py`](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/enemies.py) (Enemies), [`code/livingentity.py`](https://github.com/ankhe-lioss/wanterra_base/blob/master/code/livingentity.py) (Living Entities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_game_loop["Game Loop<br/>[main.py]"]
  node_level_setup["Level Setup<br/>[setlevel.py]"]
  node_sprite_groups["Sprite Groups<br/>[groups.py]"]
  node_sprite_rendering["Sprite Rendering<br/>[sprites.py]"]
  node_cursor["Cursor<br/>[cursor.py]"]
end

subgraph group_gameplay["Actors and Waves"]
  node_player_actor["Player<br/>[player.py]"]
  node_enemy_actor["Enemies<br/>[enemies.py]"]
  node_wave_spawner["Wave Spawner<br/>[spawn.py]"]
end

subgraph group_combat["Combat Systems"]
  node_weapon["Weapon Input<br/>[weapon.py]"]
  node_skills["Skills<br/>[skill.py]"]
  node_player_projectiles["Player Projectiles"]
  node_enemy_projectiles["Enemy Projectiles"]
  node_projectile_runtime["Projectile Runtime<br/>[projectiles.py]"]
  node_aoe["Area Effects<br/>[aoe.py]"]
  node_aoe_init["Effect Setup<br/>[aoeinit.py]"]
end

subgraph group_support["Shared Systems"]
  node_living_entity["Living Entities<br/>[livingentity.py]"]
  node_stats["Game Stats<br/>[stats.py]"]
  node_status["Status Effects<br/>[status.py]"]
  node_healthbar["Health Bar<br/>[healthbar.py]"]
  node_audio_loader["Audio Loader<br/>[load_audio.py]"]
  node_audio_assets["Audio Assets"]
end

node_player(("Player"))

node_player -->|"starts game"| node_game_loop
node_game_loop -->|"sets up"| node_level_setup
node_game_loop -->|"creates groups"| node_sprite_groups
node_game_loop -->|"updates and draws"| node_sprite_rendering
node_game_loop -->|"spawns waves"| node_wave_spawner
node_game_loop -->|"draws cursor"| node_cursor
node_game_loop -->|"imports"| node_player_actor
node_game_loop -->|"imports"| node_enemy_actor
node_game_loop -->|"imports"| node_weapon
node_player_actor -->|"inherits"| node_living_entity
node_player_actor -->|"uses"| node_skills
node_weapon -->|"reads player state"| node_player_actor
node_weapon -->|"checks skills"| node_skills
node_weapon -->|"imports"| node_player_projectiles
node_skills -->|"creates shots"| node_player_projectiles
node_skills -->|"imports"| node_enemy_projectiles
node_skills -->|"creates effects"| node_aoe
node_skills -->|"triggers rupture"| node_aoe_init
node_aoe_init -->|"sets up effects"| node_aoe
node_enemy_actor -->|"inherits"| node_living_entity
node_enemy_actor -->|"checks attacks"| node_skills
node_enemy_actor -->|"imports"| node_enemy_projectiles
node_wave_spawner -->|"creates enemies"| node_enemy_actor
node_player_projectiles -->|"inherits"| node_projectile_runtime
node_enemy_projectiles -->|"uses"| node_projectile_runtime
node_living_entity -->|"loads stats"| node_stats
node_living_entity -->|"checks effects"| node_status
node_living_entity -->|"uses health bar"| node_healthbar
node_enemy_actor -->|"imports"| node_aoe
node_stats -->|"loads sound data"| node_audio_loader
node_audio_loader -->|"loads audio"| node_audio_assets

click node_player_actor "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/player.py"
click node_enemy_actor "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/enemies.py"
click node_wave_spawner "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/spawn.py"
click node_weapon "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/weapon.py"
click node_skills "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/skill.py"
click node_player_projectiles "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/player_projectiles.py"
click node_enemy_projectiles "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/enemy_projectiles.py"
click node_projectile_runtime "https://github.com/ankhe-lioss/wanterra_base/blob/master/code/projectiles.py"
click node_aoe "https://github.com/ankhe-lioss/wanterra_base/blob/master/code/aoe.py"
click node_aoe_init "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/aoeinit.py"
click node_game_loop "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/main.py"
click node_level_setup "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/setlevel.py"
click node_sprite_groups "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/groups.py"
click node_sprite_rendering "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/sprites.py"
click node_cursor "https://github.com/ankhe-lioss/wanterra_base/blob/master/code/cursor.py"
click node_living_entity "https://github.com/ankhe-lioss/wanterra_base/blob/master/code/livingentity.py"
click node_stats "https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/stats.py"
click node_status "https://github.com/ankhe-lioss/wanterra_base/blob/master/code/status.py"
click node_healthbar "https://github.com/ankhe-lioss/wanterra_base/blob/master/code/healthbar.py"
click node_audio_loader "https://github.com/ankhe-lioss/wanterra_base/blob/master/code/load_audio.py"
click node_audio_assets "https://github.com/ankhe-lioss/wanterra_base/tree/master/audio"

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_game_loop,node_level_setup,node_sprite_groups,node_sprite_rendering,node_cursor toneBlue
class node_player_actor,node_enemy_actor,node_wave_spawner toneAmber
class node_weapon,node_skills,node_player_projectiles,node_enemy_projectiles,node_projectile_runtime,node_aoe,node_aoe_init toneMint
class node_living_entity,node_stats,node_status,node_healthbar,node_audio_loader,node_audio_assets toneRose
class node_player toneIndigo
```

## Components

### Game Runtime

- [Game Loop](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/main.py): `Code/main.py`
- [Level Setup](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/setlevel.py): `Code/setlevel.py`
- [Sprite Groups](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/groups.py): `Code/groups.py`
- [Sprite Rendering](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/sprites.py): `Code/sprites.py`
- [Cursor](https://github.com/ankhe-lioss/wanterra_base/blob/master/code/cursor.py): `code/cursor.py`

### Actors and Waves

- [Player](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/player.py): `Code/player.py`
- [Enemies](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/enemies.py): `Code/enemies.py`
- [Wave Spawner](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/spawn.py): `Code/spawn.py`

### Combat Systems

- [Weapon Input](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/weapon.py): `Code/weapon.py`
- [Skills](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/skill.py): `Code/skill.py`
- [Player Projectiles](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/player_projectiles.py): `Code/player_projectiles.py`
- [Enemy Projectiles](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/enemy_projectiles.py): `Code/enemy_projectiles.py`
- [Projectile Runtime](https://github.com/ankhe-lioss/wanterra_base/blob/master/code/projectiles.py): `code/projectiles.py`
- [Area Effects](https://github.com/ankhe-lioss/wanterra_base/blob/master/code/aoe.py): `code/aoe.py`
- [Effect Setup](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/aoeinit.py): `Code/aoeinit.py`

### Shared Systems

- [Living Entities](https://github.com/ankhe-lioss/wanterra_base/blob/master/code/livingentity.py): `code/livingentity.py`
- [Game Stats](https://github.com/ankhe-lioss/wanterra_base/blob/master/Code/stats.py): `Code/stats.py`
- [Status Effects](https://github.com/ankhe-lioss/wanterra_base/blob/master/code/status.py): `code/status.py`
- [Health Bar](https://github.com/ankhe-lioss/wanterra_base/blob/master/code/healthbar.py): `code/healthbar.py`
- [Audio Loader](https://github.com/ankhe-lioss/wanterra_base/blob/master/code/load_audio.py): `code/load_audio.py`
- [Audio Assets](https://github.com/ankhe-lioss/wanterra_base/tree/master/audio): `audio`

### Other components

- **Player**

## Connections

- Player → Game Loop: starts game (evidence: `Code/main.py`)
- Game Loop → Level Setup: sets up (evidence: `Code/main.py`)
- Game Loop → Sprite Groups: creates groups (evidence: `Code/main.py`)
- Game Loop → Sprite Rendering: updates and draws (evidence: `Code/main.py`)
- Game Loop → Wave Spawner: spawns waves (evidence: `Code/main.py`)
- Game Loop → Cursor: draws cursor (evidence: `Code/main.py`)
- Game Loop → Player: imports (evidence: `Code/main.py`)
- Game Loop → Enemies: imports (evidence: `Code/main.py`)
- Game Loop → Weapon Input: imports (evidence: `Code/main.py`)
- Player → Living Entities: inherits (evidence: `Code/player.py`)
- Player → Skills: uses (evidence: `Code/player.py`)
- Weapon Input → Player: reads player state (evidence: `Code/weapon.py`)
- Weapon Input → Skills: checks skills (evidence: `Code/weapon.py`)
- Weapon Input → Player Projectiles: imports (evidence: `Code/weapon.py`)
- Skills → Player Projectiles: creates shots (evidence: `Code/skill.py`)
- Skills → Enemy Projectiles: imports (evidence: `Code/skill.py`)
- Skills → Area Effects: creates effects (evidence: `Code/skill.py`)
- Skills → Effect Setup: triggers rupture (evidence: `Code/skill.py`)
- Effect Setup → Area Effects: sets up effects (evidence: `Code/aoeinit.py`)
- Enemies → Living Entities: inherits (evidence: `Code/enemies.py`)
- Enemies → Skills: checks attacks (evidence: `Code/enemies.py`)
- Enemies → Enemy Projectiles: imports (evidence: `Code/enemies.py`)
- Wave Spawner → Enemies: creates enemies (evidence: `Code/spawn.py`)
- Player Projectiles → Projectile Runtime: inherits (evidence: `Code/player_projectiles.py`)
- Enemy Projectiles → Projectile Runtime: uses (evidence: `Code/enemy_projectiles.py`)
- Living Entities → Game Stats: loads stats (evidence: `code/livingentity.py`)
- Living Entities → Status Effects: checks effects (evidence: `code/livingentity.py`)
- Living Entities → Health Bar: uses health bar (evidence: `code/livingentity.py`)
- Enemies → Area Effects: imports (evidence: `Code/enemies.py`)
- Game Stats → Audio Loader: loads sound data (evidence: `Code/stats.py`)
- Audio Loader → Audio Assets: loads audio (evidence: `code/load_audio.py`)
