# azavo/fnaf_minima architecture

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

- Interactive diagram: https://gitdiagram.com/azavo/fnaf_minima
- Repository: https://github.com/azavo/fnaf_minima

## Overview

This is a small Swing survival game: the player operates office lights and doors while Bonnie and Chica approach; a timed night loop tracks battery and hours and ends in a win or jumpscare. The graph separates startup, animatronic behavior, game progression, and presentation/audio. Relationships are based on the sampled Java excerpts; image and sound assets are represented through the code that loads or plays them.

Main entry points: [`freddyfivebear/src/OfficeUI.java`](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/OfficeUI.java) (Office UI), [`freddyfivebear/src/App.java`](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/App.java) (Game startup), [`freddyfivebear/src/GameLoop.java`](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/GameLoop.java) (Night loop), [`freddyfivebear/src/Bonnie.java`](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/Bonnie.java) (Bonnie AI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup"]
  node_app["Game startup<br/>[App.java]"]
end

subgraph group_threats["Animatronics"]
  node_bonnie["Bonnie AI<br/>[Bonnie.java]"]
  node_chica["Chica AI<br/>[Chica.java]"]
end

subgraph group_gameplay["Night gameplay"]
  node_loop["Night loop<br/>[GameLoop.java]"]
end

subgraph group_presentation["Office presentation"]
  node_office["Office UI<br/>[OfficeUI.java]"]
  node_sfx["Sound effects<br/>[SFX.java]"]
end

node_player(("Player"))

node_app -->|"creates"| node_office
node_app -->|"creates and starts"| node_bonnie
node_app -->|"creates and starts"| node_chica
node_app -->|"sets animatronics"| node_office
node_app -->|"starts night"| node_loop
node_player -->|"operates controls"| node_office
node_office -->|"plays control sounds"| node_sfx
node_office -->|"checks state"| node_bonnie
node_office -->|"checks state"| node_chica
node_bonnie -->|"checks door; repaints"| node_office
node_chica -->|"checks door"| node_office
node_loop -->|"reads controls; updates display"| node_office
node_loop -->|"checks survival"| node_bonnie
node_loop -->|"checks survival"| node_chica
node_office -->|"plays outcome sound"| node_sfx

click node_app "https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/App.java"
click node_bonnie "https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/Bonnie.java"
click node_chica "https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/Chica.java"
click node_loop "https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/GameLoop.java"
click node_office "https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/OfficeUI.java"
click node_sfx "https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/SFX.java"

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_app toneBlue
class node_bonnie,node_chica toneAmber
class node_loop toneMint
class node_office,node_sfx toneRose
class node_player toneIndigo
```

## Components

### Startup

- [Game startup](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/App.java): `freddyfivebear/src/App.java`

### Animatronics

- [Bonnie AI](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/Bonnie.java): `freddyfivebear/src/Bonnie.java`
- [Chica AI](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/Chica.java): `freddyfivebear/src/Chica.java`

### Night gameplay

- [Night loop](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/GameLoop.java): `freddyfivebear/src/GameLoop.java`

### Office presentation

- [Office UI](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/OfficeUI.java): `freddyfivebear/src/OfficeUI.java`
- [Sound effects](https://github.com/azavo/fnaf_minima/blob/main/freddyfivebear/src/SFX.java): `freddyfivebear/src/SFX.java`

### Other components

- **Player**

## Connections

- Game startup → Office UI: creates (evidence: `freddyfivebear/src/App.java`)
- Game startup → Bonnie AI: creates and starts (evidence: `freddyfivebear/src/App.java`)
- Game startup → Chica AI: creates and starts (evidence: `freddyfivebear/src/App.java`)
- Game startup → Office UI: sets animatronics (evidence: `freddyfivebear/src/App.java`)
- Game startup → Night loop: starts night (evidence: `freddyfivebear/src/App.java`)
- Player → Office UI: operates controls (evidence: `freddyfivebear/src/OfficeUI.java`)
- Office UI → Sound effects: plays control sounds (evidence: `freddyfivebear/src/OfficeUI.java`)
- Office UI → Bonnie AI: checks state (evidence: `freddyfivebear/src/OfficeUI.java`)
- Office UI → Chica AI: checks state (evidence: `freddyfivebear/src/OfficeUI.java`)
- Bonnie AI → Office UI: checks door; repaints (evidence: `freddyfivebear/src/Bonnie.java`)
- Chica AI → Office UI: checks door (evidence: `freddyfivebear/src/Chica.java`)
- Night loop → Office UI: reads controls; updates display (evidence: `freddyfivebear/src/GameLoop.java`)
- Night loop → Bonnie AI: checks survival (evidence: `freddyfivebear/src/GameLoop.java`)
- Night loop → Chica AI: checks survival (evidence: `freddyfivebear/src/GameLoop.java`)
- Office UI → Sound effects: plays outcome sound (evidence: `freddyfivebear/src/OfficeUI.java`)
