# tzshanta-maker/touchline-vale architecture

> Architecture diagram of the GitHub repository tzshanta-maker/touchline-vale, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tzshanta-maker/touchline-vale
- Repository: https://github.com/tzshanta-maker/touchline-vale

## Overview

Touchline Vale is a playable 3D football game, with browser, desktop, and Android ways to run it. The main workflow is player input through the game loop into a live match, where team AI and player/ball simulation determine play and the UI presents controls and match feedback. Separate branches cover squad setup, procedural stadium and player visuals, and platform shells. Relationships are limited to calls or wiring visible in excerpts, the source index, or README; unsampled features are represented only where documented.

Main entry points: [`src/main.js`](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/main.js) (Application entry), [`src/core/Game.js`](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/core/Game.js) (Match game loop), [`src/ui/GamepadNav.js`](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/GamepadNav.js) (Gamepad navigation), [`src/ui/UI.js`](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/UI.js) (Menus and HUD)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_match["Match simulation"]
  node_game["Match game loop<br/>[Game.js]"]
  node_ai["Team AI<br/>[TeamAI.js]"]
  node_ball["Ball simulation<br/>[Ball.js]"]
  node_footballer["Player simulation<br/>[Player.js]"]
end

subgraph group_controls["Input and presentation"]
  node_input["Input handling<br/>[Input.js]"]
  node_touch["Touch controls<br/>[TouchControls.js]"]
  node_gamepad["Gamepad navigation<br/>[GamepadNav.js]"]
  node_ui["Menus and HUD<br/>[UI.js]"]
  node_sound["Sound<br/>[Sound.js]"]
end

subgraph group_world["Teams and visuals"]
  node_player_model["Player models<br/>[PlayerModel.js]"]
  node_squads["Squads and formations<br/>[teams.js]"]
  node_config["Game configuration<br/>[config.js]"]
  node_stadium["Procedural stadium<br/>[Stadium.js]"]
  node_textures["Procedural textures<br/>[Textures.js]"]
end

subgraph group_runtimes["Game runtimes"]
  node_entry["Application entry<br/>[main.js]"]
  node_desktop["Desktop shell<br/>[main.cjs]"]
  node_android["Android host<br/>[MainActivity.java]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_entry
node_entry -->|"creates and starts"| node_game
node_entry -->|"creates"| node_input
node_entry -->|"creates"| node_ui
node_entry -->|"attaches"| node_touch
node_entry -->|"registers"| node_gamepad
node_touch -->|"sets actions"| node_input
node_gamepad -->|"uses"| node_input
node_gamepad -->|"navigates"| node_ui
node_game -->|"uses"| node_ai
node_game -->|"uses"| node_ball
node_game -->|"uses"| node_footballer
node_game -->|"uses"| node_stadium
node_game -->|"uses"| node_squads
node_game -->|"reads settings"| node_config
node_ai -->|"uses formations"| node_squads
node_ball -->|"creates texture"| node_textures
node_stadium -->|"builds with"| node_textures
node_player_model -->|"uses"| node_textures
node_ui -->|"plays feedback"| node_sound
node_desktop -.->|"loads game"| node_entry
node_android -.->|"hosts game"| node_entry

click node_entry "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/main.js"
click node_game "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/core/Game.js"
click node_input "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/core/Input.js"
click node_touch "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/TouchControls.js"
click node_gamepad "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/GamepadNav.js"
click node_ui "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/UI.js"
click node_sound "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/Sound.js"
click node_ai "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ai/TeamAI.js"
click node_ball "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/entities/Ball.js"
click node_footballer "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/entities/Player.js"
click node_player_model "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/entities/PlayerModel.js"
click node_squads "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/entities/teams.js"
click node_config "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/config.js"
click node_stadium "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/world/Stadium.js"
click node_textures "https://github.com/tzshanta-maker/touchline-vale/blob/main/src/world/Textures.js"
click node_desktop "https://github.com/tzshanta-maker/touchline-vale/blob/main/desktop/main.cjs"
click node_android "https://github.com/tzshanta-maker/touchline-vale/blob/main/android/src/com/touchlinevale/game/MainActivity.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_game,node_ai,node_ball,node_footballer toneBlue
class node_input,node_touch,node_gamepad,node_ui,node_sound toneAmber
class node_player_model,node_squads,node_config,node_stadium,node_textures toneMint
class node_entry,node_desktop,node_android toneRose
class node_player toneIndigo
```

## Components

### Match simulation

- [Match game loop](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/core/Game.js): `src/core/Game.js`
- [Team AI](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ai/TeamAI.js): `src/ai/TeamAI.js`
- [Ball simulation](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/entities/Ball.js): `src/entities/Ball.js`
- [Player simulation](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/entities/Player.js): `src/entities/Player.js`

### Input and presentation

- [Input handling](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/core/Input.js): `src/core/Input.js`
- [Touch controls](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/TouchControls.js): `src/ui/TouchControls.js`
- [Gamepad navigation](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/GamepadNav.js): `src/ui/GamepadNav.js`
- [Menus and HUD](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/UI.js): `src/ui/UI.js`
- [Sound](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/ui/Sound.js): `src/ui/Sound.js`

### Teams and visuals

- [Player models](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/entities/PlayerModel.js): `src/entities/PlayerModel.js`
- [Squads and formations](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/entities/teams.js): `src/entities/teams.js`
- [Game configuration](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/config.js): `src/config.js`
- [Procedural stadium](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/world/Stadium.js): `src/world/Stadium.js`
- [Procedural textures](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/world/Textures.js): `src/world/Textures.js`

### Game runtimes

- [Application entry](https://github.com/tzshanta-maker/touchline-vale/blob/main/src/main.js): `src/main.js`
- [Desktop shell](https://github.com/tzshanta-maker/touchline-vale/blob/main/desktop/main.cjs): `desktop/main.cjs`
- [Android host](https://github.com/tzshanta-maker/touchline-vale/blob/main/android/src/com/touchlinevale/game/MainActivity.java): `android/src/com/touchlinevale/game/MainActivity.java`

### Other components

- **Player**

## Connections

- Player → Application entry: starts game (evidence: `README.md`)
- Application entry → Match game loop: creates and starts (evidence: `src/main.js`)
- Application entry → Input handling: creates (evidence: `src/main.js`)
- Application entry → Menus and HUD: creates (evidence: `src/main.js`)
- Application entry → Touch controls: attaches (evidence: `src/main.js`)
- Application entry → Gamepad navigation: registers (evidence: `src/main.js`)
- Touch controls → Input handling: sets actions (evidence: `src/ui/TouchControls.js`)
- Gamepad navigation → Input handling: uses (evidence: `src/main.js`)
- Gamepad navigation → Menus and HUD: navigates (evidence: `src/main.js`)
- Match game loop → Team AI: uses (evidence: `src/core/Game.js`)
- Match game loop → Ball simulation: uses (evidence: `src/core/Game.js`)
- Match game loop → Player simulation: uses (evidence: `src/core/Game.js`)
- Match game loop → Procedural stadium: uses (evidence: `src/core/Game.js`)
- Match game loop → Squads and formations: uses (evidence: `src/core/Game.js`)
- Match game loop → Game configuration: reads settings (evidence: `src/core/Game.js`)
- Team AI → Squads and formations: uses formations (evidence: `src/ai/TeamAI.js`)
- Ball simulation → Procedural textures: creates texture (evidence: `src/entities/Ball.js`)
- Procedural stadium → Procedural textures: builds with (evidence: `src/world/Stadium.js`)
- Player models → Procedural textures: uses (evidence: `src/entities/PlayerModel.js`)
- Menus and HUD → Sound: plays feedback (evidence: `src/ui/UI.js`)
- Desktop shell → Application entry: loads game
- Android host → Application entry: hosts game
