health bar

A submission by rubic for Decade Jam 901

i set up a delegate for the player's health changing. i made this the responsibility of the combat component... which already deals damage, so it should probably also handle taking damage? the fact that this could be split into its own component has me heavily considering, if for no other reason, doing it because both components will probably be very large.

the delegate is nice and sends an update to listeners whenever the health changes. so i made the UI listen to that and update the health bar... but it doesn't update when everything wakes up. which got me thinking about what a good delegate design is for something that has a "starting" update and a "changed" update. should i just made two different delegates? for Unity's InputSystem, it has delegate properties like .started, .performed, and .canceled. this is actually kind of nice. for now, i just had the UI do its own check on the player's health.

daily creative

work on something (gamedev, art, 3d modeling, music, ...) every day

joined 1,786 days ago

2024-11
2024-10
2024-09
2024-08
2024-07

Decade Jam

To help keep members of the Decade Jam on track with their projects!

joined 1,309 days ago