# swagcode4u/pygame-girlsontarget architecture

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

- Interactive diagram: https://gitdiagram.com/swagcode4u/pygame-girlsontarget
- Repository: https://github.com/swagcode4u/pygame-girlsontarget

## Overview

Girls On Target is a single-file Pygame arcade shooter. The player starts from an intro screen, moves and fires at descending enemies, and tries to avoid collisions or letting enemies escape; lost lives or too many misses lead to game over, with restart available. The graph separates the documented screens and gameplay responsibilities, while keeping their shared implementation path. README descriptions fill in features such as score/lives and blast animation where the sampled code excerpt does not show their full behavior.

Main entry points: [`plane.py`](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py) (Game Loop), [`assets`](https://github.com/swagcode4u/pygame-girlsontarget/tree/main/assets) (Game Assets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_loop["Game Loop<br/>[plane.py]"]
  node_input["Input &amp; State<br/>[plane.py]"]
  node_assets["Game Assets"]
end

subgraph group_gameplay["Gameplay"]
  node_movement["Plane Movement<br/>[plane.py]"]
  node_shooting["Shooting<br/>[plane.py]"]
  node_enemies["Enemy Spawning<br/>[plane.py]"]
  node_collisions["Hits &amp; Misses<br/>[plane.py]"]
  node_score["Score &amp; Lives<br/>[plane.py]"]
end

subgraph group_presentation["Screens &amp; Effects"]
  node_intro["Intro Screen<br/>[plane.py]"]
  node_pause["Pause Menu<br/>[plane.py]"]
  node_gameover["Game Over<br/>[plane.py]"]
  node_effects["Blast Effects<br/>[plane.py]"]
end

node_player(("Player"))
node_pygame["Pygame"]

node_player -->|"presses keys"| node_input
node_input -->|"updates state"| node_loop
node_loop -->|"shows intro"| node_intro
node_loop -->|"shows pause"| node_pause
node_loop -->|"shows game over"| node_gameover
node_loop -->|"runs gameplay"| node_movement
node_loop -.->|"runs gameplay"| node_shooting
node_loop -->|"spawns enemies"| node_enemies
node_loop -->|"checks hits"| node_collisions
node_loop -->|"draws status"| node_score
node_loop -->|"updates effects"| node_effects
node_loop -->|"loads images"| node_assets
node_loop -->|"uses engine"| node_pygame
node_collisions -->|"changes lives"| node_score

click node_loop "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_input "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_intro "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_pause "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_gameover "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_movement "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_shooting "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_enemies "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_collisions "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_score "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_effects "https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py"
click node_assets "https://github.com/swagcode4u/pygame-girlsontarget/tree/main/assets"

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_loop,node_input,node_assets toneBlue
class node_movement,node_shooting,node_enemies,node_collisions,node_score toneAmber
class node_intro,node_pause,node_gameover,node_effects toneMint
class node_player,node_pygame toneIndigo
```

## Components

### Game Runtime

- [Game Loop](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Input & State](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Game Assets](https://github.com/swagcode4u/pygame-girlsontarget/tree/main/assets): `assets`

### Gameplay

- [Plane Movement](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Shooting](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Enemy Spawning](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Hits & Misses](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Score & Lives](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`

### Screens & Effects

- [Intro Screen](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Pause Menu](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Game Over](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`
- [Blast Effects](https://github.com/swagcode4u/pygame-girlsontarget/blob/main/plane.py): `plane.py`

### Other components

- **Player**
- **Pygame**

## Connections

- Player → Input & State: presses keys (evidence: `README.md`)
- Input & State → Game Loop: updates state (evidence: `plane.py`)
- Game Loop → Intro Screen: shows intro (evidence: `plane.py`)
- Game Loop → Pause Menu: shows pause (evidence: `plane.py`)
- Game Loop → Game Over: shows game over (evidence: `plane.py`)
- Game Loop → Plane Movement: runs gameplay (evidence: `plane.py`)
- Game Loop → Shooting: runs gameplay (evidence: `plane.py`)
- Game Loop → Enemy Spawning: spawns enemies (evidence: `plane.py`)
- Game Loop → Hits & Misses: checks hits (evidence: `plane.py`)
- Game Loop → Score & Lives: draws status (evidence: `plane.py`)
- Game Loop → Blast Effects: updates effects (evidence: `plane.py`)
- Game Loop → Game Assets: loads images (evidence: `plane.py`)
- Game Loop → Pygame: uses engine (evidence: `plane.py`)
- Hits & Misses → Score & Lives: changes lives (evidence: `plane.py`)
