Health Bar with changing health

SxarcisiousSxarcisious Member Posts: 45
edited December 2011 in Working with GS (Mac)
I can make a health bar just fine if the global health always stays the same.

How do I make the health bar for the players health if the players health's total will be increased during the game.

I have tried the following logic which does not work.

In HealthBar Actor

constrain self.size.width to 100*game.PlayersHp/PlayersHp

I can't seem to think of the correct way to do this. Advice will be appreciated, Thanks

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I would use Replicate instead of changing the width to make a heathbar

    Check out this video for some basics on Replicate



    For spacing just use 1 pixel and then Constrain the replicate number to your heath number. so a heath of 100 would appear as 100 pixels wide and will grow and shrink as the value you are constrained to. And you wont have to move your actor around to make it appear like its growing out of one side.
  • SxarcisiousSxarcisious Member Posts: 45
    Thanks! This is so much easier lol. Made short work of the health bar.

    *gives gratitude*
Sign In or Register to comment.