# lowiecool/project_eit architecture

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

- Interactive diagram: https://gitdiagram.com/lowiecool/project_eit
- Repository: https://github.com/lowiecool/project_eit

## Overview

This is a small, single-file Pygame Space Invaders game. The main loop handles keyboard events, advances gameplay, checks collisions, and draws the frame; supporting routines in the same file manage entities, scoring, level progression, and game-over behavior. The excerpts show entity asset loading and sound playback, but omit parts of initialization and the loop, so the graph avoids inferring those connections.

Main entry points: [`main.py`](https://github.com/lowiecool/project_eit/blob/main/main.py) (Main Game Loop), [`res/sounds`](https://github.com/lowiecool/project_eit/tree/main/res/sounds) (Sound Files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_loop["Main Game Loop<br/>[main.py]"]
end

subgraph group_gameplay["Gameplay Systems"]
  node_player["Player Ship<br/>[main.py]"]
  node_enemies["Enemies<br/>[main.py]"]
  node_weapons["Weapons<br/>[main.py]"]
  node_collisions["Collision Handling<br/>[main.py]"]
  node_progression["Score and Levels<br/>[main.py]"]
  node_gameover["Game Over<br/>[main.py]"]
end

subgraph group_presentation["Presentation and Audio"]
  node_sound["Sound Effects<br/>[main.py]"]
  node_scoreboard["Scoreboard<br/>[main.py]"]
end

subgraph group_assets["Game Assets"]
  node_soundfiles["Sound Files"]
end

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

node_player_actor -->|"provides input"| node_loop
node_loop -->|"polls events"| node_pygame
node_loop -->|"updates and draws"| node_player
node_loop -->|"updates and draws"| node_enemies
node_loop -->|"updates and draws"| node_weapons
node_loop -->|"checks collisions"| node_collisions
node_collisions -->|"kills enemies"| node_progression
node_collisions -->|"kills player"| node_gameover
node_loop -->|"renders"| node_scoreboard
node_player -->|"loads image"| node_pygame
node_enemies -->|"loads image"| node_pygame
node_weapons -->|"loads image"| node_pygame
node_player -->|"loads kill sound"| node_sound
node_enemies -->|"loads kill sound"| node_sound
node_weapons -->|"loads fire sound"| node_sound
node_sound -->|"loads and plays"| node_soundfiles
node_gameover -->|"renders"| node_scoreboard

click node_player "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_enemies "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_weapons "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_collisions "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_progression "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_gameover "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_loop "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_sound "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_scoreboard "https://github.com/lowiecool/project_eit/blob/main/main.py"
click node_soundfiles "https://github.com/lowiecool/project_eit/tree/main/res/sounds"

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 toneBlue
class node_player,node_enemies,node_weapons,node_collisions,node_progression,node_gameover toneAmber
class node_sound,node_scoreboard toneMint
class node_soundfiles toneRose
class node_pygame,node_player_actor toneIndigo
```

## Components

### Game Runtime

- [Main Game Loop](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`

### Gameplay Systems

- [Player Ship](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`
- [Enemies](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`
- [Weapons](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`
- [Collision Handling](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`
- [Score and Levels](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`
- [Game Over](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`

### Presentation and Audio

- [Sound Effects](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`
- [Scoreboard](https://github.com/lowiecool/project_eit/blob/main/main.py): `main.py`

### Game Assets

- [Sound Files](https://github.com/lowiecool/project_eit/tree/main/res/sounds): `res/sounds`

### Other components

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

## Connections

- Player → Main Game Loop: provides input (evidence: `main.py`)
- Main Game Loop → Pygame: polls events (evidence: `main.py`)
- Main Game Loop → Player Ship: updates and draws (evidence: `main.py`)
- Main Game Loop → Enemies: updates and draws (evidence: `main.py`)
- Main Game Loop → Weapons: updates and draws (evidence: `main.py`)
- Main Game Loop → Collision Handling: checks collisions (evidence: `main.py`)
- Collision Handling → Score and Levels: kills enemies (evidence: `main.py`)
- Collision Handling → Game Over: kills player (evidence: `main.py`)
- Main Game Loop → Scoreboard: renders (evidence: `main.py`)
- Player Ship → Pygame: loads image (evidence: `main.py`)
- Enemies → Pygame: loads image (evidence: `main.py`)
- Weapons → Pygame: loads image (evidence: `main.py`)
- Player Ship → Sound Effects: loads kill sound (evidence: `main.py`)
- Enemies → Sound Effects: loads kill sound (evidence: `main.py`)
- Weapons → Sound Effects: loads fire sound (evidence: `main.py`)
- Sound Effects → Sound Files: loads and plays (evidence: `main.py`)
- Game Over → Scoreboard: renders (evidence: `main.py`)
