Rolling Health Meter
Something I struggled to find on the internet was a decent working example of a rolling health meter, a'la Earthbound. For those not familiar, you have a HP value, and when you take damage, it isn't applied automatically -- instead, your HP instead ticks down to that value, like an odometer in a car. In Earthbound, this is not just a cosmetic effect, and as long as your HP is still ticking down, you're not dead yet, which then leads to other clever mechanics not usually seen in RPGs. What I had trouble finding was how to a) reduce and b) display the "rolling" effect -- what examples I found were cheap, and simply reduced HP by a fixed amount until the target HP was hit. What I wanted was one where the meter is quicker the more health you're gaining / losing, and slows to a crawl when nearing it's target. I figured it out, so here it is. It was done in Gamemaker's GML, but should translate relatively well to other languages. Calculating the num...