Hey Carminie, I am new here but i have been programming for a few years. My suggestion is make a health bar image that has a set of animations that each are at a different point in the health bar. Then when you lose heath or gain health you can set the animation to a different frame. With this you can also incorporate an instance variable that represents the amount of health you have.
[|||||||||]- first frame
[|||||||| ] - second frame
[|||||| ] - third frame
..... - other frames
[ ] - empty health (dead)
there may be a better way or even a better way of explaining this.
sorry if this is not helpful.
I like this idea. Expanding upon it, I'm wondering to set the full health bar as the sprite. Then set each different health % as a seperate animation.
Then as the instance variable changes (sprite takes damage) have it call the corresponding animation.
Example:
health(instance variable)= 10 then set health (sprite) animation to 100percent
health = 6 then set animation to 60percent