# angelalop03/tfgame architecture

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

- Interactive diagram: https://gitdiagram.com/angelalop03/tfgame
- Repository: https://github.com/angelalop03/tfgame

## Overview

TFG is a libGDX interactive narrative game with player and administrator experiences. The player workflow enters through the application’s opening screen, reaches the player menu, and can start or resume a game whose chapters, scenes, decisions, and options are managed against persisted game state. Administrators have a separate content-editing and player/history-management branch; news, forum, profile, and tutorial screens are additional product features. Source excerpts establish the application bootstrap and several game/data relationships; other screen and manager wiring is represented only where the SOURCE INDEX supports it.

Main entry points: [`core/src/main/java/com/us/TFG/utils/DatabaseManager.java`](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/DatabaseManager.java) (SQLite Database), [`core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java) (Scene Gameplay), [`core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java`](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java) (Visual Story Editor), [`core/src/main/java/com/us/TFG/screens/General`](https://github.com/angelalop03/tfgame/tree/main/core/src/main/java/com/us/TFG/screens/General) (Entry and Account Screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_appcore["Game Bootstrap<br/>[MyTfgGame.java]"]
  node_general["Entry and Account Screens"]
  node_playmenu["Player Menu"]
  node_playerextras["Player Services Screens"]
  node_render["Rendering Support<br/>[Render.java]"]
  node_resources["UI Resources<br/>[Resources.java]"]
  node_style["UI Styling<br/>[UIStyle.java]"]
end

subgraph group_play["Narrative Gameplay"]
  node_chaptercatalog["Chapter Catalog"]
  node_gameplay["Scene Gameplay"]
  node_tutorial["Tutorial Gameplay"]
  node_gamecontent["Chapter and Scene Logic"]
  node_scenes["Scene Logic<br/>[SceneManager.java]"]
  node_decisions["Decision Logic"]
  node_options["Option Logic<br/>[OptionManager.java]"]
end

subgraph group_admin["Administration"]
  node_adminui["Admin Screens"]
  node_storyeditor["Visual Story Editor"]
  node_adminplayers["Player Administration"]
  node_accounts["Account Logic<br/>[UserManager.java]"]
end

subgraph group_data["Persistence and Models"]
  node_database[("SQLite Database")]
  node_tablemanager["Schema Creation<br/>[TableManager.java]"]
  node_columnannotation["Column Metadata<br/>[Column.java]"]
  node_tableannotation["Table Metadata<br/>[Table.java]"]
  node_gamemodel["Game State<br/>[Game.java]"]
  node_playermodel["Player Record<br/>[Player.java]"]
  node_storymodels["Story Entities<br/>[Scene.java]"]
end

node_player(("Player"))
node_administrator(("Administrator"))

node_player -->|"opens app"| node_general
node_administrator -->|"opens app"| node_general
node_appcore -->|"shows opening"| node_general
node_appcore -->|"initializes"| node_database
node_appcore -->|"sets render context"| node_render
node_general -.->|"routes player"| node_playmenu
node_playmenu -->|"opens catalog"| node_chaptercatalog
node_chaptercatalog -.->|"loads chapters"| node_gamecontent
node_gameplay -->|"loads chapter state"| node_gamecontent
node_gameplay -->|"loads scenes"| node_scenes
node_gameplay -->|"loads decisions"| node_decisions
node_gameplay -.->|"loads options"| node_options
node_tutorial -->|"loads scenes"| node_scenes
node_tutorial -->|"loads decisions"| node_decisions
node_tutorial -->|"loads options"| node_options
node_playmenu -.->|"opens services"| node_playerextras
node_administrator -.->|"uses admin"| node_adminui
node_adminui -.->|"opens editor"| node_storyeditor
node_storyeditor -->|"uses decision logic"| node_decisions
node_storyeditor -->|"uses option logic"| node_options
node_storyeditor -->|"uses chapter logic"| node_gamecontent
node_adminui -.->|"manages players"| node_adminplayers
node_adminplayers -->|"uses account logic"| node_accounts
node_gamecontent -->|"queries database"| node_database
node_scenes -->|"queries database"| node_database
node_decisions -->|"queries database"| node_database
node_options -->|"queries database"| node_database
node_accounts -->|"uses connection"| node_database
node_database -->|"creates tables"| node_tablemanager
node_tablemanager -->|"reads metadata"| node_columnannotation
node_tablemanager -->|"reads metadata"| node_tableannotation
node_database -->|"maps records"| node_gamemodel
node_database -->|"maps records"| node_playermodel
node_database -->|"maps records"| node_storymodels
node_gameplay -->|"uses game state"| node_gamemodel
node_gameplay -->|"uses scene"| node_storymodels

click node_appcore "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/MyTfgGame.java"
click node_general "https://github.com/angelalop03/tfgame/tree/main/core/src/main/java/com/us/TFG/screens/General"
click node_playmenu "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/PlayerMenuScreen.java"
click node_playerextras "https://github.com/angelalop03/tfgame/tree/main/core/src/main/java/com/us/TFG/screens/Player"
click node_chaptercatalog "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/Game/ChapterCatalogScreen.java"
click node_gameplay "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java"
click node_tutorial "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/TutorialGameScreen.java"
click node_gamecontent "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/ChapterManager.java"
click node_scenes "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/SceneManager.java"
click node_decisions "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/DecisionManager.java"
click node_options "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/OptionManager.java"
click node_adminui "https://github.com/angelalop03/tfgame/tree/main/core/src/main/java/com/us/TFG/screens/Admin"
click node_storyeditor "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java"
click node_adminplayers "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Admin/AdminViewPlayersScreen.java"
click node_accounts "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/UserManager.java"
click node_database "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/DatabaseManager.java"
click node_tablemanager "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/TableManager.java"
click node_columnannotation "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/annotations/Column.java"
click node_tableannotation "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/annotations/Table.java"
click node_gamemodel "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/model/Game.java"
click node_playermodel "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/model/Player.java"
click node_storymodels "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/model/Scene.java"
click node_render "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/Render.java"
click node_resources "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/Resources.java"
click node_style "https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/UIStyle.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_appcore,node_general,node_playmenu,node_playerextras,node_render,node_resources,node_style toneBlue
class node_chaptercatalog,node_gameplay,node_tutorial,node_gamecontent,node_scenes,node_decisions,node_options toneAmber
class node_adminui,node_storyeditor,node_adminplayers,node_accounts toneMint
class node_database,node_tablemanager,node_columnannotation,node_tableannotation,node_gamemodel,node_playermodel,node_storymodels toneRose
class node_player,node_administrator toneIndigo
```

## Components

### Application UI

- [Game Bootstrap](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/MyTfgGame.java): `core/src/main/java/com/us/TFG/MyTfgGame.java`
- [Entry and Account Screens](https://github.com/angelalop03/tfgame/tree/main/core/src/main/java/com/us/TFG/screens/General): `core/src/main/java/com/us/TFG/screens/General`
- [Player Menu](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/PlayerMenuScreen.java): `core/src/main/java/com/us/TFG/screens/Player/PlayerMenuScreen.java`
- [Player Services Screens](https://github.com/angelalop03/tfgame/tree/main/core/src/main/java/com/us/TFG/screens/Player): `core/src/main/java/com/us/TFG/screens/Player`
- [Rendering Support](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/Render.java): `core/src/main/java/com/us/TFG/utils/Render.java`
- [UI Resources](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/Resources.java): `core/src/main/java/com/us/TFG/utils/Resources.java`
- [UI Styling](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/UIStyle.java): `core/src/main/java/com/us/TFG/utils/UIStyle.java`

### Narrative Gameplay

- [Chapter Catalog](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/Game/ChapterCatalogScreen.java): `core/src/main/java/com/us/TFG/screens/Player/Game/ChapterCatalogScreen.java`
- [Scene Gameplay](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java): `core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`
- [Tutorial Gameplay](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Player/TutorialGameScreen.java): `core/src/main/java/com/us/TFG/screens/Player/TutorialGameScreen.java`
- [Chapter and Scene Logic](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/ChapterManager.java): `core/src/main/java/com/us/TFG/manager/ChapterManager.java`
- [Scene Logic](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/SceneManager.java): `core/src/main/java/com/us/TFG/manager/SceneManager.java`
- [Decision Logic](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/DecisionManager.java): `core/src/main/java/com/us/TFG/manager/DecisionManager.java`
- [Option Logic](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/OptionManager.java): `core/src/main/java/com/us/TFG/manager/OptionManager.java`

### Administration

- [Admin Screens](https://github.com/angelalop03/tfgame/tree/main/core/src/main/java/com/us/TFG/screens/Admin): `core/src/main/java/com/us/TFG/screens/Admin`
- [Visual Story Editor](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java): `core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java`
- [Player Administration](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/screens/Admin/AdminViewPlayersScreen.java): `core/src/main/java/com/us/TFG/screens/Admin/AdminViewPlayersScreen.java`
- [Account Logic](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/manager/UserManager.java): `core/src/main/java/com/us/TFG/manager/UserManager.java`

### Persistence and Models

- [SQLite Database](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/DatabaseManager.java): `core/src/main/java/com/us/TFG/utils/DatabaseManager.java`
- [Schema Creation](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/utils/TableManager.java): `core/src/main/java/com/us/TFG/utils/TableManager.java`
- [Column Metadata](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/annotations/Column.java): `core/src/main/java/com/us/TFG/annotations/Column.java`
- [Table Metadata](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/annotations/Table.java): `core/src/main/java/com/us/TFG/annotations/Table.java`
- [Game State](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/model/Game.java): `core/src/main/java/com/us/TFG/model/Game.java`
- [Player Record](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/model/Player.java): `core/src/main/java/com/us/TFG/model/Player.java`
- [Story Entities](https://github.com/angelalop03/tfgame/blob/main/core/src/main/java/com/us/TFG/model/Scene.java): `core/src/main/java/com/us/TFG/model/Scene.java`

### Other components

- **Player**
- **Administrator**

## Connections

- Player → Entry and Account Screens: opens app
- Administrator → Entry and Account Screens: opens app
- Game Bootstrap → Entry and Account Screens: shows opening (evidence: `core/src/main/java/com/us/TFG/MyTfgGame.java`)
- Game Bootstrap → SQLite Database: initializes (evidence: `core/src/main/java/com/us/TFG/MyTfgGame.java`)
- Game Bootstrap → Rendering Support: sets render context (evidence: `core/src/main/java/com/us/TFG/MyTfgGame.java`)
- Entry and Account Screens → Player Menu: routes player (evidence: `core/src/main/java/com/us/TFG/screens/General/RegisterScreen.java`)
- Player Menu → Chapter Catalog: opens catalog (evidence: `core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`)
- Chapter Catalog → Chapter and Scene Logic: loads chapters
- Scene Gameplay → Chapter and Scene Logic: loads chapter state (evidence: `core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`)
- Scene Gameplay → Scene Logic: loads scenes (evidence: `core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`)
- Scene Gameplay → Decision Logic: loads decisions (evidence: `core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`)
- Scene Gameplay → Option Logic: loads options (evidence: `core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`)
- Tutorial Gameplay → Scene Logic: loads scenes (evidence: `core/src/main/java/com/us/TFG/screens/Player/TutorialGameScreen.java`)
- Tutorial Gameplay → Decision Logic: loads decisions (evidence: `core/src/main/java/com/us/TFG/screens/Player/TutorialGameScreen.java`)
- Tutorial Gameplay → Option Logic: loads options (evidence: `core/src/main/java/com/us/TFG/screens/Player/TutorialGameScreen.java`)
- Player Menu → Player Services Screens: opens services (evidence: `core/src/main/java/com/us/TFG/screens/Player/PlayerMenuScreen.java`)
- Administrator → Admin Screens: uses admin
- Admin Screens → Visual Story Editor: opens editor (evidence: `core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java`)
- Visual Story Editor → Decision Logic: uses decision logic (evidence: `core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java`)
- Visual Story Editor → Option Logic: uses option logic (evidence: `core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java`)
- Visual Story Editor → Chapter and Scene Logic: uses chapter logic (evidence: `core/src/main/java/com/us/TFG/screens/Admin/Game/AdminVisualStoryEditorScreen.java`)
- Admin Screens → Player Administration: manages players (evidence: `core/src/main/java/com/us/TFG/screens/Admin/AdminViewPlayersScreen.java`)
- Player Administration → Account Logic: uses account logic (evidence: `core/src/main/java/com/us/TFG/screens/Admin/AdminViewPlayersScreen.java`)
- Chapter and Scene Logic → SQLite Database: queries database (evidence: `core/src/main/java/com/us/TFG/manager/ChapterManager.java`)
- Scene Logic → SQLite Database: queries database (evidence: `core/src/main/java/com/us/TFG/manager/SceneManager.java`)
- Decision Logic → SQLite Database: queries database (evidence: `core/src/main/java/com/us/TFG/manager/DecisionManager.java`)
- Option Logic → SQLite Database: queries database (evidence: `core/src/main/java/com/us/TFG/manager/OptionManager.java`)
- Account Logic → SQLite Database: uses connection (evidence: `core/src/main/java/com/us/TFG/manager/UserManager.java`)
- SQLite Database → Schema Creation: creates tables (evidence: `core/src/main/java/com/us/TFG/utils/DatabaseManager.java`)
- Schema Creation → Column Metadata: reads metadata (evidence: `core/src/main/java/com/us/TFG/utils/TableManager.java`)
- Schema Creation → Table Metadata: reads metadata (evidence: `core/src/main/java/com/us/TFG/utils/TableManager.java`)
- SQLite Database → Game State: maps records (evidence: `core/src/main/java/com/us/TFG/utils/DatabaseManager.java`)
- SQLite Database → Player Record: maps records (evidence: `core/src/main/java/com/us/TFG/utils/DatabaseManager.java`)
- SQLite Database → Story Entities: maps records (evidence: `core/src/main/java/com/us/TFG/utils/DatabaseManager.java`)
- Scene Gameplay → Game State: uses game state (evidence: `core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`)
- Scene Gameplay → Story Entities: uses scene (evidence: `core/src/main/java/com/us/TFG/screens/Player/Game/SceneGameScreen.java`)
