# youbin999/funex_nexongamejam architecture

> Architecture diagram of the GitHub repository youbin999/funex_nexongamejam, 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/youbin999/funex_nexongamejam
- Repository: https://github.com/youbin999/funex_nexongamejam

## Overview

This is a Unity 2D rapid-fire minigame collection in which a run through historical eras produces an alternate-history ending that players can name and save to a gallery. The README documents the main run order, failure types, runtime text/image generation, offline fallback, and gallery capabilities. Source excerpts were not provided, so edges reflect documented relationships only; individual scene-to-script wiring and other implementation details are not asserted.

Main entry points: [`Assets/01_Scripts/Core/MiniGamePlayer.cs`](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Core/MiniGamePlayer.cs) (Minigame host), [`Assets/01_Scripts/Ending/EndingCreditController.cs`](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/EndingCreditController.cs) (Credit roll), [`Assets/01_Scripts/Core/GameFlowController.cs`](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Core/GameFlowController.cs) (Game flow), [`Assets/00_Scenes/00_BigBang.unity`](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/00_Scenes/00_BigBang.unity) (Big Bang intro)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run and eras"]
  node_bigbang["Big Bang intro<br/>[00_BigBang.unity]"]
  node_flow["Game flow"]
  node_host["Minigame host<br/>[MiniGamePlayer.cs]"]
  node_stone["Stone Age games"]
  node_bronze["Bronze Age games"]
  node_medieval["Medieval games"]
  node_modern["Modern-era games"]
  node_othergames["Other era games"]
end

subgraph group_ending["Ending generation"]
  node_credits["Credit roll"]
  node_narrator["Gemini narrator"]
  node_fallback["Fallback narrator"]
  node_image["Ending image"]
  node_naming["World naming<br/>[WorldNamePrompt.cs]"]
end

subgraph group_collection["Gallery and settings"]
  node_gallery["Gallery browsing<br/>[GalleryScreen.cs]"]
  node_gallerydata[("Gallery storage<br/>[GalleryStore.cs]")]
  node_settings["Game settings<br/>[SettingsMenu.cs]"]
end

node_player(("Player"))
node_geminiservice{{"Gemini service"}}
node_pollinations{{"Pollinations service"}}

node_player -->|"starts run"| node_bigbang
node_bigbang -->|"begins progression"| node_flow
node_flow -->|"plays minigames"| node_host
node_host -->|"runs era games"| node_stone
node_host -->|"runs era games"| node_bronze
node_host -->|"runs era games"| node_medieval
node_host -->|"runs era games"| node_modern
node_host -->|"runs era games"| node_othergames
node_flow -->|"starts ending"| node_credits
node_credits -->|"requests story"| node_narrator
node_narrator -.->|"generates text"| node_geminiservice
node_credits -.->|"uses when offline"| node_fallback
node_credits -->|"generates image"| node_image
node_image -.->|"requests image"| node_pollinations
node_credits -->|"prompts naming"| node_naming
node_naming -->|"saves ending"| node_gallerydata
node_gallery -->|"browses saved endings"| node_gallerydata

click node_bigbang "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/00_Scenes/00_BigBang.unity"
click node_flow "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Core/GameFlowController.cs"
click node_host "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Core/MiniGamePlayer.cs"
click node_stone "https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts/Mini_Fire"
click node_bronze "https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts/Mini_Bronze"
click node_medieval "https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts/Mini_witch"
click node_modern "https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts/Mini_Penicillin"
click node_othergames "https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts"
click node_credits "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/EndingCreditController.cs"
click node_narrator "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/GeminiEndingNarrator.cs"
click node_fallback "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/FallbackEndingNarrator.cs"
click node_image "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/EndingImageGenerator.cs"
click node_naming "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/WorldNamePrompt.cs"
click node_gallery "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Gallery/GalleryScreen.cs"
click node_gallerydata "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Gallery/GalleryStore.cs"
click node_settings "https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Settings/SettingsMenu.cs"

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_bigbang,node_flow,node_host,node_stone,node_bronze,node_medieval,node_modern,node_othergames toneBlue
class node_credits,node_narrator,node_fallback,node_image,node_naming toneAmber
class node_gallery,node_gallerydata,node_settings toneMint
class node_player,node_geminiservice,node_pollinations toneIndigo
```

## Components

### Run and eras

- [Big Bang intro](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/00_Scenes/00_BigBang.unity): `Assets/00_Scenes/00_BigBang.unity`
- [Game flow](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Core/GameFlowController.cs): `Assets/01_Scripts/Core/GameFlowController.cs`
- [Minigame host](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Core/MiniGamePlayer.cs): `Assets/01_Scripts/Core/MiniGamePlayer.cs`
- [Stone Age games](https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts/Mini_Fire): `Assets/01_Scripts/Mini_Fire`
- [Bronze Age games](https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts/Mini_Bronze): `Assets/01_Scripts/Mini_Bronze`
- [Medieval games](https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts/Mini_witch): `Assets/01_Scripts/Mini_witch`
- [Modern-era games](https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts/Mini_Penicillin): `Assets/01_Scripts/Mini_Penicillin`
- [Other era games](https://github.com/youbin999/funex_nexongamejam/tree/main/Assets/01_Scripts): `Assets/01_Scripts`

### Ending generation

- [Credit roll](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/EndingCreditController.cs): `Assets/01_Scripts/Ending/EndingCreditController.cs`
- [Gemini narrator](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/GeminiEndingNarrator.cs): `Assets/01_Scripts/Ending/GeminiEndingNarrator.cs`
- [Fallback narrator](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/FallbackEndingNarrator.cs): `Assets/01_Scripts/Ending/FallbackEndingNarrator.cs`
- [Ending image](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/EndingImageGenerator.cs): `Assets/01_Scripts/Ending/EndingImageGenerator.cs`
- [World naming](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Ending/WorldNamePrompt.cs): `Assets/01_Scripts/Ending/WorldNamePrompt.cs`

### Gallery and settings

- [Gallery browsing](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Gallery/GalleryScreen.cs): `Assets/01_Scripts/Gallery/GalleryScreen.cs`
- [Gallery storage](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Gallery/GalleryStore.cs): `Assets/01_Scripts/Gallery/GalleryStore.cs`
- [Game settings](https://github.com/youbin999/funex_nexongamejam/blob/main/Assets/01_Scripts/Settings/SettingsMenu.cs): `Assets/01_Scripts/Settings/SettingsMenu.cs`

### Other components

- **Player**
- **Gemini service**
- **Pollinations service**

## Connections

- Player → Big Bang intro: starts run (evidence: `README.md`)
- Big Bang intro → Game flow: begins progression (evidence: `README.md`)
- Game flow → Minigame host: plays minigames (evidence: `README.md`)
- Minigame host → Stone Age games: runs era games (evidence: `README.md`)
- Minigame host → Bronze Age games: runs era games (evidence: `README.md`)
- Minigame host → Medieval games: runs era games (evidence: `README.md`)
- Minigame host → Modern-era games: runs era games (evidence: `README.md`)
- Minigame host → Other era games: runs era games (evidence: `README.md`)
- Game flow → Credit roll: starts ending (evidence: `README.md`)
- Credit roll → Gemini narrator: requests story (evidence: `README.md`)
- Gemini narrator → Gemini service: generates text (evidence: `README.md`)
- Credit roll → Fallback narrator: uses when offline (evidence: `README.md`)
- Credit roll → Ending image: generates image (evidence: `README.md`)
- Ending image → Pollinations service: requests image (evidence: `README.md`)
- Credit roll → World naming: prompts naming (evidence: `README.md`)
- World naming → Gallery storage: saves ending (evidence: `README.md`)
- Gallery browsing → Gallery storage: browses saved endings (evidence: `README.md`)
