so i have this variables for health!
private double maxHealth = 150;
private double defaultHealth = maxHealth;
private double currHealth = maxHealth;
so i want the bar to always stay a maximum size no matter what max health is
so if max health is 150
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
and if i change it to maybe 200
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
it goes bigger
how do i make so it always stays the same size no matter what max health is?
this is how i solved it!
float healthScale = (float) (getStats().getCurrHealth() / getStats().getMaxHealth());
g.fillRect((int) 200, (int) 200, (int) (50 * healthScale), 8);