Having a bar increase over time?
CoolBee
Member Posts: 81
I have a meter which decreases by 1 every time you press on the screen for a total of 5 presses and after every 1.5 seconds +1 is added to the maximum of 5 but it does this in blocks is there anyway to make it so it shows the bar slowly increasing/growing instead of it just appearing and disappearing etc?
Regards!
Regards!
Comments
Ok.. here goes...
I'm assuming the bar is a health bar... and its 100px wide for ease and you want it broken down to 5 options.. I'll also assume you can do you own rules for reducing the number when the screen is touched.
The rules I've done are not the clearest to understand but require the least number of rules and so should be the most efficient.
I'll also assume you can do you own rules for reducing the 'game.health' number when the screen is touched.
Create 2 game attributes:
• Create a game attribute called game.health that starts at 5
• Create a game attribute called 'game.health_max_value' (doing this makes it easier if you decide to change values later.) Set this to you maximum value... which is '5'
Create rules inside your health bar
If 'self.width' does not equal '(self.width/game.health_max_value)*game.health'
Interpolate self width to (self.width/game.health_max_value)*game.health
Offset:
You may decide you want the health bar to align to the left or the right, at which point you need to add an offset but adjusting the health bars current position to its initial position +/- the width of the bar... you'll probably need to use 'constrain attribute' for this.
Hope it helps... I've just written he above off the top of my head but I think it should work fine.
windows screen capture
This is one that I used to make my own bars.
Another one that's different, the reverse.
@tshirtbooth is the man. Helping us out. Lots of good videos from him. And the new guys at GS Helper. Braydon and Uptimistik etc. All good dudes. Respect.