# mgomez1023/cookie-clicker architecture

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

- Interactive diagram: https://gitdiagram.com/mgomez1023/cookie-clicker
- Repository: https://github.com/mgomez1023/cookie-clicker

## Overview

This repository is a small SFML Cookie Clicker game. Its visible runtime entry point creates the game window, initializes score and upgrade state, loads artwork, and handles at least some upgrade purchases; upgrade classes hold sprite and click-power data. The excerpt shows cursor and grandma purchase logic, while the farm type is defined separately. The README is empty, and the source excerpts do not expose the complete event/render loop or all upgrade handling, so those flows are not inferred. SFML is represented only as an external dependency.

Main entry points: [`CookieClicker/CookieClicker.cpp`](https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/CookieClicker.cpp) (Game entry and state), [`CookieClicker/Header.h`](https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/Header.h) (Upgrade types), [`CookieClicker/Source.cpp`](https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/Source.cpp) (Upgrade implementations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_game["Game entry and state<br/>[CookieClicker.cpp]"]
end

subgraph group_upgrades["Upgrade model"]
  node_upgrade_types["Upgrade types<br/>[Header.h]"]
  node_upgrade_impl["Upgrade implementations<br/>[Source.cpp]"]
end

node_player(("Player"))
node_sfml["SFML framework"]

node_player -->|"plays"| node_game
node_game -->|"creates upgrades"| node_upgrade_types
node_game -->|"uses graphics"| node_sfml
node_upgrade_impl -->|"implements"| node_upgrade_types

click node_game "https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/CookieClicker.cpp"
click node_upgrade_types "https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/Header.h"
click node_upgrade_impl "https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/Source.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_game toneBlue
class node_upgrade_types,node_upgrade_impl toneAmber
class node_player,node_sfml toneIndigo
```

## Components

### Game runtime

- [Game entry and state](https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/CookieClicker.cpp): `CookieClicker/CookieClicker.cpp`

### Upgrade model

- [Upgrade types](https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/Header.h): `CookieClicker/Header.h`
- [Upgrade implementations](https://github.com/mgomez1023/cookie-clicker/blob/main/CookieClicker/Source.cpp): `CookieClicker/Source.cpp`

### Other components

- **Player**
- **SFML framework**

## Connections

- Player → Game entry and state: plays
- Game entry and state → Upgrade types: creates upgrades (evidence: `CookieClicker/CookieClicker.cpp`)
- Game entry and state → SFML framework: uses graphics (evidence: `CookieClicker/CookieClicker.cpp`)
- Upgrade implementations → Upgrade types: implements (evidence: `CookieClicker/Source.cpp`)
