# pratik-sanap/glitchverse architecture

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

## Overview

Rift Runner is a Godot 2D platformer. Its documented player workflow is to enter gameplay, move and jump through JSON-defined levels, switch dimensions, use dimension- and energy-gated skills, collect resources, and reach the exit ship. Menus, HUD, audio, and ending screens are additional product capabilities. GDScript gameplay sources were not excerpted, so links between those subsystems are included only where the README documents them; implementation-level call flow remains uncertain.

Main entry points: [`src/scenes/gameplay.gd`](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd) (Gameplay scene), [`Rift Runner.js`](https://github.com/pratik-sanap/glitchverse/blob/main/Rift%20Runner.js) (Web export runtime), [`src/scenes`](https://github.com/pratik-sanap/glitchverse/tree/main/src/scenes) (Menus and screens), [`src/scenes/game_progress.gd`](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/game_progress.gd) (Level progress)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Game flow"]
  node_menus["Menus and screens"]
  node_gameplay["Gameplay scene<br/>[gameplay.gd]"]
  node_game["Game state<br/>[game.gd]"]
  node_progress["Level progress<br/>[game_progress.gd]"]
  node_endings["Clear and ending screens<br/>[level_clear.gd]"]
end

subgraph group_play["Platforming"]
  node_movement["Movement and jump<br/>[gameplay.gd]"]
  node_dimensions["Dimension switch<br/>[gameplay.gd]"]
  node_skills["Dimension skills<br/>[game.gd]"]
  node_shield["Shield effect<br/>[shield_effect.gd]"]
end

subgraph group_world["Levels and resources"]
  node_loader["Level loader<br/>[level_loader.gd]"]
  node_leveldata["Level definitions"]
  node_collectibles["Resources and parts<br/>[gameplay.gd]"]
  node_exit["Exit ship<br/>[gameplay.gd]"]
end

subgraph group_interface["Player interface"]
  node_hud["HUD<br/>[hud.gd]"]
  node_touch["Touch controls<br/>[touch_controls.gd]"]
  node_audio["Audio manager<br/>[audio_manager.gd]"]
end

node_player(("Player"))
node_webengine["Web export runtime<br/>[Rift Runner.js]"]
node_audioworklet["Audio worklet"]
node_positionworklet["Audio position worklet"]

node_player -->|"starts at"| node_menus
node_menus -.->|"enters gameplay"| node_gameplay
node_player -->|"moves and jumps"| node_movement
node_player -->|"switches dimension"| node_dimensions
node_player -->|"uses skills"| node_skills
node_skills -.->|"uses shield effect"| node_shield
node_gameplay -.->|"loads levels"| node_loader
node_loader -->|"reads definitions"| node_leveldata
node_player -.->|"collects resources"| node_collectibles
node_collectibles -->|"enables ship exit"| node_exit
node_gameplay -.->|"tracks progress"| node_progress
node_progress -.->|"advances screens"| node_endings
node_gameplay -.->|"uses game logic"| node_game
node_gameplay -.->|"shows status"| node_hud
node_player -.->|"controls by touch"| node_touch
node_gameplay -.->|"plays audio"| node_audio
node_webengine -->|"locates worklet"| node_audioworklet
node_webengine -->|"locates worklet"| node_positionworklet

click node_menus "https://github.com/pratik-sanap/glitchverse/tree/main/src/scenes"
click node_gameplay "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd"
click node_game "https://github.com/pratik-sanap/glitchverse/blob/main/src/logic/game.gd"
click node_progress "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/game_progress.gd"
click node_endings "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/level_clear.gd"
click node_movement "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd"
click node_dimensions "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd"
click node_skills "https://github.com/pratik-sanap/glitchverse/blob/main/src/logic/game.gd"
click node_shield "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/shield_effect.gd"
click node_loader "https://github.com/pratik-sanap/glitchverse/blob/main/src/logic/level_loader.gd"
click node_leveldata "https://github.com/pratik-sanap/glitchverse/tree/main/src/levels"
click node_collectibles "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd"
click node_exit "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd"
click node_hud "https://github.com/pratik-sanap/glitchverse/blob/main/src/ui/hud.gd"
click node_touch "https://github.com/pratik-sanap/glitchverse/blob/main/src/ui/touch_controls.gd"
click node_audio "https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/audio_manager.gd"
click node_webengine "https://github.com/pratik-sanap/glitchverse/blob/main/Rift%20Runner.js"
click node_audioworklet "https://github.com/pratik-sanap/glitchverse/blob/main/Rift%20Runner.audio.worklet.js"
click node_positionworklet "https://github.com/pratik-sanap/glitchverse/blob/main/Rift%20Runner.audio.position.worklet.js"

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_menus,node_gameplay,node_game,node_progress,node_endings toneBlue
class node_movement,node_dimensions,node_skills,node_shield toneAmber
class node_loader,node_leveldata,node_collectibles,node_exit toneMint
class node_hud,node_touch,node_audio toneRose
class node_player toneIndigo
class node_webengine,node_audioworklet,node_positionworklet toneTeal
```

## Components

### Game flow

- [Menus and screens](https://github.com/pratik-sanap/glitchverse/tree/main/src/scenes): `src/scenes`
- [Gameplay scene](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd): `src/scenes/gameplay.gd`
- [Game state](https://github.com/pratik-sanap/glitchverse/blob/main/src/logic/game.gd): `src/logic/game.gd`
- [Level progress](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/game_progress.gd): `src/scenes/game_progress.gd`
- [Clear and ending screens](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/level_clear.gd): `src/scenes/level_clear.gd`

### Platforming

- [Movement and jump](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd): `src/scenes/gameplay.gd`
- [Dimension switch](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd): `src/scenes/gameplay.gd`
- [Dimension skills](https://github.com/pratik-sanap/glitchverse/blob/main/src/logic/game.gd): `src/logic/game.gd`
- [Shield effect](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/shield_effect.gd): `src/scenes/shield_effect.gd`

### Levels and resources

- [Level loader](https://github.com/pratik-sanap/glitchverse/blob/main/src/logic/level_loader.gd): `src/logic/level_loader.gd`
- [Level definitions](https://github.com/pratik-sanap/glitchverse/tree/main/src/levels): `src/levels`
- [Resources and parts](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd): `src/scenes/gameplay.gd`
- [Exit ship](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/gameplay.gd): `src/scenes/gameplay.gd`

### Player interface

- [HUD](https://github.com/pratik-sanap/glitchverse/blob/main/src/ui/hud.gd): `src/ui/hud.gd`
- [Touch controls](https://github.com/pratik-sanap/glitchverse/blob/main/src/ui/touch_controls.gd): `src/ui/touch_controls.gd`
- [Audio manager](https://github.com/pratik-sanap/glitchverse/blob/main/src/scenes/audio_manager.gd): `src/scenes/audio_manager.gd`

### Other components

- **Player**
- [Web export runtime](https://github.com/pratik-sanap/glitchverse/blob/main/Rift%20Runner.js): `Rift Runner.js`
- [Audio worklet](https://github.com/pratik-sanap/glitchverse/blob/main/Rift%20Runner.audio.worklet.js): `Rift Runner.audio.worklet.js`
- [Audio position worklet](https://github.com/pratik-sanap/glitchverse/blob/main/Rift%20Runner.audio.position.worklet.js): `Rift Runner.audio.position.worklet.js`

## Connections

- Player → Menus and screens: starts at (evidence: `README.md`)
- Menus and screens → Gameplay scene: enters gameplay
- Player → Movement and jump: moves and jumps (evidence: `README.md`)
- Player → Dimension switch: switches dimension (evidence: `README.md`)
- Player → Dimension skills: uses skills (evidence: `README.md`)
- Dimension skills → Shield effect: uses shield effect
- Gameplay scene → Level loader: loads levels
- Level loader → Level definitions: reads definitions (evidence: `README.md`)
- Player → Resources and parts: collects resources
- Resources and parts → Exit ship: enables ship exit (evidence: `README.md`)
- Gameplay scene → Level progress: tracks progress
- Level progress → Clear and ending screens: advances screens
- Gameplay scene → Game state: uses game logic
- Gameplay scene → HUD: shows status
- Player → Touch controls: controls by touch
- Gameplay scene → Audio manager: plays audio
- Web export runtime → Audio worklet: locates worklet (evidence: `Rift Runner.js`)
- Web export runtime → Audio position worklet: locates worklet (evidence: `Rift Runner.js`)
