# marchbeta2087/landwar architecture

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

- Interactive diagram: https://gitdiagram.com/marchbeta2087/landwar
- Repository: https://github.com/marchbeta2087/landwar

## Overview

Landwar is a Python/Pygame territory-capture game: the running game initializes a grid and country turrets, launches projectiles, updates ownership when projectiles hit cells, and redraws the board. Players can pan and zoom the view. The repository contains four standalone versions; the graph shows each entry point and details the v1.4 runtime, whose source was sampled. Configuration and runtime behavior are embedded in each script rather than separated into packages.

Main entry points: [`src/v1.4/领土战争 V1.4.py`](https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py) (V1.4 game loop), [`src/v1.1/领土战争.py`](https://github.com/marchbeta2087/landwar/blob/main/src/v1.1/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89.py) (V1.1 game), [`src/v1.2/领土战争.py`](https://github.com/marchbeta2087/landwar/blob/main/src/v1.2/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89.py) (V1.2 game), [`src/v1.3/领土战争 V1.3.py`](https://github.com/marchbeta2087/landwar/blob/main/src/v1.3/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.3.py) (V1.3 game)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_versions["Game versions"]
  node_v11["V1.1 game<br/>[领土战争.py]"]
  node_v12["V1.2 game<br/>[领土战争.py]"]
  node_v13["V1.3 game<br/>[领土战争 V1.3.py]"]
end

subgraph group_runtime["V1.4 runtime"]
  node_v14["V1.4 game loop<br/>[领土战争 V1.4.py]"]
  node_projectiles["Projectile simulation<br/>[领土战争 V1.4.py]"]
  node_territory["Territory updates<br/>[领土战争 V1.4.py]"]
  node_controls["View controls<br/>[领土战争 V1.4.py]"]
  node_board["Board rendering<br/>[领土战争 V1.4.py]"]
end

subgraph group_settings["Game settings"]
  node_custom_config["Custom settings<br/>[自定义设定.txt]"]
end

node_player(("Player"))

node_player -->|"plays"| node_v14
node_player -.->|"plays"| node_v11
node_player -.->|"plays"| node_v12
node_player -.->|"plays"| node_v13
node_v14 -->|"reads settings"| node_custom_config
node_v14 -->|"handles input"| node_controls
node_v14 -->|"draws board"| node_board
node_v14 -->|"launches and advances"| node_projectiles
node_projectiles -->|"checks impacts"| node_territory

click node_v11 "https://github.com/marchbeta2087/landwar/blob/main/src/v1.1/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89.py"
click node_v12 "https://github.com/marchbeta2087/landwar/blob/main/src/v1.2/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89.py"
click node_v13 "https://github.com/marchbeta2087/landwar/blob/main/src/v1.3/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.3.py"
click node_v14 "https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py"
click node_custom_config "https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E5%AE%9A.txt"
click node_projectiles "https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py"
click node_territory "https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py"
click node_controls "https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py"
click node_board "https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py"

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_v11,node_v12,node_v13 toneBlue
class node_v14,node_projectiles,node_territory,node_controls,node_board toneAmber
class node_custom_config toneMint
class node_player toneIndigo
```

## Components

### Game versions

- [V1.1 game](https://github.com/marchbeta2087/landwar/blob/main/src/v1.1/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89.py): `src/v1.1/领土战争.py`
- [V1.2 game](https://github.com/marchbeta2087/landwar/blob/main/src/v1.2/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89.py): `src/v1.2/领土战争.py`
- [V1.3 game](https://github.com/marchbeta2087/landwar/blob/main/src/v1.3/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.3.py): `src/v1.3/领土战争 V1.3.py`

### V1.4 runtime

- [V1.4 game loop](https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py): `src/v1.4/领土战争 V1.4.py`
- [Projectile simulation](https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py): `src/v1.4/领土战争 V1.4.py`
- [Territory updates](https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py): `src/v1.4/领土战争 V1.4.py`
- [View controls](https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py): `src/v1.4/领土战争 V1.4.py`
- [Board rendering](https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E9%A2%86%E5%9C%9F%E6%88%98%E4%BA%89%20V1.4.py): `src/v1.4/领土战争 V1.4.py`

### Game settings

- [Custom settings](https://github.com/marchbeta2087/landwar/blob/main/src/v1.4/%E8%87%AA%E5%AE%9A%E4%B9%89%E8%AE%BE%E5%AE%9A.txt): `src/v1.4/自定义设定.txt`

### Other components

- **Player**

## Connections

- Player → V1.4 game loop: plays (evidence: `README.md`)
- Player → V1.1 game: plays
- Player → V1.2 game: plays
- Player → V1.3 game: plays
- V1.4 game loop → Custom settings: reads settings (evidence: `src/v1.4/领土战争 V1.4.py`)
- V1.4 game loop → View controls: handles input (evidence: `src/v1.4/领土战争 V1.4.py`)
- V1.4 game loop → Board rendering: draws board (evidence: `src/v1.4/领土战争 V1.4.py`)
- V1.4 game loop → Projectile simulation: launches and advances (evidence: `src/v1.4/领土战争 V1.4.py`)
- Projectile simulation → Territory updates: checks impacts (evidence: `src/v1.4/领土战争 V1.4.py`)
