Battle System

Implement classic turn-based battle scene (top HUD + bottom commands)

majiayu000 0a22e28 2 files · 1.4 KB Updated 567 repo stars

File contents

Skill: Turn-based battle system

Objective

Implement a minimal but correct classic JRPG battle loop:

  • show battle scene with pre-rendered background
  • show party/enemy status in a top HUD
  • allow selecting a command for the current actor
  • execute a single turn and advance

Steps

  1. Create battle scene
  • game/scenes/battle/BattleScene.tscn
    • background renderer
    • battler sprite anchors (party and enemy)
    • BattleHUD (top)
    • CommandMenu (bottom)
  1. Implement battle state machine
  • game/scripts/battle/battle_controller.gd
    • states: Start, CommandSelect, ResolveTurn, End
  1. Data models (minimal)
  • CharacterData, EnemyData, SkillData, ItemData
  1. Integration
  • Exploration encounter triggers transition to BattleScene
  • On battle end, return to exploration at a defined spawn

Verification

  • Can win a battle and return to exploration
  • UI updates HP correctly
  • Deterministic outcomes when seeded

majiayu000/claude-skill-registry-data/tree/main/gaming/battle-system commit 0a22e28114

Frequently asked questions

npx skillmds add majiayu000/battle-system