Skip to content

Implement unit death and cleanup

Objective

Handle unit destruction when health reaches zero, including cleanup, death effects, and removal from game state.

Requirements

  • Death Detection: Units die when health reaches zero
  • State Cleanup: Remove dead units from game state and memory
  • Death Effects: Visual and audio feedback for unit destruction
  • Resource Drops: Dead units may drop resources for collection

Technical Details

  • Implement death state detection and handling
  • Create unit cleanup and memory management
  • Add death animation and visual effects
  • Handle resource drop generation and pickup
  • Remove dead units from AI and pathfinding systems
  • Synchronize death events across all clients

Acceptance Criteria

  • Units are destroyed when health reaches zero
  • Dead units are cleaned up from memory and game state
  • Death provides appropriate visual and audio feedback
  • Resource drops function correctly
  • Death events are synchronized across all clients

Milestone Relation

Completes the MVP combat cycle. Required for units to actually be eliminated in combat and for game state to remain clean.