diff --git a/game/systems/s_entity.c b/game/systems/s_entity.c index 781d928..cad6fa8 100644 --- a/game/systems/s_entity.c +++ b/game/systems/s_entity.c @@ -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;