# poltergeistfunk/hy452-snake architecture

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

- Interactive diagram: https://gitdiagram.com/poltergeistfunk/hy452-snake
- Repository: https://github.com/poltergeistfunk/hy452-snake

## Overview

HY452-Snake is a desktop Snake game with menus and cloud-backed scores. The player launches the game, navigates menus to play or manage an account and preferences, then can view scores and customize backgrounds or music. The README describes DynamoDB-backed scoring; the sampled client shows HTTP requests for scores, accounts, and assets, but not the cloud service implementation. Menu excerpts are partial, so some menu-to-client links are shown only where calls are visible.

Main entry points: [`src/game.py`](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/game.py) (Snake gameplay), [`src/server.py`](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/server.py) (Score and asset client), [`src/main.py`](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/main.py) (Game launcher), [`src/menu.py`](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py) (Main menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Game application"]
  node_launcher["Game launcher<br/>[main.py]"]
  node_game["Snake gameplay<br/>[game.py]"]
  node_settings["Game settings<br/>[config.yaml]"]
  node_visuals["Game artwork"]
end

subgraph group_menus["Player menus"]
  node_mainmenu["Main menu<br/>[menu.py]"]
  node_scores["High scores<br/>[menu.py]"]
  node_customization["Background and music<br/>[menu.py]"]
  node_accounts["Registration and login<br/>[menu.py]"]
  node_profile["User profile<br/>[menu.py]"]
end

subgraph group_cloud["Cloud client"]
  node_scoreclient["Score and asset client<br/>[server.py]"]
end

node_player(("Player"))
node_cloudapi{{"Cloud game API"}}
node_dynamodb[("DynamoDB scores")]

node_player -->|"launches"| node_launcher
node_launcher -->|"creates"| node_game
node_player -->|"controls"| node_game
node_game -->|"loads config"| node_settings
node_game -->|"loads artwork"| node_visuals
node_game -->|"uses menus"| node_mainmenu
node_player -->|"navigates"| node_mainmenu
node_scores -->|"fetches leaderboard"| node_scoreclient
node_customization -->|"fetches assets"| node_scoreclient
node_accounts -->|"registers and logs in"| node_scoreclient
node_profile -->|"reads player state"| node_game
node_scoreclient -->|"sends HTTP requests"| node_cloudapi
node_cloudapi -.->|"stores scores"| node_dynamodb

click node_launcher "https://github.com/poltergeistfunk/hy452-snake/blob/main/src/main.py"
click node_game "https://github.com/poltergeistfunk/hy452-snake/blob/main/src/game.py"
click node_settings "https://github.com/poltergeistfunk/hy452-snake/blob/main/config.yaml"
click node_visuals "https://github.com/poltergeistfunk/hy452-snake/tree/main/assets/images"
click node_mainmenu "https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py"
click node_scores "https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py"
click node_customization "https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py"
click node_accounts "https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py"
click node_profile "https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py"
click node_scoreclient "https://github.com/poltergeistfunk/hy452-snake/blob/main/src/server.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_launcher,node_game,node_settings,node_visuals toneBlue
class node_mainmenu,node_scores,node_customization,node_accounts,node_profile,node_dynamodb toneAmber
class node_scoreclient,node_cloudapi toneMint
class node_player toneIndigo
```

## Components

### Game application

- [Game launcher](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/main.py): `src/main.py`
- [Snake gameplay](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/game.py): `src/game.py`
- [Game settings](https://github.com/poltergeistfunk/hy452-snake/blob/main/config.yaml): `config.yaml`
- [Game artwork](https://github.com/poltergeistfunk/hy452-snake/tree/main/assets/images): `assets/images`

### Player menus

- [Main menu](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py): `src/menu.py`
- [High scores](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py): `src/menu.py`
- [Background and music](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py): `src/menu.py`
- [Registration and login](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py): `src/menu.py`
- [User profile](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/menu.py): `src/menu.py`

### Cloud client

- [Score and asset client](https://github.com/poltergeistfunk/hy452-snake/blob/main/src/server.py): `src/server.py`

### Other components

- **Player**
- **Cloud game API**
- **DynamoDB scores**

## Connections

- Player → Game launcher: launches (evidence: `README.md`)
- Game launcher → Snake gameplay: creates (evidence: `src/main.py`)
- Player → Snake gameplay: controls (evidence: `README.md`)
- Snake gameplay → Game settings: loads config (evidence: `src/game.py`)
- Snake gameplay → Game artwork: loads artwork (evidence: `src/game.py`)
- Snake gameplay → Main menu: uses menus (evidence: `src/game.py`)
- Player → Main menu: navigates (evidence: `README.md`)
- High scores → Score and asset client: fetches leaderboard (evidence: `src/menu.py`)
- Background and music → Score and asset client: fetches assets (evidence: `src/menu.py`)
- Registration and login → Score and asset client: registers and logs in (evidence: `src/menu.py`)
- User profile → Snake gameplay: reads player state (evidence: `src/menu.py`)
- Score and asset client → Cloud game API: sends HTTP requests (evidence: `src/server.py`)
- Cloud game API → DynamoDB scores: stores scores (evidence: `README.md`)
