Health Bar that runs out on time

Get help using Construct 2

Post » Thu Oct 04, 2012 6:53 pm

Trying to make a Health Bar animation that runs out on time. When Player is on collision with enemy, I want his health to tun out based on time he remains in contact or "on collision" or "overlapping" with enemy. Then have the health go back up as soon as the conditions "on collision" or "overlapping" are no longer true. Just like the health bar in "Gravsuit" Game featured in Arcade. Any help is appreciated. Thanks in advance.
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Thu Oct 04, 2012 8:16 pm

I use a tiled background object and set the width to match the player instance variable. Harder to explain than to show so I've made this commented CAPX. Hope it helps :)

HEALTH BAR

Here it is running, move the mouse over the player to remove health, take it off for the health to regenerate. - HEALTH BAR DEMOvandinz2012-10-04 20:16:59
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Fri Oct 05, 2012 4:21 am

Awesome! And so smooth!

B
16
S
3
G
3
Posts: 66
Reputation: 3,629

Post » Mon Oct 08, 2012 5:43 pm

Thanks so much! Perfect solution for my game! Really awesome
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Wed Aug 28, 2013 3:19 pm

Hey @vandinz Do you mind fixing the links? Did you use lerp and dt to make the health bar go down smoothly? Thanks!
B
15
S
6
G
3
Posts: 87
Reputation: 4,304

Post » Fri Aug 30, 2013 3:32 am

Here's the original he posted for me ...https://dl.dropboxusercontent.com/u/42168787/healthbar.zip
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Fri Aug 30, 2013 4:49 am

@vandinz


Hey,

Thanks! for posting the demo
but i cant view the health bar demo from dropbox.
help

thanks!
B
9
S
2
Posts: 82
Reputation: 914

Post » Fri Aug 30, 2013 3:07 pm

Download and extract the zip file.
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Fri Aug 30, 2013 3:09 pm

Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 22 guests