# verdessandu12-wq/fnaf architecture

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

- Interactive diagram: https://gitdiagram.com/verdessandu12-wq/fnaf
- Repository: https://github.com/verdessandu12-wq/fnaf

## Overview

This is a Raylib psychological-horror game. The main workflow is menu selection into the office gameplay, with keyboard-driven camera, tablet, and night-ending states; the main loop owns updates and rendering. Animatronic movement and camera-room visibility form a separate gameplay system. The README provides no feature detail, so this map follows the sampled runtime and named modules; some small declared subsystems, especially the screamer, have no demonstrated runtime connection.

Main entry points: [`src/main.cpp`](https://github.com/verdessandu12-wq/fnaf/blob/main/src/main.cpp) (Game Loop), [`src/animatronics/Ixel.cpp`](https://github.com/verdessandu12-wq/fnaf/blob/main/src/animatronics/Ixel.cpp) (Ixel Animatronic), [`src/camera.cpp`](https://github.com/verdessandu12-wq/fnaf/blob/main/src/camera.cpp) (Room Cameras), [`src/sixam.cpp`](https://github.com/verdessandu12-wq/fnaf/blob/main/src/sixam.cpp) (6 AM Ending)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Game Flow"]
  node_loop["Game Loop<br/>[main.cpp]"]
  node_sixam["6 AM Ending<br/>[sixam.cpp]"]
  node_screamer["Screamer<br/>[screamer.cpp]"]
end

subgraph group_play["Night Gameplay"]
  node_office["Office Gameplay<br/>[gameplay.cpp]"]
  node_camera["Room Cameras<br/>[camera.cpp]"]
  node_ixel["Ixel Animatronic<br/>[Ixel.cpp]"]
  node_animatronics["Animatronic Base<br/>[animatronics.hpp]"]
end

subgraph group_presentation["Game Presentation"]
  node_menu["Menu<br/>[menu.cpp]"]
  node_pad["Tablet Pad<br/>[pad.cpp]"]
end

subgraph group_shared["Shared Rendering"]
  node_shader["Shader Wrapper<br/>[shader.cpp]"]
  node_image_types["Image Types<br/>[sablonClass.hpp]"]
  node_image_loader["Image Loading<br/>[stb_image.h]"]
  node_anim_assets["Animatronic Art"]
  node_shader_files["Shader Effects"]
  node_ambient_music["Ambient Music<br/>[ambient.mp3]"]
end

node_player(("Player"))

node_player -->|"starts"| node_loop
node_loop -->|"updates, renders"| node_menu
node_loop -->|"updates, renders"| node_office
node_loop -->|"switches, renders"| node_camera
node_loop -->|"updates, renders"| node_ixel
node_loop -->|"updates, animates"| node_pad
node_loop -->|"updates, renders"| node_sixam
node_ixel -->|"checks room"| node_camera
node_ixel -->|"implements"| node_animatronics
node_ixel -->|"loads effect"| node_shader_files
node_ixel -->|"loads textures"| node_anim_assets
node_loop -->|"loads music"| node_ambient_music

click node_loop "https://github.com/verdessandu12-wq/fnaf/blob/main/src/main.cpp"
click node_menu "https://github.com/verdessandu12-wq/fnaf/blob/main/src/menu.cpp"
click node_office "https://github.com/verdessandu12-wq/fnaf/blob/main/src/gameplay.cpp"
click node_camera "https://github.com/verdessandu12-wq/fnaf/blob/main/src/camera.cpp"
click node_ixel "https://github.com/verdessandu12-wq/fnaf/blob/main/src/animatronics/Ixel.cpp"
click node_animatronics "https://github.com/verdessandu12-wq/fnaf/blob/main/src/animatronics/animatronics.hpp"
click node_pad "https://github.com/verdessandu12-wq/fnaf/blob/main/src/pad.cpp"
click node_sixam "https://github.com/verdessandu12-wq/fnaf/blob/main/src/sixam.cpp"
click node_screamer "https://github.com/verdessandu12-wq/fnaf/blob/main/src/screamer.cpp"
click node_shader "https://github.com/verdessandu12-wq/fnaf/blob/main/src/shader.cpp"
click node_image_types "https://github.com/verdessandu12-wq/fnaf/blob/main/src/sablonClass.hpp"
click node_image_loader "https://github.com/verdessandu12-wq/fnaf/blob/main/src/stb_image.h"
click node_anim_assets "https://github.com/verdessandu12-wq/fnaf/tree/main/assets/animatronics"
click node_shader_files "https://github.com/verdessandu12-wq/fnaf/tree/main/shader"
click node_ambient_music "https://github.com/verdessandu12-wq/fnaf/blob/main/song/ambient.mp3"

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_loop,node_sixam,node_screamer toneBlue
class node_office,node_camera,node_ixel,node_animatronics toneAmber
class node_menu,node_pad toneMint
class node_shader,node_image_types,node_image_loader,node_anim_assets,node_shader_files,node_ambient_music toneRose
class node_player toneIndigo
```

## Components

### Game Flow

- [Game Loop](https://github.com/verdessandu12-wq/fnaf/blob/main/src/main.cpp): `src/main.cpp`
- [6 AM Ending](https://github.com/verdessandu12-wq/fnaf/blob/main/src/sixam.cpp): `src/sixam.cpp`
- [Screamer](https://github.com/verdessandu12-wq/fnaf/blob/main/src/screamer.cpp): `src/screamer.cpp`

### Night Gameplay

- [Office Gameplay](https://github.com/verdessandu12-wq/fnaf/blob/main/src/gameplay.cpp): `src/gameplay.cpp`
- [Room Cameras](https://github.com/verdessandu12-wq/fnaf/blob/main/src/camera.cpp): `src/camera.cpp`
- [Ixel Animatronic](https://github.com/verdessandu12-wq/fnaf/blob/main/src/animatronics/Ixel.cpp): `src/animatronics/Ixel.cpp`
- [Animatronic Base](https://github.com/verdessandu12-wq/fnaf/blob/main/src/animatronics/animatronics.hpp): `src/animatronics/animatronics.hpp`

### Game Presentation

- [Menu](https://github.com/verdessandu12-wq/fnaf/blob/main/src/menu.cpp): `src/menu.cpp`
- [Tablet Pad](https://github.com/verdessandu12-wq/fnaf/blob/main/src/pad.cpp): `src/pad.cpp`

### Shared Rendering

- [Shader Wrapper](https://github.com/verdessandu12-wq/fnaf/blob/main/src/shader.cpp): `src/shader.cpp`
- [Image Types](https://github.com/verdessandu12-wq/fnaf/blob/main/src/sablonClass.hpp): `src/sablonClass.hpp`
- [Image Loading](https://github.com/verdessandu12-wq/fnaf/blob/main/src/stb_image.h): `src/stb_image.h`
- [Animatronic Art](https://github.com/verdessandu12-wq/fnaf/tree/main/assets/animatronics): `assets/animatronics`
- [Shader Effects](https://github.com/verdessandu12-wq/fnaf/tree/main/shader): `shader`
- [Ambient Music](https://github.com/verdessandu12-wq/fnaf/blob/main/song/ambient.mp3): `song/ambient.mp3`

### Other components

- **Player**

## Connections

- Player → Game Loop: starts
- Game Loop → Menu: updates, renders (evidence: `src/main.cpp`)
- Game Loop → Office Gameplay: updates, renders (evidence: `src/main.cpp`)
- Game Loop → Room Cameras: switches, renders (evidence: `src/main.cpp`)
- Game Loop → Ixel Animatronic: updates, renders (evidence: `src/main.cpp`)
- Game Loop → Tablet Pad: updates, animates (evidence: `src/main.cpp`)
- Game Loop → 6 AM Ending: updates, renders (evidence: `src/main.cpp`)
- Ixel Animatronic → Room Cameras: checks room (evidence: `src/animatronics/Ixel.cpp`)
- Ixel Animatronic → Animatronic Base: implements
- Ixel Animatronic → Shader Effects: loads effect (evidence: `src/animatronics/Ixel.cpp`)
- Ixel Animatronic → Animatronic Art: loads textures (evidence: `src/animatronics/Ixel.cpp`)
- Game Loop → Ambient Music: loads music (evidence: `src/main.cpp`)
