How to decrease the health bar smoothly

  • Hi,

    In my game iam using the health bar ,it will subtract 20 from health for every 0.5 sec

    when it is decreasing it should decrease smoothly but it is not working smoothly after decreasing health bar showing like a sudden stop for a sec

    can u please tell me how to fix heathbar for smooth movement

  • you gotta use lerp, search and you'll find some examples.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    In my game iam using the health bar ,it will subtract 20 from health for every 0.5 sec

    when it is decreasing it should decrease smoothly but it is not working smoothly after decreasing health bar showing like a sudden stop for a sec

    can u please tell me how to fix heathbar for smooth movement

    make your health bar a TiledBackground and give it an instance variable and set it to the full width of your sprite.

    then Every Tick (or whenever you change health) Set the width of the healthbar to:

    CurrentHealth / (Healthbar.Fullwidth * MaxHealth)

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