How do I create a boss health bar with multiple segments.

0 favourites
  • 3 posts
From the Asset Store
Health, Weapon & Rage Bars for your Games. Easy to use & Customize.
  • A lot of tutorials use the trick of setting the width of a red bar, killing the player once it hits 0 width...

    My boss' health bar has multiple segments, 5 in fact! They're not split or anything, there's simply parts of the health bar that are different colors.

    So from left to right, it goes Red, Orange, Yellow, Greenish-yellow and then Green.

    Changing the width won't do much as far as I know, unless there's a way for it to cut slices off the side instead of simply crunching it up into a smaller size!

    Anyway, it's your typical health bar. Once you hit the boss, the bar will go down starting from the right, until it gets allll the way to the left - that's when the boss will die.

    I have no idea how to go about this, my only thought is by using a LOT of sprites - which isn't a bad idea, I'll do it if I must, I figure there's a more efficient method though.

    I'd appreciate any input! Oh and on a side note - it's not required or anything - the boss has different phases, so when the boss is at full health it'll be at phase 1, at half health, phase 2, at a quarter health, phase 3, so I'll need a way to measure it's health... if that makes sense. That might help somewhat if you need any more info!

  • Try Construct 3

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

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

    Like you stated the "sprite" method is a good one. If you create a health bar sprite with six frames then you can accomplish this easily:

    (0) Red Orange Yellow GreenYellow Green

    (1) Red Orange Yellow GreenYellow black

    (2) Red Orange Yellow black black

    (3) Red Orange black black black

    (4) Red black black black black

    (5) black black black black black (dead)

    Default frame will be (0) and then you can iterate through the remaining frames each time it takes damage or back again when it heals.

    Also, you can create events that start on the following:

    Monster.AnimationFrame = 2

    Start Phase 2

    Monster.AnimationFrrame = 4

    Start Phase 3

    N.b. Just remember to set the Animation speed to 0 for the healthbar, or it will iterate through the steps itself! You want to be in full control of it.

  • Thank you so much! Appreciate the input

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