# Health bars world-space bars over enemies, damage numbers, and a fixed HUD ```{raw} html ▶ Run in browser ``` **Tags:** `ui` `hud` `camera` `tween` `signals` Enemies wander the world with health bars floating above them; the bars are drawn in world space, so they scroll with a smoothed Camera2D that follows the player. Hits spawn floating damage numbers that rise and fade on a coroutine, and a killed enemy is removed cleanly (its death is a signal the HUD counts). The player's portrait and health bar are anchored Controls, so they stay glued to the screen while the whole world pans underneath. ## What it demonstrates - World-space draws (enemy bodies + their health bars) following entities under a moving Camera2D, next to screen-anchored Controls that do not scroll. - Floating damage numbers: a per-node coroutine rises and fades, then destroy(). - A smooth HUD drain: `tween()` eases the player bar toward the real value. - Click-to-hit through `camera.screen_to_world`, clean removal via a died signal. Controls: WASD / arrows - Move (the camera follows) Left click - Hit the enemy under the pointer SPACE - Melee swing at the nearest enemy in range ESC - Quit Run: uv run python examples/features/ui/health_bars.py Headless self-check: uv run python examples/features/ui/health_bars.py --test ## Source ```{literalinclude} ../../examples/features/ui/health_bars.py :language: python :linenos: ```