GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Health bar issue

kajutokajuto Posts: 314Member
edited February 2012 in Miscellaneous
Hi everyone.!

I already made a health bar for my game, also when I collect a poison is a -10 in the health bar when it reach to 0 life . 1) How can I activate a lose scene when the health bar reach to 0 ?
2) when I collect apple is a +10 but how can I set the health bar to a maximum when reach to 200 no matter how many apple I collect when it reach the maximum it won't add more? Because it keep getting wider the health bar

I appreciate it thanks

Comments

  • SAZ_1SAZ_1 Posts: 397Member
    hi mate, right .... (1) depends how you want this done multiple ways to do this.. create a reset rule which says when health <= 0 ...reset scene (choose the current scene) .. then in the actor which resets the level add change attributes for ALL the game rules that are affected by that particular level.

    (2) in the player actor add a 2 rules --> when actor overlaps/collide with actor type: apple & when self.health <= 200 ---> change attribute self.health to self.health+10

    hope that solves both your problems & best of luck :D
  • kajutokajuto Posts: 314Member
    thanks for the reply, the (2) i mean when i have full health bar if i collected a apple how can i set not to keep adding life when it's maximum state?
  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    edited February 2012
    when attribute health is less then 200, and you collide with apple, change health to health+10

    that way it only adds to the health if its less then its full size

    cheers
  • kajutokajuto Posts: 314Member
    recently i made a level menu when i touch the level 1 i enter to play when i lose, it show a Lose Menu and a button called Level Menu and when i want to play again the level 1 , the scene start to blink, why?~?~?~?~??~?~? i'm dunno.... =-(
  • kajutokajuto Posts: 314Member
    and thanks by the way, =-)

    i do that about the health in the player or in the actor called health bar?
  • kajutokajuto Posts: 314Member
    i found the issue, only happen when my health bar reach to 0, how can i reset to 100 when the player reach to 0 in the health bar ?
  • dj_outlaw2000dj_outlaw2000 Posts: 11Member
    ohh my God i have got the same problem.... its keep on reseting the scene becoz the health bar is 0 and by reseting the scene it must be reseting the health bar too but the health bar still 0 ....
  • guillefaceguilleface Posts: 997Member
    when you reset a scene i don't think a attribute is changing so before resetting you can change your health to what ever it was and then reset it
  • One of these links might work..

    _or _

    (most helpful for me)

    (this one ^ is on how to set maximum for healthbars)

  • tatiangtatiang Posts: 11,793Member, Sous Chef, PRO, Senior Sous-Chef

    @tahlia[email protected] This thread is three years old. Please don't post answers to outdated threads.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.