# deliuski/tankss architecture

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

- Interactive diagram: https://gitdiagram.com/deliuski/tankss
- Repository: https://github.com/deliuski/tankss

## Overview

This is a small Swing, three-player tank battle game. Players launch the window and use keyboard controls; the Battlefield panel advances the game on a timer, checks bullet hits, removes destroyed tanks, and repaints the scene. Tank owns movement, health, controls, and firing; Bullet owns projectile movement and bounds. The source excerpts show these core interactions; no README or additional product capabilities are available.

Main entry points: [`battlefield.java`](https://github.com/deliuski/tankss/blob/main/battlefield.java) (Battlefield), [`tank.java`](https://github.com/deliuski/tankss/blob/main/tank.java) (Tank), [`bullet.java`](https://github.com/deliuski/tankss/blob/main/bullet.java) (Bullet), [`TankGame.java`](https://github.com/deliuski/tankss/blob/main/TankGame.java) (Game Window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_tankgame["Game Window<br/>[TankGame.java]"]
end

subgraph group_gameplay["Game Loop"]
  node_battlefield["Battlefield<br/>[battlefield.java]"]
end

subgraph group_entities["Game Entities"]
  node_tank["Tank<br/>[tank.java]"]
  node_bullet["Bullet<br/>[bullet.java]"]
end

node_players(("Players"))

node_players -->|"launches"| node_tankgame
node_tankgame -->|"creates and adds"| node_battlefield
node_players -->|"send keys"| node_battlefield
node_battlefield -->|"updates and checks hits"| node_tank
node_battlefield -->|"repaints"| node_tank
node_battlefield -->|"checks bounds"| node_bullet
node_tank -->|"creates and moves"| node_bullet
node_tank -->|"draws"| node_bullet

click node_tankgame "https://github.com/deliuski/tankss/blob/main/TankGame.java"
click node_battlefield "https://github.com/deliuski/tankss/blob/main/battlefield.java"
click node_tank "https://github.com/deliuski/tankss/blob/main/tank.java"
click node_bullet "https://github.com/deliuski/tankss/blob/main/bullet.java"

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_tankgame toneBlue
class node_battlefield toneAmber
class node_tank,node_bullet toneMint
class node_players toneIndigo
```

## Components

### Application

- [Game Window](https://github.com/deliuski/tankss/blob/main/TankGame.java): `TankGame.java`

### Game Loop

- [Battlefield](https://github.com/deliuski/tankss/blob/main/battlefield.java): `battlefield.java`

### Game Entities

- [Tank](https://github.com/deliuski/tankss/blob/main/tank.java): `tank.java`
- [Bullet](https://github.com/deliuski/tankss/blob/main/bullet.java): `bullet.java`

### Other components

- **Players**

## Connections

- Players → Game Window: launches (evidence: `TankGame.java`)
- Game Window → Battlefield: creates and adds (evidence: `TankGame.java`)
- Players → Battlefield: send keys (evidence: `battlefield.java`)
- Battlefield → Tank: updates and checks hits (evidence: `battlefield.java`)
- Battlefield → Tank: repaints (evidence: `battlefield.java`)
- Battlefield → Bullet: checks bounds (evidence: `battlefield.java`)
- Tank → Bullet: creates and moves (evidence: `tank.java`)
- Tank → Bullet: draws (evidence: `tank.java`)
