Health bar help...

FirstDanFirstDan Member Posts: 208
edited May 2012 in Working with GS (Mac)
Hi

I have two health bars on screen a player and enemy. If either get hit the health bar reduces but I can't get the health bar to reduce from right to left.

My health bars are placed on the top left hand corner.

Looking for a better functioning health bar.

Is there a way to accomplish this? Possibly without constrains.


I have watched @tshirtbooths video on creating an health bar.

Thanks all

Answers

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Just reverse the process the basic coding is the same.
  • stackpoolestackpoole Melbourne, Victoria, AustraliaMember, PRO Posts: 473
    edited May 2012
    in your health bar actor:

    contrain attribute self.positionX

    then say , how many pixels you from the side of the scene
    lets say 30 pixels from the right
    so you health bar will go from right to left.


    so you have the constrain attribute - self.positionX
    to
    30-(self.size.width/2)

    instead of a "plus"(+) use a "minus" (-)

    I think that is how you do it, not 100% sure.

    don't think it's possible without constrains
  • MotherHooseMotherHoose Member Posts: 2,456
    This one shows how to constrain healthBar to reduce from right to left



    image MH
Sign In or Register to comment.