# balatro-src/balatro-src-reverse-engineering architecture

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

- Interactive diagram: https://gitdiagram.com/balatro-src/balatro-src-reverse-engineering
- Repository: https://github.com/balatro-src/balatro-src-reverse-engineering

## Overview

This repository is a Love2D-based Balatro game source and asset set. The README documents launching the game and a default-enabled test menu opened by holding Tab during play, but does not describe the game’s internal runtime flow. Accordingly, the graph shows only those documented relationships; source excerpts were not available to verify calls among the Lua modules or asset use.

Main entry points: [`game.lua`](https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/game.lua) (Balatro game), [`functions/test_functions.lua`](https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/functions/test_functions.lua) (Test menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_balatro["Balatro game<br/>[game.lua]"]
  node_entry["Game entry<br/>[main.lua]"]
  node_engine["Engine systems"]
  node_cardplay["Card gameplay<br/>[card.lua]"]
  node_gamefunctions["Game functions"]
  node_ui["UI definitions<br/>[UI_definitions.lua]"]
end

subgraph group_tools["Test menu"]
  node_testmenu["Test menu<br/>[test_functions.lua]"]
end

subgraph group_assets["Game assets"]
  node_textures["Textures"]
  node_shaders["Shaders"]
  node_sounds["Sounds"]
end

node_player(("Player"))
node_love2d["Love2D"]

node_love2d -->|"launches"| node_balatro
node_player -->|"plays"| node_balatro
node_player -->|"opens with Tab"| node_testmenu

click node_balatro "https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/game.lua"
click node_entry "https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/main.lua"
click node_engine "https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/engine"
click node_cardplay "https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/card.lua"
click node_gamefunctions "https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/functions"
click node_testmenu "https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/functions/test_functions.lua"
click node_ui "https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/functions/UI_definitions.lua"
click node_textures "https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/resources/textures"
click node_shaders "https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/resources/shaders"
click node_sounds "https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/resources/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_balatro,node_entry,node_engine,node_cardplay,node_gamefunctions,node_ui toneBlue
class node_testmenu toneAmber
class node_textures,node_shaders,node_sounds toneMint
class node_player,node_love2d toneIndigo
```

## Components

### Game runtime

- [Balatro game](https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/game.lua): `game.lua`
- [Game entry](https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/main.lua): `main.lua`
- [Engine systems](https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/engine): `engine`
- [Card gameplay](https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/card.lua): `card.lua`
- [Game functions](https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/functions): `functions`
- [UI definitions](https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/functions/UI_definitions.lua): `functions/UI_definitions.lua`

### Test menu

- [Test menu](https://github.com/balatro-src/balatro-src-reverse-engineering/blob/asset-main/functions/test_functions.lua): `functions/test_functions.lua`

### Game assets

- [Textures](https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/resources/textures): `resources/textures`
- [Shaders](https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/resources/shaders): `resources/shaders`
- [Sounds](https://github.com/balatro-src/balatro-src-reverse-engineering/tree/asset-main/resources/sounds): `resources/sounds`

### Other components

- **Player**
- **Love2D**

## Connections

- Love2D → Balatro game: launches (evidence: `README.md`)
- Player → Balatro game: plays (evidence: `README.md`)
- Player → Test menu: opens with Tab (evidence: `README.md`)
