Health Bar for a boss (using the GS Cookbook) HELP

PixelPunPixelPun Member Posts: 324
edited November -1 in Working with GS (Mac)
Hey guys, I have followed the GS cookbook on youtube and I am having problems getting a health bar made for a boss. I can make the health bar work fine if he only took 10 hits, but then its over in like 2 seconds. I was looking for the boss to take somewhere between 200 and 300 hits(its a very fast gun). I tried making the bullet hit for less, and I tried increasing the health. When I made the bullets hit for less than -1 heath... like -0.5 or -0.2 it did not register. And when I increase the health and the other perimeters so that the bar doesn't get huge the boss will drop to about 25% and then the rest of the health will not drop.

I guess my main question is how do I make Tshirtbooths health bar tutorial use more health than 10 health? Any help would be amazing. thanks guys.

Comments

  • msonesmsones Inactive, Chef Emeritus Posts: 75
    For smaller then 1 health increments, make sure the attribute recording the boss's health is real, not an integer.

    The bar's odd changes when you increase health sound like a error in how you've written the rules. Please post the rules you've used.
  • DrGlickertDrGlickert Member Posts: 1,135
    You can put in any amount for the health. Say, 100 instead of 10. And, as msones has stated, use a real attribute instead of an integer attribute.
  • PixelPunPixelPun Member Posts: 324
    Sorry for the late reply I just got off work. I tried turing it into an real attribute, but now it takes the health bar and doesn't subtract 1, it turns the 10 health into -1. So the bar is gone with one hit. I think this is an easy fix...but I'm somewhat stumped now.
  • PixelPunPixelPun Member Posts: 324
    I figured out how to make it count down but I am still running into the same problem. It seems like out of 30 health, it will only subtract about 15 of it. The weirder thing is when you test the game and go to another scene and come back to the one with the health bar, the remainder then counts down as it is hit. The health bar still works with 10 health though... but no other number. I would like to make a health bar will 200-300 hits in it.

    How its set up:

    Game Attribute is
    Health 30 type: real

    On the health bar actor
    Constrain attribute: self.size.width to game.health
    Constrain attribute: self.position.X to 180+(self.size.width /2)

    Actor being hit:
    Change attribute: game.health to game.health -1

    Any help would be greatly appreciated I'm so close to having my first game finished and this is hampering my efforts :P

    Thanks guys
Sign In or Register to comment.