You could easily use the value system, an interface & an animation to do this.
1. create a value & assign a max health value to it.
2. create a single image that represents the full health bar image.
3. take note of the width (in pixels) of the image, as you will need to calculate how many pixels to offset the image based on the width of the image vs. current health value. Ideally if the image was 100px or 200px wide then it would be much easier to calculate.
4. create an interface, create a button, add an animation to it containing the health bar image.
5. create the interface area. it should be the exact shape/size of the health bar image. This way when you start moving image to left or right, any parts of image past the defined area will be masked out, or at least they should be.
Check out this button mash demo I made ages ago @
https://www.dropbox.com/sh/9t8yr643oivzknb/AABpQCD5MRHKodYLB...It featured a simple bar that filled up each time I pressed the "x" key on the keyboard.
6. To have it automatically reduce health you could trigger a loop inside of a called by other action at the begin of each playable scene.
pause for x minutes/milliseconds/seconds
if value 'value_name' more than 1
set value 'value_name' - 1
else
-- do/call game over actions
quit action 'this_called_by_other_actions_name'
end if
jump to action part #1
There's other methods you could use too such as a fully animated bar/icon that represents health or even a health bar represented by numbers like in some of the old FPS games, such as: Doom, Duke Nukem & Quake, etc.