Meter that grows when button is pressed, but shrinks otherwise

jbguidajbguida Member, BASIC Posts: 8

Hello,

I am working on putting a meter in my game that will grow at various rates depending on which buttons are pushed (and how quickly), but that shrinks otherwise. The point is to push the right order of buttons so that the meter stays high. I was thinking of using constrain attribute to link the height of the meter to a variable that grows at various intervals when buttons are pushed and to have the meter's height interpolate down when the variable is more than 0. When I implemented this, it only interpolated once and then stopped. Suggestions?

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Below is a tutorial to a different way of doing growth/health bars, this might work better for you. It's very straightforward.

  • jbguidajbguida Member, BASIC Posts: 8

    Cool Thanks! I had seen this before, and I got it working to an extent with a similar method. So I think it was a good suggestion, although I would prefer the meter to move more smoothly and it seems like interpolate would do that better. Basically I just added a timer that shrinks the attribute related to the meter. It works pretty well, but the shrinking is a little choppy.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Glad you got something working. I wonder if the choppiness you are getting is because you are adding or subtracting large numbers from the bar at one time. I've attached a sample using this technique that continually rises and falls and is perfectly smooth.

  • jbguidajbguida Member, BASIC Posts: 8

    Yep! That works Thanks!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Awesome, you're welcome.

Sign In or Register to comment.