How do I health bar cover?

0 favourites
  • 4 posts
From the Asset Store
Health, Weapon & Rage Bars for your Games. Easy to use & Customize.
  • 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?

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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)