I’m creating a game for a Uni assignment and want to recreate the Socom 2 style health bar.
For reference: http://www.youtube.com/watch?v=ANFjPvRNywo go to the 0:56 mark. I would advise muting the audio (btw its not my video, just one I have used for reference)
I have coded most of it, getting shot changes damage to yellow then after a few seconds it goes red. It works great but instead of swapping the colours straight away I want to animate the change, so that the yellow bar will decrease as the red bar increases.
I calculate the health remaining, health lost and damage done and the length of each coloured bar changes accordingly so there is no overlay of the textures, as they are opaque.
Is there a specific loop I can use which will decrease the yellow bar value as the red bar increases? How would one recommend I go about achieving this?
Thanks for any help.