# userdvddev/cgrabrewritten architecture

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

- Interactive diagram: https://gitdiagram.com/userdvddev/cgrabrewritten
- Repository: https://github.com/userdvddev/cgrabrewritten

## Overview

Cash Grab! is a C++ arcade game built on SFML. The user-facing flow starts in the main menu, branches to options or play, shows a comic intro, then runs the falling-object game and returns to the menu when play ends. Within gameplay, the engine coordinates player movement, coin/bomb/power-up spawning, collisions, score/status, and game-over handling. The README is empty, so documented capabilities beyond the sampled code are unavailable; SFML internals are represented only as the external framework dependency.

Main entry points: [`mainGame.cpp`](https://github.com/userdvddev/cgrabrewritten/blob/master/mainGame.cpp) (Game Launcher), [`Funcs.cpp`](https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.cpp) (Game Engine), [`options-menu.cpp`](https://github.com/userdvddev/cgrabrewritten/blob/master/options-menu.cpp) (Options Menu), [`main-menu.cpp`](https://github.com/userdvddev/cgrabrewritten/blob/master/main-menu.cpp) (Main Menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Flow"]
  node_launcher["Game Launcher<br/>[mainGame.cpp]"]
  node_entry["Program Entry<br/>[CgrabRewritten.cpp]"]
end

subgraph group_menus["Menus and Settings"]
  node_mainmenu["Main Menu<br/>[main-menu.cpp]"]
  node_options["Options Menu<br/>[options-menu.cpp]"]
end

subgraph group_gameplay["Gameplay"]
  node_player["Player<br/>[Funcs.h]"]
  node_pickups["Coins and Power-ups<br/>[Funcs.h]"]
  node_hazards["Bombs<br/>[Funcs.h]"]
  node_engine["Game Engine<br/>[Funcs.cpp]"]
  node_gameover["Game Over<br/>[Funcs.h]"]
  node_intro["Comic Intro<br/>[Funcs.h]"]
end

subgraph group_sfml["SFML Runtime"]
  node_sfml["SFML Framework"]
end

node_user(("Player"))

node_user -->|"starts"| node_entry
node_entry -->|"creates and runs"| node_launcher
node_launcher -->|"opens menu"| node_mainmenu
node_mainmenu -->|"returns choice"| node_launcher
node_launcher -->|"opens settings"| node_options
node_launcher -->|"shows intro"| node_intro
node_launcher -->|"runs gameplay"| node_engine
node_engine -->|"updates and renders"| node_player
node_engine -->|"spawns and updates"| node_pickups
node_engine -->|"spawns and updates"| node_hazards
node_engine -.->|"handles game over"| node_gameover
node_options -->|"sets volume"| node_launcher
node_mainmenu -->|"reads mute state"| node_options
node_engine -->|"reads audio levels"| node_options
node_launcher -->|"uses window and audio"| node_sfml
node_mainmenu -->|"uses graphics and audio"| node_sfml
node_options -->|"uses graphics and audio"| node_sfml
node_engine -->|"uses graphics and audio"| node_sfml

click node_player "https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h"
click node_pickups "https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h"
click node_hazards "https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h"
click node_engine "https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.cpp"
click node_gameover "https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h"
click node_intro "https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h"
click node_launcher "https://github.com/userdvddev/cgrabrewritten/blob/master/mainGame.cpp"
click node_entry "https://github.com/userdvddev/cgrabrewritten/blob/master/CgrabRewritten.cpp"
click node_mainmenu "https://github.com/userdvddev/cgrabrewritten/blob/master/main-menu.cpp"
click node_options "https://github.com/userdvddev/cgrabrewritten/blob/master/options-menu.cpp"

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_entry toneBlue
class node_mainmenu,node_options toneAmber
class node_player,node_pickups,node_hazards,node_engine,node_gameover,node_intro toneMint
class node_sfml toneRose
class node_user toneIndigo
```

## Components

### Application Flow

- [Game Launcher](https://github.com/userdvddev/cgrabrewritten/blob/master/mainGame.cpp): `mainGame.cpp`
- [Program Entry](https://github.com/userdvddev/cgrabrewritten/blob/master/CgrabRewritten.cpp): `CgrabRewritten.cpp`

### Menus and Settings

- [Main Menu](https://github.com/userdvddev/cgrabrewritten/blob/master/main-menu.cpp): `main-menu.cpp`
- [Options Menu](https://github.com/userdvddev/cgrabrewritten/blob/master/options-menu.cpp): `options-menu.cpp`

### Gameplay

- [Player](https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h): `Funcs.h`
- [Coins and Power-ups](https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h): `Funcs.h`
- [Bombs](https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h): `Funcs.h`
- [Game Engine](https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.cpp): `Funcs.cpp`
- [Game Over](https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h): `Funcs.h`
- [Comic Intro](https://github.com/userdvddev/cgrabrewritten/blob/master/Funcs.h): `Funcs.h`

### SFML Runtime

- **SFML Framework**

### Other components

- **Player**

## Connections

- Player → Program Entry: starts (evidence: `CgrabRewritten.cpp`)
- Program Entry → Game Launcher: creates and runs (evidence: `CgrabRewritten.cpp`)
- Game Launcher → Main Menu: opens menu (evidence: `mainGame.cpp`)
- Main Menu → Game Launcher: returns choice (evidence: `mainGame.cpp`)
- Game Launcher → Options Menu: opens settings (evidence: `mainGame.cpp`)
- Game Launcher → Comic Intro: shows intro (evidence: `mainGame.cpp`)
- Game Launcher → Game Engine: runs gameplay (evidence: `mainGame.cpp`)
- Game Engine → Player: updates and renders (evidence: `Funcs.cpp`)
- Game Engine → Coins and Power-ups: spawns and updates (evidence: `Funcs.cpp`)
- Game Engine → Bombs: spawns and updates (evidence: `Funcs.cpp`)
- Game Engine → Game Over: handles game over (evidence: `Funcs.cpp`)
- Options Menu → Game Launcher: sets volume (evidence: `mainGame.cpp`)
- Main Menu → Options Menu: reads mute state (evidence: `main-menu.cpp`)
- Game Engine → Options Menu: reads audio levels (evidence: `Funcs.cpp`)
- Game Launcher → SFML Framework: uses window and audio (evidence: `mainGame.cpp`)
- Main Menu → SFML Framework: uses graphics and audio (evidence: `main-menu.cpp`)
- Options Menu → SFML Framework: uses graphics and audio (evidence: `options-menu.cpp`)
- Game Engine → SFML Framework: uses graphics and audio (evidence: `Funcs.cpp`)
