How do I health bar cover?

Get help using Construct 2

Post » Mon Jan 30, 2017 4:05 pm

Hey there! ^_^
So, i have looked through all the health bar tutorials i can find, and they all are about width /* with the current life and max life -
Basically it sets the width of the healthbar to the % of hp.

Now since we have a glowing health bar, then that looks strange, that its width decreases, so i thought about
making instead a 'black' bar that cover the health instead to make it look better! ^_^

Does anyone have a tutorial capx for this?

Currently its - lerp(Self.Width,(HeroX.HeroCurrentHealth/HeroMaximumHealth)*Healthbar.ImageWidth, 5*dt)

But how to do a black bar that covers the health bar instead? I dont get the / and * to make a black bar grow backwards on the bar depending on health loss?
B
5
S
1
Posts: 37
Reputation: 451

Post » Mon Jan 30, 2017 6:10 pm

Made a health bar example for another thread. Is this perhaps what you are looking for?

how-do-i-fix-width-size-for-sprite-s_p1095304?#p1095304
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303

Post » Mon Jan 30, 2017 6:17 pm

Same concept.
Start at 0 width for black bar, add the damage points to your blackbar "health" attribute instead of subtracting from life bar. Now I would think the glowing "Halo" around your life bar should decrease proportionally but we'll never know unless we test it.
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Mon Jan 30, 2017 6:47 pm

MPPlantOfficial wrote:Same concept.
Start at 0 width for black bar, add the damage points to your blackbar "health" attribute instead of subtracting from life bar. Now I would think the glowing "Halo" around your life bar should decrease proportionally but we'll never know unless we test it.


What is the code for that? To increase it by adding points depending on how much health is lost?
B
5
S
1
Posts: 37
Reputation: 451


Return to How do I....?

Who is online

Users browsing this forum: NN81, Syazanie Amirin and 7 guests