# jacobchartier/thelastbite architecture

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

- Interactive diagram: https://gitdiagram.com/jacobchartier/thelastbite
- Repository: https://github.com/jacobchartier/thelastbite

## Overview

The Last Bite is a 2D SDL2 platform game. Its visible user flow starts at the main menu, enters gameplay, and renders the player and game scene; the README describes the objective as finding rocket pieces to escape. The sampled code also shows settings, pause, credits, and optional debug rendering. Several gameplay and scene implementations were not excerpted, so links to those areas are limited to relationships visible in the source index or README.

Main entry points: [`GameEngine/UserInterface/Graphics.cs`](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/Graphics.cs) (State renderer), [`GameEngine/UserInterface/UI/Menu.cs`](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Menu.cs) (Main menu), [`TheLastBite/Program.cs`](https://github.com/jacobchartier/thelastbite/blob/main/TheLastBite/Program.cs) (Game entry), [`GameEngine/Application.cs`](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Application.cs) (SDL application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_program["Game entry<br/>[Program.cs]"]
  node_application["SDL application<br/>[Application.cs]"]
  node_graphics["State renderer<br/>[Graphics.cs]"]
  node_input["Event input<br/>[Inputs.cs]"]
end

subgraph group_gameplay["Gameplay"]
  node_scene["Game scene<br/>[Scene.cs]"]
  node_manager["Game manager<br/>[GameManager.cs]"]
  node_entity["Entity movement<br/>[Entity.cs]"]
  node_player_character["Player character<br/>[Player.cs]"]
  node_enemy["Enemy character<br/>[Enemy.cs]"]
  node_platform["Platform geometry<br/>[Platform.cs]"]
  node_basic_platform["Basic platform<br/>[Basic.cs]"]
  node_rocket["Rocket pieces"]
end

subgraph group_interface["Interface"]
  node_menu["Main menu<br/>[Menu.cs]"]
  node_settings["Settings<br/>[Settings.cs]"]
  node_pause["Pause screen<br/>[Pause.cs]"]
  node_credits["Credits<br/>[Credit.cs]"]
  node_game_hud["Game display<br/>[Game.cs]"]
  node_debug["Debug overlay<br/>[Debug.cs]"]
  node_ui_widgets["UI widgets"]
end

subgraph group_support["Game support"]
  node_audio["Audio playback<br/>[Audio.cs]"]
  node_logging["Logging<br/>[Log.cs]"]
  node_assets["Game assets"]
end

node_player(("Player"))

node_player -.->|"starts"| node_program
node_program -->|"uses"| node_application
node_program -->|"uses"| node_graphics
node_program -->|"uses"| node_input
node_application -->|"logs"| node_logging
node_application -->|"loads"| node_assets
node_menu -->|"sets state"| node_graphics
node_menu -->|"opens"| node_settings
node_menu -->|"opens"| node_credits
node_menu -->|"starts"| node_game_hud
node_menu -->|"plays click"| node_audio
node_graphics -->|"dispatches"| node_menu
node_graphics -->|"dispatches"| node_settings
node_graphics -->|"dispatches"| node_pause
node_graphics -->|"dispatches"| node_credits
node_graphics -->|"dispatches"| node_game_hud
node_graphics -->|"renders"| node_scene
node_graphics -->|"renders"| node_debug
node_pause -->|"opens"| node_settings
node_pause -->|"returns"| node_menu
node_settings -->|"sets volume"| node_audio
node_input -->|"forwards events"| node_player_character
node_manager -->|"creates"| node_player_character
node_player_character -->|"inherits"| node_entity
node_enemy -->|"inherits"| node_entity
node_entity -->|"uses timing"| node_graphics
node_game_hud -->|"uses"| node_manager
node_debug -->|"reads player"| node_manager
node_scene -->|"uses"| node_platform
node_platform -->|"uses"| node_basic_platform
node_basic_platform -->|"draws with renderer"| node_application
node_player_character -.->|"collects"| node_rocket

click node_program "https://github.com/jacobchartier/thelastbite/blob/main/TheLastBite/Program.cs"
click node_application "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Application.cs"
click node_graphics "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/Graphics.cs"
click node_input "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Inputs.cs"
click node_menu "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Menu.cs"
click node_settings "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Settings.cs"
click node_pause "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Pause.cs"
click node_credits "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Credit.cs"
click node_game_hud "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Game.cs"
click node_scene "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Scene.cs"
click node_debug "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Debug.cs"
click node_manager "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/GameManager.cs"
click node_entity "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Characters/Entity.cs"
click node_player_character "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Characters/Player.cs"
click node_enemy "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Characters/Enemy.cs"
click node_platform "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Platforms/Platform.cs"
click node_basic_platform "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Platforms/Basic.cs"
click node_rocket "https://github.com/jacobchartier/thelastbite/tree/main/TheLastBite/assets/graphics/Objects"
click node_ui_widgets "https://github.com/jacobchartier/thelastbite/tree/main/GameEngine/UserInterface"
click node_audio "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Audio.cs"
click node_logging "https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Log.cs"
click node_assets "https://github.com/jacobchartier/thelastbite/tree/main/TheLastBite/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_program,node_application,node_graphics,node_input toneBlue
class node_scene,node_manager,node_entity,node_player_character,node_enemy,node_platform,node_basic_platform,node_rocket toneAmber
class node_menu,node_settings,node_pause,node_credits,node_game_hud,node_debug,node_ui_widgets toneMint
class node_audio,node_logging,node_assets toneRose
class node_player toneIndigo
```

## Components

### Runtime

- [Game entry](https://github.com/jacobchartier/thelastbite/blob/main/TheLastBite/Program.cs): `TheLastBite/Program.cs`
- [SDL application](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Application.cs): `GameEngine/Application.cs`
- [State renderer](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/Graphics.cs): `GameEngine/UserInterface/Graphics.cs`
- [Event input](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Inputs.cs): `GameEngine/Inputs.cs`

### Gameplay

- [Game scene](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Scene.cs): `GameEngine/UserInterface/UI/Scene.cs`
- [Game manager](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/GameManager.cs): `GameEngine/GameElements/GameManager.cs`
- [Entity movement](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Characters/Entity.cs): `GameEngine/GameElements/Characters/Entity.cs`
- [Player character](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Characters/Player.cs): `GameEngine/GameElements/Characters/Player.cs`
- [Enemy character](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Characters/Enemy.cs): `GameEngine/GameElements/Characters/Enemy.cs`
- [Platform geometry](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Platforms/Platform.cs): `GameEngine/GameElements/Platforms/Platform.cs`
- [Basic platform](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/GameElements/Platforms/Basic.cs): `GameEngine/GameElements/Platforms/Basic.cs`
- [Rocket pieces](https://github.com/jacobchartier/thelastbite/tree/main/TheLastBite/assets/graphics/Objects): `TheLastBite/assets/graphics/Objects`

### Interface

- [Main menu](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Menu.cs): `GameEngine/UserInterface/UI/Menu.cs`
- [Settings](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Settings.cs): `GameEngine/UserInterface/UI/Settings.cs`
- [Pause screen](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Pause.cs): `GameEngine/UserInterface/UI/Pause.cs`
- [Credits](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Credit.cs): `GameEngine/UserInterface/UI/Credit.cs`
- [Game display](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Game.cs): `GameEngine/UserInterface/UI/Game.cs`
- [Debug overlay](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/UserInterface/UI/Debug.cs): `GameEngine/UserInterface/UI/Debug.cs`
- [UI widgets](https://github.com/jacobchartier/thelastbite/tree/main/GameEngine/UserInterface): `GameEngine/UserInterface`

### Game support

- [Audio playback](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Audio.cs): `GameEngine/Audio.cs`
- [Logging](https://github.com/jacobchartier/thelastbite/blob/main/GameEngine/Log.cs): `GameEngine/Log.cs`
- [Game assets](https://github.com/jacobchartier/thelastbite/tree/main/TheLastBite/assets): `TheLastBite/assets`

### Other components

- **Player**

## Connections

- Player → Game entry: starts
- Game entry → SDL application: uses (evidence: `TheLastBite/Program.cs`)
- Game entry → State renderer: uses (evidence: `TheLastBite/Program.cs`)
- Game entry → Event input: uses (evidence: `TheLastBite/Program.cs`)
- SDL application → Logging: logs (evidence: `GameEngine/Application.cs`)
- SDL application → Game assets: loads (evidence: `GameEngine/Application.cs`)
- Main menu → State renderer: sets state (evidence: `GameEngine/UserInterface/UI/Menu.cs`)
- Main menu → Settings: opens (evidence: `GameEngine/UserInterface/UI/Menu.cs`)
- Main menu → Credits: opens (evidence: `GameEngine/UserInterface/UI/Menu.cs`)
- Main menu → Game display: starts (evidence: `GameEngine/UserInterface/UI/Menu.cs`)
- Main menu → Audio playback: plays click (evidence: `GameEngine/UserInterface/UI/Menu.cs`)
- State renderer → Main menu: dispatches (evidence: `GameEngine/UserInterface/Graphics.cs`)
- State renderer → Settings: dispatches (evidence: `GameEngine/UserInterface/Graphics.cs`)
- State renderer → Pause screen: dispatches (evidence: `GameEngine/UserInterface/Graphics.cs`)
- State renderer → Credits: dispatches (evidence: `GameEngine/UserInterface/Graphics.cs`)
- State renderer → Game display: dispatches (evidence: `GameEngine/UserInterface/Graphics.cs`)
- State renderer → Game scene: renders (evidence: `GameEngine/UserInterface/Graphics.cs`)
- State renderer → Debug overlay: renders (evidence: `GameEngine/UserInterface/Graphics.cs`)
- Pause screen → Settings: opens (evidence: `GameEngine/UserInterface/UI/Pause.cs`)
- Pause screen → Main menu: returns (evidence: `GameEngine/UserInterface/UI/Pause.cs`)
- Settings → Audio playback: sets volume (evidence: `GameEngine/UserInterface/UI/Settings.cs`)
- Event input → Player character: forwards events (evidence: `GameEngine/Inputs.cs`)
- Game manager → Player character: creates (evidence: `GameEngine/GameElements/GameManager.cs`)
- Player character → Entity movement: inherits (evidence: `GameEngine/GameElements/Characters/Player.cs`)
- Enemy character → Entity movement: inherits (evidence: `GameEngine/GameElements/Characters/Enemy.cs`)
- Entity movement → State renderer: uses timing (evidence: `GameEngine/GameElements/Characters/Entity.cs`)
- Game display → Game manager: uses (evidence: `GameEngine/UserInterface/Graphics.cs`)
- Debug overlay → Game manager: reads player (evidence: `GameEngine/UserInterface/UI/Debug.cs`)
- Game scene → Platform geometry: uses (evidence: `GameEngine/UserInterface/UI/Scene.cs`)
- Platform geometry → Basic platform: uses (evidence: `GameEngine/GameElements/Platforms/Platform.cs`)
- Basic platform → SDL application: draws with renderer (evidence: `GameEngine/GameElements/Platforms/Basic.cs`)
- Player character → Rocket pieces: collects (evidence: `README.md`)
