General > Developers Corner
Animated Health Bar
DankNessProvides:
--- Quote from: MrPresident on June 16, 2016, 12:24:03 PM ---It sounds like you're wanting someone to write this for you, in which case you should seek that kind of help up front.
Many people around here are more than willing to point you in the right direction with functions and wiki links, but when you just come back and say, "I don't know how to do that" or "I've added the code you posted, now what?"... that's not really helping yourself.
--- End quote ---
I've never been that upfront dude and I am open to wiki links that will help ME do it but if someone will write it and explain what it does so I could possibly use it in other situations, I would be happier than if someone just wrote it for me telling me nothing about it. I would prefer what roastchicken has done with how he did it and explained what it did. :)
roastchicken:
Sorry for not replying sooner, I was busy with a few things.
Anyways, I laid out the steps for you:
--- Quote from: roastchicken on June 10, 2016, 12:53:25 AM ---1. Store the health from the previous frame
--- End quote ---
Think about how you could do this. Obviously you can't go back in time to the previous frame and get the health value then, so you're going to need to store the health for each frame and then make sure you can access it in the next frame. I'll leave you to figure out how to do that.
--- Quote from: roastchicken on June 10, 2016, 12:53:25 AM ---2. Check if the health has changed
--- End quote ---
Pretty straight-forward. Hint: it involves if statements and comparison operators.
--- Quote from: roastchicken on June 10, 2016, 12:53:25 AM ---3. Lerp from the old health to the new health (only if the health has changed)
--- End quote ---
This is where the code I gave you a few posts above comes in.
Here are a few helpful links if you're still stuck:
if statements
local variables and blocks
relational operators
Navigation
[0] Message Index
[*] Previous page
Go to full version