IN MAIN GAME CLASS:
spriteBatch.Draw(healthBar, new Rectangle((int)bottomGUIPosition.X + 520, (int)bottomGUIPosition.Y + 25, (int)(character.healthRatio * 200), (int)healthBar.Height), Color.White);
spriteBatch.Draw(healthBarOutline, new Rectangle((int)bottomGUIPosition.X + 520, (int)bottomGUIPosition.Y + 25, 200, (int)healthBar.Height), Color.White);
IN CHARACTER OBJECT CLASS:
healthRatio = health / maxHealth;
The variable healthRatio is a float, so I have no idea what the problem is. When the health is 145 and the maxHealth is 150, healthRatio should be set to .966667, but instead it goes to zero.
The value is being updated in the character object every frame.
I realize the code isn't very clean right now as too many things are hard coded in, but its just a prototype I started an hour or so ago, so please excuse the mess. Many thanks to whoever can enlighten me as to the cause of this issue.