How do I Diablo Style Health Orb(Health Bar)

Get help using Construct 2

Post » Mon Oct 13, 2014 7:35 am

I have a sprite with 10 frames.I want each frame to represent health based on 10% increments. My object has a Hp variable and MaxHP variable. MaxHP grows with level ,HP cant be higher then MaxHP. How do I check the deference between the two variables and gather a percentage to then link each frame?
B
11
S
1
Posts: 57
Reputation: 664

Post » Mon Oct 13, 2014 8:34 am

I should have read the whole thing before starting... :D

Anyway... this is my bloodorb try: https://drive.google.com/file/d/0BwK9oy ... sp=sharing

Your version:
MaxHP - HP = Difference

Or i'm missing something...
B
33
S
6
G
7
Posts: 339
Reputation: 7,426

Post » Mon Oct 13, 2014 9:04 am

WOW your orb is awesome!
I'm Looking more for math help though
so for example
MAXHP=10 and HP=9 so player health percentage would be 90%
when the player hits 90 percent health I want it to change frame to represent this 10% increment
I do not know how to obtain percentage of remaining health.
B
11
S
1
Posts: 57
Reputation: 664

Post » Mon Oct 13, 2014 9:15 am

err... 9 / 10 * 100 = 90% ? :D
B
33
S
6
G
7
Posts: 339
Reputation: 7,426

Post » Mon Oct 13, 2014 9:24 am

how do I right that out in construct? (MaxHP)/(HP) set as another variable every tick?
B
11
S
1
Posts: 57
Reputation: 664

Post » Mon Oct 13, 2014 9:31 am

yeah, see attached image
You do not have the required permissions to view the files attached to this post.
B
33
S
6
G
7
Posts: 339
Reputation: 7,426

Post » Mon Oct 13, 2014 10:02 am

Alright well I thought I had fixed all my issues at righting this that I noticed in the image I posted before but it is still not working.
You do not have the required permissions to view the files attached to this post.
Last edited by Tryitoutkris on Mon Oct 13, 2014 10:21 am, edited 6 times in total.
B
11
S
1
Posts: 57
Reputation: 664

Post » Mon Oct 13, 2014 10:13 am

...really the order of the global variables in the event sheet is relevant to the math working properly? This Example is same as the one above, but I made the variables match your order in the event sheet. Now everything is working. can you explain why order must be this way?
You do not have the required permissions to view the files attached to this post.
B
11
S
1
Posts: 57
Reputation: 664

Post » Mon Oct 13, 2014 12:32 pm

the order shouldn't matter in this case but i always build up my events in the order i need them so i didn't have this problem yet
B
33
S
6
G
7
Posts: 339
Reputation: 7,426


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 14 guests