Meter that grows when button is pressed, but shrinks otherwise
jbguida
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
Below is a tutorial to a different way of doing growth/health bars, this might work better for you. It's very straightforward.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
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.
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.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Yep! That works Thanks!
Awesome, you're welcome.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page