How rrrrbit/blitz_ works
1. Project shape
- This is a Unity 2D endless runner with a strong separation between scene flow, gameplay runtime, world entities, and UI/menu presentation.
- The repo is content-heavy: most of the architecture is expressed through prefabs, ScriptableObject-like assets, shader graphs, and scene setup, with code acting as orchestration.
2. Scene boundary
- There are two main runtime scenes: menu_main.unity and game.unity.
- The menu scene owns title/menu interactions and transitions into the game scene; the game scene contains the core runner loop, world generation, player control, HUD, and effects.
3. Core game runtime
- The central gameplay layer lives in the Assets/Scripts/ root with classes named GAME, GAME_manager, GAME_globalData, GAME_objManager, GLOBAL, CAMERA, GLOW, and GAME_vfx.
- This suggests a manager-driven architecture: a global state layer, a gameplay state/controller, an object manager for spawned entities, a camera controller, and a VFX coordination layer.
4. Player subsystem
- Player behavior is split into movement, animation, and attack/action concerns:
- PLAYER_baseMvt.cs
- PLAYER_anim.cs
- PLAYER_slash.cs
- Trajectory.cs
- This indicates the player is not a monolith; input likely flows into movement/attack logic, which then triggers animation and slash trajectory visuals.
5. Input layer
- InputSystem_Actions.inputactions and the generated InputSystem_Actions.cs show the project uses Unity’s new Input System.
- Input is therefore a dedicated subsystem rather than ad hoc polling, which matters for diagramming because it sits between player control and gameplay state.
6. World object model
- The Assets/Scripts/World/ folder contains the entity layer:
- base types: GAME_obj.cs, GAME_objType.cs, GAME_relativeParticles.cs
- interactable hierarchy: Interactable.cs, Destructible.cs, OBJ_node.cs, OBJ_proxy.cs, OBJ_relay.cs, OBJ_burst.cs, OBJ_window.cs, OBJ_empty.cs
- The repo also includes corresponding content assets under Assets/Prefabs/entries/ and prefabs like node.prefab, relay.prefab, proxy.prefab, burst.prefab, window.prefab.
- This suggests a template-driven entity system where gameplay objects are instantiated from predefined archetypes and then handled through shared interaction/destruction logic.
7. World generation and background
- Background and stage ambience are handled separately from interactable objects:
- BG_spawns.cs
- World/bg objs/* such as BG_grid, BG_lattice, BG_stripe, BG_window
- matching prefabs in Assets/Prefabs/bg Elements/
- That separation implies the endless-runner environment is composed of spawned scenic layers and gameplay-relevant obstacles/entities, likely with independent spawning rules.
8. UI and menu system
- Menu/HUD code lives in Assets/Scripts/MENUandUI/:
- MENU_main.cs, MENU_death.cs, MENU_info.cs
- HUD.cs
- UI effects: UI_fadeOut, UI_flickerImage, UI_flickerTextIn, UI_textBtn, UI_plugButton, Flicker
- The UI is therefore a distinct presentation layer with its own animation/effect scripts, rather than being embedded in gameplay logic.
9. Visual style and rendering
- The project uses URP 2D and is visually shader-driven:
- URP settings assets and 2D renderer assets
- Shader Graph assets like glow.shadergraph, glitch.shadergraph, bgGrid.shadergraph, lattice.shadergraph, squashShear.shadergraph
- materials like glow.mat, glitch.mat
- Visual effects are not just post-processing; they are part of the gameplay identity through glowing/glitching UI, stylized background elements, and object-specific materials.
10. Animation and particle effects
- There are dedicated animation assets (slash.anim, animator controller) and particle prefabs (nodeParticle, relayParticle, burstParticle).
- This indicates a layered presentation pipeline: game events trigger animation and VFX, which are managed separately from the underlying gameplay state.
11. Data/configuration assets
- The repo includes build profiles (itch.asset, windows.asset), a physics material (playerpmat.physicsMaterial2D), a volume profile, render pipeline assets, fonts, TMP resources, and scene templates.
- These are important to diagram as the configuration/infrastructure layer supporting the runtime, especially since the project depends heavily on author-time Unity assets.
12. Likely runtime flow
- At a high level: menu scene → game scene → input-driven player actions → manager/world spawning logic → interactable object resolution → VFX/UI feedback → death/menu loop.
- The main architectural boundary is between state/control systems (GAME_*, GLOBAL, player controllers) and content instances (prefabs, object entries, background elements, UI prefabs).
13. What to emphasize in an architecture diagram
- Draw separate boxes for Menu/UI, Game Runtime, Player Controller, World/Object System, Background Spawner, and Rendering/VFX.
- Show Unity scene assets as the top-level composition units and prefabs/ScriptableObject-like entries as the content definitions feeding the runtime.
Main entry points: GAME_manager.cs Manager · GAME.cs GAME · game.unity Game scene · GAME_objManager.cs Object manager
Components 25
Scenes
Runtime entry scenes and flow boundaries
- Menu scene · Main menu runtime scene
Assets/Scenes/menu_main.unity - Game scene · Core gameplay runtime scene
Assets/Scenes/game.unity
Gameplay Runtime
Core managers, state, and execution flow
- GAME · Primary gameplay state and flow controller
Assets/Scripts/GAME.cs - Manager · Coordinates gameplay systems
Assets/Scripts/GAME_manager.cs - Global data · Cross-system runtime data and flags
Assets/Scripts/GAME_globalData.cs - Object manager · Controls world object creation and lifecycle
Assets/Scripts/GAME_objManager.cs - GLOBAL · Global utility or state bridge
Assets/Scripts/GLOBAL.cs - Input actions · Unity Input System action definitions
Assets/InputSystem_Actions.inputactions - Input code · Generated input bindings used by gameplay code
Assets/InputSystem_Actions.cs
Player
Input-driven player control and actions
- Movement · Player locomotion and position control
Assets/Scripts/PLAYER_baseMvt.cs - Animation · Player animation state and transitions
Assets/Scripts/PLAYER_anim.cs - Slash · Attack handling and slash trigger
Assets/Scripts/PLAYER_slash.cs - Trajectory · Slash path or motion visualization
Assets/Scripts/Trajectory.cs
World
Spawned entities, interactions, and background layers
- BG spawns · Background generation and ambience spawning
Assets/Scripts/World/BG_spawns.cs - World base · Shared world object types and particle support
Assets/Scripts/World/GAME_obj.cs - Interactable · Base interaction behavior for world objects
Assets/Scripts/World/Interactables/Interactable.cs - Destructible · Breakable object behavior and resolution
Assets/Scripts/World/Interactables/Destructibles/Destructible.cs - Object variants · Node, relay, proxy, burst, window, and empty variants
Assets/Scripts/World/Interactables/Destructibles/OBJ_node.cs
Presentation
Menus, HUD, camera, effects, and rendering
- Main menu · Title screen and start flow
Assets/Scripts/MENUandUI/MENU_main.cs - Death menu · Game-over and restart flow
Assets/Scripts/MENUandUI/MENU_death.cs - HUD · In-game heads-up display
Assets/Scripts/MENUandUI/HUD.cs - VFX · Gameplay-driven visual effects management
Assets/Scripts/GAME_vfx.cs - Camera · Runtime camera behavior and framing
Assets/Scripts/CAMERA.cs - Glow · Glow and screen-effect coordination
Assets/Scripts/GLOW.cs - Shaders · URP 2D shader graphs and materials for glow, glitch, and background styling
Assets/Shaders/glow.shadergraph
Connections 29
- Menu scene → Main menu: contains · Menu scene hosts the main menu controller
- Menu scene → Game scene: transitions to · Menu flow leads into the gameplay scene
- Game scene → GAME: contains · Game scene hosts the core gameplay state
- Game scene → HUD: contains · Game scene includes the in-game HUD
- Main menu → Input actions: uses · Menu interactions are driven by the Input System
- Input actions → Input code: generates · Input action asset produces wrapper code
- Input code → Movement: feeds · Player movement consumes input bindings
- Input code → Slash: feeds · Slash and action input reach the player action layer
- GAME → Manager: coordinates · Primary game state delegates to manager logic
- Manager → Global data: reads/writes · Manager uses shared gameplay state
- Manager → Object manager: spawns · Manager drives object lifecycle and instantiation
- Manager → Camera: drives · Gameplay state influences camera behavior
- Manager → VFX: triggers · Gameplay events emit visual effects
- Manager → GLOBAL: relies on · Manager uses the shared global control layer
- Movement → Animation: updates · Movement state selects animation transitions
- Slash → Trajectory: shows · Slash action drives trajectory visualization
- Slash → VFX: triggers · Attack action emits effects
- Object manager → World base: instantiates · Object manager creates world entities
- World base → Interactable: extends · Interactable layer defines shared world behavior
- Interactable → Destructible: specializes · Destructible objects add breakage behavior
- Destructible → Object variants: implements · Concrete object variants use destructible behavior
- Object manager → Object variants: spawns · Manager instantiates object archetypes and prefabs
- BG spawns → Object variants: separates from · Background generation is distinct from interactable gameplay objects
- BG spawns → Shaders: renders with · Background elements rely on shader and material styling
- HUD → Shaders: uses · UI presentation uses stylized rendering assets
- Death menu → HUD: shares layer · Death flow belongs to the UI presentation stack
- GAME → VFX: emits · Core gameplay events produce VFX feedback
- GAME → Camera: orchestrates · Core gameplay adjusts camera framing
- GAME → BG spawns: advances · Gameplay progression drives background spawning