# macchiato1239/plant-and-bees architecture

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

- Interactive diagram: https://gitdiagram.com/macchiato1239/plant-and-bees
- Repository: https://github.com/macchiato1239/plant-and-bees

## Overview

Plant-and-Bees is a Tkinter tower-defense game. The player uses the game interface to select and place towers; the game controller schedules waves, moves enemies along a path, applies tower effects, and updates money and health. The code separates game orchestration, enemy and tower rules, catalog data, and basic drawable objects. The README gives no further feature details, and some controller code is excerpted only partially, so the graph includes only relationships visible in excerpts or the source index.

Main entry points: [`main.py`](https://github.com/macchiato1239/plant-and-bees/blob/main/main.py) (Game controller), [`enemy.py`](https://github.com/macchiato1239/plant-and-bees/blob/main/enemy.py) (Enemies), [`module_tower.py`](https://github.com/macchiato1239/plant-and-bees/blob/main/module_tower.py) (Tower types), [`interactable.py`](https://github.com/macchiato1239/plant-and-bees/blob/main/interactable.py) (Interactable objects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game orchestration"]
  node_game["Game controller<br/>[main.py]"]
  node_map_path["Map path<br/>[build.py]"]
  node_hotbar["Tower hotbar<br/>[hotbar.py]"]
end

subgraph group_domain["Game entities"]
  node_enemy["Enemies<br/>[enemy.py]"]
  node_tower["Tower types<br/>[module_tower.py]"]
  node_effects["Effect types<br/>[debuff.py]"]
  node_spawn_base["Spawn and base<br/>[build.py]"]
end

subgraph group_catalog["Game data"]
  node_catalog_data["Wave and tower catalogs<br/>[dictionary.py]"]
end

subgraph group_foundation["Drawable foundation"]
  node_interactable["Interactable objects<br/>[interactable.py]"]
  node_rect["Canvas rectangles<br/>[rect.py]"]
  node_element["Element stub<br/>[element.py]"]
end

node_player(("Player"))

node_player -->|"plays through"| node_game
node_game -->|"creates paths"| node_map_path
node_game -->|"gets wave data"| node_catalog_data
node_game -->|"spawns enemies"| node_enemy
node_game -->|"moves and updates"| node_enemy
node_game -->|"runs tower actions"| node_tower
node_game -->|"places tower"| node_tower
node_game -->|"creates slots"| node_hotbar
node_catalog_data -->|"defines enemy data"| node_enemy
node_catalog_data -->|"builds tower types"| node_tower
node_tower -->|"uses effect types"| node_effects
node_enemy -->|"inherits"| node_interactable
node_tower -->|"inherits"| node_interactable
node_hotbar -->|"inherits"| node_interactable
node_spawn_base -->|"inherits"| node_interactable
node_interactable -->|"stores rectangle"| node_rect
node_enemy -->|"creates rectangle"| node_rect
node_spawn_base -->|"creates rectangles"| node_rect

click node_game "https://github.com/macchiato1239/plant-and-bees/blob/main/main.py"
click node_map_path "https://github.com/macchiato1239/plant-and-bees/blob/main/build.py"
click node_enemy "https://github.com/macchiato1239/plant-and-bees/blob/main/enemy.py"
click node_tower "https://github.com/macchiato1239/plant-and-bees/blob/main/module_tower.py"
click node_hotbar "https://github.com/macchiato1239/plant-and-bees/blob/main/hotbar.py"
click node_catalog_data "https://github.com/macchiato1239/plant-and-bees/blob/main/dictionary.py"
click node_effects "https://github.com/macchiato1239/plant-and-bees/blob/main/debuff.py"
click node_spawn_base "https://github.com/macchiato1239/plant-and-bees/blob/main/build.py"
click node_interactable "https://github.com/macchiato1239/plant-and-bees/blob/main/interactable.py"
click node_rect "https://github.com/macchiato1239/plant-and-bees/blob/main/rect.py"
click node_element "https://github.com/macchiato1239/plant-and-bees/blob/main/element.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_game,node_map_path,node_hotbar toneBlue
class node_enemy,node_tower,node_effects,node_spawn_base toneAmber
class node_catalog_data toneMint
class node_interactable,node_rect,node_element toneRose
class node_player toneIndigo
```

## Components

### Game orchestration

- [Game controller](https://github.com/macchiato1239/plant-and-bees/blob/main/main.py): `main.py`
- [Map path](https://github.com/macchiato1239/plant-and-bees/blob/main/build.py): `build.py`
- [Tower hotbar](https://github.com/macchiato1239/plant-and-bees/blob/main/hotbar.py): `hotbar.py`

### Game entities

- [Enemies](https://github.com/macchiato1239/plant-and-bees/blob/main/enemy.py): `enemy.py`
- [Tower types](https://github.com/macchiato1239/plant-and-bees/blob/main/module_tower.py): `module_tower.py`
- [Effect types](https://github.com/macchiato1239/plant-and-bees/blob/main/debuff.py): `debuff.py`
- [Spawn and base](https://github.com/macchiato1239/plant-and-bees/blob/main/build.py): `build.py`

### Game data

- [Wave and tower catalogs](https://github.com/macchiato1239/plant-and-bees/blob/main/dictionary.py): `dictionary.py`

### Drawable foundation

- [Interactable objects](https://github.com/macchiato1239/plant-and-bees/blob/main/interactable.py): `interactable.py`
- [Canvas rectangles](https://github.com/macchiato1239/plant-and-bees/blob/main/rect.py): `rect.py`
- [Element stub](https://github.com/macchiato1239/plant-and-bees/blob/main/element.py): `element.py`

### Other components

- **Player**

## Connections

- Player → Game controller: plays through (evidence: `README.md`)
- Game controller → Map path: creates paths (evidence: `main.py`)
- Game controller → Wave and tower catalogs: gets wave data (evidence: `main.py`)
- Game controller → Enemies: spawns enemies (evidence: `main.py`)
- Game controller → Enemies: moves and updates (evidence: `main.py`)
- Game controller → Tower types: runs tower actions (evidence: `main.py`)
- Game controller → Tower types: places tower (evidence: `main.py`)
- Game controller → Tower hotbar: creates slots (evidence: `main.py`)
- Wave and tower catalogs → Enemies: defines enemy data (evidence: `dictionary.py`)
- Wave and tower catalogs → Tower types: builds tower types (evidence: `dictionary.py`)
- Tower types → Effect types: uses effect types (evidence: `module_tower.py`)
- Enemies → Interactable objects: inherits (evidence: `enemy.py`)
- Tower types → Interactable objects: inherits (evidence: `module_tower.py`)
- Tower hotbar → Interactable objects: inherits (evidence: `hotbar.py`)
- Spawn and base → Interactable objects: inherits (evidence: `build.py`)
- Interactable objects → Canvas rectangles: stores rectangle (evidence: `interactable.py`)
- Enemies → Canvas rectangles: creates rectangle (evidence: `enemy.py`)
- Spawn and base → Canvas rectangles: creates rectangles (evidence: `build.py`)
