Health proportion - mathematic
#1

I already have created a bar which should present proportion of health. Player1 fights with Player2, they both have 100HP, in this case this algorithm works

Код:
475.3648 + (154.5352 * (100.0 / 100.0) * 0.5)
475.3648 - a position of textdraw when Player1 wins (Player2 has 0HP)
629.9 - a position of textdraw when Player2 wins (Player1 has 0HP)
154.5352 - difference of 629.9 and 475.3648

But this works only when players have same amount of health. I use the same method with custom healthbar and it works perfectly

Код:
PlayerTextDrawTextSize(playerid, HealthBar, 545.824340 + (58.67566 * (Player[playerid][p_health_amount] / 100.0)), 0.0);
Does anyone have an idea how to create a working algorithm for this?
Reply


Messages In This Thread
Health proportion - mathematic - by ball - 16.07.2016, 17:13
Re: Health proportion - mathematic - by AbyssMorgan - 16.07.2016, 17:17
Re: Health proportion - mathematic - by ball - 16.07.2016, 17:23
Re: Health proportion - mathematic - by PrO.GameR - 16.07.2016, 17:23
Re: Health proportion - mathematic - by ball - 16.07.2016, 17:52

Forum Jump:


Users browsing this thread: 1 Guest(s)