Hide health bar, if it was not changed

This commit is contained in:
2024-02-10 09:36:29 +01:00
parent c6a4356d2b
commit ae71e259fd

View File

@@ -389,7 +389,12 @@ void renderHealthBar(ecs_iter_t *it) {
HitBox *hitbox = ecs_field(it, HitBox, 2);
Health *health = ecs_field(it, Health, 3);
f32 time = GetTime();
for (i32 i = 0; i < it->count; i++) {
f32 lastChange = time - health[i].lastChanged;
if (lastChange > 2.0f) continue;
HitBox hb = entityTransformHitBox(pos[i], hitbox[i]);
const f32 HP_WIDTH = 10.0f;
const f32 HP_HEIGHT = 1.8f;