Hi..
I am trying to build a health bar that is based on the number of hit points. So the hitpoints obviously change and increase through the game.
Variables:
HP=70 'this is the value that increases through the game but reduces in fights
STHP=HP 'this is the value kept when going into the fight before the loop
AP1=RDN(10)+1 ' amount of the attack so reduce hit points in the loop
SBAR=90 ' end of the bar and the value used to reduce hit points.
I have the bar set at 50 pixels. so
Ink 5:Bar 40,140 to 90,142
So as the hitpoints reduce use the second bar to reduce the no of hit points. so
Ink 6: Bar 40,140 to X,142
X being the amount reduced and it works backwards towards 40 as the hitpoints reduce.
I can use a nominal value for x eg;
HP=HP-AP1 ' so for each round your hitpoints reduce
SBAR=90-"The Amount of the Attack"
So here is my problem is that as the bar is only 50 pixels and someone attacks for 5 hit points i could reduce that bar by 5 pixels but that is
really only that is 10% of the bar when the attack is really only 7%. (5/70)*100
So i can do the maths to work out the percentage, divide by 2 and that would give me a pixel count to reduce based on the 50 pixels in the bar.
What i cannot get to work is the division of (5/7)*100 or (HP/STHP)*100 i just get a zero value.
Hopefully this makes sense...
Any help appreciated
Can post my code if required.
Cheers