Most games with health bars have a visual effect when you take damage, where the lost section of the bar is painted in a different color for a brief moment, before smoothly merging back with the main bar. This is how I programmed that. My simple method keeps the rhythm of the damage taken, and…