Skip to content

Add health component#2373

Open
Litraxx wants to merge 4 commits into
endlessm:mainfrom
Litraxx:add-health-component
Open

Add health component#2373
Litraxx wants to merge 4 commits into
endlessm:mainfrom
Litraxx:add-health-component

Conversation

@Litraxx

@Litraxx Litraxx commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Added a generic health component that can be reused in different scenes.
It exports a max health property and provides various properties regarding health status.
It also provides two signals

  • health_depleted emitted when a change to the current health pushes it to zero or below
  • health_changed emitted when the health is changed and the change does not cause the health to deplete; emits the current health as an argument

Refactored the fragile barrel to use the new health component

Resolves #1747

Litraxx added 4 commits June 12, 2026 23:04
Changed break_barrel and take_damage functions to be called by health component signals
Replaced existing health logic with health component
This should make the setter more readable
Also removed the redundant `has_depleted_health` signal argument
The check is not needed since the signal is only ever called when the health change does not deplete the health
@Litraxx Litraxx marked this pull request as ready for review June 12, 2026 21:55
@Litraxx Litraxx requested a review from a team as a code owner June 12, 2026 21:55
@github-actions

Copy link
Copy Markdown

Play this branch at https://play.threadbare.game/branches/Litraxx/add-health-component/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

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.

Implement character health

1 participant