Skip to content

Add Health Bar to All Units#106

Merged
1brucben merged 3 commits into
v0.2.0from
healthbar
Nov 19, 2025
Merged

Add Health Bar to All Units#106
1brucben merged 3 commits into
v0.2.0from
healthbar

Conversation

@1brucben
Copy link
Copy Markdown
Owner

This pull request enhances the health bar rendering logic for various unit types in the UILayer class, making the UI more informative and consistent for upgradeable structures and defensive units. The changes ensure that health bars are displayed for damaged structures and that max health calculations account for unit upgrades.

UI rendering improvements:

  • Health bars are now shown for damaged MissileSilo and SAMLauncher units, in addition to their loading bars when on cooldown. [1] [2]
  • Health bars are also displayed for other structures such as City, Port, Hospital, Academy, ResearchLab, Factory, Airfield, DefensePost, and DoomsdayDevice when damaged.

Health bar logic updates:

  • The drawHealthBar method now calculates max health for upgradeable structures (City, Port, Hospital, Academy, ResearchLab, Factory) by adding +1000 HP per upgrade level.
  • For MissileSilo and SAMLauncher, the max health increases by +250 HP per level (capped at level 3).

@1brucben 1brucben merged commit 0867647 into v0.2.0 Nov 19, 2025
4 of 7 checks passed
@El-Magico777 El-Magico777 added this to the v0.1.11 milestone Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants