Submissions from 2022-06-20 to 2022-06-21 (1 total)

health bar

A submission 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.