How thespheric/guebo works
This repository is a small Haxe game built on Flixel-style runtime code. The architecture is centered around a single playable state, with most gameplay behavior split into reusable entity classes and a scripting layer for content-driven stages.
1. Boot and state flow
source/Main.hx is the entry point, and source/PlayState.hx appears to be the main gameplay state. The runtime likely boots into PlayState, which then creates the player, enemies, bullets, and stage logic.
2. Core gameplay layer
The source/obj folder contains the main in-game objects: Player, Enemy, Bullet, PlayerBullet, Shooter, BulletSpawner, and BulletSpawnerGroup. This suggests the game is organized around a shoot-’em-up style loop where actors emit bullets and manage attack patterns.
3. Player/combat boundary
Player.hx is separate from projectile classes, which implies player movement and input are isolated from combat output. PlayerBullet.hx suggests player firing is modeled independently from generic Bullet.hx, allowing different collision or behavior rules.
4. Enemy system
Enemy.hx is the base enemy abstraction, with specific enemies layered on top. EnemyDatabase.hx likely acts as a lookup/factory layer for instantiating enemy types or configuring their stats/patterns. source/obj/enemies/FairyAah.hx is a concrete enemy implementation.
5. Pattern and spawning subsystem
Shooter.hx, BulletSpawner.hx, and BulletSpawnerGroup.hx indicate a modular firing system. Rather than embedding all attack logic inside enemies, the game likely composes enemies from shooter/spawner components, making patterns reusable across enemy types.
6. Script-driven content
source/scripts/HScript.hx and source/obj/enemies/HScriptEnemy.hx show that the game can execute enemy or stage behavior from scripts. The script file assets/scripts/stage/stg0.hx is a content asset, not just code, which means stage behavior is designed to be data/script-driven rather than hardcoded only in the main source tree.
7. Event decoupling
source/backend/EventManager.hx suggests a lightweight event bus or dispatcher used to coordinate gameplay systems without tight coupling. In a game like this, that typically connects state changes, spawning, scripting triggers, and maybe audio or UI reactions.
8. Asset organization boundary
The assets tree is cleanly partitioned into data, images, music, sounds, and scripts. That separation implies the code layer handles mechanics, while content is loaded from asset folders at runtime. The text placeholder files indicate these folders are expected to be populated by real game content.
9. Engine/runtime dependency
source/flixel/FlxBasic.hx indicates a local copy or override of a Flixel core class, which is a meaningful architectural detail: the repo is not just consuming the engine, it may be adapting or vendoring part of it. That suggests some engine-level behavior is customized locally.
10. Likely overall data flow
Game start -> Main -> PlayState -> load assets and stage script -> create player and enemy objects -> enemies use shooter/spawner logic to emit bullets -> EventManager and scripting coordinate transitions, patterns, or stage events. The major boundary is between static code objects and script/content assets.
11. Diagramming guidance
For an architecture diagram, the main boxes should be: boot/state, gameplay entities, enemy/pattern system, scripting layer, event manager, and asset storage. The key arrows are from PlayState into entities, from scripts into enemy/stage behavior, and from events back into gameplay objects.
Main entry points: PlayState.hx Play State · Bullet.hx Bullet · Enemy.hx Enemy · Player.hx Player
Components 16
Boot & state
Application entrypoint and main gameplay state.
- Main · Program entry and startup bootstrap.
source/Main.hx - Play State · Primary gameplay state that owns the active stage.
source/PlayState.hx
Gameplay entities
Core in-game actors and projectiles.
- Player · Controllable player character and movement/input boundary.
source/obj/Player.hx - Player Bullet · Projectile behavior for player-fired shots.
source/obj/PlayerBullet.hx - Bullet · Shared projectile logic for bullets in the game.
source/obj/Bullet.hx
Enemy system
Enemy base classes and concrete enemy implementations.
Patterns & spawning
Reusable shooting and bullet spawning components.
- Shooter · Reusable firing/pattern component.
source/obj/Shooter.hx - Spawner · Single bullet emission unit used by patterns and enemies.
source/obj/BulletSpawner.hx - Spawner Group · Collection of spawners for coordinated attack patterns.
source/obj/BulletSpawnerGroup.hx
Scripting layer
Script execution and script-backed enemy behavior.
- HScript · Script execution layer for content-driven behavior.
source/scripts/HScript.hx - Script Enemy · Enemy wrapper that delegates behavior to scripts.
source/obj/enemies/HScriptEnemy.hx
Runtime support
Local engine/runtime overrides and event coordination.
- Event Manager · Lightweight dispatcher for gameplay and stage events.
source/backend/EventManager.hx - FlxBasic · Local engine-level Flixel class adaptation.
source/flixel/FlxBasic.hx
Content assets
Runtime-loaded stage and media content.
- Stage 0 · Scripted stage content defining stage behavior and events.
assets/scripts/stage/stg0.hx
Connections 18
- Main → Play State: starts · Bootstraps the main gameplay state.
- Play State → Player: creates · Instantiates the player for the active stage.
- Play State → Enemy DB: loads enemies · Resolves enemy types and configs for the stage.
- Play State → Event Manager: subscribes · Coordinates gameplay through shared events.
- Play State → Stage 0: runs stage · Loads scripted stage content during play.
- Play State → HScript: executes · Uses the script runtime to drive scripted content.
- Player → Player Bullet: fires · Produces player-specific projectiles.
- Player Bullet → Bullet: extends · Reuses shared bullet behavior.
- Enemy → Bullet: uses · Enemy behavior emits shared bullet logic.
- Enemy → Shooter: composes · Enemies delegate attack logic to shooters.
- Shooter → Spawner Group: organizes · Groups spawners into reusable patterns.
- Spawner Group → Spawner: contains · Coordinates individual bullet emitters.
- Spawner → Bullet: emits · Creates bullet instances as part of a pattern.
- Enemy DB → FairyAah: instantiates · Maps database entries to concrete enemy implementations.
- Script Enemy → HScript: delegates · Behavior is driven by scripts rather than hardcoded logic.
- Stage 0 → Script Enemy: configures · Stage script can define scripted enemy behavior.
- Event Manager → Play State: signals · Dispatches state and stage events back into gameplay.
- FlxBasic → Play State: supports · Local engine override underpins state behavior.