Making a health bar decrease when damaged or increase when healed is easy, you can just subtract or add by the amount of damage or healing you want. but making it move over time takes more math.
We have to increase it slowly by adding it to the delta time, if we want it to last for a certain amount of time, we take the time and divide one over the duration.
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.