How flowhartigan/brigada-game works
BRIGADA FIGHT is a mobile-first browser fighting game. The main flow is fighter selection, a versus matchup, then a real-time fight with touch-friendly actions, opponent AI, and a result. The React prototype coordinates game state and presentation; a deterministic combat engine handles rules separately from Phaser rendering. Fighter definitions and visual assets support both gameplay and character display. The graph reflects the sampled source and README; some matchup and result details are only visible as responsibilities within the prototype, so uncertain internal wiring is omitted.
Main entry points: GamePrototype.tsx Game prototype · combat.ts Combat engine · PhaserCombatStage.tsx Phaser combat stage · fighterPresentation.ts Presentation tuning
Components 18
Game experience
- Game prototype
src/components/game/GamePrototype.tsx
Combat rules
- Combat engine
src/game/engine/combat.ts - Opponent AI
src/game/engine/opponent-ai.ts - Combat formulas
src/game/engine/formulas.ts - Movement and range
src/game/engine/spatial.ts - Combat randomness
src/game/runtimeRng.ts
Visual presentation
- Phaser combat stage
src/components/game/PhaserCombatStage.tsx - Fighter sprite
src/components/game/FighterSprite.tsx - Fighter artwork
src/components/game/FighterArt.tsx - Sprite state mapping
src/components/game/fighterSpriteState.ts - Presentation tuning
src/components/game/fighterPresentation.ts - Animation assets
src/components/game/fighterAnimationAssets.ts - Action frame maps
src/components/game/animationFrames - Impact timing
src/components/game/combatPresentationTiming.ts - Fighter image lookup
src/components/game/fighterImages.ts
Fighter content
- Fighter definitions
src/game/data/fighters.ts - Fighter image files
public/fighters
Other components
- Player
Connections 19
- Player → Game prototype: chooses and acts
- Game prototype → Fighter definitions: reads roster
- Game prototype → Combat engine: updates match
- Game prototype → Opponent AI: requests opponent action
- Game prototype → Phaser combat stage: passes fight state
- Game prototype → Sprite state mapping: resolves visuals
- Game prototype → Fighter sprite: renders fighters
- Game prototype → Fighter artwork: renders portraits
- Game prototype → Presentation tuning: styles matchup
- Combat engine → Fighter definitions: reads fighter stats
- Combat engine → Combat formulas: calculates combat values
- Combat engine → Movement and range: checks movement and range
- Phaser combat stage → Animation assets: loads animation images
- Phaser combat stage → Fighter image lookup: loads idle images
- Phaser combat stage → Impact timing: gets impact duration
- Animation assets → Action frame maps: uses frame maps
- Fighter image lookup → Fighter image files: selects image files
- Fighter sprite → Presentation tuning: uses presentation styles
- Fighter artwork → Presentation tuning: uses presentation styles