Health bar that is not equal to the width of a number.

Get help using Construct 2

Post » Sat Feb 22, 2014 10:48 pm

I want to know how to make my enemies health bar shrink, its not a problem to make because you can make something like this
enemy health=50,width of health bar= 50, set width of health bar to health

But if some enemy of mine will have lets say 500 health than it would be huge.
So can i make health bar small but still to shrink according to damage taken.

Thank you in advance.
B
7
S
2
Posts: 102
Reputation: 975

Post » Sat Feb 22, 2014 10:52 pm

Make the width a percentage of his health. So if current health is X and full health is Y, Healthbar Current Width = (Healthbar Full Width)*(X/Y) . You should define healthbar full width as the maximum width you want the health bar to be when the player has full health, rather than defining it based on his health.
B
11
S
2
G
3
Posts: 283
Reputation: 1,968


Return to How do I....?

Who is online

Users browsing this forum: Clark Thy Lord and 1 guest