# h4tch/zombies-game-of-life architecture

> Architecture diagram of the GitHub repository h4tch/zombies-game-of-life, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/h4tch/zombies-game-of-life
- Repository: https://github.com/h4tch/zombies-game-of-life

## Overview

##### Main Components

a) Game Engine Layer (LÖVE Framework)
- Should be represented as a foundational layer
- Handles rendering, input, physics, and audio

b) Core Game Systems
- Main Game Loop (main.lua)
- Configuration System (conf.lua)
- Game State Manager (game.lua)
- Stage Management (stage.lua)
- Grid System (grid.lua)
- Input Handler (keys.lua)

c) Game Elements
- Player System (player.lua)
- Introduction Screen (intro.lua)
- Asset Management (assets directory)

**┌─────────────────────────────────────────────┐**
- LÖVE Framework               │
- ┘
- ↑
**┌─────────────────────────────────────────────┐**
- Core Game Systems              │
- ┬─────────────┬────────────────┤
- Game Loop  │    Config   │  State Manager │
- (main.lua) │  (conf.lua) │   (game.lua)   │
- ┴─────────────┴────────────────┘
- ↑
**┌─────────────────────────────────────────────┐**
- Game Components                │
- ┬─────────────┬────────────────┤
- Player   │    Grid     │     Stage      │
- System    │    Manager     │
- ┴─────────────┴────────────────┘

##### Important Relationships to Highlight

- How main.lua initializes and coordinates other components
- Relationship between the grid system and stage management
- Demonstrate player interaction with the grid and stage systems
- How the input handler (keys.lua) affects the player and game state

##### Technical Details

- LÖVE version compatibility (from conf.lua)
- Entry point through launch.sh
- Asset loading paths
- State transitions between intro and main game

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef framework fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef component fill:#e67e22,stroke:#d35400,color:white
    classDef asset fill:#95a5a6,stroke:#7f8c8d,color:white

    %% LÖVE Framework Layer
    subgraph Framework
        LOVE[LÖVE Game Framework]:::framework
    end

    %% Core Systems Layer
    subgraph CoreSystems
        Main["Main Game Loop"]:::core
        Config["Configuration System"]:::core
        GameState["Game State Manager"]:::core
        Inheritance["Inheritance System"]:::core
        Launch["Launch Script"]:::core
    end

    %% Game Components Layer
    subgraph GameComponents
        Player["Player System"]:::component
        Grid["Grid System"]:::component
        Stage["Stage Management"]:::component
        Keys["Input Handler"]:::component
        Intro["Introduction Screen"]:::component
    end

    %% Asset Management
    subgraph Assets
        AssetMgmt["Asset Management"]:::asset
        Sources["Asset Sources"]:::asset
    end

    %% Relationships
    LOVE --> Main
    Main --> GameState
    Main --> Config
    GameState --> Stage
    GameState --> Intro
    Stage --> Grid
    Grid --> Player
    Keys --> Player
    Keys --> GameState
    AssetMgmt --> Sources
    Main --> AssetMgmt
    Inheritance --> GameState

    %% Click events for component mapping
    click Main "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/main.lua"
    click Config "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/conf.lua"
    click GameState "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/game.lua"
    click Stage "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/stage.lua"
    click Grid "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/grid.lua"
    click Keys "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/keys.lua"
    click Player "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/player.lua"
    click Intro "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/intro.lua"
    click AssetMgmt "https://github.com/H4tch/Zombies-Game-of-Life/tree/master/assets/"
    click Sources "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/assets/sources.txt"
    click Inheritance "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/inheritance.lua"
    click Launch "https://github.com/H4tch/Zombies-Game-of-Life/blob/master/launch.sh"

    %% Legend
    subgraph Legend
        L1["Framework Component"]:::framework
        L2["Core System"]:::core
        L3["Game Component"]:::component
        L4["Asset Component"]:::asset
    end
```
